fix: scope retained G2 evidence validity to the attested contract surface - #4
Open
CompleteDotTech wants to merge 2 commits into
Open
fix: scope retained G2 evidence validity to the attested contract surface#4CompleteDotTech wants to merge 2 commits into
CompleteDotTech wants to merge 2 commits into
Conversation
…face The passed-evidence relationship verifier required the historic tested source commit to be the head's merge-base and the entire tested-source- to-head diff to contain exactly one modified file, docs/G2-EVIDENCE.md. That protected the original evidence-only attestation, but applied forever it froze every later non-evidence change out of the attested branch: the G2 evidence relationships step fails on PR OpenCoven#15's onboarding/readiness-only diff (run 32956215259). Introduce scripts/g2-scope-manifest.json, a versioned (schema_version 1) fail-closed attestation-scope manifest, and make both relationship verifiers compare the tested commit to the terminal commit by scope: - protected patterns enumerate the G2-attested contract surface derived from what this checker validates (crates/**, the architecture/schema/ testing documents and golden fixtures it requires), what the reviewed workflow exercises (.github/workflows/ci.yml, packages/psyche-npm/**, Cargo.toml, Cargo.lock, rust-toolchain.toml, clippy.toml, deny.toml), and the trust root itself (the checker, its tests, the test manifest, the scope manifest, and the evidence document); - explicitly unscoped operational/readiness paths (onboarding, governance, roadmap, agent metadata, non-attested docs) may change without refreshing G2 evidence; - unmatched or new paths default to protected until explicitly classified; - the checker enforces a REQUIRED_PROTECTED_PATHS floor independently of manifest edits, so the manifest itself cannot shrink the trust root; - renames, copies, deletes, typechanges, submodule changes, unsafe paths, and truncated (>=300-file) compare responses fail closed even when the paths classify unscoped; - changing only docs/G2-EVIDENCE.md remains subject to the original exact evidence-only relationship rules; - local and GitHub Actions verification share one classification logic; - diagnostics name the protected paths that invalidated the attestation without quoting their contents. Because this change touches protected trust-root paths, the retained attestation is invalidated by design: docs/G2-EVIDENCE.md transitions from Status: passed (tested source f4f242f, run https://github.com/OpenCoven/psyche/actions/runs/31565714638) to the exact candidate placeholders until a new attestation replaces it. The historic record remains in git history. Every file of PR OpenCoven#15 is explicitly classified unscoped, so it passes this gate without claiming its new files were covered by G2. Refs OpenCoven#16 Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
CompleteDotTech
marked this pull request as ready for review
August 30, 2026 16:03
Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
Owner
Author
|
CI status: no checks can report yet — the fork's Actions workflows are not initialized (documented per the no-fake-green rule).
Local verification that did run: |
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.
Summary
Implements OpenCoven#16: the retained G2 attestation stays bound to the contract surface it actually proves instead of the entire future repository tree, while unrelated repository-readiness, governance, and operational documentation may evolve.
The defect. The passed-evidence relationship verifier required the historic tested source commit to be the pull-request head's merge-base and the entire tested-source-to-head diff to contain exactly one modified file,
docs/G2-EVIDENCE.md. That correctly protected the original evidence-only attestation PR, but applied forever it prevents every later non-evidence repository change: theG2 evidence relationshipsstep fails on PR OpenCoven#15's onboarding/readiness-only diff (failing run) even though rust formatting, clippy, workspace tests, state-machine tests, reusable conformance, migrations, crash recovery, fault-injection clippy, evidence-checker unit tests, npm distribution, dependency audit, and secret scanning all pass on the tested jobs.The design.
scripts/g2-scope-manifest.json(versioned,schema_version: 1) is a fail-closed G2 attestation-scope manifest. Both relationship verifiers — local git and the GitHub Actions compare — classify every tested-to-terminal changed path through one shared logic:crates/**including all golden and migration fixtures;docs/ARCHITECTURE.md,docs/SCHEMAS.md,docs/TESTING.md), what the reviewed workflow exercises (.github/workflows/ci.yml,packages/psyche-npm/**,Cargo.toml,Cargo.lock,rust-toolchain.toml,clippy.toml,deny.toml), and the trust root itself (scripts/check-g2-evidence.py,scripts/check-g2-evidence-test.py,scripts/g2-test-manifest.json, the scope manifest, anddocs/G2-EVIDENCE.md).README.md,LICENSE,SECURITY.md,AGENTS.md,CONTRIBUTING.md,.gitignore,agent/**,docs/ROADMAP.md,docs/PROTOCOL-OWNERSHIP.md,docs/CLI.md,docs/CONFIGURATION.md,scripts/agent-bootstrap,scripts/agent-check. Every file of PR Establish Psyche roadmap and agent-readiness foundation OpenCoven/psyche#15 is covered, so it passes this gate without claiming its new files were covered by G2.REQUIRED_PROTECTED_PATHSfloor independently of manifest edits, so the manifest itself cannot shrink the trust root.docs/G2-EVIDENCE.mdremains subject to the original exact evidence-only relationship rules.G2 validation is not disabled or bypassed: every existing source hash, command hash, matrix row, workflow invariant, manifest relationship, CI attestation check, and evidence field is still enforced (57 pre-existing checker tests pass unchanged; two only had their expected error text updated to the new scope classification).
Attestation lifecycle. Because this repair touches protected trust-root paths, its own rule invalidates the retained attestation:
docs/G2-EVIDENCE.mdtransitions fromStatus: passed(tested sourcef4f242f88f41dcb8286c867ea1601dac2c14a80a, CI attestationhttps://github.com/OpenCoven/psyche/actions/runs/31565714638— preserved here and in git history) to the exactcandidateplaceholders until a new candidate/attestation replaces it. Nothing unrelated is blessed: candidate evidence records no tested source and no CI attestation. After merge, a new evidence-only PR records the next exact-head attestation under the scoped rules, and PR OpenCoven#15 rebases onto this gate.Issue
Refs OpenCoven#16
Closes OpenCoven#16
Test plan
python3 scripts/check-g2-evidence-test.py: 70/70 locally (57 pre-existing + 13 new focused tests), including:validate_repositoryagainst the real tree: workflow hash and structure, scope manifest, candidate evidence, manifest/matrix relationship, and all source and documentation invariants.G2 evidence relationships, dependency audit, secret guard, and npm distribution.