Commit 450e73b
fix(plugin-auth): report the zero-account boot dead end at kernel:ready (#14866)
* feat(plugin-auth): report the zero-account boot dead end at kernel:ready
A deployment with human `sys_user` rows and zero `sys_account` rows cannot be
recovered from inside: nobody can sign in, the bootstrap carve-out counts
humans and so does not open, `invite_only` refuses self-registration, and no
administrator exists to invite anyone. Today it boots silently.
Reports it at `kernel:ready`, at `error` level, naming both the consequence
and the remedy. Extends the existing walled-owner reporter family rather than
opening a parallel one: same hook, and the bounded human-population page is
read ONCE and shared with `probeWalledOwnerAccountState`, which now accepts
the already-known answer. At most one report per boot — the error subsumes
the walled-owner warning when a deployment matches both shapes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* test(plugin-auth): pin the zero-account boot report, its controls and its independence
Pins the dead-end shape, all four silent controls, the error level with its
`warn` fallback, the boot wiring, independence from each of the walled-owner
probe's four preconditions, the one-report-per-boot precedence, and that
`sys_user` is paged exactly once per boot.
Measured while writing this: breaking the declared-owner precondition alone
is an unreachable boot — a walled posture with no declared owner refuses
startup in `init()` (#11184) — so the reachable no-owner shape is the default
deployment, which is what the suite pins.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* chore(changeset): patch changeset for the zero-account boot report
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* docs(permissions): re-anchor the system-context census row past the new boot check
`check:check-system-context-census` caught the line rot my kernel:ready edit
caused: the session-resolution elevation read moved from auth-plugin.ts:1380
to :1405. Re-anchored by the gate's own --fix; no census row's meaning changes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
* fix(plugin-auth): make the boot diagnostic sink's `warn` channel required
`check:optional-error-sink` (gate #9754) failed on this branch: with both
`error?` and `warn?` optional, `BootDiagnosticLogger` was a type every value
of which may print nothing, so the contract permitted silence even though the
emitter's explicit fallback branch was careful.
Take the gate's own prescribed fix — `warn` becomes required, `error` stays
optional. The two shapes the gate forbids are NOT taken: `error` is not made
required (falsified, hosts inject reduced sinks), and this is not satisfied
with a required `info` (a lost sign-in path reported at `info` is the
reassuring half-truth AGENTS.md "Degradation log levels" removes).
Fallout, all of it inside this module's own surface:
- the emit branch drops its now-dead `?.` on `warn`; the type guarantees the
channel, and the surrounding try/catch still holds for a throwing sink.
- the "a logger that throws cannot break the boot" double no longer
satisfied the type. It carries a real `vi.fn()` warn rather than a cast —
a cast would re-open exactly the hole the gate closes — and now also pins
that `warn` stays untouched when `error` is present and throws.
The host call site is unaffected: `ctx.logger` is the spec `Logger`, whose
`warn` is already required.
Gate census moves by exactly one, in the intended direction: sinks declaring
an optional `error` beside a REQUIRED `warn` 30 -> 31, sinks permitting
silence 2 -> 1 (the remainder is the pre-existing baselined one, shrink-only).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Leehom <pm@objectstack.ai>1 parent 95fdf62 commit 450e73b
6 files changed
Lines changed: 844 additions & 16 deletions
File tree
- .changeset
- content/docs/permissions
- packages/plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
1036 | 1040 | | |
1037 | 1041 | | |
1038 | 1042 | | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1039 | 1056 | | |
1040 | 1057 | | |
1041 | 1058 | | |
1042 | 1059 | | |
1043 | 1060 | | |
1044 | 1061 | | |
1045 | 1062 | | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1049 | 1078 | | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | 1079 | | |
1055 | 1080 | | |
1056 | 1081 | | |
| |||
0 commit comments