test(dal): capture fixtures for the three moved schemas - #113
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 1 |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gives
passport_doc_compat's frozen-document guard a readable document for thethree sectors whose
schema_versionmoved, and adds the recipe that producedthem.
Closes #109.
Why
All six battery fixtures are listed in
UNREADABLE_FIXTURES, soevery_frozen_passport_doc_still_readsskipped every one of them: the sectorwith 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.jsonandelectronics/v1.2.0.json.Captured, not written
just capture-fixture <sector>creates and publishes a passport through thereal vault against real Postgres, then writes the row's
doccolumn.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 IIIfacility 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, sojwsSignatureanddisclosureSignaturescarrytest-header/test-sigaround a real payload, andcomplianceResultreportsPASSTHROUGH_NO_VALIDATIONbecause no sector plugin is loaded. Immaterial to aguard that asks whether a stored document still deserialises — those are a
Stringand a struct either way — but a captured document should not bemistaken 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 frozenafterwards 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:
chemistry_regulated_metalsadmits lithium only for LFP, while all fourrecycledContent*figures are mandatory for an industrial battery — so an LFPindustrial 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
documents it previously had none of
just checkgreen (728/728)just fmtappliedpassport_doc_compatgreen against the new fixturesharness
just test-integration— the capture tests are#[ignore]d (they writeinto the source tree), so CI never runs them; they were run by hand to
produce the fixtures