Repository navigation
Conversation
Runs `bawbel-gate audit verify` as a separate process in an empty directory with an empty home, so it cannot lean on a gate config, a manifest, or state from the host that wrote the chain. It must not modify the file or write anything. Detected from the file alone: an edited field, a deleted record, reordered records, an inserted record, a record cut off mid-line. Not detected, and pinned as such: removal of the final records, and a log rewritten with every hash recomputed. Both are exposed by comparing the head hash against one recorded elsewhere, which the last two tests check with the `audit tail -n 1` command the README documents. If a "not detected" test starts failing, the verifier got stronger and the docs need updating. Refs #84 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P Signed-off-by: chaksaray <chaksaray@gmail.com>
README: a "Verifying a log you did not write" section. audit verify needs the chain file alone. It detects an edited, deleted, inserted or reordered record and a cut-off line, and does not detect removed final records or a log rewritten with every hash recomputed. Both change the head, so the section shows how to read the head, two ways to record it outside the log (a git note, a daily commit to a separate repository), and how to compare later. SECURITY.md: a "Limits of the audit chain" section, and the in-scope bullet on undetected falsification now points to it. Every command in the section is run by tests/test_audit_third_party_verify.py. Closes #84 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P Signed-off-by: chaksaray <chaksaray@gmail.com>
This branch has not been deployed
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 #84
What and why
GATE-12b.
bawbel-gate audit verifycan be run by someone who does not trust the operator, and nothing said so or said where it stops. This PR states the property, pins it with tests, and documents how to record a chain head outside the log. It changes no code undersrc/.tests/test_audit_third_party_verify.py(12 tests, own commit): runsaudit verifyas a separate process in an empty working directory with an empty home, so it cannot use a gate config, a manifest, or state from the writing host. It also asserts verify does not modify the file or write anything.README.md: a "Verifying a log you did not write" section under "7. Audit and operate" (property paragraph, how to read the head, two ways to record it, how to check later), and a pointer from the "Audit log (M2)" paragraph.SECURITY.md: a "Limits of the audit chain" section.Governing spec
DESIGN.md section(s): 8.6 (chain head can be anchored externally;
audit verifyreplays the chain). Not changed.docs/adr/0001-audit-chain-construction.mdalready says the same about anchoring; the new text matches it.Output contract
src/, DESIGN.md, the CLI, the audit record format.Verification (run this session on the branch)
Runbook check, on the published package: a chain written by the development tree, copied alone into an empty directory, verified by
bawbel-gate==0.1.0from PyPI in a separate virtualenv withenv -iand an emptyHOME:What verify does and does not detect, from the tests (each is one test):
Both undetected cases change the head. The tests run the README's own commands (
audit tail -n 1for the head,grep -Fcfor the comparison) and show the head differs and the anchored hash is absent in each.Mutation check on a copy of the tree: skipping the hash comparison, skipping the prev comparison, making verify exit 0 on failure, making it read a config from the working directory, read
~/.bawbel, or write a file to the working directory, and making it detect tail truncation each fail at least one of the new tests.Invariant ordering
This PR touches
tests/and docs only, notaudit/. The test commit comes first:Invariants redefined: none
Differences from the runbook
bawbel-gate audit verify". The two limits above are exactly that, so I added "other than the limits listed under 'Limits of the audit chain' below" to the bullet. That edit narrows what the policy invites reports about, so I am flagging it for you to confirm (see Decisions).audit verifyhas no--expect-headflag, so the comparison is agrep -Fcon the file. A flag would be a code change underaudit/and needs its own DESIGN.md PR; not done here.Decisions for the maintainer
Not verified
git notes add,git add/git commitin a throwaway repository). Thegit pushsteps were not run. Whether a given remote lets the gate host rewrite the note ref or branch is the operator's setting.grepis required for the comparison command and for the last three tests; they are skipped where it is missing.Checklist
git commit -s)tests/replay/if this blocks an attack class (not applicable)🤖 Generated with Claude Code
https://claude.ai/code/session_015T9K217kxBqsUZ3omKYv9P