test(accounting): the judge must SAY it proves carriage and not fidelity (red)
1 of 1 red, on an ASSERT about the published sentence. The behavioural half of the same test is already green and that is the point: PM's M10 measured that a mutated converter writing a BLANK PNG gives `asset_holds = True`, because the bundle is internally consistent -- the digest it claims to have written really is the asset's digest -- and the judge has no opinion about whether those bytes hold the source's picture. The limit is therefore asserted in both directions: it is REAL (the blank PNG is accepted here) and it must be STATED (the docstring names what the route cannot see). "A bundle claiming a conversion it did not perform still fails" reads wider than the route reaches; the suite fells that mutant, this gate cannot. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
24a828469f
commit
7bc9882100
1 changed files with 36 additions and 0 deletions
|
|
@ -671,6 +671,42 @@ def test_the_build_never_writes_a_claim_the_document_supplied(tmp_path: Path) ->
|
|||
)
|
||||
|
||||
|
||||
def test_the_judge_proves_carriage_and_says_it_does_not_prove_fidelity(tmp_path: Path) -> None:
|
||||
"""The limit, MEASURED here rather than trusted to the prose beside it.
|
||||
|
||||
PM's M10 2026-09-19: a mutated converter that writes a BLANK PNG gives
|
||||
`asset_holds = True`. The bundle is internally consistent -- the digest it
|
||||
claims to have written really is the asset's digest -- and the judge has
|
||||
no opinion about whether those bytes hold the source's picture. The suite
|
||||
fells that mutant (`test_the_carried_png_holds_the_source_pixels_exactly`
|
||||
decodes both sides); this gate cannot, and the docstring's "a bundle
|
||||
claiming a conversion it did not perform still fails" reads wider than
|
||||
the route reaches.
|
||||
|
||||
So the limit is asserted in BOTH directions: it is real (the blank PNG is
|
||||
accepted) and it is stated (the docstring names it). Teaching the judge
|
||||
pixels is a different job; leaving a reader to infer the gap is not.
|
||||
"""
|
||||
source = tmp_path / "figur.bmp"
|
||||
source.write_bytes(_huge_bmp())
|
||||
blank = tmp_path / "blank.png"
|
||||
blank.write_bytes(_png_bytes(b"\xff\xff\xff"))
|
||||
before = gate._sha256(source)
|
||||
after = gate._sha256(blank)
|
||||
text = (
|
||||
f"\n"
|
||||
f"Image: figur.bmp (8x4 px) -- converted from image/bmp sha256:{before} "
|
||||
f"to image/png sha256:{after}\n"
|
||||
)
|
||||
build = _build(assets={f"{after[:12]}-figur.png": after}, bundle_text=text)
|
||||
assert gate.asset_holds(build, source) is True
|
||||
|
||||
doc = gate.asset_holds.__doc__ or ""
|
||||
lowered = doc.lower()
|
||||
assert "fidelity" in lowered, "the judge does not say what its second route cannot see"
|
||||
assert "pixel" in lowered, "the limit is stated without naming what is not checked"
|
||||
|
||||
|
||||
def _declared(heading: int = 2, image: int = 1, fate: str = "rejected") -> dict[str, Any]:
|
||||
return {
|
||||
"accounting_version": 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue