fix(scan): scope a partition census gap to its own partition, and write the rule down

A missing JavaScript file cannot make a PHP answer wrong. A census gap now carries the partition it
was raised for, and reaches only that partition questions. On the measured plugin four JavaScript
files -- a webpack build output, a minified select2, a build config and one source file -- had taken
the admissibility of 4,425 PHP regions with them.

Two controls exercise the real boundaries rather than injecting a reason, and both were confirmed to
FAIL with the old classification restored, so they guard what they claim to.

And the rule is now in the design, because this was the fifth instance found and fixed one at a time.
Two invariants, eleven instances between them:

  A degradation is owned by the narrowest scope that caused it. Vendor exclusion as a global veto,
  line ambiguity inherited by every question, an empty scope blocking a sibling comparison, a language
  boundary demoting every answer, a census gap demoting every answer. The fourth and fifth cost the
  declared v0.1 target its entire admissibility, and neither passing subject could reveal it because
  both hold one language.

  A token matches the thing it names, not text that contains it. gets inside fgets, resolve inside
  resolveUrl, user inside users, a sink word inside a comment, a dotted setting on its last segment,
  a flow query reading the receiver.

Each carries a review test: a new degradation must state the scope it reaches and justify demoting
that far, and a text match must be bounded AND confined to the part of the node that names the callee.

1,419 tests pass, eighteen skipped.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo
This commit is contained in:
Marius Ciepluch
2026-09-21 13:21:27 +02:00
co-authored by Claude Opus 5
parent c93669c34f
commit 29cef32bac
5 changed files with 123 additions and 6 deletions
+10 -2
View File
@@ -121,11 +121,19 @@ class PartitionGraph:
if not named or not expected <= observed:
self.diagnostics.append("partition_file_census_incomplete" if named else "partition_file_census_unavailable")
reason = "partition_file_census_incomplete" if named else "partition_file_census_unavailable"
# The partition the gap came FROM travels with it. A census gap is evidence about one
# graph: a JavaScript file missing from the JavaScript graph says nothing about whether
# a PHP answer is right, and without this the scan cannot tell the difference.
rows = [
dict(r, census_failure=reason, missing_file_names=sorted(expected - observed) if named else [])
dict(
r,
census_failure=reason,
census_language=language,
missing_file_names=sorted(expected - observed) if named else [],
)
for r in normalized
if isinstance(r, Mapping)
] or [{"census_failure": reason, "missing_file_names": []}]
] or [{"census_failure": reason, "census_language": language, "missing_file_names": []}]
# Preserve any individual empty or sharded graph's degradation.
previous = answers.get(rid, [])
if not previous or any(