Skip to content

conformance: wire content-index checks and policy-aware state validation#11

Merged
samjanny merged 1 commit into
mainfrom
fix/conformance-state-undeclared-content-index
Jun 3, 2026
Merged

conformance: wire content-index checks and policy-aware state validation#11
samjanny merged 1 commit into
mainfrom
fix/conformance-state-undeclared-content-index

Conversation

@samjanny
Copy link
Copy Markdown
Owner

@samjanny samjanny commented Jun 3, 2026

Summary

Closes the two in-scope conformance gaps reported in #10 against the rc.47 corpus (108 vectors). The conformance suite goes from 10 failures to 0; the two Stage 7 trust vectors are reported as out of scope rather than counted as failures.

Changes

Content index (vectors 230-235)

The library already implements the Stage 9b checks in validation::content_index; the conformance runner was calling skip_content_index_check() unconditionally, so the checks never ran. Wire them instead:

  • Manifest vectors that declare content_root run verify_content_index against the served index supplied in extra_files.
  • Content vectors verify the index against content_root, then compare the document seq and body hash against the committed entry for its path.
  • Add content_index_path and content_root to the harness Context.

No library changes were needed for this part.

State undeclared (vectors 220-221)

parse_and_verify_transaction now takes an optional manifest state_policy. When Some, each state_updates entry is cross-checked against the declared (namespace, key) set via the existing validate_state_updates_against_policy, producing E_STATE_UNDECLARED (plus the policy-relative E_STATE_VALUE_SIZE and E_STATE_TTL). Passing None preserves standalone verification, so a caller that does not have the manifest is unaffected; a caller that does have it gets the check without a separate call it could forget. The conformance runner loads the policy from the manifest referenced by context.previously_verified.

The two existing transaction call sites that verify in isolation pass None.

Trust (vectors 210-211) left out of scope

The Stage 7 trust-state machine remains out of scope for this crate (documented at the crate root). Rather than leave the suite red or silently pass, these two vectors are listed in an explicit skip set in the harness and reported with a printed count. Removing an id from that set is the natural trigger when the capability lands.

Verification

  • cargo fmt --all --check: clean
  • cargo clippy --all-targets --locked -- -D warnings (default and test-utils): clean
  • cargo doc --no-deps --all-features --locked with -D warnings: clean
  • cargo test --all-targets --locked (default and test-utils): all green, no regressions
  • Conformance against the 108-vector corpus: 106 verified, 2 skipped as out of scope, 0 failures

Note on the corpus pin

CI pins the corpus at the v1.0-rc.47 tag. The 20 new vectors (including 210-211, 220-221, 230-235) are on main of the spec repo but the tag still points at the 88-vector revision. When the tag is updated to the 108-vector revision, this change is what keeps the conformance job green.

Close two conformance gaps against the rc.47 corpus, taking the
conformance suite from 10 failures to 0 (the two Stage 7 trust vectors
are reported as out of scope, not failures).

Content index (vectors 230-235): the library already implements the
Stage 9b checks in validation::content_index; the conformance runner was
calling skip_content_index_check() unconditionally. Wire it instead:
manifest vectors that declare content_root run verify_content_index
against the served index in extra_files; content vectors verify the
index and then compare the document seq and body hash against the
committed entry. Add content_index_path and content_root to the harness
Context.

State undeclared (vectors 220-221): parse_and_verify_transaction now
takes an optional manifest state_policy and, when present, cross-checks
each state_updates entry against the declared (namespace, key) set via
the existing validate_state_updates_against_policy, producing
E_STATE_UNDECLARED (plus the policy-relative E_STATE_VALUE_SIZE and
E_STATE_TTL). Passing None preserves standalone verification. The
conformance runner loads the policy from the manifest referenced by
context.previously_verified.

The Stage 7 trust-state machine remains out of scope for this crate, so
vectors 210-211 are listed in an explicit skip set in the harness and
reported with a printed count rather than silently passing.
@samjanny samjanny merged commit 349af18 into main Jun 3, 2026
10 checks passed
@samjanny samjanny deleted the fix/conformance-state-undeclared-content-index branch June 3, 2026 08:52
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