Skip to content

[Decision] D7 now derives the twoFactor / jwks / deviceCode models — map them and retire their three #7770 exemptions? #7994

Description

@huangyiirene

Filed by the domain:identity seat (#6022) out of PR #7980's review, on that dev's reported open question. It is small, and it is filed rather than taken because it touches a line the 2026-08-12 ruling wrote explicitly.

What changed underneath the exemptions

#7820's ruling widened D7's derivation to the auth manager's whole plugin set. A side effect: the derivation now emits the twoFactor / jwks / deviceCode models, which it previously did not.

Those three objects — sys_two_factor, sys_device_code, sys_jwks — are registered in UNMAPPED_MANAGED_OBJECTS (from #7770) and therefore get zero D7 collision coverage. Their registered reason said the plugins were "not loaded by this call". That sentence is now false, and PR #7980 correctly restated it in place rather than leaving a stale justification standing.

So the exemptions still hold, but for a different and weaker reason than the one they were granted under: the models are now derived, they are simply still unmapped.

The question

Map the three models into MODEL_TO_OBJECT and retire their exemptions — or leave them exempt?

  • A — leave as shipped. Entries kept, reasons restated. Zero further work. The three tables keep zero collision coverage.
  • B — map them. Three MODEL_TO_OBJECT lines, three COVERED_OBJECTS entries, three exemptions dropped; coverage goes 9 → 12 objects. The derivation change has already paid the expensive part.

Why this is not mine to take

The ruling says the #7770 exemptions 「保持不动」. I read that as scoping that card, not as a permanent verdict — but it is an explicit line, and an execution seat quietly reversing one is exactly the drift the single-producer rules exist to stop. The dev reached the same conclusion and flagged instead of acting; recording that as the right call.

⛔ This is not blocking #7980, which is ACCEPTed and queued.

Four-lens analysis

① Platform long-term coherence. B shrinks a special case: an exemption list whose members are exempt for a reason that no longer describes why. A keeps three entries whose justification has already had to be rewritten once — and a documented exemption whose document keeps needing maintenance is a smell, not a record.

② Measured business pull. Low today, and honestly so — no measured collision on these three tables. The pull is preventive: sys_two_factor and sys_jwks hold credential-adjacent material, and D7 exists precisely to catch a platform extension field silently colliding with a better-auth-owned column there. Nobody is hitting this; the cost of not having the guard only shows up on the day someone does.

③ AI-agent error-resistance. The strongest lens for B. A guard that reads as covering 12 managed objects while actually judging 9 is the failure shape #7770 was filed for in the first place — the coverage gap is invisible from outside and produces a green that means less than it appears to. Closing the class beats leaving three known holes with notes attached.

④ Startup scope discipline. Cuts toward B only because the expensive half is already spent. Standalone, this would be speculative guard-building and should wait; as a six-line rider on a derivation that now emits the models anyway, "declare-and-maintain three exemptions forever" is the more expensive option.

Recommendation: B, as a small follow-up card rather than urgent work. If the answer is A, the useful outcome is still a one-line note on why the exemptions stay now that their original reason has expired — so the next reader does not re-derive this question a third time.

Related

#7820 / PR #7980 (the widening, and the restated reasons) · #7770 / PR #7822 (where the three exemptions were registered)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions