Repository navigation
test(plugin-auth): the last three #23184 test-budget rows (org-create-posture-gate, implicit-account-linking, dev-admin-seed-credential-gate) - #24626
Merged
objectstack-fleet[bot] merged 3 commits intoOct 19, 2026
Conversation
…at module top, pooled engine, one founder sign-up) Claude-Session: https://claude.ai/code/session_01LR1cD9JqgkeqY7k9rrZH8s Co-authored-by: Claude <noreply@anthropic.com>
…m one copied sign-up Claude-Session: https://claude.ai/code/session_01LR1cD9JqgkeqY7k9rrZH8s Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LR1cD9JqgkeqY7k9rrZH8s Co-authored-by: Claude <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
席位核对ACCEPT · #23184 ·
Generated by Claude Code |
objectstack-fleet
Bot
deleted the
claude/issue-23184-plugin-auth-test-budget
branch
October 19, 2026 17:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #23184
Clause-②: no
The three
@objectstack/plugin-authrows that were still open on #23184. Every other row on the card has landed (#23243, #23300, #23697, #23711, #23721, #23748), so this PR closes the card. Tests only: no source file, option or export changes, and nothing is published (skip-changeset).The readings (A1)
Each reading is the vitest module line (
✓ src/FILE.test.ts (N tests) MS), the number the hourly battery's per-file timing reads. Base and head ran interleaved, three rounds, underscripts/pm/os-verify-lock.sh, on a shared box. Base is the file atde4352460, run under a temporary name. Head is6c63f499e(the merge ofmainafter it touches none of these files).org-create-posture-gate.test.tsimplicit-account-linking.test.tsdev-admin-seed-credential-gate.test.tsThe projection scales the card's CI reading by head ÷ base. That is the card's own worst CI/local ratio applied to the head median (2.44, 3.39 and 2.26). No file declares a budget header: all three come in under the 10 s line.
Where the time went (per-case probe at base, scrypt calls counted and timed):
org-create-posture-gate: the slowest phase was per-test. 25 sign-ups each ran one production-parameter scrypt derivation under a fresh salt, 3.5 s of 4.9 s. The first case also loaded better-auth's vendor modules inside the clock, about 0.8 s.implicit-account-linking: also per-test. 14 sign-ups took 1.9 s of 3.8 s, and the first manager's vendor load took about 0.75 s.dev-admin-seed-credential-gate: per-test again. A sqlite boot (init()plus DDL for 30 objects, about 70 ms) ran in each of 15 cases. There were 12 derivations (1.8 s), and case ⓪ paid about 1.1 s of vendor load.CI readings (A2): NOT MEASURED. Two sources were tried. The
test-core-timings-K-of-6artifacts of the hourly runs (latest39265242003) and the Test Core job logs both redirect toproductionresultssa13.blob.core.windows.net, which answers 403 from this container. TheTest Corecheck-run annotations name only the slowest file of a package that is over its ceiling. The open refresh #24467 carries no per-file readings ("Regression readings: NOT MEASURED"). So the card's 2026-10-13 readings stay the CI numbers, and the pin is the next measured refresh's list.What changed
All three files: vendor modules load at module top.
AuthManagerreaches better-auth through a lazyawait import(), so the first case paid the vendor's module evaluation inside its clock. Side-effect imports at module top follow AGENTS.md ("clocked windows measure behaviour, never loading"). They copy the shapeadmin-impersonate-endpoint.test.tsalready uses, and each list is the set of modules a probe saw that file's managers load.NODE_ENV, which its env module keeps on first evaluation. Measured inside vitest: that module is already evaluated when the./auth-managerimport runs. It is reached via./objectql-adapter.js→better-auth/adapters. The vendor readsisTest() = true, isDevelopment() = false, even after a case setsNODE_ENV=development. So moving the rest of the load changes no captured value, anddev-admin-seed-credential-gategets the move too. An earlier note on this card said that could not happen; it does not hold.org-create-posture-gate: one founder sign-up per file. It goes through the real/sign-up/emailroute in abeforeAll, with both knobs unset.runGuidedWorkspaceCreationcopies its tables (structuredClone) onto each case's own engine, builds the case's own manager under the case's own env and tenancy service, and presents that sign-up's cookie. No case is about the sign-up: each one is about whatorganization/createand/auth/configanswer under a scenario. The two cases that sign up inline still do. Derivations: 25 → 3.implicit-account-linking: one sign-up per file, copied per case.signUpgives a case's first sign-up on a still-empty engine a copy of one real sign-up's tables, with the user row's address set to the case's own, and answers that sign-up's cookies. Two kinds of sign-up still run live, as before:secondaryStoragemanager, where the session goes to the cache.makeManagerrecords which engine a manager runs over. Derivations: 14 → 2.dev-admin-seed-credential-gate: pooled engine, scrypt memo. It reuses the landed__tests__/sqlite-engine-pool.testkit.ts: one booted engine per file, emptied before each case, refused if its schema changed or it holds an organization row. It also reuses__tests__/scrypt-memo.testkit.ts: a sign-in after the seed, and the second seed run, re-derive the same password against the same salt and are answered from the first derivation's bytes. Every fresh salt is still derived for real. Derivations: 12 → 9. Engine boots: 15 → 1.Every
it,describeandexpectline of the base files is present unchanged in the head, compared line by line:expect(linesit(linesdescribe(linesThe one added
expectasserts the shared sign-up's own 200, the same checksignUpalready made. In org-create,expect(cookie).not.toBe('')is the same line; it now reads the copied sign-up's cookie. The test lists match too: 25/25, 23/23 and 15/15 pass at both base and head.Equivalence and isolation (measured once, nothing kept)
implicit-account-linking: all 13 addresses, including theaccountLinkingopt-out manager. The copied tables equal a live sign-up of that address on that manager, andget-sessionwith the copied cookie answers 200 for that user and address.org-create-posture-gate: all 23 scenariosrunGuidedWorkspaceCreationruns. A sign-up under the scenario's own env and tenancy service gives the same tables beforeorganization/create, then the same status, body, three/auth/configflags and tables after it.row_N): 0 in all 36. So a copied table cannot collide with an id the case's engine assigns later.scripts/ablation-replace.mjs(anchor hit 1 → 0, blob changed, restored blob == HEAD,git diff HEADempty):structuredCloneinimplicit-account-linkingturns the file red: 12 failed / 23.sqlite-engine-pool.testkit.tsturnsdev-admin-seed-credential-gatered: 13 failed / 15.structuredCloneinorg-create-posture-gateleaves the file green (25/25). Its assertions readsys_organization, which each case's own engine creates, so a leak into the sign-up's tables is invisible to them. So isolation there was measured directly. A snapshot of the shared sign-up's tables taken after thebeforeAllis byte-identical after the last case with the copy, 4 rows before and after. Without the copy the snapshot changes: 4 → 15 rows. The same snapshot inimplicit-account-linkingis identical with the copy and changed without it.--sequence.shufflewith seeds 1, 2 and 3, all three files green (25/25, 23/23, 15/15). The verbose order shows different first cases per seed.Tests and gates, at head
54067dc35(after mergingmainat5a871e4e4)@objectstack/plugin-authtest files ran in 8 chunks withvitest run --maxWorkers=2, each under the lock. Every chunk exited 0 (VERDICT command-exit 0): 165/165 files passed, with 3165 tests passed and 10 skipped. The skips were already there at base.pnpm --filter @objectstack/plugin-auth run typecheckgaveVERDICT command-exit 0.check:test-typecheckreports OK and the debt ledger is unchanged (10 files / 88 errors / 23 signatures).tsc -p tsconfig.test.json --listFilesOnlylists all three files, and none of them is in the ledger.--no-inline-config): exit 0, no findings.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, with no paths, at54067dc35gave 55 commands. All 55 exited 0, each exit captured before any pipe.check:dual-build-cjs-loadsfirst exited 3 (PREREQUISITE NOT MET, no workspacedist/). It exited 0 when re-run after a fullturbo run build(77/77,VERDICT command-exit 0).dispatch-gates --ranreports 55 derived, 55 run, 0 NOT-MEASURED, 0 UNRUN.test:repowas not run locally (CI-owned; the diff touches no repo-project test).measure-test-shard-timings --self-testis not owed.Acceptance notes
org-create-posture-gate's assertions cannot see a write that leaks into tables its cases do not read. The copy holds by construction and by the snapshot above. This is an observation about the file's reach, not a defect.Generated by Claude Code