Repository navigation
Quote the pinned sentence behind each check - #70
Merged
Merged
Conversation
scope-undescribed was written as a MUST from 0.3's 28 October text and stayed one after 4.7 became a SHOULD on 3 November, so the validator called northbound.camp invalid and our client refused it. Nothing compared a message's basis with later pins. Each MUST, SHOULD or Rule validator message now quotes its sentence in `requires`, and each such mock check quotes it in its basis. check-requirements.mjs, run by check:spec, fails when a runtime pin lacks the quote or the quote lacks its basis's key word. Writing the quotes found mediated-scope-unsupported (also a SHOULD since 3 November), stale 0.3 quotes in the mock, and RS256 client assertions the 0.4 Guides dropped. scope-undescribed checks the domain's own scopes_supported when its protected resource metadata lists one (a reading). spec:keywords reports key-word changes between snapshots for the upgrade procedure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Ties each normative validator message and mock check to the pinned sentence it enforces, so a change to a key word upstream fails
npm run check:spec. It also fixes the two validator errors and the mock bases that the new check found stale.Most of the 664 changed lines are quotes added to
src/validator/messages.tsandtest/mock-company/violations.ts. The checker verifies those mechanically. The parts that need a reviewer's judgement are the basis changes listed under How,scripts/check-requirements.mjs, and the scope check insrc/validator/profiles/draft-0.4.ts.Why
Fixes #71.
The live validator calls northbound.camp invalid, partly because its issuer lists
openid,profile,email,phoneandoffline_accessinscopes_supportedwithout describing them inauth.scopes. That'sscope-undescribed, a MUST error that makes our client refuse the Company. In 0.4 and 1.0, 4.7 says:The root cause:
scopes_supported".check:specchecked that each changelog entry had a disposition. Nothing compared a message's basis with the pinned text.mediated-scope-unsupportedhas the same history. On 28 October the text said "all of them inscopes_supported"; by 3 November it said "The Company SHOULD also include them".Northbound still has one real error after this change: its protected resource metadata says
"resource": "https://www.northbound.camp/api", and 3.2 requireshttps://northbound.camp. Run on this branch,npm run validate -- northbound.campnow reports that error and two info notes, and nothing about scopes.How
scripts/check-requirements.mjs, run bycheck:spec:requiresfield.…skips text within a paragraph.Quotes: 63 messages and 79 mock checks gained a quote or had theirs fixed. Every quote passed the checker, and I read the uncertain ones against the pins. Writing them moved bases. Each move below keeps its severity unless it says otherwise:
scope-undescribed: MUST → SHOULD. Now a warning, and the client no longer refuses over it.mediated-scope-unsupported: MUST → SHOULD. Now a warning.mediated-grant-missing,nothing-offered,issuer-ambiguous, mocksession-jwt.not-jwtandfeedback.fields: MUST → Rule. The pinned text states them with no key word.not-a-url,domain-invalid: Rule → MUST. Each rests on a MUST sentence in 3 or 3.1.json-duplicate-member: SHOULD → Guides. Still a warning that the client refuses.jwks-kid-duplicate: its ref is now RFC 7517 §4.5, where its SHOULD comes from.version.missing: MUST → Rule. 3.4's sentence has no key word.account-token.rotated-reused: MUST → RFC 6749 §6. 4.4 no longer says MUST.handoff.bodyandclose.body: they quoted an "empty JSON object". Under 0.4 these bodies carry a request ID, and the mock already accepted that.Scope check: when the domain's protected resource metadata lists
scopes_supported,scope-undescribedchecks those scopes against that document, and skips the issuer's list. 3.2 says the domain's list "suits a Company whose issuer also serves other resources or clients", and 4.7 says either list "MAY leave out scopes the Company offers only to its other clients". Recorded as a reading.RS256: the mock no longer accepts RS256 client assertions. The 0.4 changelog says "Companies are no longer told to accept RS256 client assertions", and the mock's own description already said ES256 or PS384.
Stale version text: the validator CLI's
--protocolhelp and avalidate.tscomment still called 0.4 the only version and the default. The default is 1.0.Upgrade procedure:
npm run spec:keywords -- <old snapshot> <new snapshot>lists the sentences whose key words changed. docs/upgrading.md step 3 runs it before a new pin. Across our consecutive pins it reports:Every one is either handled in this PR, already handled (
metadata-assertion-algsfor PS384 under 1.0), or a Company obligation that no check of ours enforces.Not in this PR
The audit found checks whose behaviour, and not only their quote, is broader than their sentence. Each needs its own id,
TAMPERSrow and decision, so they're listed in TODO.md:message.authorunder 1.0;session-jwt.sub-changed: under 0.4 a knownsidwith another User ID starts a new Session, and the mock still refuses it;authorize.secret-in-url;http-non-public-host;company.*checks, which quote nothing yet.Testing
scripts/check-requirements.test.mjsuses 0.3's two 4.7 sentences. The MUST quote matches the 28 October text and fails against the 3 November one, and a SHOULD quote fails under a MUST basis.test/validator.test.ts:orders:*in the protected resource metadata andopenid,profileandoffline_accessonly in the issuer's list. It checks that only the undescribed protected-resource scope is reported, as a warning on that document.scope-undescribedput back to MUST and its 28 October quote,npm run check:specfails:scope-undescribed: not in the 0.4 text.npm run check:spec,npm run check:docs,npm run typecheck,npm run test:tooling(22),npm test(1,756 passed, 1 skipped, after fixing the catalog test's format regex for quotes with parentheses), the interop unit tests (454),npm run test:properties(209) andnpm run test:hypothesis(63).No pixels change. The validator's messages page shows the new wording and severities through the existing template.
Risk
check:specruns on every PR. A refreshed pin now fails until each changed sentence's check is reviewed, which is the point of the change and adds work to every refresh.🤖 Generated with Claude Code