test(plugin-auth): map twoFactor / jwks / deviceCode into D7 collision coverage (#7994) - #8121
Merged
os-zhuang merged 1 commit intoAug 12, 2026
Conversation
…#7994) The 2026-08-12 ruling adopts Option B: map the three models the #7820 widening made derivable, add their COVERED_OBJECTS entries and retire the three #7770 exemptions. D7 collision coverage goes 9 -> 12 objects. MANAGED_EXTENSION_FIELDS is untouched: it doubles as the ADR-0092 D2 write whitelist, and the new coverage is proven with a synthetic registry through findCollisions() instead of by declaring fields on credential tables. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PEVB6w7D7uCszR9Mw1BL73
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 0 changed package(s). ✅ |
This was referenced Aug 12, 2026
os-zhuang
marked this pull request as ready for review
August 12, 2026 17:03
os-zhuang
deleted the
claude/issue-7994-d7-map-twofactor-jwks-devicecode
branch
August 12, 2026 17:20
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.
Fixes #7994
Executes the maintainer ruling of 2026-08-12 (Option B), recorded on the card with provenance 「接受你的全部建议。」:
That ruling explicitly amends the #7820 ruling's 「保持不动」 line to have scoped that card only, so retiring the three exemptions is the decision here, not a reversal of one.
What changed
One file,
packages/plugins/plugin-auth/src/managed-extension-fields.test.ts:MODEL_TO_OBJECTgainstwoFactor → sys_two_factor,jwks → sys_jwks,deviceCode → sys_device_code.COVERED_OBJECTSgains the three objects (the literal, deliberately not derived from the map).UNMAPPED_MANAGED_OBJECTSloses its three managed-extension-fields D7 collision guard silently skips sys_api_key (no apikey entry in MODEL_TO_OBJECT) #7770 entries.MANAGED_EXTENSION_FIELDSis untouched — zero diff. It doubles as the ADR-0092 D2 write whitelist, so buying D7 coverage by declaring fields onsys_two_factor/sys_jwkswould have been a security change wearing a bookkeeping disguise. The new coverage is proven throughfindCollisions()against a synthetic registry instead.The acceptance criterion, and why the count is not it
"Coverage goes 9 → 12" is a count, and a test asserting the map has twelve entries derives its expectation from the structure it checks — an assertion that cannot fail. The ruling's own wording sets the real bar: a synthetic collision on each of the three tables must turn the gate red. Predictions were written before each run.
A1 — synthetic collision on the real gate (temporary
MANAGED_EXTENSION_FIELDSentriessys_two_factor.secret,sys_device_code.user_code,sys_jwks.private_key, never committed). Predicted red; observed red:The counterfactual — the same three collisions against
main's unmapped gate. The collision assertion passes green; only the #7770 accounting net fires, saying the three objects "were skipped and proved nothing about their fields". That is the hole this card closes, measured rather than argued.A2 — can the new pins fail? Deleting the three
MODEL_TO_OBJECTentries while keeping the pins. Predicted red; observed red on all three per-table pins (byObject[object]becomes undefined,if (!owned) continueswallows the synthetic field,findCollisionsreturns[]):Each pin asserts both spellings (
backup_codes/backupCodes,private_key/privateKey,user_code/userCode), and a companion test keeps them non-vacuous by requiring silence on three plausible extension names these tables do not own.Verification
pnpm --filter @objectstack/plugin-auth test— 45 files, 1069 tests passed (re-run after rebasing onto currentmain, closure rebuilt first sinceobjectqlmoved).pnpm --filter @objectstack/plugin-auth typecheck— clean.check:nul-bytes,check:test-source-alias,check:docs-audit-scope,check:query-options-erasure— all green; the erasure ratchet reports no files added against the base.check:type-check-debtmeasures it (sibling config dropping the test excludes): 108 with this change, 108 on the same commit without it — delta zero, against a recorded ceiling of 131. The single diagnostic in this file (TS1470on the pre-existingimport.meta.urlline) is present in both measurements.Release impact
None — test-only, so this PR carries
skip-changesetrather than a changeset ("such a PR releases nothing", per the workflow's own prescription inlint.yml).Generated by Claude Code
Generated by Claude Code