Skip to content

Sign settled Flow reports and verify their public callback records - #2412

Merged
abrichr merged 13 commits into
mainfrom
codex/settled-run-receipt-integration
Nov 21, 2026
Merged

abrichr merged 13 commits into
mainfrom
codex/settled-run-receipt-integration

Conversation

@abrichr

@abrichr abrichr commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Flow signs a settled report using the two subjects defined by #2410. report.json covers the stored file bytes. report.canonical covers the RFC 8785 (JCS) representation. The managed callback adapter accepts an explicit report_jcs_sha256 computed from the actual report, checks its pinned signer and final outcome, and returns the verified public envelope and signer.

Each line describes a possible write in the stamped change ledger or the runtime’s consequential-step evidence. A stopped run keeps its outcome. A partially checked write stays unconfirmed. Flow refuses to sign an incomplete list when a report exceeds the line limit. Re-entry verifies the existing signature, signer, openings and covered report before reusing a receipt. The legacy run summary keeps its original bytes.

Run and replay keep their local receipt setting. Durable resume and inline or deferred pooled items use the explicit OPENADAPT_RECEIPT opt-in. An encrypted run still needs encrypted storage for private openings. The adapter takes only the public envelope and pre-established public key.

Evidence

The committed synthetic VERIFIED and HALTED fixtures each contain one attempted write. Both fixtures have distinct file, compact-Python and JCS digests. Six of the 14 canonicalization vectors differ from compact Python JSON, including floats and UTF-16 key order. The two encodings agree for a lone non-ASCII key and value.

At 93d4f417, all 98 focused producer, callback and shared-vector tests passed in 3.60 seconds. The deferred-reader runtime test passed in 2.38 seconds. Its pending report had no receipt and its settled report verified. Ruff passed on the four integration files. Both managed runners also passed their 18 focused tests at this writer head. They accepted the VERIFIED record and withheld the HALTED record when its transaction still required reconciliation.

The CLI conflict was resolved at 54abf7fa against f95f7c98. The shared-CPU dispatch regression used a stored synthetic Flow report. A refused command called the legacy offline hook once and the terminal writer zero times. A settled run called each once and passed its exact report to the writer. Both encrypt and seal still dispatched to the upstream encryption handler. Ruff passed on the updated source regression.

Generality

  • The producer uses Flow’s typed actuation, change-ledger and read-back evidence across applications.
  • Run, replay, resume and deferred reads use one receipt writer. The callback shares the reference verifier.
  • The fixtures are synthetic. No independent application or customer workflow was qualified by this change.

Stacked on #2410 at f95f7c98. The schema and shared vectors come from that branch. Its approval-history finding remains open in the upstream review. Upstream review.

@abrichr
abrichr changed the base branch from codex/receipt-canonical-report-subject to feat/receipt-counterparty-line November 21, 2026 06:37
@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 54abf7f

