Repository navigation
A rule carries its check, and a key that signs only check results records whether it held - #689
Closed
felipesauer wants to merge 7 commits into
Closed
felipesauer wants to merge 7 commits into
felipesauer wants to merge 7 commits into
Conversation
…hain Four new kinds: check.declared (a rule carries a program and its arguments), checker.enrolled (a person vouches for a key that signs check results only, under its own anchor), and check.passed / check.failed (a rule held, or did not, at a commit). Both readers fold the role: a check result is authentic only under a checker key, and any other kind under a checker key is refused.
The core gains three operations: declareCheck records the program that checks a rule, enrollChecker records a key that signs check results only (from a checker request, refused for a key that is a member of an identity), and runRuleChecks runs every check of a rule in force through a runner it is handed and records each result under the checker's own anchor. A checker key cannot found an identity, so it writes nothing else. The account of authorship says which identities are machines.
…hrough every guard that counts them
… README sweep, sandbox removal
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
Author
|
Superseded by 691: the same tree, with two commits re-authored under the project's commit address. |
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.
What
A decision in force can now carry the program that checks it, and a machine with a key of its own can record, at a commit, whether the rule held.
mnema check declare <rule> <program> [args...]records the program that checks a rule. It is started without a shell, so nothing in the program or its arguments is split, globbed or expanded; a credential in either refuses the declaration.mnema check runruns the check of every rule in force from the project root, with a timeout (300 s by default), and records onecheck.passedorcheck.failedper rule, naming the rule and the commit. What a program printed is kept as its last 4000 characters, with control bytes made visible and credentials redacted. It exits non-zero when any check failed, and refuses a tree that has changes outside the record or is not at a commit.mnema key request --checker,mnema key enroll --checker); a key that is already a member is refused. A checker key signs check results and nothing else:verifyrefuses a check result from any other key, and refuses any other kind signed by a checker key, in both readers (TypeScript and the Python second reader, with the same vectors and an agreement test).mnema accountabilitylists the checker as a machine.check.declared,checker.enrolled,check.passed,check.failed. Existing kinds and the canonical form are untouched.Wiring to the Action (not done here):
packages/actionreads the record and runsverify; it does not runcheck run. Connecting them is a later step: a job that has the runner's key as a secret, runsmnema check run --key, and commits or uploads the results. Until then the step is one of the team's own workflow.Proof
HOMEwith a clean environment: the head wrote a record with a declared check, an enrolled checker and acheck.passed; the binary ofmain-v1reads it asUNREADABLE ... unknown event kind "check.declared"andverifyreports the tail as unreadable. Acheck.passedforged under a person's key makes the head'sverifyfail withcheck.passed is signed by <key>, which is not enrolled as a checker at this point.accountabilityprinted the runner asmachine (signs check results only).Known limits
check runruns as the runner and can read the checker's key and the environment the runner has. The role narrows what such a key can sign, and only that: a key taken this way can say that any rule's check passed at any commit, and no fact withdraws the role yet, so a leaked checker key keeps signing passes the verifier accepts. Keep the key in a secret scoped to the job that runscheck run, and treat a leak as a reason to stop trusting every result that key signed. The program does not inherit theMNEMA_*variables, which narrows what it is handed, not what it can read from disk.