Skip to content

fix(plugin-auth)!: a locked account is refused on every door that ends in a session for it - #34139

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/locked-account-refused-on-every-sign-in-door
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/locked-account-refused-on-every-sign-in-door

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Clause-②: no (narrowing) — while an account's lock holds (ADR-0069 D2, lockoutThreshold on), every door that ends in a session for that account refuses it with the answer password sign-in gives under the deployment's lockoutRefusal, and every password door counts its refused attempts toward that one lock and checks it before the password.
Metadata-protocol: none
Skills-docs: none — no published skill teaches the account lockout or these sign-in doors (git grep -i over skills/ for lockout, ACCOUNT_LOCKED, locked_until, sign-in/phone-number, magic-link/verify and phone-number/verify: zero hits).

维护者速读

  • 改了什么:账号被锁定期间,任何最终会发出会话的登录入口都拒绝它:短信验证码、邮件登录链接、验证邮件后自动登录、无会话打开的改邮箱确认链接、双因素验证一步(TOTP / 一次性码 / 备用码)、经身份提供方登录(社交、通用 OAuth、ID Token、企业 SSO)、设备授权、手机号+密码;答复与邮箱密码登录在当前 lockoutRefusal 设置下一致。手机号+密码与邮箱密码一样计入失败次数、成功清零、在校验密码前先查锁。没有密码的账号也会被锁定拦住。
  • 为什么改:锁定规则(ADR-0069 D2)要求锁定的账号在每一扇会落成会话的门前都被拒,而不只是邮箱密码这一扇。
  • 风险与回滚:只影响处于锁定期的账号与手机号密码的失败计数;未锁定账号、已过期的锁、关闭锁定的部署都不变;管理员模拟登录、已登录用户凭其存储会话做的会话轮换(开双因素、改密码并踢掉其他会话)、服务端进程内的主体会话不受影响(改密码轮换已在 WebContainer 运行时下实测)。开启锁定时,每个携带会话凭据的认证请求多一次会话行读取。回滚即 revert 本 PR。
  • 先看:packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts(refuseLockedAccountSession、isNotASignIn、recordLockoutRequest)、sign-in-lockout-refusal.ts 的请求记录、auth-manager-before-hook.ts 的记录接线与手机门闸。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/locked-account-every-sign-in-door.test.ts,预期 70/70 通过。
  • 需要你做的:无,席位落地。

What changes

