Repository navigation
refactor(plugin-auth): drop AuthManager's 12 counted query-options any assertions and ratchet the erasure baseline (#25224) - #25326
Conversation
…y assertions and ratchet the baseline (#25224) The twelve options literals (argument 1 of an engine.findOne, engine.find or engine.count call, each carrying context: SYSTEM_CTX) close with }); instead of } as any);. The engine read signatures already infer them, so the file typechecks unchanged, and a type assertion emits no byte. scripts/query-options-erasure-baseline.json is the gate's own pnpm check:query-options-erasure --update output: auth-manager.ts's key leaves. Per ruling 6351993113 item 1; nothing else in the file moves. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr
📓 Docs Drift Check9 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin b8be044cb16ff160bd116b0562f2b5232b514dc2 && git checkout b8be044cb16ff160bd116b0562f2b5232b514dc2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0 32f94b8b7075c804352bd61b0d234108258cdf8d && git checkout -B drift-repro 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0 && git merge --no-ff 32f94b8b7075c804352bd61b0d234108258cdf8d
node scripts/docs-audit/affected-docs.mjs --json 97967a9a06f3b85a2f9fe2f1bf615e1eb186b7f0 |
席位核对 · ACCEPT · 2026-10-23T01:55Z
Generated by Claude Code |
Requested by Sales · project thread
Part of #25224
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6351993113
The basis for the
Clause-②: noline: dropping a type assertion widens no accept set and no public surface, and a type assertion has no emitted byte. Measured below:@objectstack/plugin-auth'sdist/index.js,dist/index.mjs,dist/index.d.tsanddist/index.d.mtsare byte-identical to base.The sweep PR of ruling
6351993113item 1, between cut 2 (PR #25307, landed note6354354210) and the cut(s) that move the nine methods these sites sit in. It follows the amended claim6354594310. #25224 stays open for the later cuts.scripts/query-options-erasure-baseline.jsongrandfatheredauth-manager.tsat 12 engine query-optionsany-erasures. This PR drops all 12 in place and ratchets the baseline down, so the nine methods can later move into new modules without carrying a counted site into a file the baseline does not list. Nothing else changes: +12 / −13 over 2 files.Branch:
claude/project-thread-lg3wrj, the harness-pinned branch for this session, restarted fromorigin/main9dc1f42d50after #25307 merged. It names no issue, so the card relation is this body's first line.What changes
packages/plugins/plugin-auth/src/auth-manager.ts: 12 lines. Each counted closer} as any);becomes});. Each one closes the options literal (argument 1) of anengine.findOne,engine.findorengine.countcall that carriescontext: SYSTEM_CTX. The edit was made from the AST: for each call ESLint reports, the script removed exactly the textas anybetween the literal's}and the call's);, and refused any site where those 7 characters were anything else.scripts/query-options-erasure-baseline.json: exactly whatpnpm check:query-options-erasure --updatewrites. The file's key leaves (one line). This is ascripts/ledger, andscripts/gate files aredomain:spec's by the anchoring exception. Cross-lane, declared: the edit is the gate's own prescribed ratchet output, not a gate edit.⛔ Not in this PR (ruling item 1):
engine.update(…, { context: SYSTEM_CTX } as any)casts, which the ratchet does not count;as unknown as EngineQueryOptionsorconst opts: EngineQueryOptionsrewrite;eslint.config.mjsor anyscripts/*.mjs;The twelve sites
Re-located by shape at base
9dc1f42d50: ESLint'squery-options/no-any-erasure, run on the file's text with the grandfathering lifted, reports exactly 12, the baseline's count. These are the ruling's twelve sites in the ruling's nine methods; only their line numbers have moved since49185cdb.stampIdentitySourceengine.findOne:8854·engine.count:8864:8856·:8867refreshMustChangeCacheIfStaleengine.count:9007:9009refreshOrgMfaCacheIfStaleengine.count:9035:9037resolveUserAuthGatesengine.findOne:9184·engine.findOne:9193:9188·:9195assertPasswordNotReusedengine.findOne:9374:9378recordPasswordHistoryengine.findOne:9421:9425unlockUserengine.findOne:9689·engine.find:9703:9691·:9705enforceSessionControlsengine.findOne:9748:9752enforceConcurrentCapengine.find:9832:9837Report block (ruling
6351993113item 2)Base
9dc1f42d50, head32f94b8b70. Every exit code was captured before any pipe. Builds and suites ran throughos-verify-lock.Typecheck.
pnpm --filter @objectstack/plugin-auth typecheck(bothtscprojects andcheck:test-typecheck): exit 0, afterturbo run build --filter='@objectstack/plugin-auth^...'.ESLint.
node --stack-size=4000 node_modules/eslint/bin/eslint.js --no-inline-config packages/plugins/plugin-auth/src/auth-manager.ts(the rootlintscript's binary and flags): exit 0. The file's key is gone, so the rule now lints it aterror, and it flags nothing.The ratchet.
pnpm check:query-options-erasureexits 1:packages/plugins/plugin-auth/src/auth-manager.ts: baselined file is clean/gone (was 12) — ratchet DOWN: run pnpm check:query-options-erasure --update and commit the baseline.pnpm check:query-options-erasure --updateexits 0 (baseline updated: 50 non-test site(s) in 15 file(s)), and the baseline diff is that one line.ratchet holds: 50 unswept non-test site(s) in 15 file(s), none new, and every file measured parsed, andbaseline key set verified against 9dc1f42: no files added.The bundle.
pnpm run buildinpackages/plugins/plugin-auth, at base and at head, on the same dependency dists. 18 files indist/on both sides, the same list; 16 of them are byte-identical:dist/index.js6f45fdf90839b0de47090a92e75f0309c0baa628ed838956a2522c2fad40f034dist/index.mjs2cb04450a30b102aac0df38ebded7bd138b16968cf01dd65e11214269e27712fdist/index.d.ts4bc04c66f724c79782493249820b1b7d9bff7c826931ce6b362d325af8797891dist/index.d.mtsd70d7d8063053de2d39bd0dbae06423bbe0ef1dcecf5130b867c6f4d79a0c8cdThe only files that differ are
index.js.mapandindex.mjs.map, and in each only themappingskey differs (version,sourcesandnamesare equal).sourcesContent, whichcheck:sourcemap-no-sources-contentenforces. So the cause is not the one the ruling expected (embedded source text). It is the source positions.as any, so it is the)after the literal.Tests.
pnpm exec vitest run --maxWorkers=3inpackages/plugins/plugin-auth: baseTest Files 187 passed (187),Tests 3525 passed | 10 skipped (3535), VERDICT command-exit 0; head the same counts, VERDICT command-exit 0.Positive control. One of the 12 restored (
:8856back to} as any);), nothing else:pnpm check:query-options-erasureexits 1:packages/plugins/plugin-auth/src/auth-manager.ts: NEW engine query-options erasure (1 site(s)). … This file is not grandfathered, and the baseline never grows.8854:52(query-options/no-any-erasure).git checkout --afterwards;git diff HEADwas empty.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 63 commands for the 2 paths. All 63 ran at32f94b8b70after a fullturbo run build, and all 63 exited 0.--ran: 63 derived, 63 run, 0 NOT-MEASURED, 0 UNRUN.check-governed-merges.mjs --branch HEAD: NOT governed, 25 changed lines.auth-manager.ts: an import line and the public-config literal near:8011, none of the 12 lines.git merge-treeof this branch with feat(spec, platform-objects): declare features.cloudManaged with a hide-when-on gate, and hide the six doors that add people while it is on #25309's head is clean.Changeset
None:
skip-changeset, per ruling6348891160item 4, as ruling6351993113item 1 reads it. The emitted bundle and declarations are byte-identical, so this PR publishes nothing.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01LSXBc2GCBwiAL7vV4kWkyr