You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 84c06a2
Browse filesBrowse the repository at this point in the historyBrowse files
Independent pushed-byte review of 460557e accepted the CH3-10/CH3-11
repairs but found a pre-existing, more fundamental defect: scrutinizing
materialization_root's trustworthiness exposed that
p037_evidence_b.record_problems() claimed, in its own docstring, to check
"the same clauses" as the generic p037_evidence.record_problems(), but
actually implemented only a small subset -- instrument_paths/
treatment_paths/subject_paths exact equality were never checked at all
(only instrument_carve_outs, and only as a set, tolerating a reordered or
duplicated closure); input_roots was never validated; instrument_identity
was never cross-checked against a value freshly recomputed at the record's
own source commit (comparison_problems's before==after equality cannot
catch two independently forged-but-equal digests); population_commit's
existence and ancestry were never checked; analysis_manifest/
support_manifest were never re-derived from the population commit, nor
their sha256 fields checked against the carried manifest; reference_
profile/execution_profile were never checked; artifacts were never
validated at all.
Ported the full contract clause for clause, using the same pure,
parameter-driven ev.* helpers the generic function itself calls
(population_fields/analysis_manifest/support_manifest/_manifest_entries/
_manifest_digest/reference_profile_problems/commit_exists/is_ancestor --
none of these read EPOCH/INSTRUMENT_PATHS internally) and this module's
own environment_id()/instrument_identity() for the two genuinely
epoch-coupled checks. subject_paths was also missing from evidence_
fields()'s own returned dict (the SUBJECT_PATHS constant already existed,
it just was never included) -- added and now validated too.
One intentional divergence, named rather than silently kept: the old
`materialized_root`/`population_intact()` branch is REMOVED, not renamed
to the field verdict snapshots actually write (`materialization_root`) --
it was dead code (that typo'd field name is never written, so the branch
never ran), and reintroducing it correctly would still make historical
validation depend on an ephemeral materialized directory that need not
still exist. Population integrity is proven durably instead, exactly as
the generic function proves it: by re-deriving analysis_manifest/support_
manifest from the population commit and checking their digests.
The same review found the field this dead branch was named after was
itself the live vulnerability: p037_verdict_snapshot.py's compare()
trusted the AFTER snapshot's own recorded `materialization_root` field
directly as authority for the witness file-identity check (CH3-11's own
fix). A manually altered snapshot can change BOTH `materialization_root`
and `witness.site.file` to matching forged strings, and the CH3-11 exact-
equality check between them would still pass -- two forged strings
agreeing with each other, not with reality. compare() now computes
canonical_root = ev.materialization_root(population_commit, analysis_
manifest_sha256).relative_to(ROOT).as_posix() and requires the recorded
`materialization_root` to equal it, refusing (fail-closed) otherwise; the
per-file witness-binding loop uses canonical_root, never the recorded
field, to reconstruct expected_witness_file.
New selftests: 16 record_problems() mutation hostiles (wrong/missing
instrument_paths/treatment_paths/subject_paths/instrument_identity,
invalid input_roots, nonexistent/non-ancestor population_commit, tampered
analysis/support manifest, wrong analysis/support digest, empty
execution_profile, four artifact-attestation mismatches), each derived by
mutating ONE field of a single real record built from evidence_fields()
against live HEAD (never two hand-crafted invalid records compared only to
each other); two pairwise-forged-equal-digest controls proving comparison_
problems's before==after check is not mistaken for authenticity now that
each side independently fails record_problems() on its own; and six
canonical-materialization-root hostiles in p037_verdict_snapshot.py
(correct case classifies, forged population/digest halves each refused,
missing root refused, and the loop-closing case: a witness file forged to
match a forged recorded root still fails against the canonical root).
Sanity check against the two currently-committed R_B baselines (docs/
evidence/p037-b-baseline-verdict-{python,rust}.json): both fail only on
the closure-identity fields (instrument_paths/carve_outs/treatment_paths/
subject_paths/instrument_identity), exactly the expected drift from
INSTRUMENT_CARVE_OUTS growing since they were taken (dump.rs, verdict.rs,
render.rs, own-cli/src/ownir.rs all joined after). Every deeper check --
population ancestry, manifest re-derivation, digest cross-check, artifact
attestation -- passes cleanly on both real historical artifacts, so the
kill gate (a substantive contract failure on a previously-valid artifact)
does not fire; both files remain superseded for the unrelated reason this
whole review arc already established.
Zero production semantics: touches only scripts/p037_evidence_b.py and
scripts/p037_verdict_snapshot.py. All three production_diff_gate units
(rust, extractor, cli) report IDENTICAL against 460557e. ruff and strict
mypy are clean; every module selftest passes; tests/test_p037_a2d_epoch.py
and tests/test_p037_cumulative_evidence.py stay green.
No T_B named, no R_B taken, no R1 commit/push/replay.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AN6xHbpovxrmZ4AMjS7WQA
0 commit comments