Skip to content

test(dal): capture fixtures for the three moved schemas - #113

Merged
LKSNDRTMLKV merged 1 commit into
mainfrom
test/capture-moved-schema-fixtures
Aug 14, 2026
Merged

test(dal): capture fixtures for the three moved schemas#113
LKSNDRTMLKV merged 1 commit into
mainfrom
test/capture-moved-schema-fixtures

Conversation

@LKSNDRTMLKV

Copy link
Copy Markdown
Member

Summary

Gives passport_doc_compat's frozen-document guard a readable document for the
three sectors whose schema_version moved, and adds the recipe that produced
them.

Closes #109.

Why

All six battery fixtures are listed in UNREADABLE_FIXTURES, so
every_frozen_passport_doc_still_reads skipped every one of them: the sector
with the most schema movement had no protection against the next non-additive
change. Textile and electronics were a version behind. This adds
battery/v2.6.0.json, textile/v1.2.0.json and electronics/v1.2.0.json.

Captured, not written

just capture-fixture <sector> creates and publishes a passport through the
real vault against real Postgres, then writes the row's doc column.

A fixture authored from the current structs deserialises back into them by
construction — the guard would pass tautologically and catch nothing. What makes
these evidence is that the create and publish paths produced everything the
guard inspects: the schema version resolved from the catalog (not passed as an
argument), publishedAt, retentionLocked, version, the stamped Annex III
facility and Art. 13 operator identifier, and the exact serde shape of
sectorData — 30 fields on battery, 17 textile, 13 electronics.

The recipe refuses to overwrite an existing fixture: a frozen document that gets
re-captured has stopped being evidence about the release that produced it.

Two limits, stated rather than implied

These are not cryptographically meaningful. The harness signs with
MockIdentity, so jwsSignature and disclosureSignatures carry
test-header / test-sig around a real payload, and complianceResult reports
PASSTHROUGH_NO_VALIDATION because no sector plugin is loaded. Immaterial to a
guard that asks whether a stored document still deserialises — those are a
String and a struct either way — but a captured document should not be
mistaken for a signed one.

They were captured after the 0.17.0 bump, not before. The guard's own doc
asks for capture before bumping dpp-domain, because a fixture frozen
afterwards can only catch the bump after next. Battery had nothing at all, so
this is a real improvement, but it is a weaker guarantee than three new files
might suggest.

Found on the way

The battery body carries the full set its category makes mandatory rather than
the minimum that validates. The first attempt used LFP and was refused:

cobalt recycled content declared for a LFP battery, which contains no cobalt

chemistry_regulated_metals admits lithium only for LFP, while all four
recycledContent* figures are mandatory for an industrial battery — so an LFP
industrial battery cannot carry the full mandatory set at all
. The fixture is
NMC for that reason. Worth someone's attention, but it is core's tension to
resolve, not this repo's.

Checklist

  • Tests added or updated for new behaviour — the guard now exercises three
    documents it previously had none of
  • just check green (728/728)
  • just fmt applied
  • passport_doc_compat green against the new fixtures
  • No secrets in the diff — fixtures are synthetic products from a test
    harness
  • No DB schema change
  • just test-integration — the capture tests are #[ignore]d (they write
    into the source tree), so CI never runs them; they were run by hand to
    produce the fixtures

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 1 duplication

Metric Results
Complexity 5
Duplication 1

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@LKSNDRTMLKV
LKSNDRTMLKV merged commit ca74189 into main Aug 14, 2026
22 checks passed
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.

Frozen-document guard covers no readable battery document

1 participant