Repository navigation
feat(registry): report every validation finding in one run - #20
jdjioe5-cpu wants to merge 2 commits into
Conversation
Resolves the ROADMAP.md conflict structurally: rebuilt on main, kept every main row, kept both sides' Changelog lines, and let only this repo's own rows advance from the branch (AGENTS.md 12). Section 3 counts recomputed.
|
Maintainer push to this branch — exactly what changed. This PR conflicted with My commit: Measured scope: I compared my merge's tree against what a plain automatic merge of the same two commits produces. Files where my version differs from both inputs:
In Current CI: red on No code, test, or config file of yours was modified unless it is listed above. This branch is yours; if you would rather resolve conflicts yourself, say so and I will stop pushing here. Why |
|
The facts I checked
json("supported-countries.json", { countries: "KE" }); // wrong type: string, not array
const report = errors().join("\n");
expect(report).toMatch(/supported-countries\.json: /); // still passes
expect(report).not.toMatch(/ke-test-school\.json/); // now fails
So with per-file aggregation, one unusable country list produces one message per payee file that references it. The test exists precisely to stop that cascade. Two coherent ways out A — aggregate findings, but keep fail-fast on dependency-level config. B — aggregate unconditionally and change the invariant. Then the test has to change deliberately, with a rewritten assertion describing the new expected output plus an ADR in My recommendation is A: it delivers the row's stated value (no more one-failure-at-a-time whack-a-mole across payee files) without degrading the single most confusing failure mode, and it needs no invariant discussion. Which one the org wants is Allison's call as maintainer. Until she answers, leave the assertion alone rather than skipping or relaxing it — a red |
What and why
Closes #16.
Implements multi-violation finding aggregation for the registry validator per roadmap row
M1-41. Instead of stopping at the first failure,validateRegistrychecks all rules on every file, producing structured findings with stable rule IDs, messages, and actionable fix hints sorted deterministically by file then rule ID. Unparseable JSON is reported distinctly and stops further per-file checks.Hard-rule and doc review:
docs/ARCHITECTURE_ESSENTIALS.md§8 (Registry rules)AGENTS.md§3 (Hard rules 10: Minimum viable; 11: Country-agnostic core)AGENTS.md§8.4 (kinlock-registry: public fields only, ISO codes, attester authority scope, canonical formatting, global slug uniqueness)Changes
scripts/registry.ts:Finding(file,ruleId,field,message,fixHint) andValidationResultinterfaces.validateRegistryto aggregate findings without exiting early on schema errors, continuing to check slug, directory, ISO country/currency, attester authorization, and duplicate slug.fileascending, thenruleIdascending).errorsstring array with existing pattern format alongsidefindings.formatFindinghelper.scripts/validate.ts:formatFindingto output structured findings with rule ID and actionable fix hints.scripts/registry.test.ts:scripts/validate.test.ts:formatFindingformatting and fix hints.README.md:ROADMAP.md:M1-41asDONE, added Changelog entry, updatedLast updated.Tests
Commands executed locally:
Docs / ADR
README.mdwith rule IDs and descriptions.Roadmap
M1-41:TODO->DONEAssumptions and open questions
None. Output formatting is deterministic and diffable across platforms.