Skip to content

Commit f09ca0c

Browse files
PhysShellcodex
andcommitted
P-037 A2.0: make provenance closure fail on phantom paths
Strengthen the runtime-dependency self-check: every path declared as part of the measurement must not only be covered by SUBJECT_PATHS, it must resolve to an actual git object in HEAD. A matching typo in both lists can therefore no longer protect an empty path. Refs #304. Co-Authored-By: ChatGPT <noreply@openai.com>
1 parent 6ed8f3f commit f09ca0c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎scripts/p037_evidence.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ def closure_problems() -> list[str]:
123123
f"runtime path {path!r} is outside SUBJECT_PATHS; a measurement "
124124
"could change without invalidating its evidence"
125125
)
126+
obj = _norm(path)
127+
if _git("cat-file", "-e", f"HEAD:{obj}").returncode != 0:
128+
problems.append(
129+
f"runtime path {path!r} is declared but does not exist in HEAD; "
130+
"a misspelled dependency would otherwise protect an empty path"
131+
)
126132
if len(set(SUBJECT_PATHS)) != len(SUBJECT_PATHS):
127133
problems.append("SUBJECT_PATHS contains duplicate entries")
128134
return problems

0 commit comments

Comments
 (0)