Goal: stop recursive Brigade receipt growth and ensure GraphTrail pre-edit context is attached when an indexed target and task are available.
Architecture: verification receipts reference the previous receipt by stable metadata only, never by embedding its full payload. Work briefs reuse the existing GraphTrail context renderer and record a compact attachment result without turning missing GraphTrail into a hard failure.
src/brigade/work_cmd/verification.py,tests/test_work_cmd_verification.py: previous-receipt evidence compaction.src/brigade/work_cmd/session.py,src/brigade/context_cmd.py, relevant tests: pre-edit GraphTrail brief attachment.docs/and changelog/release notes where the integration contract is documented.
- Add a failing test that creates a prior receipt containing nested
evidence, runs a second verification, and asserts the new receipt contains only priorrun_id, status, path, and digest, with no nestedevidencekey. - Run the focused test; expect failure because the full previous receipt is embedded.
- Replace full-payload embedding with a compact reference derived from the prior receipt and its digest.
- Run the focused test and receipt-signing tests; expect pass.
- Commit
fix(work): reference prior verification receipts compactly.
- Add a failing test for a target with
.graphtrail/graphtrail.db, a fake GraphTrail binary, and a selected task. Assertwork brief --jsoncontains an attached code-graph brief and a nonzero context record. - Run the focused test; expect failure because current work briefs report no attached context.
- Reuse the existing context helper from the work-brief path, keep missing binary/db/task fail-open, and record attachment metadata in the brief payload.
- Run focused work/context tests; expect pass.
- Commit
feat(work): attach graphtrail context to pre-edit briefs.
- Run through Brigade with
PYpointing at the existing development venv:./scripts/verify. - Generate two temporary verification receipts and assert the second stays below 100 KB and parses with
jq.
Verification evidence:
- Branch-backed Brigade run
20260709-201930-work-verify-342ea9: Ruff checks passed, 374 files were already formatted, version 0.21.1 matched 12 locations, and pytest reported 1,813 passed and 1 skipped. - Temporary branch-backed receipts were 3,257 bytes and 3,582 bytes. The second parsed with
jq, contained onlydigest,path,run_id, andstatusin its prior-receipt reference, matched the first receipt digest, and remained below 100 KB.