Skip to content

Commit 0d9ae81

Browse files
feat: add Signed line to pretty-print output (1.0.10)
- format_receipt_pretty() accepts optional signed param (default 'none') - CLI passes signed='YES (sigstore)' when --sign is active - Display-only change — receipt JSON schema unchanged - Bottom border width corrected to 42 dashes Bump: 1.0.9 → 1.0.10
1 parent c921189 commit 0d9ae81

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
66

7+
## [1.0.10] — 2026-03-08
8+
9+
### Added
10+
11+
- **`Signed` line in pretty-print output**: `format_receipt_pretty()` now accepts an optional `signed` parameter (default `"none"`). When `--sign` is active, the pretty receipt displays `Signed: YES (sigstore)`. Display-only — receipt JSON is unchanged.
12+
13+
### Changed
14+
15+
- **Bottom border width**: Pretty-print bottom border now uses 42 dashes (`` + 42×``) for visual consistency with the header.
16+
717
## [1.0.9] — 2026-03-08
818

919
### Fixed

aiir/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
from __future__ import annotations
1212

13-
__version__ = "1.0.9"
13+
__version__ = "1.0.10"

aiir/_receipt.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,13 @@ def generate_receipts_for_range(
177177
# ---------------------------------------------------------------------------
178178

179179

180-
def format_receipt_pretty(receipt: Dict[str, Any]) -> str:
181-
"""Human-readable receipt summary."""
180+
def format_receipt_pretty(receipt: Dict[str, Any], signed: str = "none") -> str:
181+
"""Human-readable receipt summary.
182+
183+
Args:
184+
receipt: The receipt dict.
185+
signed: Signing status to display (e.g. 'YES (sigstore)' or 'none').
186+
"""
182187
commit = receipt.get("commit", {})
183188
ai = receipt.get("ai_attestation", {})
184189
# Guard against non-dict commit/ai_attestation — a crafted
@@ -240,6 +245,7 @@ def format_receipt_pretty(receipt: Dict[str, Any]) -> str:
240245
),
241246
f"{vl} Hash: {content_hash}",
242247
f"{vl} Time: {timestamp}",
248+
f"{vl} Signed: {_strip_terminal_escapes(signed)}",
243249
f"{bl}{hl * 42}",
244250
]
245251
return "\n".join(lines)

aiir/cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,15 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
739739
signed_count = 0
740740
stdout_json_receipts: List[Dict[str, Any]] = []
741741

742+
# Determine signing display status for --pretty.
743+
# This runs after --sign validation, so if args.sign is True
744+
# we know sigstore is available and --output is set.
745+
_signed_display = "YES (sigstore)" if args.sign else "none"
746+
742747
# Pretty-print (always goes to stderr so it can combine with any mode).
743748
if args.pretty:
744749
for receipt in receipts:
745-
print(format_receipt_pretty(receipt), file=sys.stderr)
750+
print(format_receipt_pretty(receipt, signed=_signed_display), file=sys.stderr)
746751

747752
# Mode A: individual files (--output / --sign)
748753
if args.output or args.sign:

0 commit comments

Comments
 (0)