The rule: a locked account is refused on every door that ends in a session for that account, with the answer password sign-in gives under the deployment's lockoutRefusal; every password door counts its refused attempts toward the one lock and checks it before the password.

  • The check at session creation (auth-manager-sign-in-lockout.ts, refuseLockedAccountSession, composed into session.create.before, the one write every sign-in door ends in). While lockoutThreshold is on and the account's locked_until is still ahead, it refuses a new session and writes the account's login_failed row with the reason ACCOUNT_LOCKED. The counter is not moved. The doors this reaches: the SMS one-time code, the emailed sign-in link (both lanes), the verification link that signs the caller in, an address-change confirmation opened without a session, the second-factor routes (TOTP, one-time code, backup code), sign-in through an identity provider (social and generic-OAuth callbacks, the ID-token sign-in, enterprise SSO over OIDC and SAML; on a callback the refusal rides the provider door's error redirect with the same code), and the device grant.
  • What is not a sign-in, each exemption holding only when its condition is established, and judged a sign-in otherwise:
    • the server's in-process principal session: made outside any request, and carrying the token prefix only the mint writes;
    • an administrator's impersonation session: made on the impersonation route, with impersonatedBy naming the account whose live session of record made the request, which is not the impersonated account;
    • a new session for the account whose live session of record made the request (enrolling a second factor, a password change that ends the other sessions, an impersonating administrator's own rotation).
  • The request record. recordLockoutRequest, run by the global before-hook while the lockout is on, records the request's path and the account of the session of record it presents, read from the stored sys_session row its token names (unexpired) before the endpoint runs, never from a session cache or the request's own view. It is kept in the request state, which reaches the database hooks in every supported runtime, including the WebContainer runtime, where the endpoint context does not. The check reads the endpoint context when it reaches the hook and this record otherwise. The first record in a request stands.
  • The password doors (/sign-in/email, /sign-in/phone-number): each has its own gate before the credential check (admitSignInAttempt), which counts toward the account's one lock (reservation by compare-and-set, as before), refuses a locked account whatever password it is sent, and is settled by the after-hook (success resets the count). /sign-in/phone-number finds the account by an exact phone_number match, as better-auth does. At session creation a password door is admitted only on its gate's recorded admitted verdict for this account in this request, and refused when that verdict is absent. Under 'uniform' a locked account at a password door gets that door's own wrong-password answer (INVALID_EMAIL_OR_PASSWORD, INVALID_PHONE_NUMBER_OR_PASSWORD); under 'explicit', 403 ACCOUNT_LOCKED. The email door's session controls, last-login stamp and ban-cause step are unchanged and stay email-only.
  • sign-in-lockout-refusal.ts: lockedAccountRefusal is the one answer for both settings ('uniform': the vendor's code with the sentence read off its constant, held equal to the measured /sign-in/email answer by the pins), plus the request-record carrier.
  • packages/runtime/src/dispatcher-error-vocabulary.ts: one foreign-vocabulary row (shape objlit) for the vendor's INVALID_EMAIL_OR_PASSWORD stamped in sign-in-lockout-refusal.ts. No ledger entry and no packages/spec change.
  • Docs: content/docs/permissions/authentication.mdx states the rule and names every door and the accounts with no password; content/docs/kernel/runtime-services/audit-service.mdx says when a login_failed row is written.
  • Changeset .changeset/plugin-auth-locked-account-every-sign-in-door.md: fix(plugin-auth)!:, patch (plugin-auth, runtime), both declarations, ADR-0087 not-required (no-migration-prescription), and a rule-level BREAKING paragraph whose Now and Who moves name every door and population above.

Tests

src/locked-account-every-sign-in-door.test.ts (new, 70 cases): a real AuthManager through handleRequest, with twoFactor, phoneNumber, magicLink, admin and deviceAuthorization mounted, lockoutThreshold: 3, and the account's own locked_until. The reference answer is always measured: /sign-in/email for the same locked account in the same deployment.

  • Under both lockoutRefusal values, a locked account gets no session row and the reference answer at the SMS code, the sign-in link (both lanes), the verification link, /two-factor/verify-totp, /two-factor/verify-otp and /two-factor/verify-backup-code, the device grant and the address-change confirmation opened without a session (its address is not moved). An identity provider's callback redirects to the error with the reference code. Each refusal writes one login_failed row for that door with ACCOUNT_LOCKED, and an enrolled locked account gets no challenge at a code door.
  • /sign-in/phone-number: one answer whatever the password, no session; three wrong passwords lock the account and write account_locked; a correct password resets the count.
  • With no gate verdict recorded, a locked account gets no session at /sign-in/email, and an unlocked one still signs in.
  • Fail closed, one pin per exemption: a session made outside any request without the mint token, an impersonation mark without a session of record, the request's own view of a session, and a password door with no verdict are each refused, and an expired session presented by the same account exempts nothing.
  • Where no endpoint context reaches the database hooks (the WebContainer runtime, stood up by emptying the endpoint-context store for the request under test): the correct password on the attempt that reaches the threshold signs in and clears the count at both password doors; a locked, signed-in account's password change still ends its other sessions; a code door still refuses.
  • CONTROLS: an unlocked account and an expired lock sign in at every door; with the lockout off a stored lock is not read; password sign-in is unchanged; /sign-in/email counts and resets as before; the second-factor challenge, the OTP completion, the device grant, an identity-provider sign-in and the address-change confirmation work for an unlocked account; impersonation of a locked account, a locked administrator's own rotation, change-password with revokeOtherSessions and the in-process principal session all keep working.
Readings (head 4d27b2c)
  • pnpm --filter @objectstack/plugin-auth test: Test Files 278 passed (278), Tests 5594 passed, 10 skipped. The new file is 70 of 70 in that run.
  • pnpm --filter @objectstack/plugin-auth typecheck: exit 0. pnpm --filter @objectstack/runtime typecheck: exit 0.
  • Runtime ledger suites (error-envelope.conformance, http-dispatcher.error-leak, package-door-error-parity, actions-validation-envelope): 4 files, 70 tests passed.
  • Red before, green after, for the runtime without endpoint context: with the three source files taken from 4eadd3d and this head's tests, 3 of 70 fail (both password doors' threshold-reaching sign-in, and the password change), and 70 of 70 pass on this head.
  • Ablations, one at a time through scripts/ablation-replace.mjs. The subject resolves from src/, so no rebuild is involved. Each mutation landed by anchor count and blob hash, and was restored with the blob equal to HEAD and git diff HEAD empty.
    • session-creation check removed: 35 of 70 fail, among them the backup-code, OTP, device-grant, identity-provider and address-change pins; restored, green.
    • phone-door gate removed: 4 fail; restored, green.
    • phone-door settlement removed: 3 fail; restored, green.
    • password-door verdict check replaced by an admit: 3 fail (the two no-verdict pins and the unit pin); restored, green.
    • outside-any-request exemption widened to admit: 1 fails; restored, green.
    • impersonation mark accepted without a session of record: 1 fails; restored, green.
    • the request's own view of its session accepted as the holder: 1 fails; restored, green.
    • the session-of-record read removed: 4 fail (impersonation, the administrator's rotation, the password change, in both runtimes); restored, green.
    • the recorded path ignored where no endpoint context reaches the hook: 3 fail; restored, green.
  • Dogfood battery, pnpm --filter @objectstack/dogfood test under the verify lock on 4d27b2c: VERDICT command-exit 0, Test Files 467 passed, 3 skipped (470), Tests 3962 passed, 42 skipped (4004), no failure.

Acceptance notes

  • The ID-token sign-in and the enterprise SSO callbacks have no pin of their own. They end in the same session write, and the identity-provider callback pin covers the shared callback path. Pinning them needs a signed ID token against a provider key set, and a registered SSO provider with discovery, which is more than this change carries.
  • Where a password door's session is refused at session creation instead of by its gate (no gate verdict recorded), the answer and the login_failed reason are the general ones, not always that door's own. Accepted: that path is reached only when the gate did not record a verdict.
  • The session-of-record read takes the bearer credential before the session cookie, which is not the vendor's order in every case. Where they differ, the exemption is not established and the check fails closed. Accepted.
  • check:skill-examples and check:dual-build-cjs-loads answered PREREQUISITE NOT MET locally (exit 3; they read client package builds this worktree does not hold), and check:type-check-debt exited 3 under shared-box load. All three are NOT MEASURED here and are read from CI.

Verification

node scripts/pm/dispatch-gates.mjs --commands derived 108 families for 4d27b2c, and all were run locally. The --ran reconciliation with recorded exit codes: 108 accounted, 105 exit 0, 3 NOT MEASURED (named above), 0 unrun. The seat reads the CI check-runs.


Generated by Claude Code

… in a session for it

ADR-0069 D2: a session for a locked account is refused at session
creation with the answer password sign-in gives under the deployment's
lockoutRefusal, and the refused attempt writes its login_failed row.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…hecks the lock before its credential

ADR-0069 D2: /sign-in/phone-number counts its refused attempts toward the
account's lock, resets the count on success, and refuses a locked account
before its credential is checked, with that door's own wrong-password
answer under lockoutRefusal 'uniform'. Tests pin the rule on every door.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…ngeset and the second-factor backup-code pin

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
… the dispatcher vocabulary ledger

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-auth, @objectstack/runtime, touching 32 documentable anchor(s).

3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/self-hosting.mdx (via INVALID_EMAIL_OR_PASSWORD (literal, a string literal in UNREGISTERED_CODE_SITES; a string literal in lockedAccountRefusal))
  • content/docs/kernel/runtime-services/audit-service.mdx (via ACCOUNT_LOCKED (literal, a string literal in admitSignInAttempt; a string literal in lockedAccountRefusal; a string literal in refuseLockedAccountSession), INVALID_EMAIL_OR_PASSWORD (literal, a string literal in UNREGISTERED_CODE_SITES; a string literal in lockedAccountRefusal), locked_until (literal, a string literal in LOCKED_ACCOUNT_ROW_FIELDS; a string literal in settleSignInAttempt))
  • content/docs/permissions/authentication.mdx (via INVALID_EMAIL_OR_PASSWORD (literal, a string literal in UNREGISTERED_CODE_SITES; a string literal in lockedAccountRefusal))
What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: sys_user (literal, 55 pages)
  • 7 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 43 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json aab8b3188a9c7804d6f5164141576c1b856de082 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 3348a16451e71601e5190ffa28dc99738ef5f0ca — the merge of head 4d27b2c90137d087fa2a1abc0f546a74b141645a into base aab8b3188a9c7804d6f5164141576c1b856de082, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3348a16451e71601e5190ffa28dc99738ef5f0ca && git checkout 3348a16451e71601e5190ffa28dc99738ef5f0ca
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin aab8b3188a9c7804d6f5164141576c1b856de082 4d27b2c90137d087fa2a1abc0f546a74b141645a && git checkout -B drift-repro aab8b3188a9c7804d6f5164141576c1b856de082 && git merge --no-ff 4d27b2c90137d087fa2a1abc0f546a74b141645a

node scripts/docs-audit/affected-docs.mjs --json aab8b3188a9c7804d6f5164141576c1b856de082

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs aab8b3188a9c7804d6f5164141576c1b856de082 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (the maintainer routes contract-tier reviews to the review seat, 2026-11-15T21:34Z) · head 6617ff7

@objectstack-fleet objectstack-fleet Bot added the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 6617ff7 · 2026-11-15T21:37Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6617ff70f2334e704b5df6b1c600261223cc4c6e
Local-runs: none
Scope: .changeset/plugin-auth-locked-account-every-sign-in-door.md, content/docs/permissions/authentication.mdx, packages/plugins/plugin-auth/src/auth-manager-after-hook.ts, packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/auth-manager-database-hooks.ts, packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/locked-account-every-sign-in-door.test.ts, packages/plugins/plugin-auth/src/sign-in-lockout-refusal.ts, packages/runtime/src/dispatcher-error-vocabulary.ts + none

Read at 2026-11-15T21:49Z. First review of this head; claim: comment 6901766329; lane request 6901751579 on mailbox #33873. Independence: implemented and dispatched by security#1 (sunhaolin); reviewed by os-tesla.

This record stays at the rule layer on purpose (public repository, account lockout). Anything that would describe how a rule could be missed is in the seat's private notes and is not repeated here.

① Derived judgments

Read, not run: the diff against merge base f81e4b6c, the head tree by git show, the PR body and comments, the head's check-runs, and the vendor at the version the lockfile pins (better-auth, @better-auth/core, @better-auth/sso, @better-auth/oauth-provider, @better-auth/scim, all 1.7.12; lockfile and plugin-auth/package.json agree).

The rule under review: while an account's lock holds, every door that ends in a session for it refuses it with the answer password sign-in gives under lockoutRefusal; every password door counts toward the one lock and checks it before the password.

  • One write, one check. Every vendor path that makes a session goes through the one internal session-creation call, and that call hands session.create.before the endpoint context of the request it serves. plugin-auth has three session-creating sites of its own (impersonation, the impersonating administrator's rotation, the principal mint); all three use the same call. The oauth-provider and scim packages create no session. So composing the refusal into session.create.before is the right seam, and it sits after the row read that already refuses on a read fault.
  • Door census. Reached by the new check and refused for a locked account: SMS one-time code, emailed sign-in link (both lanes), verification link that signs in, address-change confirmation opened without a session, every second-factor verify route, social and generic-OAuth callbacks and the id-token sign-in, enterprise SSO callbacks (OIDC and SAML), the device grant. Left to the password gate: email and password, phone number and password. Never a locked account: sign-up. Not a new session: session refresh, the one-time-token handoff of an existing session. Not mounted in this package: username, passkey, email-OTP, anonymous, SIWE, one-tap, multi-session, API-key plugins.
  • Exemptions. Impersonation: the mark is written only by the two administrator-gated sites; no door copies caller input into it. Own session: the comparison is against the session the request resolved, and only for the same account; a caller with no session cannot reach it. Whether all three are scoped tightly enough is graded in S1 and N1.
  • The answer. lockedAccountRefusal is the single constructor for both settings; 'explicit' is the same status, code and sentence the gate throws, 'uniform' is built from the vendor's own constant. At a code or link door the refusal is only ever given after the door's own credential passed, so a caller without a valid credential gets that door's ordinary answer whether or not the account is locked: no account-existence or lock-state answer is added beyond what password sign-in already gives a holder of the correct password. At redirect doors the same code rides the door's error redirect.
  • Phone and password against email and password. Same reservation, same compare-and-set counter, same lock stamp, same reset on success, same verifier wrapper for the uniform refusal (the vendor's phone door verifies through the wrapped verifier), gate before the vendor's credential check. The account lookup is an exact match on the column the vendor matches. The early return added to the before-hook for the phone path skips nothing that applied to it. Session controls and last-login stamp remain email-only, as declared.
  • Newly refused beyond locked accounts. None found: the check returns unless lockoutThreshold is on and the stored lock is still ahead; an expired lock and a deployment with the lockout off are untouched.
  • Head does not compile. See M1.

② Semver level

Clause-②: no (narrowing) and Metadata-protocol: none are present, line-initial, in both the PR body and the changeset; fix(plugin-auth)!: carrier, a BREAKING paragraph, and one ADR-0087 marker not-required (no-migration-prescription), which fits: nothing an author can write is removed or renamed, so there is no FROM to TO mapping to carry. patch on @objectstack/plugin-auth and @objectstack/runtime is the level AGENTS.md prescribes for a non-protocol breaking change. The remedy is stated (the Unlock action). The declaration is under-stated in who moves: S3.

CI on this head (61 check-runs): 32 success, 21 skipped, 2 failure (Type Check · workspace, and TypeScript Type Check which reports that lane), 1 cancelled (Check Changeset, superseded by a newer run of the same automation, so its verdict on the changeset is not in hand), 5 in progress (Test Core shards 2, 3, 5, 7 and 8 of 8). This is a FAIL, so there is nothing for the seat to wait on; the next head needs a full green read including Check Changeset.

③ Boundary flags

  • No packages/spec change, no schema, no governed path in the diff. ADR-0069 is cited, not edited; its D2 seam cell still names only /sign-in/email. The published docs on main already say a lock refuses every sign-in that resolves to the account, so the narrowing makes a published refusal real and takes no declared capability away.
  • The rule as worded is about new sessions. Live sessions, OAuth tokens and API keys of a locked account are outside it and unchanged; ADR-0069's seam list names locked-account rejection on the session-validation path, which nothing here rules on.
  • packages/runtime is moved only by a ledger row; that row is what breaks the build (M1).
  • The PR body's local readings were taken for plugin-auth at the commit before the last one, and the last commit is the one that reds the runtime type check.

④ Design judgment

The narrowing holds against the published rule, by construction rather than by a list of doors, and the choice to keep password doors on their own gate is what preserves each door's own wrong-password answer under 'uniform'. The pins are real requests through handleRequest with a measured reference answer and controls for each exemption, an unlocked account, an expired lock and the lockout off.

M1 (must-fix) — the head does not type-check. packages/runtime/src/dispatcher-error-vocabulary.ts:552 writes shape: 'apierrorarg', and CodeStampShape in the same file has no such member; CI says exactly that (Type '"apierrorarg"' is not assignable to type 'CodeStampShape', packages/runtime typecheck exit 2), and the tree agrees. It is the only row in the table with that shape.

S1 (should-fix) — the rule is not kept on every door that ends in a session in every configuration this repo supports: one of the three exemptions is not scoped tightly enough, and where it is uncertain it degrades toward admitting rather than refusing. Detail is in the seat's notes.

S2 (should-fix) — on the two password doors the rule is held by the gate alone. Gate and session-creation check are two rules that agree today rather than one rule. Tie the session-creation check's treatment of those doors to the gate's recorded verdict for that account. Detail is in the seat's notes.

S3 (should-fix) — the declaration under-states who moves. The tree also refuses a locked account at external-identity sign-in (social, generic OAuth, enterprise SSO), at the device grant and at an address-change confirmation opened without a session; the changeset's Now and Who moves name none of them, and say nothing of accounts that have no password, which the lock now reaches on doors that never took one. None of those doors has a pin; the second-factor OTP route shares the pinned code path but is not itself pinned. Name the populations in the changeset and the docs sentence, and add a pin with its control for at least one external-identity door and the device grant.

S4 (should-fix) — content/docs/kernel/runtime-services/audit-service.mdx states when a login_failed row is written (a password sign-in that named an account, or an IP allow-list refusal). This diff writes that row, with the lock as its reason, at code, link, second-factor and external-identity doors too. The docs-drift check listed the page; it is untouched.

N1 (nit) — one exemption reads the request's own view of the caller's session rather than the session of record, and the two can differ. Detail is in the seat's notes.

N2 (nit) — the backup-code pin's ablation is declared NOT MEASURED; take it with the next head.

Implemented-by: claude/locked-account-refused-on-every-sign-in-door
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: FAIL

…d door's session follows its gate's verdict

ADR-0069 D2: a new session for a locked account is exempt only when its
condition is established - the in-process principal mint, an impersonation
naming the requester's live session of record, or the requester's own
session of record read before the endpoint runs. On a password door the
session is admitted only on that door's own gate verdict. The uniform
refusal is stamped as an object literal and classified in the runtime
ledger; docs and changeset name every door the rule reaches.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 15, 2026
…rovider's callback and the second-factor OTP step, and every exemption failing closed

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 4eadd3d · 2026-11-15T23:01Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Note for the delta on 4eadd3d00d (claimed): this is the implementer's patch round for record 6901922014. CI on this head: 38 success, 15 skipped, 0 failed. The implementer has not reported yet: its gates and the dogfood battery may still be running, and the PR body has not been brought to this head. The seat posts the replacement body with this head's readings when that report lands. Until then, the round's commits are the record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4eadd3d00dee930e1717ad0fef62a0932831dc47
Local-runs: none
Scope: .changeset/plugin-auth-locked-account-every-sign-in-door.md, content/docs/kernel/runtime-services/audit-service.mdx, content/docs/permissions/authentication.mdx, packages/plugins/plugin-auth/src/auth-manager-after-hook.ts, packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/auth-manager-database-hooks.ts, packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/locked-account-every-sign-in-door.test.ts, packages/plugins/plugin-auth/src/sign-in-lockout-refusal.ts, packages/runtime/src/dispatcher-error-vocabulary.ts + none

Read at 2026-11-15T23:12Z. Delta review of this head against FAIL 6901922014 at 6617ff7; claim: comment 6902833532; taken on patrol as owed. Independence: implemented and dispatched by security#1 (sunhaolin); reviewed by os-tesla.

This record stays at the rule layer on purpose (public repository, account lockout). Anything that would describe how a rule could be missed is in the seat's private notes and is not repeated here.

① Derived judgments

Read, not run: the delta 6617ff70..4eadd3d0 (commits 49d4fbb4 and 4eadd3d0), the whole diff against merge base f81e4b6c, the head tree by git show, the PR body and comments, the head's check-runs, and the vendor at the pinned version (better-auth, @better-auth/core, @better-auth/sso 1.7.12).

The rule under review is unchanged: while an account's lock holds, every door that ends in a session for it refuses it with the answer password sign-in gives under lockoutRefusal; every password door counts toward the one lock and checks it before the password.

The prior record's findings, by id:

  • M1: closed.
    The ledger row's shape is a member of CodeStampShape, the stamp in sign-in-lockout-refusal.ts is written in that shape, and both type-check lanes are green on this head.
  • S1: closed.
    Each of the three exemptions now holds only when its own condition is positively established, and a condition that cannot be established is judged a sign-in. That is true in every supported configuration I could read. The correction over-reaches in one of them: see S5.
  • S2: closed.
    At a password door the session-creation check admits only on that door's gate verdict admitted, recorded in this request for this account and this identifier, and refuses when the verdict is absent. The two rules are now one. Pinned both ways: a request with no verdict recorded gets no session under either setting, with its unlocked control; and the existing cases that sign in with the correct password on the attempt that reaches the threshold hold the admitted branch. By read, each goes red if its branch is removed.
  • S3: closed.
    The changeset's Now and Who moves, and the docs sentence, name every door the tree reaches: one-time code, sign-in link, verification link, address-change confirmation opened without a session, the three second-factor routes, identity-provider sign-in (social, generic OAuth, ID token, enterprise SSO), the device grant and the phone-number password door, and they say the lock reaches an account that has no password. The remedy is stated (Unlock). Pins with controls were added for the device grant, an identity-provider callback and the second-factor OTP route. What is still unpinned is N3; what the PR body still says is N4.
  • S4: closed.
    audit-service.mdx now states that a login_failed row is also written, with the lock as its reason, at every other door that ends in a session, and that the password doors are email and phone number.
  • N1: closed.
    The own-session exemption is decided from the stored session row the request's token names, read before the endpoint runs and required to be unexpired; the request's own view of its session is no longer consulted. A unit pin holds that, and by read it goes red on reverting.
  • N2: open, unchanged.
    The body still declares the backup-code pin's ablation NOT MEASURED. Carried in N4.

New on this head:

  • Newly refused beyond locked accounts. Outside S5, none found: the session-creation check returns before any new logic unless lockoutThreshold is on and the stored lock is still ahead, the new before-hook read never throws and records nothing on a fault, and an unlocked account, an expired lock and a deployment with the lockout off are untouched (controls for each stand). In one supported configuration there is one: S5.
  • Exemption controls. Impersonation of a locked account, a locked administrator's own rotation, a locked signed-in account's password change that ends its other sessions, and the in-process principal session are each still exercised through a real request and still pass by read, now on the stored session of record.
  • The uniform answer. lockedAccountRefusal builds the vendor's code and sentence as an object literal; the pins compare status, code and sentence against the measured /sign-in/email answer, so a vendor rename turns them red.

② Semver level

Clause-②: no (narrowing) and Metadata-protocol: none are present, line-initial, in both the PR body and the changeset; fix(plugin-auth)!: carrier, a BREAKING paragraph, one ADR-0087 marker not-required (no-migration-prescription), patch on @objectstack/plugin-auth and @objectstack/runtime. All as judged before, and the changeset's account of who moves is now complete (S3).

CI on this head, complete: 53 check-runs, 38 success, 15 skipped, none failing, none running. Type Check · workspace, TypeScript Type Check and Check Changeset are all success. Nothing for the seat to wait on from CI.

③ Boundary flags

  • No packages/spec change, no schema, no governed path in the diff. packages/runtime is moved only by the one ledger row.
  • While the lockout is on, every auth request that presents a session token now pays one more read of its session row, before the endpoint runs. With the lockout off nothing is read.
  • The lock is placed by refused password attempts and now holds at doors that never took a password, for accounts that have none. That is declared in the changeset and the docs. Whether an account with no password should be countable at a password door is a security-lane decision this record does not make.
  • As before: live sessions, OAuth tokens and API keys of a locked account are outside the rule as worded and unchanged.

④ Design judgment

The narrowing holds against the published rule, and the delta makes it hold by positive evidence rather than by absence: an exemption is something the request proves, and a password door's session follows the one verdict its gate recorded. The docs on main already promised the refusal; this makes it real and takes no declared capability away. The pins added are real requests with measured reference answers and a control beside each.

No must-fix.

S5 (should-fix) — continues S1 and S2. In one supported configuration the corrected check cannot see what it needs to tell a password sign-in its gate admitted from any other new session, and it refuses: an account the gate admitted, presenting the correct password, can be refused at session creation, and that refusal is then settled as a refused credential rather than handed back. The same configuration also refuses, for a locked account, the cases the changeset lists as unchanged. This was introduced by 49d4fbb4; the head before it admitted there. Read from the tree's own notes on that configuration, not measured. The request-scoped record the gate and the new before-hook write is available there, so the check can consult it before refusing; a pin belongs with the fix. Bounded as S1 was, and graded as S1 was; the seat may regrade. Detail is in the seat's notes.

N3 (nit) — continues S3. Three declared doors have no pin of their own: the address-change confirmation opened without a session, the ID-token sign-in, and the enterprise SSO callbacks. All three end in the one write the check is composed into, and the last two share the pinned callback's code path, so the rule holds by construction; a later vendor move would not be caught at those doors.

N4 (nit) — continues N2. The PR body predates 49d4fbb4: its readings block names 6617ff70 and 44 cases, the backup-code ablation is still NOT MEASURED, no ablation reading is given for any pin added since, its quick-read lists fewer doors than the changeset, and its account of the exemptions and of the password doors is the previous head's. By read each new pin goes red when its branch is removed; the body should say so from a measurement, and describe this head.

N5 (nit) — where a password door's session is refused at session creation rather than by its gate, the answer and the reason its login_failed row records are the general ones and not, in every case, that door's own. Detail is in the seat's notes.

N6 (nit) — the read of the session of record chooses among presented credentials in an order of its own, which is not the vendor's in every case. Where they differ the exemption is not established, so it fails closed. Detail is in the seat's notes.

N7 (nit) — auth-manager-sign-in-lockout.ts spells a route constant that a sibling module already exports; import it so the two cannot part.

Implemented-by: claude/locked-account-refused-on-every-sign-in-door
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: PASS

…its recorded path and session of record where no endpoint context reaches the hook

ADR-0069 D2: the before-hook records the request's path beside the account
of the session of record it presents, in the request state, and the
session-creation check reads that record where the endpoint context does not
reach the database hooks. A password door is then still admitted on its
gate's verdict, and the exemptions still hold, while every other door still
refuses. Pins for that runtime shape and for the address-change confirmation
opened without a session.

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 4d27b2c · 2026-11-16T01:02Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Note for the delta on 4d27b2c901 (claimed): this is round 3 for your PASS 6902971818 (S5 should-fix, N3–N7). The implementer has not reported yet, so the PR body has not been brought to this head. The seat posts the replacement body with this head's readings when that report lands. Until then, the round's commits are the record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4d27b2c90137d087fa2a1abc0f546a74b141645a
Local-runs: none
Scope: .changeset/plugin-auth-locked-account-every-sign-in-door.md, content/docs/kernel/runtime-services/audit-service.mdx, content/docs/permissions/authentication.mdx, packages/plugins/plugin-auth/src/auth-manager-after-hook.ts, packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/auth-manager-database-hooks.ts, packages/plugins/plugin-auth/src/auth-manager-sign-in-lockout.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/locked-account-every-sign-in-door.test.ts, packages/plugins/plugin-auth/src/sign-in-lockout-refusal.ts, packages/runtime/src/dispatcher-error-vocabulary.ts + none

Read at 2026-11-16T01:10Z. Delta review of this head against PASS 6902971818 at 4eadd3d; claim: comment 6904437749; no lane request (owed per check-owed-reviews). Independence: implemented for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it.

This record stays at the rule layer on purpose (public repository, account lockout). Anything that would describe how a rule could be missed is in the seat's private notes and is not repeated here.

① Derived judgments

Read, not run: the delta 4eadd3d0..4d27b2c9 (commits c3b89943 and 4d27b2c9, both in full; no merge from main between them), the whole diff against merge base f81e4b6c, the head tree by git show, the PR body and comments, the head's check-runs, and the vendor at the pinned version (better-auth and @better-auth/core 1.7.12).

The rule under review is unchanged: while an account's lock holds, every door that ends in a session for it refuses it with the answer password sign-in gives under lockoutRefusal; every password door counts toward the one lock and checks it before the password.

What the delta does: the global before-hook now records, in the request's own state, what the request is (its path, and the account whose stored, unexpired session it presents), and the check at session creation judges the request by its endpoint context where that reaches it and by that record where it does not. 4d27b2c9 only puts back the gate-verdict carrier that c3b89943 dropped while rewriting its neighbour; against 4eadd3d0 that carrier is unchanged.

The prior record's findings, by id:

  • M1: closed, as before. Both type-check lanes are green on this head.
  • S1: closed, and it stays closed.
    Every exemption is still something the request positively establishes. A session made with neither an endpoint context nor a request record is exempt only as the in-process principal session; with a record and no endpoint context, the same three conditions are judged on the record. A request whose record was never written establishes nothing and is judged a sign-in.
  • S2: closed, and it stays closed.
    A password door's session is admitted only on that door's gate verdict admitted, recorded in this request for this account. Where the endpoint context reaches the check, the identifier is compared as before; where it does not, the verdict's account and the request it was recorded in bind it. The pin for an absent verdict and its control stand.
  • S3: closed, as before.
  • S4: closed, as before.
  • S5: closed.
    In the configuration S5 named, a password sign-in its gate admitted now gets its session, and the attempt is settled as a success. Pinned on both password doors with the correct password on the attempt that reaches the threshold: status, one more session row, and the count cleared. The locked, signed-in account's own password change that ends its other sessions passes there too, pinned. The control stands beside them: in the same configuration a one-time-code door still refuses a locked account, under both lockoutRefusal settings, with the measured password-door answer and no session row. By read each of the three passing cases is red at 4eadd3d0, and the way the test stands the configuration up does take the endpoint context away from the session hook at the pinned vendor version.
  • N1: closed, as before.
  • N2: open. Continued in N2 below.
  • N3: changed. The address-change confirmation opened without a session now has its pin, under both settings, with an unlocked control, and it also holds that the address is not moved. Two doors remain: N1 below.
  • N4: open, and further behind. N2 below.
  • N5: open, unchanged. N3 below.
  • N6: open, unchanged. N4 below.
  • N7: closed. The route constant is imported from the module that owns it.

Judged for this delta in particular:

  • Does the lock go unjudged on any door. Not found. Where the endpoint context reaches the check, which is every door of the production runtime, the decision is the one 4eadd3d0 made, input for input: the path is the endpoint's own, and the session of record comes from the same read. Only a session made without an endpoint context is judged differently than before, and there the check admits nothing it could not admit under the rule's own three exemptions and the gate's own verdict; whatever cannot be established is still refused.
  • Per-request state. The delta adds no module-level or process-level state. The request record and the gate verdict are two slots of the vendor's request state, opened fresh for each request; on the production runtime that state is local to the request by construction. In the one configuration whose request state is documented by the tree as single-flight, the new record is exactly as request-local as the existing verdict carrier, no more and no less: N5.
  • Newly refused beyond locked accounts. None found: the check still returns before any new logic unless lockoutThreshold is on and the stored lock is still ahead, and the before-hook's record never throws.

② Semver level

Clause-②: no (narrowing) and Metadata-protocol: none are present, line-initial, in both the PR body and the changeset; fix(plugin-auth)!: carrier, a BREAKING paragraph, one ADR-0087 marker not-required (no-migration-prescription), patch on @objectstack/plugin-auth and @objectstack/runtime. The delta touches neither the changeset nor the docs, and nothing in it changes who moves.

CI on this head, complete: 53 check-runs, 38 success, 15 skipped, none failing, none running. Type Check · workspace, TypeScript Type Check, Check Changeset and all eight Test Core shards are success. Nothing for the seat to wait on from CI.

③ Boundary flags

  • No packages/spec change, no schema, no governed path in the diff. The delta is four files of packages/plugins/plugin-auth/src.
  • While the lockout is on, every auth request now writes one small record into its own request state, and one that presents a session token still pays the one read of its session row. With the lockout off nothing is read or written.
  • As before: the lock is placed by refused password attempts and holds at doors that never took a password, for accounts that have none; declared, and a security-lane decision this record does not make. Live sessions, OAuth tokens and API keys of a locked account are outside the rule as worded and unchanged.

④ Design judgment

The narrowing holds against the published rule, and this delta removes the one place where the correction over-reached without loosening it anywhere else: the request is described once, before the endpoint runs, and the check reads that description when the endpoint's own does not reach it. An exemption is still something the request proves, never something inferred from what is missing. The docs on main already promised the refusal; this makes it real and takes no declared capability away.

No must-fix, no should-fix.

N1 (nit) — continues N3. Two declared doors still have no pin of their own: the ID-token sign-in and the enterprise SSO callbacks. Both end in the one write the check is composed into and share the pinned callback's code path, so the rule holds by construction; a later vendor move would not be caught at those doors.

N2 (nit) — continues N4 and N2. The PR body is now four commits behind: its readings block names 6617ff70 and 44 cases, the backup-code ablation is still NOT MEASURED, no reading is given for any pin added since, its quick-read lists fewer doors than the changeset, and its account of the exemptions and of the password doors is that of the first head. It should describe this head, from a measurement.

N3 (nit) — continues N5, unchanged. Where a password door's session is refused at session creation rather than by its gate, the answer and the reason its login_failed row records are the general ones and not, in every case, that door's own. Detail is in the seat's notes.

N4 (nit) — continues N6, unchanged. The read of the session of record chooses among presented credentials in an order of its own, which is not the vendor's in every case. Where they differ the exemption is not established, so it fails closed. Detail is in the seat's notes.

N5 (nit) — new, continues S5. In the configuration S5 named, the pins cover the two password doors, one own-session rotation and one refusing door; the administrator's impersonation and the second-factor enrolment are held there by read only, on the branch the pinned cases share. That configuration's request state is the one the tree already documents as single-flight, so the record this delta adds inherits that caveat together with the verdict carrier it sits beside; a sentence saying so beside the record would keep the next reader from assuming more. Detail is in the seat's notes.

Implemented-by: claude/locked-account-refused-on-every-sign-in-door
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot removed the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

席位核对

ACCEPT at Head-sha: 4d27b2c90137d087fa2a1abc0f546a74b141645a (2026-11-16T01:23Z).

  • Shape:
    • No-card order from the security#1 seat.
    • +1361 / −45. Not governed.
    • Clause-②: no (narrowing), BREAKING; patch on @objectstack/plugin-auth and @objectstack/runtime (one vocabulary ledger row); ADR-0087 marker not-required (no-migration-prescription); Metadata-protocol: none.
  • Rule: while an account's lock holds, every door that ends in a session for it refuses it, with the answer password sign-in gives under lockoutRefusal. Every password door counts toward the one lock and checks it before the credential.
    • The doors that end in a session are one-time code, sign-in link, verification link, address-change confirmation opened without a session, the second-factor routes, identity-provider sign-in, the device grant, and the phone-number and email password doors.
    • Every exemption fails closed.
  • Gates:
    • CI on this head: 39 success, 17 skipped, 0 failed.
    • Locally: plugin-auth Tests 5594 passed | 10 skipped (the rule file is 70/70); plugin-auth and runtime typecheck OK; 105 of 108 derived families exit 0. The 3 NOT MEASURED have exit 3 (prerequisite or shared-box load), and CI carries them.
    • Ablations of every arm went red and were restored. The configuration-specific case was red before the fix and green after it.
    • Dogfood battery on this head: Tests 3962 passed | 42 skipped (4004), no failures.
  • Review: review#2 at CONTRACT_REVIEW_TIER.
    • FAIL 6901922014.
    • Delta PASS 6902971818 with S5 should-fix.
    • Delta PASS 6904558413 on this head, with no must-fix and no should-fix. Its N2 (body behind the head) is answered by the body now posted for this head.
  • Accepted deviations (nits, final round):
    • The ID-token sign-in and the enterprise SSO callbacks have no pin of their own; they share the pinned callback path.
    • Where a password door is refused at session creation, the answer and the audit reason are the general ones.
    • The session-of-record read orders credentials its own way, and it fails closed where that differs.
    • The configuration-specific request record inherits the documented single-flight caveat.
  • Residual, not in this rule: the concurrent-session cap and the last-login stamp are applied at the email password door only. This is recorded privately for the security lane.
  • Landing: through the merge queue, by the seat.

Implemented-by: os-dev (security#1 order, session_017xRBcT1w3zpekijraHJE4f) · Reviewed-by: review#2 (session_01L9qibxTeW8xHnxoHxWNHWW).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 01:23
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43786160491 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (2/8) — 失败步骤: Run this shard's tests

    @objectstack/spec:test:repo:  FAIL   repo  scripts/root-index.test.ts > content/docs/references/index.mdx (the committed page) > states no count that its own rows contradict
      ↳ 失败原因: @objectstack/spec:test:repo: AssertionError: expected [ 218, 1663 ] to deeply equal [ 218, 1664 ]
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 10 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43788207778 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (2/8) — 失败步骤: Run this shard's tests

    @objectstack/spec:test:      ✓ inverts the card's measured control: the three bogus keys now FAIL parse instead of adding zero warnings  382ms
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/spec:test:repo:  FAIL   repo  scripts/root-index.test.ts > content/docs/references/index.mdx (the committed page) > states no count that its own rows contradict
      ↳ 失败原因: @objectstack/spec:test:repo: AssertionError: expected [ 218, 1663 ] to deeply equal [ 218, 1664 ]
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 13 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Merged via the queue into main with commit e735892 Nov 16, 2026
61 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/locked-account-refused-on-every-sign-in-door branch November 16, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants