fix(gate): implement R5, drive verify.py through the real gate, correct receipt wording - #1
Open
MacFall7 wants to merge 1 commit into
Open
fix(gate): implement R5, drive verify.py through the real gate, correct receipt wording#1MacFall7 wants to merge 1 commit into
MacFall7 wants to merge 1 commit into
Conversation
…ct receipt wording Audit findings (estate audit 2026-07-17) closed: 1. R5 was promised in policy.md and read_refund_policy() but never checked. _evaluate now takes an optional requested_amount; a request that differs from the order total is DENIED under R5. propose_refund and the tool schema expose it so an inflated customer ask reaches the gate. 2. verify.py hardcoded the ESCALATE expectation for unknown orders and re-derived verdicts via _evaluate, so the headline count partially tested the verifier, not the gate. Every case now runs through propose_refund — the real execution path — including the approval mutation, a receipt-hash recompute, an R5 inflated-amount deny, and a post-approval repeat proposal that must deny under R3. 6/6 → 8/8. 3. propose_refund docstring claimed a "signed receipt"; the receipt is a sha256 hash, unsigned. Wording corrected to match the code (README already said sha256). Verified: python verify.py → 8/8, exit 0 (Python 3.10).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the three P0 findings from the 2026-07-17 estate audit. Loom blocker: record after this merges, not before.
Findings closed
1. R5 promised, never implemented.
policy.mdandread_refund_policy()list R5 (refund equals order total);_evaluate()ran R1-R4 only. The gate now takes an optionalrequested_amountand denies under R5 when it differs from the order total. Exposed throughpropose_refundand the tool schema, so the "customer asks for more than they paid" case reaches the gate. This adds a demo beat: the model can be talked into requesting an inflated amount; the gate cannot.2. verify.py partially tested itself. The unknown-order case hardcoded
got = "ESCALATE"without calling the gate, and every other case re-derived the verdict via_evaluateinstead of the real execution path. Every case now runs throughpropose_refund, including:6/6 becomes 8/8, and the count now means what it says.
3. Wording.
propose_refunddocstring claimed a "signed receipt"; it is an unsigned sha256 hash. Corrected. README already used the honest "Receipt (sha256)" phrasing.Verification
Receipt: tools.py sha256 cfe51364…, verify.py c35fae9f…, README.md c4bf7398… as pushed on this branch.
Authored by the Cowork executor from audit findings; adjudication basis UPLOADED_ARTIFACT (code read and executed in-session). Merge is Mac's gate.