Skip to content

test: the shared revocation-statement table, run by all four bindings - #671

Merged
EricAndrechek merged 3 commits into
v2from
v2-revocation-statement-fixture
Oct 21, 2026
Merged

EricAndrechek merged 3 commits into
v2from
v2-revocation-statement-fixture

Conversation

@EricAndrechek

@EricAndrechek EricAndrechek commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What

Adds tests/fixtures/revocation-statement/ (copied byte for byte, SHA256SUMS verified; generated by the delivery side's registry tests, which run the same file) and a test in each binding that reads it.

The contract rule

docs/guides/fetch-v1.md, "Build-level revocation", rule 5: predicate.advisory has non-empty string id and url, and class, summary, superseded_by and revoked_at are strings; "no fix" is superseded_by: "". Anything else means the candidate is ignored with one warning naming it, and the first candidate in the listing that verifies wins. All four bindings already implement this; no conformance case covered a non-string field or a valid candidate after invalid ones. No production code changes.

The cases

  • 10 statement rows: superseded-by-empty and superseded-by-build verify (the six parsed strings must equal expect_advisory; the revoked message omits "; superseded by build ..." exactly when there is no fix); superseded-by-null, -number, -missing, class-number, summary-null, revoked-at-number, other-key and manifest-mismatch are refused.
  • 6 listing rows (invalid-then-valid, valid-then-invalid, valid-only, invalid-only, two-invalid-then-valid, two-valid): served from a local registry in listing order through each binding's real candidate loop; the result is CHTYPES_ARTIFACT_REVOKED carrying the winning advisory, or fail-open with one "does not verify and is ignored" warning per ignored entry.

Each test skips loudly when the table is absent and refuses a table with no rows. Go and Python were run locally and fail when the string check is removed; TypeScript and Rust are verified in CI.

docs/guides/fetch-v1.md names the table; each CHANGELOG has one bullet under Added.

Update: the table now also has sixteen-invalid-then-valid: 16 non-verifying statements, then a valid one. A client reads at most 16 revocation referrers per manifest (MAX_REFERRERS), so it fails open, and the 17th is dropped without a warning. The registry refuses to accept a 17th revocation for a manifest, so that state can't arise in service. Copied byte-for-byte, and every file checks against SHA256SUMS. Go (7/7 listings) and Python (18 tests) pass locally. A TS test's temp-dir prefix was renamed to match the other TS tests.

🤖 Generated with Claude Code

EricAndrechek and others added 3 commits October 21, 2026 06:28
The table pins rule 5 of "Build-level revocation" (superseded_by, class,
summary and revoked_at must be strings; "" means no fix) and that the first
verifying revocation in a listing wins, with one warning per ignored
candidate before it. Each binding reads tests/fixtures/revocation-statement
(generated by the delivery side's registry tests, copied byte for byte) and
runs the 10 statement rows through its revocation-verify function and the 6
listing rows through its real candidate loop against a local registry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The public lint reads any chtypes-<letter> token as a private sibling
repository's name; the TS test's temp-dir prefix was one. It now follows
the other TS tests' prefixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The delivery side's generated table gains sixteen-invalid-then-valid:
16 distinct non-verifying statements, then a valid one. A client reads at
most 16 revocation referrers per manifest (MAX_REFERRERS), so it fails
open and the 17th is dropped without a warning; the registry refuses to
accept a 17th revocation for a manifest, so the state is unreachable in
service. Copied byte-for-byte; every file checks against SHA256SUMS.
Go (7/7 listings) and Python (18 tests) pass locally against it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EricAndrechek
EricAndrechek merged commit b7a6c3e into v2 Oct 21, 2026
72 of 73 checks passed
@EricAndrechek
EricAndrechek deleted the v2-revocation-statement-fixture branch October 21, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant