Repository navigation
[maintainer] refactor(plugin-auth): split src/auth-manager.ts (10,338 lines, +1,867 in 30 days) along its AuthManager seams, one move-only slice per PR #25224
Description
Filing gate ③: a task the maintainer dispatched, quoted verbatim below. Filed by domain:cli seat 1 (seat post #6024) · os-sales · session session_01CxBKycaiUpA1yGx1XyoGqX, as the restart act of #24586. ⛔ Not a claim.
The maintainer's words, verbatim (#24586, recorded in 6270097840): 「24586 同意A,是否建议这波分拆等 v18 发布之后再处理。」 The restart condition (npm @objectstack/spec latest ≥ 18.0.0) was read true by triage in 6291735609. The ruling's restart act: "one [maintainer] card per file over 10,000 lines into its owning lane … Each card starts with a fresh seam measurement taken at that time, in #23050's shape." This file was under the line at the ruling (8,471 lines 30 days ago) and is over it now, so the ruling's per-file rule covers it.
Reader who acts: the domain:services seat (packages/plugins/plugin-auth is that lane's), one dispatch per slice.
Measured (on origin/main 123ff6f4e, 2026-10-22)
History note: this clone's history starts 2026-09-17, so "total" commit counts are lower bounds; the 7- and 30-day windows are complete, and git blame --since=2026-09-22 agrees with a diff against the last pre-window commit fa2980341 to within 7 lines.
- Size and churn: 10,338 lines (8,471 thirty days ago: +1,867, +22.0%). 24 commits in 7 days, 47 in 30 days.
git blame --since=2026-09-22attributes 2,277 lines (22.0%) to the last 30 days. - Structure: a 1,583-line module preamble (
AuthManagerOptionsalone is 470 lines), then oneAuthManagerclass (8,755 lines, 181 members). Two methods dominate:createAuthInstance(1,424 lines, the better-auth config with about 30 sub-banners in its hook arms) andbuildPluginList(1,336). The largest sections:
| section | lines | lines from the last 30 days |
|---|---|---|
| module preamble | 1,583 | 341 |
plugin assembly (resolvePasswordHasher, addOptionalPlugin, buildJwtPlugin, buildPluginList) |
1,551 | 241 |
createAuthInstance |
1,423 | 324 |
request routing, base paths, subject erasure, SCIM, MCP URLs, getPublicConfig, SSO |
1,376 | 168 |
| membership, audience admission, self-registration grants, bootstrap staging | 1,206 | 416 |
| password policy, lockout, auth gates, session controls | 1,155 | 330 |
| email/SMS delivery + locale | 560 | 58 |
| actor + organization guards | 553 | 191 |
- Shared state a split must pass:
config(171 refs),getDataEngine(22),logDurabilityDegradation(12),auth,resolveActor, the request-scoped staging maps (pendingSelfRegistrationGrants,pendingOwnerVerifiedStamps,pendingOperatorProvisioning).createAuthInstance's hook arms call into the membership, guard, password and email sections. - What reads it by path: 12
scripts/files, including the ADR anchorscripts/adr-anchors/packages__plugins__plugin-auth__src__auth-manager.ts.json(ADR-0093, ADR-0108),check-auth-mount-ledger.mjs,check-dispatcher-error-vocabulary.mjs,tenant-audit-census.mjs,publish-smoke.shand four baselines; 19 files undercontent/anddocs/; 119 test files. - In flight: none of the 10 open PRs touch the file.
⚠️ This is an authentication boundary. Move-only is the whole contract here: a slice that changes any sign-in, session or membership outcome is out of scope.
The ask (from #24586's ruling and #23050's shape)
- Split along the existing seams, one area per PR. Each slice is move-only: no logic changes.
- Shared state stays explicit: moved code reaches the class's shared members through one named context object. ⛔ Not a second copy of a helper, ⛔ not a re-derivation.
- Every slice proves it moved nothing: every gate, baseline, ADR anchor and docs anchor that reads the file by path is migrated in the same PR and stays green. ⛔ A gate whose target moved must not go silently empty.
- Serial with the file's in-flight PRs (a slice waits for an open PR on the same region, or the PR merges
mainafter the slice). - ⛔ No new gate.
Not in this card
Any behaviour change. A design change to the shared members beyond giving them an explicit context. Splitting files in other lanes (#24586 hands those to their own seats).
Dedupe
MCP search_issues on this repository, closed included: "split large file move-only service-automation engine.ts security-plugin.ts auth-manager.ts decompose modules" → 2 hits: #24586 (the ruling this card carries out) and #23050 (closed, rest-server.ts). New.
Generated by Claude Code
Activity
objectstack-fleet commentedon Oct 22, 2026
Serial note ·
domain:servicesseat 1 (seat post #6021) ·os-sales·session_016g7nYP9wdNx1GDa5XDr7Uy· 2026-10-22T13:23Z. ⛔ Not a claim. Thread-read: nonepackages/plugins/plugin-auth/src/auth-manager.tsis in flight under #25112 (claim6341542393, the magic-link mount). The first slice of this card is cut only after #25112's PR lands, on a fresh seam reading of the merged file. Open PRs touching the file at this note: none besides that card's coming PR.Generated by Claude Code
objectstack-fleet commentedon Oct 22, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, cut 1 (one cut = one PR, move-only, cuts strictly serial) · 2026-10-22T18:01ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (fresh seam reading on
origin/main0f1eeee, after #25112's PR #25238 landed:auth-manager.tsis 10,349 lines,AuthManagerhas 176 members; stop on a breach and explain it in the report): cut 1 moves the body ofAuthManager#buildPluginList(:3424-:4768, 1,345 lines, the largest single member aftercreateAuthInstance) unedited into one new module,packages/plugins/plugin-auth/src/better-auth-plugin-list.ts, by #23050's pattern (landed note6136102437, steps 1-6): the class keeps the private method and its docblock, and its body becomes one named host literal plus.call. The body reads 22 class members (AST walk on0f1eeee): 2 fields read (config, reassigned after construction, so a getter;degradedFeatures, never reassigned), 2 fields written (jwtSigningFailureReported,orgRolesMap, so accessors), and 18 methods (late-bound closures). In the same PR, every reader whose reading includes a moved line is re-pointed with its sum unchanged: in-package source scanners (better-auth-schema-parity.test.tsandmanaged-extension-fields.test.tsread the plugin factory imports the body carries; the rest found by measurement), anydocs/qa/platform-checklist/areas/*.jsonsymbol anchor that resolves inside the moved range, and anyscripts/reader of moved lines (declared cross-lane in the PR). ⛔ Notpackages/spec, not any ADR, notcreateAuthInstanceor any other member. Later cuts each take their own amended claim on the merged file.Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: a move-only cut widens no accept set and no public surface; the proof owed is
@objectstack/plugin-auth'sdist/*.d.tsbyte-identical to base and the same export list.Responsibility: n/a — not a defect card
Thread-read: 6341869420
Serial constraints cleared: none of the 14 open PRs touches
packages/plugins/plugin-auth/src/auth-manager.ts(each PR's file list read this act). #25265 touches four otherplugin-authfiles (last-admin-guard.ts,default-organization-invariant.ts,ensure-default-organization.ts,tenancy-service.ts) and its own test, none of them a reader of the moved range. The serial predecessor named in6341869420(#25112) landed as PR #25238.Resume-from: none
Generated by Claude Code
objectstack-fleet commentedon Oct 22, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, cut 1 (one cut = one PR, move-only, cuts strictly serial) · amends claim6347670835, whose cut-1 file surface breached on measurement · 2026-10-22T19:06ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (amended; same base
0f1eeee): the breach.6347670835putAuthManager#buildPluginListin cut 1. Measured before any reader was counted, that move does not stand alone: its body needs module-level helpers that only it reads (the organization slug guard, the organization-hook codes block at:1492-:1548,consentOrganizationOf) and two names it shares with the rest of the file (readBooleanEnv,OAUTH_ORGANIZATION_CLAIM), whichindex.ts'sexport * from './auth-manager.js'forbids exporting fromauth-manager.ts(the published.d.tswould widen), so they need a non-re-exported shared module too. That came to about 3,075 changed lines, over the card's 3,000-line human-merge line, and the range also carries an ADR-0108 anchor.buildPluginListtherefore becomes a later cut, landed by hand. Cut 1 is now the actor and organization guards: eightAuthManagermethods (resolveActor,isPlatformAdminUserId,assertActorNotHeld,assertOrganizationDeletable,assertRemoveMemberPermitted,assertRevokeSessionIdentifiesRecord,assertAdminRevokeUserSessionIdentifiesRecord,resolveMembershipRole; 358 body lines) and the module-levelINVITATION_ROLE_CAP_READ_FAULT_CODE/invitationRoleCapReadFaultApiError(:1464-:1490, read only by those bodies) move unedited into one new module,packages/plugins/plugin-auth/src/auth-manager-actor-guards.ts, by #23050's pattern (landed note6136102437). The class keeps each method and its docblock; each body becomes a per-method host (Pick<ActorGuardHost, …>) plus.call. The bodies read five class members (AST walk on0f1eeee):orgRolesMapandorganizationDeleteStandingJudge(fields, handed over as getters) andcomputeAuthGate,getDataEngine,resolveActor(late-bound closures). Readers whose reading includes a moved line, re-pointed in the same PR with their sums unchanged:api-error-code.pin.test.ts(the per-file floor),better-auth-schema-parity.test.tsandmanaged-extension-fields.test.ts(the plugin factory scan:hasPermission,defaultRoles),organization-delete-read-fault.test.ts(the caller frame), and one row ofpackages/runtime/src/dispatcher-error-vocabulary.ts(domain:cli, declared cross-lane in the PR). No changeset:skip-changeset, per ruling6348891160item 4. Nodocs/qa/platform-checklistanchor and no ADR anchor names a moved symbol (measured). ⛔ Notpackages/spec, not any ADR, notbuildPluginList,createAuthInstanceor any other member. Later cuts each take their own amended claim on the merged file.Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: a move-only cut widens no accept set and no public surface. The proof owed is ruling
6348891160item 1 (on #25222, covering this card), read on@objectstack/plugin-auth'sdist/index.d.tsanddist/index.d.mts, each: the same declaration set (no private member made public or protected; nothing added, removed, renamed or retyped); byte-identical to base after one normalisation only, sorting the members of each string-literal union in place; the same ESM and CJS export lists; and every raw-diff line a union-member swap. Measured at this cut's head: the raw files are byte-identical to base (0 diff lines), with the ruling's positive control in the PR and the report.Responsibility: n/a — not a defect card
Thread-read: 6347670835
Ruling-ref: 6348891160
Serial constraints cleared: re-read this act. None of the 13 open PRs touches any of this cut's seven files (each PR head diffed against its merge base with
origin/main; #24467's one file read through the API). New since6347670835: #25268 (packages/mcp,packages/qa), #25266 (plugin-sharing,plugin-security,cli,spec, docs) and #25270 (service-automation, #25222's slice 1). #25265 still touches five otherplugin-authfiles, none of them in this cut; the Version Packages PR #24876 touches onlyplugin-auth'sCHANGELOG.mdandpackage.json.origin/maingained three commits since0f1eeee, none touching these files.Resume-from: none
Generated by Claude Code
objectstack-fleet commentedon Oct 22, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25273",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "Cut 1 of the auth-manager.ts split, per the amended claim 6349004758 (Ruling-ref 6348891160): eight AuthManager method bodies (resolveActor, isPlatformAdminUserId, assertActorNotHeld, assertOrganizationDeletable, assertRemoveMemberPermitted, assertRevokeSessionIdentifiesRecord, assertAdminRevokeUserSessionIdentifiesRecord, resolveMembershipRole; 358 lines) and the module-level INVITATION_ROLE_CAP_READ_FAULT_CODE block (base :1464-:1490) move unedited into packages/plugins/plugin-auth/src/auth-manager-actor-guards.ts by the landed #23050 pattern: the class keeps each method, signature and docblock, its body a per-method host of exactly the members it reads (three methods as late-bound closures, two reassigned fields as getters) plus .call, async dropped. Five path readers whose reading included a moved line were re-pointed in the same PR with their sums unchanged, one of them cross-lane (packages/runtime/src/dispatcher-error-vocabulary.ts, domain:cli, one row's file field). The first claim 6347670835 named buildPluginList for cut 1; measured, that move is about 3,075 changed lines (over the 3,000-line human-merge line) and carries an ADR-0108 anchor, so it becomes a later cut landed by hand, as the amended claim records. No sign-in, session or membership outcome changes: same tests, same published declarations, same export lists.",
"tests": "Base 0f1eeee, head 26c8deb (source unchanged after e55cb6d; 26c8deb only drops the changeset e315a80 added). (1) Move proof, TS scanner token identity per body plus every line = base line minus two spaces plus same params/return plus stub docblock and signature kept with async dropped: 8 of 8 pass, 358 body lines; base :1464-:1490 (27 lines) verbatim in the module and absent from auth-manager.ts. git diff --color-moved=plain --color-moved-ws=allow-indentation-change marks 398 of 407 deleted and 435 of 566 added lines moved; the 9 other deleted lines are the 8 private async signature lines and one import name. (2) Ruling 6348891160 item 2 block, plugin-auth built through turbo run build at base and head: dist/index.d.ts raw base 82729d0115e4a866ed30dde301da18f96bad321e9a78fcd12b2cdd77bca3801f, raw head the same, normalised base 27d278f6825004c0b604eb60bbf9b3cd0fd8f66a89300bbe62bf7304238f6802, normalised head the same; dist/index.d.mts raw base 9665953d56da469ac783292e8406d09544f8cfe219bac7ef892625fe9a73f96a, raw head the same, normalised base 16f1ed01f0391a8bb5d7de138cbd0f9a7915b83faa9675009cc2996d8cbdb841, normalised head the same; raw diff 0 lines on both, so no union swap occurs and item 1 holds outright. Normaliser verbatim: node -e 'const s=require("fs").readFileSync(process.argv[1],"utf8");process.stdout.write(s.replace(/"[^"\n]"(?:\s\|\s*"[^"\n]")+/g,r=>r.split(/\s\|\s*/).sort().join(" | ")))' dist/index.d.ts | sha256sum. Positive control: head dist/index.d.ts with private resolveActor; made public (line 3662, one line) hashes raw 35f7e05b837ddc0f4610783c831b6857e7c5ae7b3bafd23d726ad871255ea299 and normalised 284877cf4dad17a7fe392f3ba8600f57ed6e5321c33a5109bd96b98e1bb66a29, both differ. Export lists: ESM dist/index.mjs and CJS dist/index.js 155 names each at base and head, same sorted-name hash ed3ac8b902031d30 on all four. (3) os-verify-lock -c 'pnpm exec vitest run --maxWorkers=3' in packages/plugins/plugin-auth at e55cb6d: Test Files 185 passed (185), Tests 3487 passed | 10 skipped (3497), VERDICT command-exit 0, the same counts as base. Readers red before their edit, at 1863367 (the move alone): full suite Test Files 3 failed | 182 passed (185), 7 tests (organization-delete-read-fault.test.ts 5 of 7; better-auth-schema-parity and managed-extension-fields: AUTH_MANAGER_PLUGINS names plugins auth-manager.ts no longer imports: defaultRoles, hasPermission); api-error-code.pin.test.ts run alone: expected 18 to be greater than or equal to 24, exit 1; pnpm check:dispatcher-error-vocabulary exit 1 (stale-row plus unclassified-site), exit 0 after the row moved (56 found; 56 classified). pnpm --filter @objectstack/plugin-auth typecheck exit 0; pnpm --filter @objectstack/runtime typecheck exit 0 after the full build; eslint --no-inline-config over the 7 files exit 0. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset at 26c8deb: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 59 commands; all 59 ran after a full turbo run build and git fetch --unshallow, each exit code captured before any pipe, all 59 exit 0; --ran: 59 derived, 59 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 1,010 changed lines (+598/-412, 7 files) vs the 3,000-line human-merge line. Census gates base vs head: same summaries for check-system-context-census, check-tenant-audit-census, check-registry-log-declared, check:durability-log-level, check:auth-mount-ledger, check:cross-package-test-inputs; scanned-file counts move only by the new module. test:repo not run locally (no repo-project test changed and the derived list does not name it); CI runs it. CI on 26c8deb, the PR's check-runs read at report time (46): 34 success, 12 skipped (path-filtered or opt-in jobs), 0 failure, 0 pending. Build Core success; Test Core (1/6) to (6/6) success and Test Core success; TypeScript Type Check success (Type Check · workspace, · source gates, · consumer gates, · debt ledger: success); Lint & Repo Gates success (Lint · ESLint, · repo & tooling gates, · docs & code guards, · CI, release & engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup & corpus: success); Dogfood Regression Gate success (its shard matrix skipped by its filter); Check Changeset success; Governed Surface Queue Guard success; Check PR Size success; Part-of PR must not also close its card success; The card this PR closes must claim this branch success; No other open PR may claim the same issue success; No other open PR may claim the same single-writer path success; Check Documentation Links success; Flag docs affected by code changes success. mergeable_state clean. No Claude Approvals check runs on this PR. Docs Drift Check (advisory, never fails the build) comment 6349355591: re-derived with node scripts/docs-audit/affected-docs.mjs --json 0f1eeee, exit 0: 35 pages, every one listed through a literal the moved bodies carry unchanged (SERVICE_UNAVAILABLE 11, sys_member 14, sys_organization 10, sys_session 9, NOT_FOUND 1) plus one name collision (content/docs/permissions/system-context.mdx:171 names plugin-approvals' approval-service.ts #resolveActor, a different method); no page restates a rule this move changes, so no doc edit is owed.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "17 — all reads, no write tool: issue_read get 2, issue_read get_comments 3, list_pull_requests 1, search_pull_requests 3, pull_request_read get 2, pull_request_read get_files 4, pull_request_read get_check_runs 2. (claude-code-remote subscribe_pr_activity once, not a GitHub write.)",
"api_writes": "5 relay acts (scripts/pm/ fleet-write, each read back): 1) label-write on #25224, run 39827597533, 3 actions: POST labels pm:dispatched, DELETE label pm:queue, POST assignees os-sales; 2) post-stamped claim comment 6347670835 on #25224, run 39827763009; 3) post-stamped amended claim comment 6349004758 on #25224, run 39837221540; 4) dispatch pr_create #25273 (draft, assignee os-sales, label skip-changeset; body read back identical), run 39839634890; 5) this report comment on #25224 via post-stamped. Plus git push of the branch (not REST). No other write.",
"open_questions": [],
"out_of_scope_findings": [
"carrier: none · noted, not filed — api-error-code.pin.test.ts at 1863367 failed its per-file floor run alone (expected 18 to be greater than or equal to 24) but the full plugin-auth run at the same head did not report it red; not reproduced, the re-pointed floor is green in both shapes; recorded in the PR Proof section"
]
}
Generated by Claude Code
objectstack-fleet commentedon Oct 22, 2026
Landed cut 1 ·
domain:servicesseat 1 (seat post #6021) ·os-sales·session_016g7nYP9wdNx1GDa5XDr7Uy· 2026-10-22T21:00Z6350658338)origin/main49185cdb8aState: the card stays open and dispatched (
Part of); the card thread claims cut 2 afresh on the merged file, per6349004758.Generated by Claude Code
objectstack-fleet commentedon Oct 22, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, cut 2 (one cut = one PR, move-only, cuts strictly serial) · amends claim6349004758for cut 2, on the merged file · 2026-10-22T21:28ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session, restarted fromorigin/mainafter cut 1's PR #25273 merged; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (fresh seam reading on
origin/main49185cdb8a, cut 1 landed per6351216603:auth-manager.tsis 10,004 lines): cut 2 is the sign-in lockout path (ADR-0069 D2) and the last-login stamp (D7). SevenAuthManagermethods (assertAccountNotLocked,recordSignInOutcome,auditRefusedSignIn,resolveSignInAccountId,findSignInAccount,resolveTwoFactorAccountLockout,stampLastLogin; 173 body lines) move unedited into one new module,packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts, by #23050's pattern (landed note6136102437), the shape cut 1 landed. The class keeps each method and its docblock; each body becomes a per-method host plus.call. The bodies read five class members (AST walk on49185cdb8a):config(a field the class reassigns insetBaseUrlandapplyConfigPatch, so a getter) andfindSignInAccount,getDataEngine,logDurabilityDegradation,resolveSignInAccountId(late-bound closures). No module-level declaration moves; the imports only these bodies use leave with them (accountLockedEventFor,refusalCodeOf,signInClientFingerprint,signInFailureEventFor, and theEngineQueryOptionstype). Readers whose reading includes a moved line, re-pointed in the same PR with their sums unchanged:api-error-code.pin.test.ts(its sum of throws over the filesAuthManager's bodies live in; theACCOUNT_LOCKEDthrow moved, so the module joins the list and the sum stays 27). Measured as not reading a moved line: the two plugin-factory scans (the module imports no factory),check:dispatcher-error-vocabulary(exit 0), the query-options erasure ratchet (the moved bodies hold 0 sites;auth-manager.tskeeps its 12, so the baseline holds), and nodocs/qa/platform-checklistanchor, ADR anchor or docs page names a moved symbol. Why this seam and not the whole ADR-0069 tail: the first reading took the 16 hardening methods at:8852-:9951. Five of them (assertPasswordNotReused,recordPasswordHistory,unlockUser,enforceSessionControls,enforceConcurrentCap) hold 6 of the file's 12 query-optionsany-erasure sites, and a site moved into a filescripts/query-options-erasure-baseline.jsondoes not list failspnpm lintand the shrink-only baseline, so a move cannot carry them. They stay, with a needs-decision on how later cuts carry such sites reported to the coordinator; this cut is the largest coherent seam that holds none. No changeset:skip-changeset, per ruling6348891160item 4. ⛔ Notpackages/spec, not any ADR, not the five methods above, notbuildPluginList,createAuthInstanceor any other member. Later cuts each take their own amended claim on the merged file.Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: a move-only cut widens no accept set and no public surface. The proof owed is ruling
6348891160item 1 (on #25222, covering this card), read on@objectstack/plugin-auth'sdist/index.d.tsanddist/index.d.mts, each: the same declaration set (no private member made public or protected; nothing added, removed, renamed or retyped); byte-identical to base after one normalisation only, sorting the members of each string-literal union in place; the same ESM and CJS export lists; and every raw-diff line a union-member swap. Measured at this cut's head: both raw files are byte-identical to base (0 diff lines), so item 1 holds with no union swap to account for; the hashes, the normaliser and the ruling's positive control are in the PR and the report.Responsibility: n/a — not a defect card
Thread-read: 6351216603
Ruling-ref: 6348891160
Serial constraints cleared: re-read this act. None of the 14 open PRs touches any of this cut's three files (each PR head diffed against its merge base with
origin/main; #24467's one file,scripts/test-shard-timings.json, read through the API). #25286 touchesplugin-auth'slast-admin-guard.tsand a new test of its own, neither in this cut; the Version Packages PR #24876 touches onlyplugin-auth'sCHANGELOG.mdandpackage.json. #25290 (#25223's cut 1) and #25288 areplugin-security.Resume-from: none
Generated by Claude Code
refactor(plugin-auth): move AuthManager's sign-in lockout path into a…
3 remaining items
docs(permissions): re-measure the tenant-audit census over the moved …
objectstack-fleet commentedon Oct 22, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25307",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "Cut 2 of the auth-manager.ts split, per the amended claim 6351729156 (Ruling-ref 6348891160; the erasure fork ruled A in 6351993113, read in 6352024441): seven AuthManager method bodies, the sign-in lockout path (ADR-0069 D2) and the last-login stamp (D7) (assertAccountNotLocked, recordSignInOutcome, auditRefusedSignIn, resolveSignInAccountId, findSignInAccount, resolveTwoFactorAccountLockout, stampLastLogin; 173 lines), move unedited into packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts by cut 1's shape (#23050): the class keeps each method, signature and docblock; each body is a per-method host typed as a Pick of SignInLockoutHost (config as a getter, four methods as late-bound closures) plus .call; findSignInAccount reads no member and is called directly; async dropped on six stubs. No module-level declaration moves; four auth-session-audit imports and the EngineQueryOptions type left with the bodies. The moved bodies hold 0 counted query-options erasures, so the baseline is untouched; the sweep PR of 6351993113 item 1 follows after this merges. Two path readers moved with the cut: api-error-code.pin.test.ts (the module joins its file list, the sum stays 27) and the tenant-audit census (regenerated; see tests). File surface vs the claim: the claim named three files; the PR also carries the census's two committed documents (content/docs/permissions/tenant-audit-census.mdx, docs/audits/2026-08-tenant-audit-write-call-sites.counts.md), which the census keys by path and card ask 3 requires migrated in the same PR; explained in the PR body. No sign-in, session or membership outcome changes: same tests, same published declarations, same export lists.",
"tests": "Base 49185cd, head 7598318 (move c204bd0, pin reader 4ee2639, census f898b1e, then a merge of origin/main 5801a4f, whose five commits touch no plugin-auth file). (1) Move proof, TS scanner token identity per body with template literals re-scanned at their substitutions, plus every line = base line minus two spaces, same params and return type, stub docblock and signature kept with async dropped: 7 of 7 pass, 173 body lines. git diff --color-moved=plain --color-moved-ws=allow-indentation-change marks 163 of 169 deleted and 177 of 327 added lines moved; the 6 other deleted lines are the six private async signature lines. (2) Ruling 6348891160 item 2 block, plugin-auth built at base (turbo run build) and head: dist/index.d.ts raw base 462694a9be58c0ed9b0bc7541828e62911a2a2c874a27d5e6cea9740ae734d4b, raw head the same, normalised base 05e3e4dc5f32e40f6d16b2f48a4e132b4315a9c98b9478941b0351154e0610df, normalised head the same; dist/index.d.mts raw base ea7e59d064510a044cf630f63b2c9f4b5cd41dd22d32b326267abfd870272fdb, raw head the same, normalised base 80fc0552ec518819842bad5e3fab8cc24075c382a5693594a1428b9e73fd6e48, normalised head the same; raw diff 0 lines on both, so no union swap occurs and item 1 holds outright; the same raw hashes again at 7598318 after a full turbo run build. Normaliser: the ruling's one-liner, verbatim in the PR body. Positive control: head dist/index.d.ts with private assertAccountNotLocked; made public (line 4015, one line) hashes raw 5e437fc5736b14b2261fbf4976a1e7c5d47d3fadd275566e4ce8af718aabdcee and normalised ec108851cd97419575810eec1cbc85dad9a983519eeb3ee90ef07d1646f52dd1, both differ. Export lists: ESM dist/index.mjs and CJS dist/index.js 155 names each at base and head, same sorted-name hash ed3ac8b902031d30 on all four. (3) os-verify-lock -c 'pnpm exec vitest run --maxWorkers=3' in packages/plugins/plugin-auth: Test Files 185 passed (185), Tests 3493 passed | 10 skipped (3503), VERDICT command-exit 0, at base, at 4ee2639 and at 7598318. pnpm --filter @objectstack/plugin-auth typecheck exit 0; eslint --no-inline-config over the 3 source files exit 0. Reader red before its edit: with the move alone the api-error-code pin sum read 26, above the floor of 24, so it held in silence; the edit restores 27. (4) Tenant-audit census, base vs head per site via --json (new module's path mapped back to auth-manager.ts): 236 sites on both, every site's object, tenancy, options and elevation reading the same, 0 unresolved and 0 unledgered receivers on both. What moved: the three engine.update('sys_user', ...) sites of recordSignInOutcome (base :9508, :9524) and stampLastLogin (:9730). In the class the census reads this.getDataEngine() through the same-file method's declared return type; in the module the same call runs on a Pick-typed this, which the census does not follow, so it places them by the literal object name sys_user (readable engine type 195 to 192, placed by the object NAME 31 to 34). Before the census commit, check-tenant-audit-census.mjs and its --self-test exited 1 (per-file drift in both documents and two prose-count errors); after node scripts/tenant-audit-census.mjs --write and the page's two hand-written erased-receiver counts (41 to 44) both exit 0. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 89 commands for the 5 paths (59 for the 3 source paths plus 30 docs families for the two census documents); all 89 ran at f898b1e and again at 7598318 after a full turbo run build, each exit code captured before any pipe, all 89 exit 0 both times; --ran: 89 derived, 89 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 521 changed lines (+340/-181, 5 files) vs the 3,000-line human-merge line. test:repo not run locally (no repo-project test changed and the derived list does not name it); CI runs it. CI on 7598318, the PR's check-runs read at report time (47): 36 success, 11 skipped (path-filtered or opt-in jobs, and the first pr-automation run's Auto Label, Check PR Size and Check Changeset, each superseded by a success in the next run), 0 failure, 0 pending. Build Core success; Test Core (1/6) to (6/6) success and Test Core success; Build Docs success; TypeScript Type Check success (Type Check · workspace, · source gates, · consumer gates, · debt ledger: success); Lint and Repo Gates success (Lint · ESLint, · repo and tooling gates, · docs and code guards, · CI, release and engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup and corpus: success); Dogfood Regression Gate success (its shard matrix skipped by its filter); Spec property liveness success; Check Changeset success; Governed Surface Queue Guard success; Check PR Size success; Part-of PR must not also close its card success; The card this PR closes must claim this branch success; No other open PR may claim the same issue success; No other open PR may claim the same single-writer path success; Check Documentation Links success; Flag docs affected by code changes success. mergeable_state clean. No Claude Approvals check runs on this PR. Docs Drift Check (advisory, never fails the build) comment 6352937491: re-derived with node scripts/docs-audit/affected-docs.mjs --json 49185cd, exit 0: 6 pages (5 hand-written plus release-owned content/docs/releases/v17/17-5.mdx), each reached through the AuthManager class name, the durationSeconds name (a class field, not a moved line) or a literal the moved bodies carry unchanged (ACCOUNT_LOCKED, locked_until, login_failed, last_login_ip); no page restates a rule this move changes, so no doc edit is owed beyond the census's own two documents.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "8 since this cut began (21:00Z) — all reads, no write tool: list_pull_requests 1, issue_read get_comments 3, pull_request_read get_files 1, pull_request_read get_check_runs 2, pull_request_read get 1. (claude-code-remote subscribe_pr_activity once, not a GitHub write.)",
"api_writes": "4 relay acts (scripts/pm/ fleet-write, each read back): 1) post-stamped amended claim comment 6351729156 on #25224, run 39857599177; 2) post-stamped Ruling-ref comment 6352024441 on #25224, run 39859877096; 3) dispatch pr_create #25307 (draft, assignee os-sales, label skip-changeset; 14478 bytes sent, 14478 stored, identical), run 39866833623; 4) this report comment on #25224 via post-stamped. Plus git push of the branch (not REST). No other write.",
"open_questions": [],
"out_of_scope_findings": [
"carrier: none · noted, not filed — scripts/tenant-audit-census.mjs resolves a this.m() receiver only through a same-named method or function declared in the same file and never reads a function's this parameter, so every engine write a host-pattern split moves out of a class drops from 'receiver carried a readable engine type' to 'placed by the object NAME' (here 3 sites; later cuts of this card and of #25222 / #25223 that move engine writes will show the same). The sites are not lost: each is still placed by its literal declared object name with the same tenancy and context reading. Teaching the census to follow a this parameter typed as a Pick of a host interface is a census logic change, not this card's (ask 5); recorded in the PR body's census section."
]
}
Generated by Claude Code
objectstack-fleet commentedon Oct 22, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25307",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "Refreshed report for cut 2 on the new base, superseding 6353329648 for every reading below (the services seat 1 asked for it after #25303 landed first). origin/main 829cb77 (carrying #25303 and #25286) was merged into the branch, no rebase: head daacbb4. auth-manager.ts auto-merged; the two tenant-audit census documents conflicted with #25303's one new sys_user write and were resolved by tool, not by hand: both taken from main, regenerated with node scripts/tenant-audit-census.mjs --write, and the page's two hand-written erased-receiver counts set to the census's figure (44); check-tenant-audit-census.mjs and its --self-test exit 0. The cut itself is unchanged from 6353329648: seven AuthManager method bodies (assertAccountNotLocked, recordSignInOutcome, auditRefusedSignIn, resolveSignInAccountId, findSignInAccount, resolveTwoFactorAccountLockout, stampLastLogin; 173 lines) moved unedited into packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts by cut 1's shape, per claim 6351729156 (Ruling-ref 6348891160; erasure fork ruled A in 6351993113, read in 6352024441). At the new base auth-manager.ts is 10,034 lines and the head's is 9,927; the moved bodies sit at new-base :9468-:9502, :9527-:9572, :9591-:9616, :9624-:9641, :9671-:9681, :9712-:9721, :9751-:9777 (each 30 lines below the old base). The PR body was not edited (written once at pr_create; the seat's attribution header, footer and review request stand); it still cites the old base, and this report carries the new-base readings. No sign-in, session or membership outcome changes.",
"tests": "New base 829cb77, head daacbb4. (1) Move proof re-run against the new base, TS scanner token identity per body with template literals re-scanned at their substitutions, plus every line = base line minus two spaces, same params and return type, stub docblock and signature kept with async dropped: 7 of 7 pass, 173 body lines. git diff --color-moved=plain --color-moved-ws=allow-indentation-change 829cb77 daacbb4 over the two files marks 163 of 169 deleted and 177 of 327 added lines moved, the same as on the old base. (2) Ruling 6348891160 item 2 block on the new base: full turbo run build at head, then plugin-auth built at 829cb77 and again at daacbb4 with the same dependency dists (the second head build is byte-identical to the first, diff -r empty). dist/index.d.ts raw base 4bc04c66f724c79782493249820b1b7d9bff7c826931ce6b362d325af8797891, raw head the same, normalised base 3c8612c88f3f41c963c243e91c2523d2754b2accb4a4c2ba52a5627fd6eaa1e5, normalised head the same; dist/index.d.mts raw base d70d7d8063053de2d39bd0dbae06423bbe0ef1dcecf5130b867c6f4d79a0c8cd, raw head the same, normalised base 51510aad856bbacd24757d1c62dc7273bfd6313ed543c8b1f1e86195fc2c7cd0, normalised head the same; raw diff 0 lines on both, so no union swap occurs and item 1 holds outright. The base hashes moved from the old reading because #25303 added a private member to AuthManager; new base equals new head. Normaliser: the ruling's one-liner, verbatim in the PR body. Positive control: head dist/index.d.ts with private assertAccountNotLocked; made public (line 4021, one line, 4 diff lines) hashes raw 076fa4b2f981ae1784212e2465a596e263c06c0b7b7fd55985a58baf0ffeab5a and normalised b91838a2b56c0bdd664d71f64629be00147a10bb0a87e7828afc0d84284f26c2, both differ. Export lists: ESM dist/index.mjs and CJS dist/index.js 155 names each at new base and head, same sorted-name hash ed3ac8b902031d30 on all four; index.js and index.mjs bytes differ, as a move inside the bundle must. (3) os-verify-lock -c 'pnpm exec vitest run --maxWorkers=3' in packages/plugins/plugin-auth: new base Test Files 187 passed (187), Tests 3525 passed | 10 skipped (3535), VERDICT command-exit 0; head the same counts, VERDICT command-exit 0. The api-error-code pin sum is 18 + 9 = 27 at the new base and 17 + 9 + 1 = 27 at head. (4) Tenant-audit census, new base vs head per site via --json (new module's path mapped back to auth-manager.ts): 237 sites on both, 0 per-site differences in object, tenancy, options and elevation, 0 unresolved and 0 unledgered receivers on both; the only total that moves is placed by the object NAME 31 to 34 (readable engine type 196 to 193), the three engine.update('sys_user', ...) sites of recordSignInOutcome (new-base :9538, :9554) and stampLastLogin (:9760), for the reason given in the PR body's census section. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset at daacbb4 after the full build: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 89 commands for the same 5 paths; all 89 ran, each exit code captured before any pipe, all 89 exit 0; --ran: 89 derived, 89 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 517 changed lines (+338/-179, 5 files) vs the 3,000-line human-merge line. CI on daacbb4, the PR's check-runs read at report time (42): 35 success, 7 skipped (Console Pin Gate, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Temporal Conformance, 18.x upgrade harness, Packed-tarball smoke, and Check Changeset in the synchronize run with the skip-changeset label on), 0 failure, 0 pending. Build Core success; Test Core (1/6) to (6/6) success and Test Core success; Build Docs success; TypeScript Type Check success (Type Check · workspace, · source gates, · consumer gates, · debt ledger: success); Lint and Repo Gates success (Lint · ESLint, · repo and tooling gates, · docs and code guards, · CI, release and engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup and corpus: success); Dogfood Regression Gate success; Spec property liveness success; Governed Surface Queue Guard success; Check PR Size success; Part-of PR must not also close its card success; The card this PR closes must claim this branch success; No other open PR may claim the same issue success; No other open PR may claim the same single-writer path success; Check Documentation Links success; Flag docs affected by code changes success. No Claude Approvals check runs on this PR. Docs Drift Check (advisory) comment 6352937491, updated for this head: re-derived with node scripts/docs-audit/affected-docs.mjs --json 829cb77, exit 0: the same 6 pages as before, each through the AuthManager class name, the durationSeconds class field or a literal the moved bodies carry unchanged; no doc edit owed beyond the census's two documents.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "10 since this cut began (21:00Z), 2 since 6353329648 — all reads, no write tool: list_pull_requests 1, issue_read get_comments 3, pull_request_read get_files 1, pull_request_read get_check_runs 3, pull_request_read get 2 (one of them #25303, to read that it had merged). (claude-code-remote subscribe_pr_activity once, not a GitHub write.)",
"api_writes": "5 relay acts this cut (scripts/pm/ fleet-write, each read back): 1) amended claim 6351729156, run 39857599177; 2) Ruling-ref comment 6352024441, run 39859877096; 3) pr_create #25307, run 39866833623; 4) os-dev-report 6353329648, run 39869876491; 5) this refreshed report via post-stamped. Plus git push of the branch (the merge daacbb4; not REST). No PR body edit. No other write.",
"open_questions": [],
"out_of_scope_findings": [
"carrier: none · noted, not filed — as in 6353329648: scripts/tenant-audit-census.mjs resolves a this.m() receiver only through a same-named method or function in the same file and never reads a function's this parameter, so engine writes a host-pattern split moves out of a class are placed by object name instead of by type (3 sites here); a census logic change, not this card's (ask 5)."
]
}
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Landed cut 2 ·
domain:servicesseat 1 (seat post #6021) ·os-sales·session_016g7nYP9wdNx1GDa5XDr7Uy· 2026-10-23T00:23Z6353926040)origin/main9dc1f42d50State: the card stays open and dispatched (
Part of). Next, per ruling6351993113: the sweep PR (Part of this card), then the 9 methods it unblocks, each claimed afresh on the merged file.Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, the sweep PR of ruling6351993113item 1 (one PR, cuts strictly serial: after cut 2, before any cut moving the nine methods) · amends claim6351729156for this PR, on the merged file · 2026-10-23T00:42ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session, restarted fromorigin/main9dc1f42d50after cut 2's PR #25307 merged; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (read on
origin/main9dc1f42d50, cut 2 landed per6354354210:auth-manager.tsis 9,927 lines andscripts/query-options-erasure-baseline.jsongrandfathers it at 12): exactly the two changes ruling6351993113item 1 fixes. (a) Inpackages/plugins/plugin-auth/src/auth-manager.ts, the 12 counted closers} as any);become});, each the options literal (argument 1, carryingcontext: SYSTEM_CTX) of anengine.findOne/engine.find/engine.countcall. Re-located by shape at this base (ESLint'squery-options/no-any-erasurewith the grandfathering lifted reports exactly 12, the baseline's count), call line and closer line:stampIdentitySource:8854/:8856and:8864/:8867·refreshMustChangeCacheIfStale:9007/:9009·refreshOrgMfaCacheIfStale:9035/:9037·resolveUserAuthGates:9184/:9188and:9193/:9195·assertPasswordNotReused:9374/:9378·recordPasswordHistory:9421/:9425·unlockUser:9689/:9691and:9703/:9705·enforceSessionControls:9748/:9752·enforceConcurrentCap:9832/:9837. These are the ruling's twelve sites in the ruling's nine methods; only their lines moved since49185cdb. (b)scripts/query-options-erasure-baseline.jsonexactly aspnpm check:query-options-erasure --updatewrites it: the file's key leaves (one line). That JSON is ascripts/ledger (domain:specby the anchoring exception); the edit is the gate's own--updateoutput, declared cross-lane in the PR as the gate-prescribed ratchet, not a gate edit. ⛔ Nothing else: not the 13engine.update(…, { context: SYSTEM_CTX } as any)casts, noas unknown as EngineQueryOptions, noconst opts: EngineQueryOptionsrewrite, no other erasure in the file, no edit toeslint.config.mjsor anyscripts/*.mjs, no method moved. Title underrefactor(plugin-auth), no!. No changeset:skip-changeset, per ruling6348891160item 4 (the emitted bundle is byte-identical, measured in the PR). The move cut(s) of the nine methods follow after this merges, each on its own amended claim.Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: dropping a type assertion widens no accept set and no public surface; a type assertion has no emitted byte. The proof owed is ruling
6351993113item 2's report block:pnpm --filter @objectstack/plugin-auth typecheckexit 0;eslint --no-inline-configon the file exit 0 (linted, its key gone); the ratchet's pre---updaterefusal line and its post---updateexit 0 with "no files added"; the sha256 ofdist/index.js,dist/index.mjs,dist/index.d.ts,dist/index.d.mtsat base and head (identical), with the.mapfiles named as the only differing files and why; the plugin-auth suite counts equal to base; and the positive control (one assertion restored:pnpm check:query-options-erasureexits 1 naming the file). Premise (item 5), measured on this base before this claim with the 12 closers dropped and nothing else:pnpm --filter @objectstack/plugin-auth typecheckexit 0, and the ratchet refuses only with 「baselined file is clean/gone (was 12) — ratchet DOWN」; the byte-identical bundle is measured in the PR. A base that breaks either is a fresh fork on this card, ⛔ never laundered withas unknown as.Responsibility: n/a — not a defect card
Thread-read: 6354354210
Ruling-ref: 6351993113
Serial constraints cleared: re-read this act. Of the 16 open PRs (each head diffed against its merge base with
origin/main; the Version Packages PR #24876 touches changesets,CHANGELOG.mdandpackage.jsonfiles only; #24467's one file,scripts/test-shard-timings.json, read through the API), one touchesauth-manager.ts: #25309 (features.cloudManaged), an import line and the public-config literal near:8011, none of the 12 lines;git merge-treeof this branch with #25309's head is clean. None touchesscripts/query-options-erasure-baseline.jsonoreslint.config.mjs.Resume-from: none
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25326",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "The sweep PR of ruling 6351993113 item 1, between cut 2 (PR #25307, merged as 9dc1f42) and the cut(s) that move the nine methods, per the amended claim 6354594310. Part of #25224, no closing keyword; #25224 stays open. Exactly two changes, +12/-13 over 2 files: (a) in packages/plugins/plugin-auth/src/auth-manager.ts the 12 counted closers '} as any);' became '});', each the options literal (argument 1, carrying context: SYSTEM_CTX) of an engine.findOne / engine.find / engine.count call, in the ruling's nine methods (stampIdentitySource :8856 :8867, refreshMustChangeCacheIfStale :9009, refreshOrgMfaCacheIfStale :9037, resolveUserAuthGates :9188 :9195, assertPasswordNotReused :9378, recordPasswordHistory :9425, unlockUser :9691 :9705, enforceSessionControls :9752, enforceConcurrentCap :9837; closer lines at base 9dc1f42). The edit was made from the AST: for each call the rule reports with the grandfathering lifted (exactly 12, the baseline's count), only the 7 characters ' as any' between the literal's closing brace and the call's ');' were removed, and any other text there would have been refused. (b) scripts/query-options-erasure-baseline.json exactly as pnpm check:query-options-erasure --update writes it: the auth-manager.ts key leaves (one line), declared cross-lane in the PR as the gate's own ratchet output. Not touched: the 13 engine.update(..., { context: SYSTEM_CTX } as any) casts, any 'as unknown as' or typed-const rewrite, any other erasure, eslint.config.mjs, any scripts/*.mjs, any method move. Title under refactor(plugin-auth), no '!'; skip-changeset per ruling 6348891160 item 4. A type assertion emits no byte, so no sign-in, session or membership outcome changes (bundle measured byte-identical below).",
"tests": "Ruling 6351993113 item 2 report block. Base 9dc1f42, head 32f94b8; every exit code captured before any pipe; builds and suites ran through os-verify-lock. (1) Typecheck: pnpm --filter @objectstack/plugin-auth typecheck (both tsc projects and check:test-typecheck) exit 0, after turbo run build --filter='@objectstack/plugin-auth^...'. (2) ESLint: node --stack-size=4000 node_modules/eslint/bin/eslint.js --no-inline-config packages/plugins/plugin-auth/src/auth-manager.ts (the root lint script's binary and flags) exit 0; with the file's key gone the rule lints it at error and flags nothing. (3) Ratchet: with the 12 closers dropped and the baseline untouched, pnpm check:query-options-erasure exit 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.' Then --update exit 0 ('baseline updated: 50 non-test site(s) in 15 file(s)'), baseline diff one line. Re-run exit 0: 'ratchet holds: 50 unswept non-test site(s) in 15 file(s), none new, and every file measured parsed' and 'baseline key set verified against 9dc1f42: no files added'. (4) Bundle: pnpm run build in packages/plugins/plugin-auth at base and at head on the same dependency dists; 18 files in dist on both sides, same list, 16 byte-identical. sha256 at base and at head: dist/index.js 6f45fdf90839b0de47090a92e75f0309c0baa628ed838956a2522c2fad40f034; dist/index.mjs 2cb04450a30b102aac0df38ebded7bd138b16968cf01dd65e11214269e27712f; dist/index.d.ts 4bc04c66f724c79782493249820b1b7d9bff7c826931ce6b362d325af8797891; dist/index.d.mts d70d7d8063053de2d39bd0dbae06423bbe0ef1dcecf5130b867c6f4d79a0c8cd. The only differing files are dist/index.js.map and dist/index.mjs.map, and in each only the mappings key differs (version, sources and names equal). Why: these maps carry no sourcesContent (check:sourcemap-no-sources-content enforces that), so the difference is not embedded source text, as the ruling expected, but source positions: decoded, each map holds the same segment count on both sides (67,009 and 67,083) and exactly 12 segments differ in each, one on each of the 12 closer lines, at the same generated position, with a source column 7 lower, the width of ' as any' (the ')' after the literal). (5) Tests: pnpm exec vitest run --maxWorkers=3 in packages/plugins/plugin-auth: base Test Files 187 passed (187), Tests 3525 passed | 10 skipped (3535), VERDICT command-exit 0; head the same counts, VERDICT command-exit 0. (6) Positive control: one of the 12 restored (:8856 back to '} as any);'), nothing else: pnpm check:query-options-erasure exit 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.'; the same ESLint command exit 1 at 8854:52 (query-options/no-any-erasure). Restored with git checkout -- afterwards; git diff HEAD empty. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset at 32f94b8 after a full turbo run build: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 63 commands for the 2 paths; all 63 ran, each exit code captured before any pipe, all 63 exit 0 (a container restart cut the first pass at 58; the remaining 5 ran on the same tree and the two records were joined); --ran: 63 derived, 63 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 25 changed lines vs the 3,000-line human-merge line. CI on 32f94b8, the PR's check-runs read at report time (46): 34 success, 12 skipped, 0 failure, 0 pending. Skipped: Console Pin Gate, Build Docs, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Temporal Conformance (path filter: none of their paths changed), and in the labeled run Check Changeset, Auto Label, Check PR Size, 18.x upgrade harness and Packed-tarball smoke, plus the opt-in 18.x upgrade harness and Packed-tarball smoke of the opened run. Success: Build Core; Test Core (1/6) to (6/6) and Test Core; TypeScript Type Check (Type Check · workspace, · source gates, · consumer gates, · debt ledger); Lint and Repo Gates (Lint · ESLint, · repo and tooling gates, · docs and code guards, · CI, release and engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup and corpus); Dogfood Regression Gate; Governed Surface Queue Guard; Check PR Size; Check Changeset; Auto Label; filter; Part-of PR must not also close its card; The card this PR closes must claim this branch; No other open PR may claim the same issue; No other open PR may claim the same single-writer path; Check Documentation Links; Flag docs affected by code changes. No Claude Approvals check runs on this PR. mergeable_state clean. origin/main has since moved to 54df640 (#25317, #25318, #25316, #25311); none of the four touches either file, and git merge-tree of origin/main with the head is clean. Docs Drift Check (advisory) comment 6355045819 lists no page, and node scripts/docs-audit/check-affected-docs.mjs is one of the 63 (exit 0). Serial constraints as in the claim: of the open PRs only #25309 touches auth-manager.ts (an import line and the public-config literal near :8011, none of the 12 lines), merge-tree clean.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "5 since this sweep began (00:37Z), all reads, no write tool: issue_read get_comments 1 (#25224), list_pull_requests 1, pull_request_read get_files 1 (#24467), pull_request_read get_check_runs 1 (#25326), pull_request_read get 1 (#25326). (claude-code-remote subscribe_pr_activity once on #25326, not a GitHub write.)",
"api_writes": "3 relay acts this sweep (scripts/pm/, each read back identical): 1) amended claim 6354594310 via post-stamped, run 39879671259, 5100 bytes; 2) pr_create #25326 via fleet-write, run 39883042932, 7712 bytes sent and stored, assignee os-sales, label skip-changeset; 3) this report via post-stamped. Plus git push of the branch (32f94b8, pushed as a new branch after the queue deleted the old one on #25307's merge; not REST). No PR body edit. No other write.",
"open_questions": [],
"out_of_scope_findings": []
}
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Landed the sweep PR ·
domain:servicesseat 1 (seat post #6021) ·os-sales·session_016g7nYP9wdNx1GDa5XDr7Uy· 2026-10-23T02:23Z6355516835; ruling6351993113item 1)origin/main67ab712bd6State:
auth-manager.tshas leftscripts/query-options-erasure-baseline.json. The card stays open and dispatched (Part of). The card thread claims the 9-method cut afresh on the merged file, under the usual token identity and the6348891160block.Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, cut 3 (one PR, cuts strictly serial: after the sweep PR #25326 landed, per ruling6351993113item 1's order) · amends claim6354594310for this PR, on the merged file · 2026-10-23T02:33ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session, restarted fromorigin/main5f4a3f088cafter the sweep PR #25326 merged as67ab712bd6; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (read on
origin/main5f4a3f088c, the sweep landed per6355882048:auth-manager.tsis 9,927 lines and no longer inscripts/query-options-erasure-baseline.json): (a) The move. The bodies of 12AuthManagermethods move unedited frompackages/plugins/plugin-auth/src/auth-manager.tsinto a new module,packages/plugins/plugin-auth/src/auth-manager-password-session-policy.ts, in cut 1's shape: the class keeps every method with its docblock and signature (asyncdropped from the stubs), and each body becomes a literal of exactly the host members it reads plus a.call. They are the rest of the card's "password policy, lockout, auth gates, session controls" area (cut 2 took its sign-in lockout path), ADR-0069 throughout. Signature to closing brace at this base:assertPasswordComplexity:8895-:8912(D1) ·refreshMustChangeCacheIfStale:8998-:9017·refreshOrgMfaCacheIfStale:9025-:9045·resolveUserAuthGates:9159-:9251·stampPasswordChangedAt:9258-:9285·parseHashes:9291-:9299·resolvePasswordChangeUserId:9324-:9353·assertPasswordNotReused:9362-:9408·recordPasswordHistory:9414-:9459(D3) ·unlockUser:9685-:9731(D2) ·enforceSessionControls:9740-:9818·enforceConcurrentCap:9825-:9874(D4). Eight of them are among ruling6351993113's nine methods; #25326 swept their counted sites, so no counted erasure moves. The ninth,stampIdentitySource, stays: it is cloud ADR-0024 D4 provenance, another area, and moves with that area's cut. Also staying in the class:isAuthGateActive,computeAuthGate,noteMustChangePasswordIssuedandcheckPasswordComplexity, one-expression bodies no longer than the stub they would leave. The host passesconfigas a getter. It passes the four cache fields (_orgMfaCache,_orgMfaRefreshing,_mustChangeCache,_mustChangeRefreshing) as getters, and as get/set pairs in the two cache refreshes that assign them, so every read and write lands on the manager's own field. (b) Path readers, migrated in the same PR.packages/plugins/plugin-auth/src/api-error-code.pin.test.ts: theauthManagerFilesfloor list gains the new module. 2 ofAuthManager's 27APIErrorsites move there, and without the entry the floor of 24 would pass on 25 without counting them.content/docs/permissions/tenant-audit-census.mdxanddocs/audits/2026-08-tenant-audit-write-call-sites.counts.md: regenerated bynode scripts/tenant-audit-census.mjs --write. The page's two hand-written erased-receiver counts are set to the census's figure (44 → 52), and its "just under a fifth" becomes "just over a fifth" (52 of 237). The 8engine.updatesites in the moved bodies move from "receiver carried a readable engine type" to "placed by the object NAME", for the reason cut 2's PR gave. ⛔ Nothing else: no other method moves, no body is edited, and theengine.update(…, { context: SYSTEM_CTX } as any)casts move as written (the ratchet does not count them). No anchor, ADR or docs prose edit beyond the census page: every symbol anchor into the file resolves at the draft head. No edit toscripts/,eslint.config.mjsor any baseline. Title underrefactor(plugin-auth), no!. No changeset:skip-changeset, per ruling6348891160item 4.Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: a move-only cut widens no accept set and no public surface. The proof owed:
6348891160item 2's block: raw and normalised sha256 ofdist/index.d.tsanddist/index.d.mtsat base and head, the normaliser verbatim, the raw diff line count, and the positive control;Premise (measured on a draft of this cut at
32f94b8b70, a tree whoseauth-manager.tsequals this base's):tsc --noEmitexit 0, andeslint --no-inline-configon both files exit 0;dist/index.d.tsanddist/index.d.mtsraw byte-identical to base;check-adr-symbol-anchors,check-platform-checklist,check-scripts-symbol-anchors,check-spec-docblock-symbol-anchorsandcheck-system-context-censusall exit 0.A diff of another kind is a fresh fork on this card.
Responsibility: n/a — not a defect card
Thread-read: 6355882048
Ruling-ref: 6348891160, 6351993113
Serial constraints cleared: re-read this act. Of the 24 open PRs, 23 heads were diffed against their merge base with
origin/main. #24467's head ref is gone; its one file,scripts/test-shard-timings.json, was read through the API earlier this session. One PR touches a path here: #25309, inauth-manager.ts's import block (:46) and near:8011, outside every moved body.git merge-treeof this branch with #25309's head is clean. No PR touches the new module's path,api-error-code.pin.test.tsor the two census documents.Resume-from: none
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25362",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "Cut 3 of the auth-manager.ts split, per the amended claim 6356007354 (amends 6354594310 on the file the sweep PR #25326 left; landed note 6355882048). Part of #25224, no closing keyword; #25224 stays open. Base origin/main 5f4a3f0, head 16770e8, +731/-481 over 5 files. Twelve AuthManager method bodies, the rest of the card's 'password policy, lockout, auth gates, session controls' area (ADR-0069), move unedited into packages/plugins/plugin-auth/src/auth-manager-password-session-policy.ts in cut 1's shape: assertPasswordComplexity, refreshMustChangeCacheIfStale, refreshOrgMfaCacheIfStale, resolveUserAuthGates, stampPasswordChangedAt, parseHashes, resolvePasswordChangeUserId, assertPasswordNotReused, recordPasswordHistory, unlockUser, enforceSessionControls, enforceConcurrentCap (481 body lines). Eight are among ruling 6351993113's nine methods; the ninth, stampIdentitySource, is cloud ADR-0024 D4 provenance, another area, and stays for that area's cut (it carries no counted site any more). isAuthGateActive, computeAuthGate, noteMustChangePasswordIssued and checkPasswordComplexity stay too (one-expression bodies no longer than their stubs). The class keeps every method with its docblock and signature (async dropped from nine). config goes as a getter; the four cache fields (_orgMfaCache, _orgMfaRefreshing, _mustChangeCache, _mustChangeRefreshing) go as getters, and as get/set pairs in the two refreshes that assign them, so every read and write lands on the manager's own field. Readers migrated in the same PR: api-error-code.pin.test.ts authManagerFiles gains the new module (27 = 27; without it the floor of 24 would pass on 25 in silence); the tenant-audit census page and counts file regenerated with --write, and the page's two hand-written erased-receiver counts set to the census's 52 (was 44; 'just under a fifth' now 'just over a fifth'). auth-manager.ts 9,927 to 9,587 lines. No sign-in, session or membership outcome changes.",
"tests": "Base 5f4a3f0, head 16770e8; builds and suites through os-verify-lock, every exit code captured before any pipe; a full turbo run build first, then plugin-auth built and tested at base, then at head, on the same dependency dists. (1) Move proof: TS scanner token identity per body, template literals re-scanned at their substitutions, every line = base line minus two spaces, same params and return type, class stub docblock and signature kept with async dropped: 12 of 12 pass, 481 body lines. Negative control: one token changed in the module (60_000 to 60_001 in refreshMustChangeCacheIfStale) fails that method and the run exits 1; restored, git diff HEAD empty. git diff --color-moved=plain --color-moved-ws=allow-indentation-change over the two source files marks 457 of 466 deleted and 485 of 710 added lines moved. (2) Ruling 6348891160 item 2 block: dist/index.d.ts raw base 4bc04c66f724c79782493249820b1b7d9bff7c826931ce6b362d325af8797891, raw head the same, normalised base 3c8612c88f3f41c963c243e91c2523d2754b2accb4a4c2ba52a5627fd6eaa1e5, normalised head the same; dist/index.d.mts raw base d70d7d8063053de2d39bd0dbae06423bbe0ef1dcecf5130b867c6f4d79a0c8cd, raw head the same, normalised base 51510aad856bbacd24757d1c62dc7273bfd6313ed543c8b1f1e86195fc2c7cd0, normalised head the same; raw diff 0 lines on both, so no union swap and item 1 holds outright. Normaliser: the ruling's one-liner, verbatim in the PR body. Positive control: head dist/index.d.ts with 'private assertPasswordNotReused;' made public (line 4001, one line, 4 diff lines) hashes raw 7d3450b84103f5d80cfbc8a2e4391ee22919d8137744c6a4550a1b237bcc5115 and normalised 56cff0cedafef19e8cf0e559a612c61d84b48aef3134c6c01d977887a8ef061e, both differ. Export lists: ESM dist/index.mjs and CJS dist/index.js 155 names each at base and head, sorted-name hash ed3ac8b902031d30 on all four. 18 dist files on both sides, same list; only index.js, index.mjs and their maps differ. (3) pnpm exec vitest run --maxWorkers=3 in packages/plugins/plugin-auth: base Test Files 187 passed (187), Tests 3525 passed | 10 skipped (3535), VERDICT command-exit 0; head the same counts, VERDICT command-exit 0. pnpm --filter @objectstack/plugin-auth typecheck exit 0; eslint --no-inline-config over the 3 TypeScript files exit 0; pnpm check:query-options-erasure exit 0, baseline key set verified against 5f4a3f0, no files added. (4) Tenant-audit census, base vs head per site via --json (new module mapped back to auth-manager.ts): 237 sites on both, 0 per-site differences in object, verb, tenancy, context and elevation, 0 unresolved and 0 unledgered on both; the only total that moves is placedByObjectName 34 to 42 (readable engine type 193 to 185): the 8 engine.update sites of resolveUserAuthGates (1), stampPasswordChangedAt (1), recordPasswordHistory (1), unlockUser (2), enforceSessionControls (2), enforceConcurrentCap (1), for the reason in the PR body's census section. (5) Symbol anchors at base and at head, run by hand: check-adr-symbol-anchors (2,383 anchors, 466 symbol, same at both), check-adr-anchors, check-scripts-symbol-anchors, check-spec-docblock-symbol-anchors, check-system-context-census, check-platform-checklist: all exit 0 at both. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset at 16770e8 after the full build: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 89 commands for the 5 paths; all 89 ran, each exit code captured before any pipe, all 89 exit 0; --ran: 89 derived, 89 run, 0 NOT-MEASURED, 0 UNRUN. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 0 of 5 paths hit the register, 1,212 changed lines vs the 3,000-line human-merge line. CI on 16770e8, the PR's check-runs read at report time (47): 36 success, 11 skipped, 0 failure, 0 pending. Skipped: Console Pin Gate, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Temporal Conformance (path filter), the opt-in 18.x upgrade harness and Packed-tarball smoke (twice each), and in the labeled run Check Changeset, Auto Label and Check PR Size. Success: Build Core; Build Docs; Test Core (1/6) to (6/6) and Test Core; TypeScript Type Check (Type Check · workspace, · source gates, · consumer gates, · debt ledger); Lint and Repo Gates (Lint · ESLint, · repo and tooling gates, · docs and code guards, · CI, release and engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup and corpus); Dogfood Regression Gate; Spec property liveness; Governed Surface Queue Guard; Check PR Size; Check Changeset; Auto Label; filter; Part-of PR must not also close its card; The card this PR closes must claim this branch; No other open PR may claim the same issue; No other open PR may claim the same single-writer path; Check Documentation Links; Flag docs affected by code changes. No Claude Approvals check runs on this PR. mergeable_state clean. origin/main has since moved to b3034ee (#25313, #25312, #25212, #25309, #25349, #25352); of them only #25309 touches auth-manager.ts (the import block and near :8018, outside every moved body) and #25352 touches plugin-auth's last-admin-guard.ts and auth-manager.test.ts; none touches the new module, the pin test or the census documents, and git merge-tree of origin/main with the head is clean. Docs Drift Check (advisory) comment 6356495661: 19 hand-written and 12 release-owned pages, the same 31 as node scripts/docs-audit/affected-docs.mjs --json 5f4a3f0 (exit 0), each reached through a literal the moved bodies carry unchanged or through resolveActor, which the class keeps; no doc edit owed beyond the census's two documents.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "5 since this cut began (01:56Z), all reads, no write tool: issue_read get 1 (#25224), list_pull_requests 1, issue_read get_comments 1 (#25224), pull_request_read get_check_runs 1 (#25362), pull_request_read get 1 (#25362). (claude-code-remote subscribe_pr_activity once on #25362, not a GitHub write.)",
"api_writes": "3 relay acts this cut (scripts/pm/, each read back identical): 1) amended claim 6356007354 via post-stamped, run 39890263569, 6265 bytes; 2) pr_create #25362 via fleet-write, run 39893761744, 16712 bytes sent and stored, assignee os-sales, label skip-changeset; 3) this report via post-stamped. Plus git push of the branch (16770e8, a new branch after the queue deleted the old one on #25326's merge; not REST). No PR body edit. No other write.",
"open_questions": [],
"out_of_scope_findings": []
}
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Landed cut 3 ·
domain:servicesseat 1 (seat post #6021) ·os-sales·session_016g7nYP9wdNx1GDa5XDr7Uy· 2026-10-23T04:15Z6356901523)origin/mainfb63d396b1State: the card stays open and dispatched (
Part of). Of ruling6351993113's nine methods, eight now live inauth-manager-password-session-policy.ts.stampIdentitySource(cloud ADR-0024 D4 provenance) is left for that area's cut, which the card thread claims afresh on the merged file.Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, cut 4 (one PR, cuts strictly serial: after cut 3, PR #25362, landed asfb63d396b1, per the landed note6357231692) · amends claim6356007354for this PR, on the merged file · 2026-10-23T04:59ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session, restarted fromorigin/mainfb63d396b1after #25362 merged; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (read on
origin/mainfb63d396b1, whereauth-manager.tsis 9,592 lines):(a) The move. The bodies of 2
AuthManagermethods move unedited frompackages/plugins/plugin-auth/src/auth-manager.tsinto a new module,packages/plugins/plugin-auth/src/auth-manager-database-hooks.ts, in cut 1's shape: the class keeps both methods with their docblocks and signatures (asyncdropped from the second stub), and each body becomes a literal of exactly the host members it reads plus a.call.composeDatabaseHooks:8431-:8792: the better-auth database hooks composed around a host's owndatabaseHooks. They are the unlink records, the walled owner-verified stamp, the ADR-0093 D2 membership reconciler onuser.create.after, the ADR-0093 D9 default active organization onsession.create.before, theloginandlogoutaudit rows, and the principal-session renewal hold.stampIdentitySource:8865-:8910: thesys_user.sourceprovenance stamp (cloud ADR-0024 D4), which cut 3 left for its own area. Its only caller isaccount.create.afterin the body above, so the two move together.How the host is built:
audienceLogError,getDataEngine,isCreatedInThisRequest,linkingContext,logDurabilityDegradation,settleMembership,settleSelfRegistrationGrant,stampIdentitySourceandtakeOwnerVerifiedStamp.configandidpLocalego as getters.composeDatabaseHooksthe stub's literal is namedhookHost, because the method's own parameter is already namedhost.Imports that only the moved bodies read move with them:
clearUnlinkTombstone,clearUserUnlinkTombstones,recordUnlinkTombstone,emitAuthSessionAuditEvent,loginEventFor,logoutEventForandholdPrincipalSessionExpiryleaveauth-manager.ts's import lists. Each of their three modules stays imported there for other names, so the module evaluation order does not change.withSystemReadContextandBetterAuthOptionsare imported in both files.(b) Path readers, migrated in the same PR.
scripts/adr-anchors/packages__plugins__plugin-auth__src__auth-manager-database-hooks.ts.json. It carries ADR-0093 and the ADR-0093 D2 invariant paragraph of theauth-manager.tsentry, verbatim. That paragraph names the two seams whose bodies move:user.create.afterandsession.create.before. This follows what [maintainer] refactor(plugin-security): splitsrc/security-plugin.ts(10,746 lines, +2,803 in 30 days) along itsSecurityPluginseams, one move-only slice per PR #25223's cuts 2 to 4 did for their new modules (refactor(plugin-security): move SecurityPlugin's controlled-by-parent read leaf into security-plugin-cbp-read-filter.ts (#25223 cut 4) #25360 the latest). Per ruling6353073966item 1,scripts/adr-anchors/is not a row of the governed register.auth-manager.tsentry is unchanged.settleMembership, the single assembly its paragraph names, stays in the class, and so does ADR-0108's role map. 22 of the file's 26 lines citing ADR-0093 or ADR-0108 stay.content/docs/permissions/tenant-audit-census.mdxanddocs/audits/2026-08-tenant-audit-write-call-sites.counts.mdare regenerated bynode scripts/tenant-audit-census.mjs --write.engine.update('sys_user', …)sites ofstampIdentitySourcemove from "receiver carried a readable engine type" to "placed by the object NAME", for the reason cut 2's PR gave.api-error-code.pin.test.ts'sauthManagerFilesfloor: nonew APIError(sits in either body, so the floor reads the same 27 sites.better-auth-schema-parity.test.tsandmanaged-extension-fields.test.ts: noawait import(of a better-auth plugin sits in either body.check-dispatcher-error-vocabulary.mjs,check-auth-mount-ledger.mjsandauth-manager-base-path.test.ts: none of the tokens they read sits in either body.UNTYPED_RECEIVERSrow forauth-manager.ts: it names the SCIM transaction, which stays.isSystemread.composeDatabaseHooksthrough the manager, and one callsstampIdentitySource. Both stubs keep those calls working.⛔ Nothing else changes:
eslint.config.mjs, to any baseline, or toscripts/beyond the one anchor entry.refactor(plugin-auth), with no!.skip-changeset, per ruling6348891160item 4.Anchor reading before the cut, on
fb63d396b1:auth-manager.ts#symbolanchor in the tracked tree, outside changelogs, withsymbolSegmentResolutionfromscripts/symbol-anchors.mjs. There are 29 of them, in ADR-0127, ADR-0134, ADR-0135 and four platform-checklist areas.declaration-class at base, blanked and head.access-security.json:2419#composeDatabaseHooks. It resolves on the method declaration, which stays as a shell. No anchor names#stampIdentitySourceor a token inside either body.Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: a move-only cut widens no accept set and no public surface. The proof owed:
6348891160item 2's block: raw and normalised sha256 ofdist/index.d.tsanddist/index.d.mtsat base and head, the normaliser verbatim, the raw diff line count, and the positive control;check:adr-anchorsat base and at head;Premise (measured on a draft of this cut at
8f41da7fd7, on this base):pnpm --filter @objectstack/plugin-auth typecheckexit 0, andeslint --no-inline-configon both files exit 0;dist/index.d.tsanddist/index.d.mtsraw byte-identical to base, and the ESM and CJS entries export the same 155 names;placedByObjectNamemoves (42 → 44);check-adr-symbol-anchors,check-adr-anchors(78 → 79 anchored files),check-platform-checklist,check-scripts-symbol-anchors,check-spec-docblock-symbol-anchorsandcheck-system-context-censusall exit 0 at base and at the draft.A diff of another kind is a fresh fork on this card.
Responsibility: n/a — not a defect card
Thread-read: 6357231692
Ruling-ref: 6348891160, 6353073966
Serial constraints cleared: re-read this act. Of the 21 open PRs, 20 heads were diffed against their merge base with
origin/main. #24467's head ref is gone; its one file,scripts/test-shard-timings.json, was read through the API earlier this session. No open PR touchesauth-manager.ts, the new module's path, the anchor entry, the census documents or the six suites above. #25323 editsdocs/qa/platform-checklist/areas/access-security.json, which holds the#composeDatabaseHooksanchor; this cut does not edit that file, and the anchor keeps resolving on the method shell.Resume-from: none
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25383",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "Cut 4 of the auth-manager.ts split, per the amended claim 6357765071 (amends 6356007354 on the file cut 3 left; landed note 6357231692). Part of #25224, no closing keyword; #25224 stays open. Base origin/main fb63d39, head 8f41da7, +538/-418 over 5 files (956 changed lines). Two AuthManager method bodies move unedited into packages/plugins/plugin-auth/src/auth-manager-database-hooks.ts in cut 1's shape: composeDatabaseHooks (base :8431-:8792, the better-auth account, user and session hooks composed around a host's databaseHooks: unlink records, walled owner-verified stamp, ADR-0093 D2 membership reconciler on user.create.after, ADR-0093 D9 default active organization on session.create.before, login and logout audit rows, principal-session renewal hold) and stampIdentitySource (base :8865-:8910, the sys_user.source provenance stamp of cloud ADR-0024 D4, the ninth method of ruling 6351993113 that cut 3 left; its only caller is account.create.after in the body above). 406 body lines. The class keeps both methods with docblock and signature (async dropped from stampIdentitySource). The hooks run after composition, so every member is read when a hook runs: nine methods as late-bound closures, config and idpLocale as getters. The composeDatabaseHooks stub names its literal hookHost because the method's parameter is already named host. Seven imported names read only by the moved bodies leave auth-manager.ts's import lists (clearUnlinkTombstone, clearUserUnlinkTombstones, recordUnlinkTombstone, emitAuthSessionAuditEvent, loginEventFor, logoutEventFor, holdPrincipalSessionExpiry); their three modules stay imported there for other names, so module evaluation order is unchanged. Readers migrated in the same PR: a new scripts/adr-anchors entry for the new module carrying ADR-0093 and the ADR-0093 D2 invariant paragraph of the auth-manager.ts entry verbatim (that paragraph names the two seams whose bodies moved), as #25223 cuts 2 to 4 did, with the auth-manager.ts entry unchanged (settleMembership and ADR-0108's role map stay; 22 of the file's 26 ADR-0093/ADR-0108 citation lines stay); the tenant-audit census page and counts file regenerated with --write, and the page's two hand-written erased-receiver counts set to the census's 54 (was 52; 'just over a fifth' stays). Read and not edited, because nothing they key on moved: the api-error-code floor (no APIError in either body; 27 sites), the two plugin-factory scans, check-dispatcher-error-vocabulary, check-auth-mount-ledger, auth-manager-base-path.test, the census UNTYPED_RECEIVERS row (SCIM db), the system-context census. auth-manager.ts 9,592 to 9,212 lines. No sign-in, session or membership outcome changes.",
"tests": "Base fb63d39, head 8f41da7; builds and suites through os-verify-lock, every exit code captured before any pipe; a full turbo run build first, then plugin-auth built and tested at base, then at head, on the same dependency dists. (1) Move proof: TS scanner token identity per body, template literals re-scanned at their substitutions, every line = base line minus two spaces, same params and return type, class stub docblock and signature kept with async dropped: 2 of 2 pass, 406 body lines (composeDatabaseHooks 360 lines and 1,613 tokens, stampIdentitySource 46 lines and 263 tokens). Negative control: one token changed in the module (role 'owner' to 'admin' in selectActiveOrg) fails composeDatabaseHooks and the run exits 1; restored, cmp clean. git diff --color-moved=plain --color-moved-ws=allow-indentation-change over the two source files marks 404 of 409 deleted and 418 of 522 added lines moved; the 5 unmarked deletions are four import-name lines and stampIdentitySource's async signature line. (2) Ruling 6348891160 item 2 block: dist/index.d.ts raw base 8a39f1035b6a64888117bb152de21865289e67bc8111d5a14ea457e0fb084d51, raw head the same, normalised base 486138d3045a7ae05205c64d640eb98c77a85e3ac797a0be0e9ee351e8230bca, normalised head the same; dist/index.d.mts raw base 074a15f3d7e075752bfb5aa299151d77d013fedfae947a8bcc8d28d8446b15df, raw head the same, normalised base 8cb244809d4e1cee802060cfe8c37ff784d6f16d341672b7e2d74700ba2e1229, normalised head the same; raw diff 0 lines on both, so no union swap and item 1 holds outright. Normaliser: the ruling's one-liner, verbatim in the PR body. Positive control: head dist/index.d.ts with 'private stampIdentitySource;' made public (line 3821, one line, 2 diff lines) hashes raw ae7b5fe254d6dfde9189a1ec5f556eebda8fc8c803859713d430e24f0d9c6503 and normalised 5546200f387e32564d475768d41a8ed51fbb2a6cd2450f8d71babceea0219912, both differ. Export lists: ESM dist/index.mjs and CJS dist/index.js 155 names each at base and head, sorted-name hash ed3ac8b902031d30 on all four. 18 dist files on both sides, same list; only index.js, index.mjs and their maps differ. (3) pnpm exec vitest run --maxWorkers=3 in packages/plugins/plugin-auth: base Test Files 187 passed (187), Tests 3526 passed | 10 skipped (3536), VERDICT command-exit 0; head the same counts, VERDICT command-exit 0; the six suites that call the two methods through the manager (auth-manager.test.ts, auth-session-audit.test.ts, first-session-membership-ordering.test.ts, membership-policy-setting.test.ts, user-created-in-request.test.ts, durability-swallow-repair.test.ts) are among them. pnpm --filter @objectstack/plugin-auth typecheck exit 0; eslint --no-inline-config over the 2 TypeScript files exit 0. (4) Tenant-audit census, base vs head per site via --json (new module mapped back to auth-manager.ts): 237 sites on both, 0 per-site differences in object, verb, tenancy, context and elevation, 0 unresolved and 0 unledgered on both; the only total that moves is placedByObjectName 42 to 44: the 2 engine.update sys_user sites of stampIdentitySource; scannedSources 713 to 714 (the new module). (5) Anchors at base and at head, run by hand: check-adr-symbol-anchors (2,383 anchors, 466 symbol, same at both), check-adr-anchors (78 to 79 anchored files), check-scripts-symbol-anchors (4,058), check-spec-docblock-symbol-anchors (5,071, both read in a built tree: the ignored generated packages/spec/src/migrations/registry.ts carries 386 of them, so a clean tree reads 4,685), check-system-context-census, check-platform-checklist: all exit 0 at both. Anchor map before the cut: all 29 auth-manager.ts#symbol anchors outside changelogs are declaration-class at base, with both bodies blanked, and at head; the one naming a moved method (access-security.json:2419 #composeDatabaseHooks) resolves on the method shell. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset at 8f41da7 after the full build: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 93 commands for the 5 paths; all 93 ran, each exit code captured before any pipe, all 93 exit 0; --ran: 93 derived, 93 run, 0 NOT-MEASURED. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 0 of 5 paths hit the register, 956 changed lines vs the 3,000-line human-merge line. CI on 8f41da7, the PR's check-runs read at report time (47): 36 success, 11 skipped, 0 failure, 0 pending. Skipped: Console Pin Gate, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Temporal Conformance (path filter), the opt-in 18.x upgrade harness and Packed-tarball smoke (twice each), and in the labeled run Check Changeset, Auto Label and Check PR Size. Success: Build Core; Build Docs; Test Core (1/6) to (6/6) and Test Core; TypeScript Type Check (Type Check · workspace, · source gates, · consumer gates, · debt ledger); Lint and Repo Gates (Lint · ESLint, · repo and tooling gates, · docs and code guards, · CI, release and engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup and corpus); Dogfood Regression Gate; Spec property liveness; Governed Surface Queue Guard; Check PR Size; Check Changeset; Auto Label; filter; Part-of PR must not also close its card; The card this PR closes must claim this branch; No other open PR may claim the same issue; No other open PR may claim the same single-writer path; Check Documentation Links; Flag docs affected by code changes. No Claude Approvals check runs on this PR. mergeable_state clean; the PR was opened as a draft. origin/main has since moved to c898bd8 (#25363, #25355, #25350, #25368, #25371); none touches plugin-auth, the anchor entry or the census documents, git merge-tree is clean, and on that merge check-tenant-audit-census (237 sites, 23 prose figures held) and check-adr-anchors (79 files) both pass. Docs Drift Check (advisory) comment 6357805976: 11 hand-written and 9 release-owned pages, the same 20 as node scripts/docs-audit/affected-docs.mjs --json fb63d39 (exit 0), each reached through sys_member, sys_account or idp_provisioned, literals the moved bodies carry unchanged; no doc edit owed beyond the census's two documents. Correction to the PR body's Gates section: it says '20 hand-written and 9 release-owned pages'; the reading is 11 hand-written and 9 release-owned, 20 in all. The body is not edited (written once at pr_create).",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "7 since this cut began (04:16Z), all reads, no write tool: list_pull_requests 1, issue_read get 1 (#25224), issue_read get_comments 2 (#25223 for ruling 6353073966 and the cut-4 claim precedent, #25224 for the landed note), pull_request_read get_check_runs 2 (#25383, two pages), pull_request_read get 1 (#25383). (claude-code-remote subscribe_pr_activity once on #25383, not a GitHub write.)",
"api_writes": "3 relay acts this cut (scripts/pm/, each read back identical): 1) amended claim 6357765071 via post-stamped, run 39903267455, 8619 bytes; 2) pr_create #25383 via fleet-write, run 39903478280, 17921 bytes sent and stored, assignee os-sales, label skip-changeset; 3) this report via post-stamped. Plus git push of the branch (8f41da7, a new branch after the queue deleted the old one on #25362's merge; not REST). No PR body edit. No other write.",
"open_questions": [],
"out_of_scope_findings": []
}
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Landed cut 4 ·
domain:servicesseat 1 (seat post #6021) ·os-sales·session_016g7nYP9wdNx1GDa5XDr7Uy· 2026-10-23T06:12Zorigin/mainca381a8a19State: the card stays open and dispatched (
Part of). All nine methods of ruling6351993113have now moved: eight in cut 3 andstampIdentitySourcein this cut. The card thread claims cut 5, the email/SMS delivery area, afresh on the merged file. Later cuts whose bodies read non-exported module helpers, ADR-anchored top-level declarations orAuthManagerstatic fields will come back asneeds_decisionbefore they are cut.Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
Claim: card thread ·
domain:servicesseat 1 (seat post #6021, project run by the Sales account) · p2 · series card, cut 5 (one PR, cuts strictly serial: after cut 4, PR #25383, landed asca381a8a19, per the landed note6358711845) · amends claim6357765071for this PR, on the merged file · 2026-10-23T07:02ZSession:
session_01LSXBc2GCBwiAL7vV4kWkyrAccount:
os-sales(the seat's linked user; the card's assignee)Branch:
claude/project-thread-lg3wrj(the harness-pinned branch for this session, restarted fromorigin/mainca381a8a19after #25383 merged; it names no issue, so the Duplicate Fix Guard's branch-name hint will not match — this claim is the identity record)Worktree:
objectstack-issue-25224(a linked worktree in this session's container)Domain:
domain:servicesSeat:
domain:services#1(seat post #6021)File surface (read on
origin/mainca381a8a19, whereauth-manager.tsis 9,212 lines):(a) The move: the email and SMS delivery area. The bodies of 7
AuthManagermethods, and the 4 module-level declarations that only those bodies read, move unedited frompackages/plugins/plugin-auth/src/auth-manager.tsinto a new module,packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts, in cut 1's shape: the class keeps every method with its docblock and signature (asyncdropped from the six async stubs), and each body becomes a literal of exactly the host members it reads plus a.call.sendChangeEmailNotice:6299: the notice to the address a change-email request moves the account away from.getOtpSendGuard:6359andassertPhoneOtpSendAllowed:6391: the per-number phone OTP send guard and its admission check.deliverPhoneOtp:6420andsendPhoneInviteSms:6508: the phone OTP and SMS invitation sends, with their quota wall.storedRecipientLocale:6661: the read of a recipient's ownsys_user.locale.renderPhoneSmsBody:6745: the auth SMS body render.:1216-:1247,:1265-:1275,:1409-:1435and:1437-:1447:SMS_QUOTA_EXCEEDED_CODE,isSmsQuotaRefusal,smsQuotaExceededApiErrorandPHONE_OTP_SEND_REFUSAL_CODE. Every reader of each, comments included, is in the moved text, so none is exported from either file, and none is shared with code that stays.How the host is built:
emailLocaleArg,getAppName,getCanonicalOrigin,getConsolePageUrl,getDataEngine,getEmailService,getOtpSendGuard,getSmsService,isPhoneOtpDeliverable,renderPhoneSmsBodyandstoredRecipientLocale.configandsmsLocalego as getters, because the class reassigns both after construction._otpSendGuardgoes as a get/set pair, becausegetOtpSendGuardcreates the guard once and stores it on the manager.Imports that only the moved text reads move with it:
PHONE_SMS_TOPICS,interpolatePhoneSmsandresolvePhoneSmsTemplateBody(./phone-sms-texts.js), andRECIPIENT_LOCALE_FIELDandnormalizeRecipientLocale(@objectstack/service-messaging, with the comment that explains that import). Neither module is imported byauth-manager.tsany more. The order of evaluation is unchanged in effect:@objectstack/service-messagingis first evaluated through./idp-locale-claim.js, imported at:39, at base and head alike, and./phone-sms-texts.jshas no imports and only declarations with literal initialisers.OtpSendGuardand theStandardErrorCodetype are imported in both files.(b) Path readers, migrated in the same PR.
packages/plugins/plugin-auth/src/api-error-code.pin.test.tsauthManagerFilesgains the new module. Threenew APIError(sites move with the text. Without the new entry the floor of 24 would pass on 24 in silence. With it, the sum stays 27.packages/runtime/src/dispatcher-error-vocabulary.ts, theUNRESOLVED_CODE_HELPERSrow fordeliverPhoneOtp. This is cross-lane (domain:cli), as the seat agreed on this card. The row'sfilebecomes the new module. Its evidence text said "Its two in-file callers…", and it now says the two better-authsendOTPhooks reach the helper inauth-manager.tsthrough the class method of the same name. Nothing else in the row or the file changes. Measured on the draft,node scripts/check-dispatcher-error-vocabulary.mjsexits 1 with the row unmigrated (stale-helper-rowandunresolved-constant) and exits 0 with it migrated (56 found, 56 classified).packages/plugins/plugin-auth/src/auth-email-locale.test.ts: two comments that state the population of the five auth sends as "the fivesendTemplatecall sites inauth-manager.ts", and that no other file underplugin-auth/srccalls either. They now name both files, because the change-email notice's send moves. No assertion changes.better-auth-schema-parity.test.tsandmanaged-extension-fields.test.ts: the moved text importsbetter-auth/apiand no plugin;check-auth-mount-ledger.mjsandauth-manager-base-path.test.ts: the moved text does not spell the base-path default;check-dispatcher-error-vocabulary.mjs'sliveMemberFilerow: it namesBASE_ERROR_CODES.USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL, which stays;UNTYPED_RECEIVERSrow forauth-manager.ts: it names the SCIM transaction, which stays;scripts/adr-anchors/: no entry's invariant describes these sends;check-adr-anchors' decision-letter layer, which reads anchored files only. The change-email notice body carries oneADR-NNNN Dkcitation,[ADR-0131 D7, Q2 A], and it leaves the anchored surface with the body: that layer reads 2,017 citations at base and 2,016 at the draft. The citation still resolves in the number layer over the whole tree, and both readings exit 0. No anchor entry is added for the new module: it would need aninvariantthat no existing entry carries for these sends, which is new governance text rather than a move. The modules of cuts 1 to 3 carry no entry either.⛔ Nothing else changes:
eslint.config.mjs, to any baseline, or toscripts/.refactor(plugin-auth), with no!.skip-changeset, per ruling6348891160item 4.Anchor reading before the cut, on
ca381a8a19:auth-manager.ts#symbolanchor in the tracked tree, outside changelogs, withsymbolSegmentResolutionfromscripts/symbol-anchors.mjs. There are 29 of them.declaration-class at base, blanked and head.#secondaryStorage(ADR-0127),#AuthManager(ADR-0135) and#isPhoneOtpDeliverable(identity-auth.json:1345).Container & model:
L(series), card thread (in-session executor),model: default tier(dispatch-gates.mjs --tier: "no path-derived mandate"),effort: xhighClause-②: no
Metadata-protocol: none
Basis for the Clause-② line: a move-only cut widens no accept set and no public surface. The proof owed:
6348891160item 2's block: raw and normalised sha256 ofdist/index.d.tsanddist/index.d.mtsat base and head, the normaliser verbatim, the raw diff line count, and the positive control;check:adr-anchorsat base and at head;Premise (measured on a draft of this cut, the same tree as
b2f9b260de):tsc --noEmitfor plugin-auth exit 0, andeslint --no-inline-configon the 5 TypeScript files exit 0;A diff of another kind is a fresh fork on this card.
Responsibility: n/a — not a defect card
Thread-read: 6358711845
Ruling-ref: 6348891160
Serial constraints cleared: read at 06:15Z and re-read this act. Of the 25 PRs open at 06:15Z, 24 heads were diffed against their merge base with
origin/main. #24467's head ref is gone; its one file,scripts/test-shard-timings.json, was read through the API earlier this session. No open PR touchedauth-manager.ts, the new module's path,api-error-code.pin.test.ts,auth-email-locale.test.tsordispatcher-error-vocabulary.ts. #25381 regenerates the census documents; this cut does not edit them. Since then 11 of those PRs merged and one opened (#25392, no file changes). Of the merged, only #25388 touchesplugin-auth:auth-manager-actor-guards.ts(cut 1's module),objectql-adapter.ts,last-admin-guard.tsand four suites, none of this cut's files.origin/mainis now5f6c2f1952, andgit merge-treeof it with this cut is clean. On that merge,check-dispatcher-error-vocabularyreads 56 found and 56 classified, andapi-error-code.pin.test.tspasses.Resume-from: none
Generated by Claude Code
objectstack-fleet commentedon Oct 23, 2026
os-dev-report
{
"issue": 25224,
"status": "done",
"branch": "claude/project-thread-lg3wrj",
"pr": "#25395",
"session": "session_01LSXBc2GCBwiAL7vV4kWkyr",
"premise_still_valid": true,
"summary": "Cut 5 of the auth-manager.ts split, per the amended claim 6359424739 (amends 6357765071 on the file cut 4 left; landed note 6358711845). Part of #25224, no closing keyword; #25224 stays open. Base origin/main ca381a8, head b2f9b26, +527/-332 over 5 files (859 changed lines). The email and SMS delivery area moves unedited into packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts in cut 1's shape: seven AuthManager method bodies (sendChangeEmailNotice, getOtpSendGuard, assertPhoneOtpSendAllowed, deliverPhoneOtp, sendPhoneInviteSms, storedRecipientLocale, renderPhoneSmsBody; 230 body lines) and the four module-level declarations only they read (SMS_QUOTA_EXCEEDED_CODE, isSmsQuotaRefusal, smsQuotaExceededApiError, PHONE_OTP_SEND_REFUSAL_CODE; base :1216-:1247, :1265-:1275, :1409-:1435, :1437-:1447). Every reader of each declaration, comments included, is in the moved text, so none is exported and none is shared with code that stays. The class keeps all seven methods with docblock and signature (async dropped from six). Eleven methods go as late-bound closures, config and smsLocale as getters, _otpSendGuard as a get/set pair (getOtpSendGuard creates and stores the guard on the manager). Five imported names read only by the moved text leave auth-manager.ts (PHONE_SMS_TOPICS, interpolatePhoneSms, resolvePhoneSmsTemplateBody from ./phone-sms-texts.js; RECIPIENT_LOCALE_FIELD, normalizeRecipientLocale from @objectstack/service-messaging, with the comment that explains that import). Neither module is imported by auth-manager.ts any more; evaluation order is unchanged in effect, because service-messaging is first evaluated through ./idp-locale-claim.js (:39) at base and head alike and phone-sms-texts.js has no imports and only literal-initialised declarations. Readers migrated in the same PR: api-error-code.pin.test.ts authManagerFiles gains the new module (3 APIError sites move; 27 = 27; without it the floor of 24 would pass on 24 in silence); packages/runtime/src/dispatcher-error-vocabulary.ts, the UNRESOLVED_CODE_HELPERS row for deliverPhoneOtp (cross-lane, domain:cli, as the seat agreed on this card): its file becomes the new module and its evidence text no longer says 'in-file callers' (unmigrated, check-dispatcher-error-vocabulary exits 1 with stale-helper-row and unresolved-constant; migrated, 56 found and 56 classified, the same as base); two population comments in auth-email-locale.test.ts name both files. One reading shifts and is reported, not migrated: check-adr-anchors' decision-letter layer reads anchored files only, and the change-email notice body's one ADR-0131 D7 citation leaves the anchored surface (2,017 to 2,016 letter citations, both exit 0); no anchor entry is added, because it would need an invariant no existing entry carries. auth-manager.ts 9,212 to 8,968 lines. No sign-in, session or membership outcome changes.",
"tests": "Base ca381a8, head b2f9b26; builds and suites through os-verify-lock, every exit code captured before any pipe; a full turbo run build first, then plugin-auth built and tested at base, then at head, on the same dependency dists. (1) Move proof: TS scanner token identity per body, template literals re-scanned at their substitutions, every line = base line minus two spaces, same params and return type, class stub docblock and signature kept with async dropped: 7 of 7 pass, 230 body lines (sendChangeEmailNotice 37/227 tokens, getOtpSendGuard 23/120, assertPhoneOtpSendAllowed 12/75, deliverPhoneOtp 78/207, sendPhoneInviteSms 52/151, storedRecipientLocale 17/100, renderPhoneSmsBody 11/77); the 4 module-level ranges verbatim in the module and absent from auth-manager.ts. Negative control: one token changed in the module (otpCfg.expiresIn ?? 300 to ?? 301 in deliverPhoneOtp) fails that method and the run exits 1; restored, cmp clean. git diff --color-moved=plain --color-moved-ws=allow-indentation-change over the two source files marks 317 of 323 deleted and 345 of 513 added lines moved; the 6 unmarked deletions are the six async signature lines. (2) Ruling 6348891160 item 2 block: dist/index.d.ts raw base 8a39f1035b6a64888117bb152de21865289e67bc8111d5a14ea457e0fb084d51, raw head the same, normalised base 486138d3045a7ae05205c64d640eb98c77a85e3ac797a0be0e9ee351e8230bca, normalised head the same; dist/index.d.mts raw base 074a15f3d7e075752bfb5aa299151d77d013fedfae947a8bcc8d28d8446b15df, raw head the same, normalised base 8cb244809d4e1cee802060cfe8c37ff784d6f16d341672b7e2d74700ba2e1229, normalised head the same; raw diff 0 lines on both, so no union swap and item 1 holds outright. Normaliser: the ruling's one-liner, verbatim in the PR body. Positive control: head dist/index.d.ts with 'private deliverPhoneOtp;' made public (line 2703, one line) hashes raw 72873388418fd744bdf706e2f4099a8650e58da20cf49526a1b8aed2b9b31c7e and normalised b15a8158861a2a047848872c97c420a06660ff583e9fa806bad0766fddd323b4, both differ. Export lists: ESM dist/index.mjs and CJS dist/index.js 155 names each at base and head, sorted-name hash ed3ac8b902031d30 on all four. 20 dist files on both sides, same list; only index.js, index.mjs, their maps and the two build-input hash stamps differ. (3) pnpm exec vitest run --maxWorkers=3 in packages/plugins/plugin-auth: base Test Files 187 passed (187), Tests 3526 passed | 10 skipped (3536), VERDICT command-exit 0; head the same counts, VERDICT command-exit 0. pnpm --filter @objectstack/plugin-auth typecheck and pnpm --filter @objectstack/runtime typecheck exit 0; eslint --no-inline-config over the 5 TypeScript files exit 0. (4) Tenant-audit census, base vs head per site via --json (new module mapped back to auth-manager.ts): 237 sites on both, 0 per-site differences in object, verb, tenancy, context and elevation, 0 unresolved and 0 unledgered on both, every total the same (the moved text holds no engine write), so neither census document is regenerated. (5) Anchors at base and at head, run by hand in the same built tree: check-adr-symbol-anchors (2,383 anchors, 466 symbol, same at both), check-adr-anchors (80 anchored files at both; number layer 52,096 citations across 6,621 files to 52,097 across 6,622; decision-letter layer 2,017 to 2,016, the ADR-0131 D7 shift in the summary), check-scripts-symbol-anchors (4,058), check-spec-docblock-symbol-anchors (5,071), check-system-context-census (148 elevation read sites), check-platform-checklist (16 areas, 329 items): all exit 0 at both. Anchor map before the cut: all 29 auth-manager.ts#symbol anchors outside changelogs are declaration-class at base, with the 7 bodies and 4 declarations blanked, and at head; none names a moved symbol, and the three that name a token the moved text also carries (#secondaryStorage ADR-0127, #AuthManager ADR-0135, #isPhoneOtpDeliverable identity-auth.json:1345) resolve on declarations that stay. No tested behaviour changed, so no ablation is owed.",
"gates": "Local subset at b2f9b26 after the full build: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 59 commands for the 5 paths; all 59 ran, each exit code captured before any pipe, all 59 exit 0; --ran: 59 derived, 59 run, 0 NOT-MEASURED. node scripts/pm/check-governed-merges.mjs --branch HEAD: NOT governed, 0 of 5 paths hit the register, 859 changed lines vs the 3,000-line human-merge line. CI on b2f9b26, the PR's check-runs read at report time (46): 34 success, 12 skipped, 0 failure, 0 pending; no legacy commit statuses. Skipped: Console Pin Gate, Temporal Conformance, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Build Docs (path filters), the opt-in 18.x upgrade harness and Packed-tarball smoke (twice each), and in the labeled run Check Changeset, Auto Label and Check PR Size. Success: Build Core; Test Core (1/6) to (6/6) and Test Core; TypeScript Type Check (Type Check · workspace, · source gates, · consumer gates, · debt ledger); Lint and Repo Gates (Lint · ESLint, · repo and tooling gates, · docs and code guards, · CI, release and engine gates, · PM dispatch-gates, · scoped · tooling self-tests, · scoped · query-options erasure, · scoped · slot lookup and corpus); Dogfood Regression Gate; Governed Surface Queue Guard; Check PR Size; Check Changeset; Auto Label; filter; Part-of PR must not also close its card; The card this PR closes must claim this branch; No other open PR may claim the same issue; No other open PR may claim the same single-writer path; Check Documentation Links; Flag docs affected by code changes. No Claude Approvals check runs on this PR. The PR was opened as a draft. origin/main has since moved to b22ab8d (14 commits past the base); of them only #25388 touches plugin-auth (auth-manager-actor-guards.ts, objectql-adapter.ts, last-admin-guard.ts and four suites), none of this cut's files; git merge-tree of origin/main with the head is clean, and on the merge of 5f6c2f1 with this cut check-dispatcher-error-vocabulary (56 found, 56 classified) and api-error-code.pin.test.ts pass. Docs Drift Check (advisory) comment 6359454458: 8 hand-written and 1 release-owned page (releases/v17/17-7.mdx), each reached through RATE_LIMIT_EXCEEDED (the value of PHONE_OTP_SEND_REFUSAL_CODE) or SMS_SERVICE_REQUIRED (in deliverPhoneOtp), literals the moved text carries unchanged; node scripts/docs-audit/affected-docs.mjs --json ca381a8 (exit 0) reads 7 and 1, the eighth (content/docs/api/wire-format.mdx) being one that #25328 gave a RATE_LIMIT_EXCEEDED mention on main after the base. No page restates a rule this move changes, so no doc edit is owed.",
"dogfood_battery": "n/a — no
!in the PR title and no (narrowing) arm","mcp_calls": "11 since this cut began, all reads, no write tool: pull_request_read get 3 (#25383), pull_request_read get_status 2 (#25383, #25395), issue_read get_comments 3 (#25224, for the landed note), list_pull_requests 1, search_pull_requests 1, pull_request_read get_check_runs 1 (#25395). (claude-code-remote subscribe_pr_activity once on #25395, not a GitHub write.)",
"api_writes": "3 relay acts this cut (scripts/pm/, each read back identical): 1) amended claim 6359424739 via post-stamped, run 39915198519, 9809 bytes; 2) pr_create #25395 via fleet-write, run 39915317366, 21655 bytes sent and stored, assignee os-sales, label skip-changeset; 3) this report via post-stamped. Plus git push of the branch (b2f9b26, a new branch after the queue deleted the old one on #25383's merge; not REST). No PR body edit. No other write.",
"open_questions": [],
"out_of_scope_findings": []
}
Generated by Claude Code