Repository navigation
Commit 162f668
docs(spec): demo-staff and dev-login prose state the measured seed behaviour and point at demoStaff (#26500)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBD535BtxqcqchrhyxX7HFcR)_
Fixes #26424
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么:** 只改文字。`demoStaff` 的 TSDoc 不再说种子写入的 `sys_user`
行会被拒(ADR-0092);`devLogins` 的三条拒收提示、文件头 TSDoc 和 `email` 描述不再教作者在 `data`
里种账号,改为指向 `demoStaff`。
- **为什么改:**
运行时实测:种子写入以系统上下文执行,身份写守卫让行,这行会落库,但没有凭据、登录不了。旧文字一处说"会被拒",一处教人去种它,两处都和实际不符,AI
作者会照抄。
- **风险与回滚:** 无 schema、键或行为变化;只有 prose 和一条拒收提示的措辞变了。回滚即 revert 本 PR。
- **先看:** `packages/spec/src/system/dev-login.zod.ts`(guidance 三条 +
email
描述)、`packages/spec/src/system/demo-staff.zod.ts`(L14-20)、`content/docs/references/system/dev-login.mdx`(重生成)。
- **两分钟验证:** `git grep -n 'in \`data\`' --
packages/spec/src/system/dev-login.zod.ts` 应无输出;`git grep -n 'refused
(ADR-0092)' -- packages/spec/src/system/demo-staff.zod.ts` 应无输出。
- **需要你做的:** 无,席位落地。
## What changes
- `packages/spec/src/system/demo-staff.zod.ts`: the TSDoc sentence that
said a `sys_user` row written through `data` "is refused (ADR-0092)" now
states the measured behaviour. Every seed write runs under the system
execution context, which ADR-0092's identity-write guard stands aside
for, so the row lands. It lands as a directory row with no account and
cannot sign in.
- `packages/spec/src/system/dev-login.zod.ts`: the three `guidance`
prescriptions (`permissions`, `capabilities`, `seed`) stop telling the
author to seed the account in `data`. They tell the author to declare
the person in `demoStaff`, so that `os dev` creates the account.
- **Surface additions, accepted by seat 1 at claim time:** the same
file's header TSDoc ("What it is NOT", which listed "`data` fixtures" as
the way to have the account) and the `email` field's `.describe()` ("an
account this application seeds") now point at `demoStaff` too. These
were added because the `guidance` strings do not reach the generated
reference. Only field `.describe()` text renders there, so without the
`email` change the regenerated `dev-login.mdx` would not have moved.
- `content/docs/references/system/dev-login.mdx`: regenerated
(`gen:docs`). Its `email` row now names `demoStaff`.
- `.changeset/26424-demo-staff-dev-login-seed-prose.md`: `patch` for
`@objectstack/spec`, with both declaration lines.
No schema, key or behaviour change.
## Why
The two files pointed in opposite directions, and both were wrong about
what happens. `packages/runtime/src/app-plugin.ts` writes every seed
insert with `SEED_WRITE_EXECUTION_CONTEXT` (`isSystem: true`).
`packages/plugins/plugin-auth/src/identity-write-guard.ts` bypasses
`isSystem` writes. `packages/runtime/src/app-plugin.seed.test.ts` pins a
`sys_user` seed row being inserted.
`packages/plugins/plugin-auth/src/dev-admin-seed-gate.ts` records the
consequence end to end: 13 `sys_user` rows, zero `sys_account` rows, and
sign-in answering 401. An author who follows the old `devLogins` text
gets a person who cannot sign in. `demoStaff` exists for this case.
## Tests
- `pnpm --filter @objectstack/spec test` at `4b28e265`, under
`os-verify-lock`: `VERDICT command-exit 0`, Test Files 728 passed (728),
Tests 22040 passed, 1 todo.
- `pnpm --filter @objectstack/spec build` at `4b28e265`: `VERDICT
command-exit 0`.
- No ablation: the diff changes no tested behaviour. It changes prose
and one refusal prescription's wording, and no test pins that wording.
## Acceptance notes
- Card acceptance: `git grep -n 'refused (ADR-0092)' --
packages/spec/src/system/demo-staff.zod.ts` gives 0 lines. `git grep -n
'in \`data\`' -- packages/spec/src/system/dev-login.zod.ts` gives 0
lines. Control leg: `git grep -c 'through \`data\`'` on the same file
gives 2, so the grep reads the file. `git grep -c demoStaff` on
`dev-login.zod.ts` gives 5.
- Premise correction: the card says the three strings at L67/L71/L73 are
`.describe()` text that reaches `dev-login.mdx`. They are `strictObject`
`guidance` entries, which are shown in an unknown-key refusal and not in
the generated reference. The text that reached the reference was the
`email` description, which is why it joined the surface.
- `skills/objectstack-platform/SKILL.md:446` still says the row "is
refused (ADR-0092)". That sentence belongs to PR #26420's patch round
and is left untouched here.
## Verification
<details><summary>Refusal prescription as an author sees it (built
dist)</summary>
`DevLoginSchema.safeParse({ email: 'a@b.co', seed: true })` now answers:
```text
Unrecognized key(s) on a `devLogins` entry: `seed`.
• a `devLogins` entry creates no account. Declare the person in `demoStaff` — `os dev` creates the account so it can sign in — and name it here so the banner can print it. A `sys_user` row seeded through `data` has no credential and cannot sign in. This key is new in @objectstack/spec 17.5 and strict from birth — an unknown key here was never accepted.
```
</details>
<details><summary>Generated artifacts</summary>
`pnpm --filter @objectstack/spec check:generated` first reported 1 of 14
stale (`content/docs/references/**`). After `gen:docs`: "All 14
generated artifacts are up to date".
</details>
<details><summary>Derived gates at 4b28e26 (node
scripts/pm/dispatch-gates.mjs --commands, then --ran)</summary>
`dispatch-gates --ran`: 98 derived, 91 run, 7 NOT MEASURED, 0 unrun. All
91 that ran exited 0, including `check:docs`, `check:generated`,
`check:doc-authoring`, `check:nul-bytes`, `check:api-surface`,
`check:authorable-surface`, `check:issue-citations` and
`check-changeset-no-major`.
The 7 that exited 3 (PREREQUISITE NOT MET) need a full workspace build
or a fixture commit that this shallow clone lacks. CI runs them:
- `node scripts/check-plugin-teardown-shape.mjs --self-test` (pinned
fixture commit not in the shallow clone)
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`
(`@objectstack/formula` not built)
- `pnpm --filter @objectstack/lint run check:doc-security-posture`
(`@objectstack/lint` not built)
- `pnpm --filter @objectstack/spec run check:skill-examples`
- `pnpm check:docs-transcript-drift`
- `pnpm check:dual-build-cjs-loads`
- `pnpm check:lean-entry-closure`
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind. (No names were
added.)
- [x] 3. No formatter ran; `pnpm lint` passes. (`pnpm lint` is left to
CI.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufzed5ZRLMtNcevsCJit
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b7f2b0c commit 162f668
4 files changed
Lines changed: 33 additions & 14 deletions
File tree
- .changeset
- content/docs/references/system
- packages/spec/src/system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | | - | |
74 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
0 commit comments