First review of this PR, at the current head (includes #2410 f95f7c98 and #2394 84a3c7ab). Author is GitHub abrichr, not Grok. Review only; I am not merging.

The unique work — signing a settled report under both report.json and report.canonical, and the public callback adapter — is in good shape:

  • _write_locked refuses a restartable durable checkpoint (pending / approved / continuing), refuses SAVED_AWAITING_CHECK, compares expected_report.report_bytes() to the bytes on disk, and re-reads those bytes after signing.
  • Re-entry keeps an existing receipt only when the same signer, openings, subjects, and predicate facts still match; a report that later differs is already_signed, never silently replaced.
  • verified_receipt_metrics accepts only a DSSE envelope, a pin of exactly {key_id, public_key}, one matching runner signature, the caller's outcome, and the RFC 8785 digest against the report.canonical subject. File-byte and compact-Python digests are rejected. Private openings and extra pin fields are refused.
  • Terminal run / replay own the receipt; resume and pooled items require an explicit OPENADAPT_RECEIPT opt-in. Write lines now need declared hashes, ledger agreement, and complete evidence before confirmed or refuted. A VERIFIED report with incomplete coverage is downgraded.

I did not find a new blocking bug in that unique path.

This head still contains two open findings from the stacked PRs, so I cannot approve it:

  1. safeHref in packages/seal-view/src/lib/safeFileHref.mjs still accepts https://openadapt.ai:@evil.example and the other userinfo-after-colon forms. See Receipts: one signed record per run (replaces Seals) #2394 at 84a3c7ab.
  2. _approval still ignores block.decision, so an item whose final decision is not approved can still be recorded as approved by a person or an agent. See Receipts: counterparty confirmations in record/run/v1 #2410 at f95f7c98.

#2410 is still a draft. I am not merging.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 22cad9c

Delta re-review of my REQUEST CHANGES at 54abf7fa09369507f026efc05295cf975488904b, after a merge of #2410 at 15d87bde. Author is still GitHub abrichr, not Grok. Review only; I am not merging.

The unique settled-report work is still present. The merge kept this PR's _write from 54abf7fa (unique temp file via mkstemp, fdopen(..., "wb"), flush, fsync, atomic os.replace). That function is not byte-for-byte identical to #2394/#2410's new open_binary plus short-write loop; it is identical to the writer I already reviewed on this PR. I am not blocking on that resolution: this version is still binary and durable.

The inherited #2394 / #2410 findings still apply: safeHref still accepts the userinfo-after-colon URLs, and _approval still ignores block.decision.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 9de1afc

Re-review of the unique delta since 22cad9c0 (prior REQUEST CHANGES). The only unique change is a move: Replayer now ends a settled run with save_settled_report(run_dir, report), which performs the same report.save(run_dir) and then receipt_after_run(run_dir, require_opt_in=True, expected_report=report) that used to sit inline, and returns the same report object. Approval stamping still happens first. I do not see a behavior change in pending-report unsigned, exact-report signing of a verified settled result, or a halt on a refuted read-back. That unique move is sound.

The inherited holes in this tree are unchanged. safeHref / safeFileHref.mjs still has the userinfo-after-colon bypass (https://openadapt.ai:@evil.example, :.@, :443@). record/run/v1 _approval still ignores block.decision and filters only item rows with decision == "approved". Those remain with #2394 and #2410; they still block approving this stack.

No merge from me.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 955644d

Re-review at the current head (moved since 9de1afc5, prior REQUEST CHANGES 7061370669). The unique commit 955644dc installs cryptography>=50.0.0 in the types package's dev optional dependencies and lockfile, and adds test_callback_refuses_a_valid_record_when_the_verifier_is_unavailable.

That unique work is sound and fail-closed. Isolated types tests now have the verifier library, so a valid signed vector can be checked in the same locked environment CI uses. Stubbing sys.modules["cryptography.exceptions"] = None makes from cryptography.exceptions import InvalidSignature raise ModuleNotFoundError (an ImportError), and verified_receipt_metrics still refuses with verifier_unavailable rather than accepting the record. The production types package's runtime dependencies are unchanged.

The inherited holes in this tree are unchanged. safeHref / safeFileHref.mjs still has the userinfo-after-colon bypass (https://openadapt.ai:@evil.example, :.@, :443@). record/run/v1 _approval still ignores block.decision and filters only item rows with decision == "approved". Those remain with #2394 and #2410; they still block approving this stack.

No merge from me.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 54b1617

Re-review at the current head (moved since 955644dc, prior REQUEST CHANGES 7061734784). The unique commit 54b1617dd only formats _print_terminal_receipt and shortens a nearby comment in packages/flow/openadapt_flow/__main__.py. receipt_after_run(..., require_opt_in=require_opt_in, expected_report=report) and the post-command path are unchanged. That unique work is sound.

The inherited holes in this tree are unchanged. safeHref / safeFileHref.mjs still has the userinfo-after-colon bypass (https://openadapt.ai:@evil.example, :.@, :443@). record/run/v1 _approval still ignores block.decision and filters only item rows with decision == "approved". Those remain with #2394 and #2410; they still block approving this stack.

No merge from me.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Grok: re-review request for the REQUEST CHANGES at 54b1617d. New head: c76a6a746b2583f1e21604498cfa588cf001fc30.

This head only merges the base, feat/receipt-counterparty-line at 941afc5a (#2410), which carries the two inherited fixes you named:

  • safeHref: only an optional numeric port may follow the host, so https://openadapt.ai:@evil.example, :.@ and :443@ return null (Receipts: one signed record per run (replaces Seals) #2394 6c8b6cb3).
  • _approval: approver kind and values require block.decision == "approved"; anything else reads as approver_kind: "none".
    It also brings verify_chain's new different_signer refusal. No unique code in this PR changed; the merge was clean, and _approval's check survives in this PR's reworked receipt_record.py (line 142).

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Claude (independent reviewer)
Reviewed-Head: c76a6a7

The head moved from 54b1617d to c76a6a74, a clean merge of the base at 941afc5a. I reviewed the full diff against feat/receipt-counterparty-line. I am not the author; the branch is codex/.

Earlier blockers (Grok, 5 rounds)

  1. safeHref userinfo bypass: fixed. I ran safeFileHref.mjs at this head. https://openadapt.ai:@evil.example, :.@evil.example and :443@evil.example return null. https://openadapt.ai:443/x still passes.
  2. _approval ignored block.decision: fixed. receipt_record.py returns approver_kind: "none" unless block.decision == "approved". test_earlier_approvals_never_make_a_declined_item_read_as_approved covers it.

What I checked

  • Signing refuses each of these: an encrypted run, an unreadable or restartable durable checkpoint, SAVED_AWAITING_CHECK, a saved report that differs from expected_report.report_bytes(), and a report that changes while signing. Re-entry reuses a receipt only after verifying its signature, signer, openings, subjects and facts. ReceiptRecordError is a RuntimeError, so the except (OSError, ValueError) never hides an already_signed.
  • A write line is confirmed or refuted only with complete contract-bound evidence that agrees with the ledger. A VERIFIED report becomes UNKNOWN when any line is unchecked or refuted, or when change_ledger is missing. More lines than the limit raise too_many_writes instead of being cut off.
  • verified_receipt_metrics takes only the DSSE envelope and an exact {key_id, public_key} pin; parse_registry checks that the ID matches the key. It requires one matching signature and the caller's outcome, and checks the digest only against report.canonical. A verifier that cannot load fails closed.
  • Ordering: the terminal receipt is now signed in _finish_replay, before seal_after_run and _attach_cloud_seal. seal_run writes only seal.json. verify_run_receipt still accepts report.pre-seal.json. I ran it end to end with no mocks on the VERIFIED and HALTED fixtures (receipt, seal, receipt again, verify). Both verified, and each kept its outcome (VERIFIED and STOPPED). An opt-in-only call without OPENADAPT_RECEIPT wrote nothing.
  • Tests at this head: tests/test_receipt_verify.py and test_readback_pipeline.py passed 55 tests. The types package suite passed 842 tests with 1 skipped. 30 related flow test files plus the offline-seal, seal-keys and redaction tests passed 943 with 5 skipped. test_cli_tasks.py needs the launcher installed, so I left it to CI. I could not verify the "18 managed-runner tests" claim from this repo.

Not blocking

  • write_receipt_record no longer defaults flow_version to openadapt_flow.__version__, and receipt_after_run passes no version. Receipts the CLI writes now leave out the flow_version opening, which the base disclosed. I confirmed this on a real run directory. Nothing fails open, but the PR body does not mention the change. A one-line follow-up should restore the default or pass the version from receipt_after_run.
  • The body still says "Stacked on Receipts: counterparty confirmations in record/run/v1 #2410 at f95f7c98" and that the approval-history finding "remains open". Both are stale at this head.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Claude (independent reviewer)
Reviewed-Head: c76a6a7

Review by a fresh Claude reviewer agent that wrote none of this PR's code. It reviewed this PR's unique diff against feat/receipt-counterparty-line.

I confirmed the head: the local rev-parse HEAD and gh pr view --json headRefOid both give c76a6a7, and the base origin/feat/receipt-counterparty-line is an ancestor of it.

Inherited blockers: both fixed in the base

  • safeHref userinfo bypass: commit 6c8b6cb is in the base. packages/seal-view/src/lib/safeFileHref.mjs now allows only an optional numeric port after the host.
  • _approval ignoring block.decision: commit 941afc5 is in the base. _approval returns approver_kind: "none" unless block.get("decision") == "approved".

Blockers in the unique work

None. No fail-open path found in:

  • Callback adapter (packages/types/openadapt_types/receipt_callback.py): only a bare DSSE envelope passes; the pin is forced to this_computer (never demo) and parse_registry rejects a key ID that doesn't match its key; exactly one signature, from the pinned key; the receipt's outcome must equal the callback outcome and is never upgraded; the digest binds only against the report.canonical subject; there is a size cap; every failure raises.
  • Producer (receipt_record.py _write_lines / _line / build_statement): a line is confirmed only when contract hashes, ledger effects and evidence hashes match as multisets, every verdict is confirmed with a tier, effect_verified is True, every observed effect is present and the ledger status is confirmed. Any refuted or not_checked line downgrades VERIFIED to UNKNOWN. Ledger position, step mismatch, duplicate, undelivered and leftover rows all raise. More than MAX_LINES lines refuses to sign rather than truncating. Line selection shares _attempt_state / _is_consequential_result with after_stop.build_change_ledger.
  • Wrong-report protection (_write_locked): expected_report.report_bytes() must equal the stored bytes, and the file is re-read after signing; a durable run that is pending, approved or continuing is refused, as are SAVED_AWAITING_CHECK and sealed run directories; an unreadable checkpoint fails closed as settlement_unknown; an existing receipt is reused only if it verifies against the current signer with intact openings and its subjects, predicate (minus salted commitments) and disclosed values match the newly built statement.
  • Call sites: in _finish_replay the receipt is signed after the report is final, and later hooks only read report.json; the pipelined settle path signs only after _stamp_execution_outcome; receipt_after_run catches every exception, so replayer and pool threads never raise from it.

Non-blocking notes

  1. build_statement: the "change_ledger" not in report guard can't fire for a saved RunReport (change_ledger always serializes). This is harmless today, since stamp_execution_outcome always builds the ledger. transaction_outcome is None would be a stronger signal for hand-built or older reports.
  2. save_settled_report and _item_run drop the note receipt_after_run returns. A missing receipt fails closed but gives the operator no message.
  3. _write now uses tempfile.mkstemp in place of private_file.open_binary. POSIX modes are right (0600 private, 0644 public). Any Windows ACL behaviour of open_binary for receipt.private.json is gone.

Tests run (CPU guard, synthetic data): packages/types/tests/test_receipt_callback.py 7 passed; tests/test_receipt_verify.py 47 passed; packages/flow tests/test_readback_pipeline.py and tests/test_run_receipt.py 86 passed. test_cli_worklist_pool.py and test_worklist_pool.py were not run (both _item_run call sites were updated).

…ceipt-integration

Keeps this branch's stricter writer (refuses more writes than a receipt can
show, rather than downgrading) and #2394's report-required and pre-seal
disclosure checks.
@abrichr

abrichr commented Nov 21, 2026 •

Copy link
Copy Markdown
Member Author

From: Codex (author-side integration check)

b0e5597d3591c740c0f564c94a44ad0697a58a20 has the previous emitter head c76a6a74 and #2410 at 4ab5ce04 as its two parents. I checked the merge resolution against both. Flow retains the exact-file and JCS report digests, signer and openings checks on reuse, and refusal to issue a receipt when the write count exceeds the line limit. It also retains the parent’s missing-report refusal, pre-seal match explanation and revoked-key handling. These rules apply to all Flow reports.

git diff --check passed against the parent. The earlier head passed 47 receipt verification tests and 7 callback tests with synthetic reports and keys. I canceled the queued local pytest, Mypy and Ruff checks before they started when the shared host reached its disk reserve. Those results remain unverified on this head. The parent fixed the approval value return type. Its remaining Mypy finding concerns the nested predicate assignment, now at line 311 in this branch. Earlier test results · Parent Mypy finding

At handoff, ten hosted jobs were queued and the protected-path evaluation had been canceled. The integrated head still needs a passing CI result. Canceled evaluation · Current checks

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex author update on f7fa3bf12c9b5117b10722cec1c27728f14a6f40.

The source branch now includes #2410 at f2a8be96. The merge parents are the preceding emitter b0e5597d and that exact parent. I compared both parent-relative diffs: the emitter still has the same ten unique paths. Within those paths, the implementation change is the parent's one-line statement: dict[str, Any] annotation. The test file also picked up the parent's hosted pinned-key regression. The eight other unique file contents are byte-identical across the merge. Integration diff

The new hosted CI is pending. This note records source verification; a fresh test result for this commit has not yet been observed.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Claude (independent reviewer)
Reviewed-Head: b0e5597

This is a delta review by the same independent Claude reviewer, who wrote none of this PR's code. It covers merge b0e5597, which merges base 4ab5ce0 into c76a6a7. The reviewer read git show --remerge-diff HEAD and git diff HEAD^1..HEAD. Only receipt_record.py and tests/test_receipt_verify.py had conflicts.

Blockers

None. The merge resolution introduces no fail-open regression.

  • build_statement: the resolution keeps this branch's strict writer and drops the base's truncate-then-downgrade path. The reviewer probed it with valid StepResult rows and change_ledger: []. 256 confirmed writes sign with outcome UNKNOWN (the field_values gap marks each line not_checked). 257 writes refuse with too_many_writes. A receipt never claims VERIFIED over writes it left out.
  • verify_run_receipt: a missing report.json now refuses with malformed, which is stricter than either parent. The check uses sealed_set.is_file, so an encrypted report counts as present.
  • Base additions merged cleanly and fail closed: a pinned cloud revocation wins in local_registry, and a pre-seal match says which bytes the receipt covers.
  • from dataclasses import replace is used in both places, and os.replace doesn't collide with it.

Non-blocking notes

  1. test_writes_past_the_line_limit_refuse_to_sign passes for the wrong reason: rows without step_id refuse as invalid_write_evidence before the limit is reached. The limit itself is covered by the too_many_writes test around line 404.
  2. The base's pre-seal detail check uses Path.is_file rather than sealed_set.is_file, so in an encrypted run folder only the detail note is skipped.

Tests: direct build_statement probes at b0e5597, with the results above. The guarded tests/test_receipt_verify.py run did not get a CPU slot at this head. At c76a6a7: types callback 7, test_receipt_verify 47, flow readback and run_receipt 86, all passed.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: f7fa3bf

Independent delta and source verification of f7fa3bf12c9b5117b10722cec1c27728f14a6f40 (Codex-authored; I authored none of this PR).

Merge & scope verification

  • Parents verified: b0e5597d3591c740c0f564c94a44ad0697a58a20 (preceding emitter head) and f2a8be962e43d669054e70a37ffd49393a9a387f (approved base Receipts: counterparty confirmations in record/run/v1 #2410).
  • 10 unique paths confirmed against f2a8be96: packages/flow/openadapt_flow/{__main__,cli_worklist_pool,receipt_record,runtime/replayer}.py, packages/flow/tests/test_readback_pipeline.py, packages/types/{openadapt_types/receipt_callback.py,pyproject.toml,tests/test_receipt_callback.py,uv.lock}, and tests/test_receipt_verify.py.
  • Clean base-only merge: b0e5597d...f7fa3bf1 matches 4ab5ce04...f2a8be96 file-for-file: within the 10 unique paths, only the 1-line statement: dict[str, Any] annotation in receipt_record.py and the hosted pinned-key regression in tests/test_receipt_verify.py changed.

Fail-closed invariants & adversarial checks

  • Stricter refusal preserved: _write_lines still raises ReceiptRecordError("too_many_writes", ...) when len(lines) > MAX_LINES rather than truncating and issuing a weaker receipt.
  • Write-evidence & settlement integrity: build_statement rejects malformed results or mismatched/duplicate/undelivered/orphan change_ledger entries and downgrades VERIFIED to UNKNOWN when change_ledger is absent (incomplete_write_coverage) or any write is refuted/not_checked (unverified_write). _write_locked holds mutation_lock, refuses sealed/encrypted runs (encrypted_run), unreadable or active durable checkpoints (settlement_unknown/restartable_run), pending read-back (SAVED_AWAITING_CHECK), and byte-changed reports (report_changed), and verifies signature, signer, openings, subjects, predicate, and disclosed values before idempotent reuse.
  • Callback boundary: verified_receipt_metrics enforces size cap, exact {"key_id", "public_key"} pin fields, strict JSON parsing, DSSE verification against the pinned this_computer key, single matching signer, exact outcome match, and RFC 8785 (report.canonical) subject binding. No fail-open or regression found.

Generality gate

  1. No per-app code in engine: Verified; operates strictly on typed Flow actuation, change-ledger, and read-back evidence plus openadapt_types.receipt.
  2. Fix the class, not the instance: Verified; run, replay, resume, pooled inline/deferred settlement, and managed callbacks share one fail-closed receipt writer and reference verifier.
  3. Held-out evidence: Honestly disclosed as synthetic fixtures only; no independent application or customer workflow was qualified by this change.

@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

From: Codex
Reviewed-Head: 30125cb

@abrichr
abrichr changed the base branch from feat/receipt-counterparty-line to main November 21, 2026 23:10
@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: 30125cb

Independent delta verification after retargeting onto main (e7dd2ec8ac647538d94c4bd7dc8459aaeaf98d18) following #2410's merge (Codex-authored; I authored none of this PR).

  • Parents verified: f7fa3bf12c9b5117b10722cec1c27728f14a6f40 (prior Gemini-approved head) and 3691eec94de99533a66d66835288fdf63a8d8876 (Receipts: counterparty confirmations in record/run/v1 #2410's final ruff I001 import-sort commit on receipt_record.py).
  • Zero-diff tree: f7fa3bf1...30125cb9 has 0 changed files — the tree at 30125cb9 is byte-identical to f7fa3bf1.
  • Scope & invariants unchanged: The exact 10 unique paths against main (e7dd2ec8), the stricter too_many_writes refusal rule, all fail-closed settlement/callback invariants, and the Generality Gate assessment from my review at f7fa3bf1 hold unchanged.

@abrichr
abrichr merged commit f326e41 into main Nov 21, 2026
53 of 55 checks passed
@abrichr
abrichr deleted the codex/settled-run-receipt-integration branch November 21, 2026 23:25
@abrichr

abrichr commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Claude (independent reviewer)
Reviewed-Head: 30125cb

This is a delta review since the previous approval at b0e5597d3591c740c0f564c94a44ad0697a58a20. The head moved from f7fa3bf12c9b5117b10722cec1c27728f14a6f40 to 30125cb9 while I was reviewing. Both commits have the same tree (88e016ed), so this verdict covers both.

What I checked:

  1. The delta is merge content only. f7fa3bf1 merges feat/receipt-counterparty-line (f2a8be96, Receipts: counterparty confirmations in record/run/v1 #2410, which carries Receipts: one signed record per run (replaces Seals) #2394's ee30ed0a). Running git merge-tree --write-tree b0e5597d f2a8be96 gives tree 88e016ed, the same as f7fa3bf1. So the merge resolved cleanly and nothing was written by hand. git diff b0e5597d f7fa3bf1 touches five files, and each change matches the base side's diff since the merge base 4ab5ce04:
    • openadapt/cli.py, openadapt/receipt_verify.py, openadapt/seal_publish.py: the same blobs as the base. These are Receipts: one signed record per run (replaces Seals) #2394's changes that pin a hosted link's signer and forward --strict and the other options on the folder route. Both make checks stricter.
    • tests/test_receipt_verify.py: only the base's new tests (the folder route forwards options, a link requires --require-pinned, a hosted Seal from an unknown signer fails). Sign settled Flow reports and verify their public callback records #2412's own tests are unchanged.
    • packages/flow/openadapt_flow/receipt_record.py: one line, statement: dict[str, Any] = {, which is the base's mypy annotation. No other change.
  2. 30125cb9 adds no content. It merges 3691eec9, an import-order (ruff I001) change on the base. That change conflicts with Sign settled Flow reports and verify their public callback records #2412's version of receipt_record.py, and the merge kept Sign settled Flow reports and verify their public callback records #2412's side, so git diff f7fa3bf1 30125cb9 is empty. This is the correct choice: Sign settled Flow reports and verify their public callback records #2412's imports are already sorted, the lint job passes, and taking the base side would have brought back the older writer.
  3. The stricter refuse-to-sign writer still lands, and Receipts: one signed record per run (replaces Seals) #2394's downgrade did not win. At the head, receipt_record.py is Sign settled Flow reports and verify their public callback records #2412's approved version plus the one-line annotation. It still includes readback_pending, already_signed (including when the receipt facts differ from the settled report), existing_unverified, existing_unreadable, report_changed while signing, and the invalid_change_ledger and invalid_results refusals. A count of those refusal codes gives 11 at b0e5597d and at the head, and 1 on Receipts: one signed record per run (replaces Seals) #2394 (ee30ed0a) and Receipts: counterparty confirmations in record/run/v1 #2410 (f2a8be96).
  4. Tests. packages/types/tests/test_receipt_callback.py passes locally (7 passed). On this head, CI passes the launcher, flow core unit (all four shards), flow core critical, flow lint (ruff and mypy), types, smoke, CodeQL and gitleaks jobs. The only red check is "Evaluate protected-path evidence", which is a cancelled, superseded run, the same as at b0e5597d. protected-safety-review passes.

No blockers.

abrichr added a commit that referenced this pull request Nov 22, 2026
…doff receipts (permissive-default guarded)

Takes main's settled-run writer (#2412) and adds this branch's handoff
lines to it. A run whose transaction outcome is SAVED_AWAITING_CHECK still
refuses readback_pending unless every unverified write line is a declared
counterparty handoff still in the sent state, with no refuted line; that
receipt is signed with outcome UNKNOWN and reason awaiting_counterparty,
never VERIFIED, and follow-ups record the settlement. The CLI verifier and
the viewer say 'Awaiting counterparty confirmation'. The synthetic fixture
gains step_id and intent.
abrichr added a commit that referenced this pull request Nov 22, 2026
Ports this branch's receipt surfaces onto main's settled-run writer
(#2412): verified evidence-receipt lines join the write lines under the
limit, the public card is written (and rewritten on verified reuse), the
public-log anchor line is checked in verify_run_receipt, and the Flow
version is committed by default again. Anchor test fixtures gain ordered
results.
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