docs(architecture): make the docs true and put tripwires behind the layout rules - #185
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 55 |
| Duplication | 10 |
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
force-pushed
the
docs/truth-pass-and-layout-standard
branch
from
August 25, 2026 03:24
7b20a26 to
a309e02
Compare
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 commits: correct every documented claim that had drifted from the code, bring the code layout standard into the repository, and put a tripwire behind each of its rules.
Why these belong together
The layout standard already existed — five numbered rules, written 2026-07-04. Exactly one of them had a test, and it is the only one that had not drifted:
mod.rsis a pure indextests.rspast 400 lineslib.rsatsrc/root//!181 violations across five unenforced rules, zero across the enforced one. Nobody ignored anything on purpose — the rules simply had nothing watching them, and a rule with nothing watching it is a preference. Preferences lose to deadlines.
No files move in this PR. The rules now bind for all new and moved code; the existing backlog is worked through separately.
1. Where the standard was, and why nobody followed it
The rules lived in an archived directory in a different, private repository, and
mod_rs_is_pure_index.rscited that path from this public repo — whichCLAUDE.md§6 forbids in terms. So four of the five rules were invisible to anyone working here, and the pointer to them was itself a leak. Both are fixed: the standard is nowdocs/architecture/CODE-LAYOUT.md, and the comment points at it.Rules 6–10 are new, and each closes a place where practice had actually diverged: the
lib.rs-only convention, sibling test files, module docs, one name for test scaffolding (test_support.rs, notfixtures.rs), and naming that separates structural tripwires from behavioural tests.Rule 3 is demoted to guidance and labelled as such. "Free functions group by verb-domain" cannot be tested without a definition nobody would agree on, and an unenforceable rule sitting in a list of enforced ones is what teaches a reader the list is decorative.
2. How the tripwires behave
Each carries a baseline of the files that already violated it. Those pass; anything not on the list fails. A stale entry also fails, so a fixed file has to be pruned or the list stops describing anything.
Three design points worth review:
path (892 lines), which would have failed the build every time anyone touched a baselined file for an unrelated reason. A tripwire that fires on innocent edits is one that gets deleted.// LAYOUT-DEVIATION: <reason>exempts a file. A rule with no escape hatch gets deleted the first time it is inconvenient; a rule with a greppable, reasoned escape hatch survives. Do not add to a baseline to go green — a baseline entry states nothing, a marker has to state why.Verified to fail
Per the standard's own rule, a gate nobody has watched fail is a gate nobody knows is wired. All four behaviours were exercised before this was committed: a probe file violating rules 1, 6, 7 and 8 plus an over-long
tests.rs— all five red; adding the deviation marker — all five green; a fabricated baseline entry — red, naming the stale path; probes removed — green.3. The documentation corrections
PORTS.mdattributedArchivePortto ESPR Art. 13, which is the registry. The back-up duty is Art. 10(4), "independent third party" is Art. 2(32), and the availability period is Annex III(i). Fixed, and the confirmed citations added toarchive.rs, which described the substance correctly but cited nothing. Every otherArt. 13reference in the codebase was checked and is genuinely about the registry.OVERVIEW.mdclaimed retention of "10-20 years". Every figure recorded in every instrument manifest is 10, several markedAssumed. Replaced with how the value is actually derived.`product group`in both the Rust and JSON columns. Rewritten complete, pointing atPASSPORT_WIRE_KEYSas the authority since that constant is asserted against.DATA-MODEL.mdcontained zero occurrences of "instrument". New §3.5 covers the three-record shape, why applicable law is a set (Art. 5(7), no precedence rule anywhere), the three folds, why "may this bind" is never folded to a boolean, andPassportObligation's third state.ElectronicsDatadoes not exist. It does, at v1.2.0. Replaced with a table of all twelve product groups, and theUnsoldGoodsReportdivergence from Impl. Reg. (EU) 2026/2 is now recorded where the type is documented.dpp-vocabentirely and undercounted crates (9 → 12) and product groups (11 → 12).lib.rs(published rustdoc) andVERSIONING.mdboth stated every crate depends ondpp-domain. Six of eleven do not — and theVERSIONING.mdcopy was rationale build(deps): bump actions/upload-artifact from 4 to 7 #1 for lockstep versioning.Where a count was the thing that goes stale, it is replaced with a pointer to the authority rather than a fresher number.
just checkgreen — 1154 tests.