feat: sector schema endpoints, plugin-absence warning, and shared test scaffolding - #176
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -7 |
| Duplication | -5 |
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.
Three issues from the open-issue audit, the duplication work they surfaced, and the 0.12.0 release.
Closes #175. Closes #144. Closes #85.
Six commits, one concern each.
feat(node)— name catalogued sectors with no plugin (#175)One line at boot listing them, at
warn. Passthrough is a legitimateconfiguration so this does not refuse to boot — but a sector with no plugin and
a sector whose plugin found nothing wrong both produce a determination with no
findings, so from the outside they were indistinguishable, and "no violations"
read as "checked and clean" when it could mean "never checked".
warnrather thaninfobecause a production node loads a full signed set fromthe release pipeline, so a gap there is a misconfiguration, and
infois whereit would be missed.
feat(integrator)— serve sector JSON Schemas (#144)Three unauthenticated routes: list, current, pinned-by-version (a leading
visaccepted). Resolved through the same
VersionedSchemaRegistrythe publish gatevalidates against — never a copy, which would drift in the direction where a
body passes here and fails at publish.
Descriptions are stripped, deliberately and temporarily. #144 is blocked on
the schema prose being audited: those fields make regulatory assertions never
checked against primary text, and two electronics descriptions once asserted an
adoption date, an effective date, three named priority product classes and a
phase-two date for an act that does not exist. Inside a library those are
developer comments; on a public endpoint they become a product surface a
consumer reads, caches and relies on.
So the machine-readable contract ships and the prose does not. Everything that
decides accept or reject — types,
enum,required,pattern, bounds,additionalProperties— is served in full, which is what an SDK actually needsto pre-validate. This is a holding position and is marked as one in the module
docs: restore the descriptions once the audit verifies them.
strip_descriptionsand its single call site are the only things to remove.
The stripper is schema-aware rather than a blanket key removal: under
properties,$defs/definitionsandpatternPropertiesthe keys areauthor-chosen names, so a property legitimately called
descriptionwould bedeleted by a naive walk, taking a real field out of the contract. No schema
declares one today; the test pins it so the first one to do so is safe.
titleis kept — short labels, not assertions.Spec updated: three path files, a
Problemcomponent schema (RFC 7807, whichthese routes actually return), and the three unauthenticated routes added to the
lint baseline alongside the existing ones.
test:— one Postgres harness, andtempfilefor keystores (#85)start_pghad reached eight copies that had drifted into six distinctimplementations, each with its own hardcoded 1500ms readiness sleep. It now
lives once in
dpp_dal::test_harness(start_pg,start_pg_raw,start_pg_before) behind a dev-onlytest-harnessfeature.Nine keystore sites moved from a hand-built
std::env::temp_dir()path totempfile::tempdir(). Severity was low and stays stated plainly — throwawaykeys, literal passphrases, nothing production-adjacent reads those paths — but
they hold Ed25519 private keys, get no restrictive permissions, and every run
left the file behind. #85 suggests routing these through the harness; they are
inline instead, because coupling a crypto concern to a Postgres helper buys
nothing.
test:— the in-memory repository double, and a gateimpl PassportRepository for InMemoryPassportRepowas copied into three suites.The
implblocks were byte-identical; the structs had already diverged, onehaving grown
Arc+Clonethe other two lacked. Now one home indpp_dal::in_memory_repo, behind the same feature, cloneable so it serves allthree.
just harness-checkis the signal that was missing, wired intojust checkalongside
subjects-checkandmod-rs-check. It fails when either sharedhelper is defined outside its home, and names what to use instead. Verified to
fail before being wired in — both rules were tripped deliberately and reverted;
the diff carries no trace.
The eight copies existed with a comment above them explaining the problem, so
the rule without the gate would have decayed the same way.
No new crate
The first attempt at #85 added a
dpp-test-supportcrate, which #85 itselfproposes. It was discarded: every consumer already depends on
dpp-dal, and acrate holding one function for callers who could already see it earns nothing
against the no-fission-before-1.0 rule.
dpp-dalispublish = false, so thefeature ships nowhere.
The wider duplication was measured rather than assumed, and most of it is not
duplication: the three
serde_json::Valuepassport builders are wire-shaped forHTTP tests, a different thing from the typed builders, and the
TestAuthProvider/
AlwaysFaildoubles hash differently per suite — small, purpose-built, andmerging them would couple unrelated tests to one double's behaviour. The three
typed passport builders are a real candidate, deferred with a written trigger
rather than rejected. All of that is recorded in CLAUDE.md so it is not
re-litigated.
chore(release)— 0.12.0MINOR under the pre-1.0 convention: new endpoints, no breaking change in this
batch. The
[Unreleased]section carried an earlier breaking entry(
publishValid→sectorDataValid), which a minor bump may contain.#161 is not in this release. The GS1 Digital Link route still answers
404for a suspended passport; it needs
find_by_gtin_any_status, which is ondpp-core's main but not in the published 0.18.0 this engine pins. Deferred to
the next patch by decision, not oversight.
Verification
just checkgreen: fmt, clippy, the debug/subject/mod-rs/harness/spec-version/outbound/grants/migrations gates, 841 tests, integration-suite compile, and
cargo audit.spec-version-checkconfirmsapi/openapi.yamlandCargo.tomlagree on 0.12.0. The OpenAPI bundle is regenerated and lints clean (1 pre-existing
warning class, 37 baselined).
Noted, not fixed
api/components/responses/NotAcceptable.yamldeclaresapplication/problem+jsonbut references the
{error, message}ApiErrorschema. The resolver emitsRFC 7807 there. Pre-existing and out of scope for this branch.