Skip to content

feat(runner+cli): run-attempt receipts + madp report (issue #5 proposals 6+7) - #10

Merged
askclaw-vesper merged 2 commits into
mainfrom
feat/run-receipts-and-report
Aug 20, 2026
Merged

askclaw-vesper merged 2 commits into
mainfrom
feat/run-receipts-and-report

Conversation

@askclaw-vesper

Copy link
Copy Markdown
Collaborator

Implements issue #5, proposals 6 and 7 (both redesigned per the dialogue's own constraints). Stacked on #9 — merge order: #9, then this.

Proposal 6 — run-attempt receipt (recovery-namespace only)

Every run --launch writes a run-attempt-receipt JSON under work/run-attempts/ (Git-ignored → never the ledger):

  • Before any process starts: outcome: in_flight, round/actor, argv_sha256 (digest only — the plaintext argv embeds the briefing), runner pid, start timestamp.
  • On finalize: completed/failed, exit status, claim-cleanup state (claim-consumed-by-completion / claim-released / claim-retained-blocked / release-failed), detail.
  • Nothing in acceptance or validation reads receipts; the ledger stays the authority.

Canary (from the proposal): a launch killed (SIGKILL) mid-turn via a sleeping fake worker leaves an in_flight receipt, completed_turns: [], turn_index: 0, and exactly one commit (init) — test_killed_mid_turn.

Proposal 7 — madp report (derived, never committed)

madp report DIR derives the evidence index on demand: per-turn commit SHA, recorded vs recomputed digests (artifact + evidence), completed_via, provider/model/session, probed CLI version. Read-only: never committed, never read by acceptance/validation.

Canary (from the proposal): tampering one evidence file flips report.ok false with an evidence digest mismatch AND validate --require-git fails independently (test_tampered_evidence_is_flagged_by_report_and_validate); test_report_is_read_only proves no commit, no worktree touch.

Tests

  • Receipts: finalized-on-success, failed-with-release (worker exit 1), never-in-ledger + production gate stays green.
  • Report: index contents, tamper flagging, read-only.
  • CLI: report exit codes; kill canary.
  • Full suite: 279 passed; scripts/verify.py{"ok": true}.

@adaptcom adaptcom Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confidence Score: 4/5

Summary

Adds gitignored run-attempt receipts and a read-only madp report evidence index; ledger authority preserved and all new tests pass. Low risk, but one claim-leak edge case in launch needs fixing.

Important Files Changed

File Overview
src/multi_agent_dialogue/runner.py Writes in-flight receipt before launch; finalizes outcome and claim-cleanup state
src/multi_agent_dialogue/engine.py build_report derives per-turn evidence index with digest recomputation
src/multi_agent_dialogue/cli.py New report subcommand, exit 1 on mismatch
examples/fakes/bin/fake-worker FAKE_SLEEP_SECONDS knob for kill-canary fixture
docs/technical-reference.md Documents report command and receipt semantics
tests/test_cli.py Report CLI tests and SIGKILL mid-turn canary
tests/test_real_contracts.py Receipt lifecycle and build_report tests
tests/test_provenance_recovery.py Adds report to the expected CLI surface

Re-run review · View in Adapt

Comment thread src/multi_agent_dialogue/runner.py Outdated
Comment thread src/multi_agent_dialogue/engine.py
Comment thread src/multi_agent_dialogue/engine.py Outdated
Comment thread src/multi_agent_dialogue/runner.py Outdated
Comment thread tests/test_cli.py Outdated
Comment thread tests/test_cli.py Outdated
@askclaw-vesper
askclaw-vesper force-pushed the feat/run-receipts-and-report branch from 48388fc to e06b8ec Compare August 20, 2026 06:06
…osals 6+7)

Run-attempt receipt (redesigned per review): every run --launch writes
a receipt under the gitignored work/run-attempts/ recovery namespace —
in-flight BEFORE any process starts (argv digest only, never the
plaintext argv; runner pid; start time), finalized on outcome
(completed/failed, exit status, claim-cleanup state). Never committed,
never read by acceptance logic. Kill canary: a launch killed mid-turn
leaves an in_flight receipt, an untouched ledger (init commit only),
and an unadvanced schedule.

madp report (redesigned per review): derives the evidence index on
demand from the accepted commits and raw files — per-turn commit SHA,
recorded vs recomputed digests, provider/model/session, probed CLI
version. Never committed; acceptance/validation never read it. A
tampered evidence file is flagged by report AND independently by
validate.
- receipt start is best-effort (never holds a claim hostage); filename
  token gains pid + random suffix so fast release-and-retry cannot
  overwrite a prior receipt;
- build_report guards malformed state records (missing file keys) and
  non-dict cli_version instead of crashing — tampering is flagged, not
  fatal to the report;
- tests: run_all_turns moved to the shared fixture base (no inherited
  re-run); the kill canary kills the process group and drains the
  pipes, so no sleeping fake-worker is orphaned.
@askclaw-vesper
askclaw-vesper force-pushed the feat/run-receipts-and-report branch from e06b8ec to ad896a3 Compare August 20, 2026 06:12
@askclaw-vesper
askclaw-vesper merged commit 70cfdde into main Aug 20, 2026
2 checks passed
@askclaw-vesper
askclaw-vesper deleted the feat/run-receipts-and-report branch August 20, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant