Repository navigation
treeproof v0.1.1
Security fixes for the gate, from an independent review of 0.1.0. Upgrade if you rely on the gate or the Action.
- Observed receipts no longer open the gate by default (
[gate] accept_observednow defaults tofalse). An agent could print a fake runner summary through the host's Bash tool and have it recorded as a pass. Observed recording also only reads a plain runner invocation now (cargo test,pytest,npm test, ... with nothing chained, piped, redirected or substituted). - The gate no longer reads its policy from the working copy. Hooks use the
treeproof.tomlcommitted atHEADwhen the session started;treeproof gate,status,exportand MCPreceipt_queryuse the one committed atHEAD(--policy-refto choose). ThePreToolUsehook refuses agent edits totreeproof.toml.run.allow_unrecognizedis read from the committed policy, and the gate refuses unrecognised-output passes unless that policy allows them. - A passing subset no longer satisfies the gate. Runs that select part of the suite (cargo "filtered out", pytest
-k/-m/node ids/single files/"deselected",go test -run, jest/vitest-tand file filters, nextest filters) need[gate] allow_subset = trueor an exact pinned command. A run that records failing tests blocks the gate for that tree until the same command passes again. A failing run withdraws any cached pass for the same run key. treeproof verifyand the GitHub Action apply a policy and stop trusting keys from the change itself. Newverifyoptions--keys-ref <rev>,--no-repo-keys,--policy-ref <rev>and--no-policy;--tree currentapplies the policy atHEADby default. The Action reads trusted keys andtreeproof.tomlfrom the pull request's base commit (newtrust-refinput).- Session baseline without
SessionStart. The firstPreToolUse/PostToolUseof a session records the baseline tree and policy snapshot; ifStopcomes first, the baseline is where the branch left its upstream (HEADwhen there is none). Committing changes no longer slips past a session that had noSessionStart. - Nested repositories. Receipts record the working-tree digest of each initialised submodule or embedded repository (SPEC 3.5, 4.1), the run key includes them, and the gate compares them, so edits inside a submodule invalidate a receipt.
- Environment values in receipts are keyed. Allowlisted variables are recorded as HMAC-SHA256 under a per-machine secret (
env.saltin the store) instead of a plain SHA-256, so a committed receipt does not allow offline guessing. Run keys change, so the first run after upgrading is a cache miss. - Receipts with more than one subject are rejected, as SPEC section 2 requires.
- The local gate trusts only this machine's key and
TREEPROOF_TRUSTED_KEYS, not keys in the working copy's.treeproof/trusted_keys/. - Library:
treeproof::Context(store directory and key file) withrun::run_in,run::record_observed_inandgate::evaluate_in, so callers no longer needstd::env::set_var;RunOptions::new/shell_lineandwith_*builders;TestResultandRunStatusenums withRunOutcome::test_result(),run_status()andpassed();gate::policy_rejection;Config::load_committedandload_at_rev;keys::trusted_keys_at_rev;git::nested_trees. Existing signatures are unchanged.GateConfiggains theallow_subsetfield. - The Action's installer falls back to
cargo installwhen the release has no binary for the runner (v0.1.0 has no Intel macOS archive). - Docs: threat model, configuration, SPEC (2, 2.1, 3.2, 3.4, 3.5, 4.1, 5, 7) and Action docs describe the above.