Repository navigation
Commit bc75bcd
docs(skills): scope "Declaring is a demand" to what os serve does (#35294)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg1XdbbGasMNVx41tq3hZKV4)_
Fixes #35285
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`objectstack-platform` 技能里「Declaring is a demand」一条,从"凡是声明了而缺
provider 都是启动硬错误"改成按 `os serve` 的真实行为分两类:provider 表里的 token 与
`ai`/`ai-studio` 缺包即启动失败;企业版/云端 token(`hierarchy-security` 等)缺 provider
只告警、照常启动,`hierarchy-security` 的层级范围随后退化为仅本人。
- 为什么改:旧句会让 agent 告诉用户"应用会拒绝启动",实际却以更窄的可见性正常启动;反过来也会把一次干净启动误读成层级范围已生效。
- 风险与回滚:纯技能文案 + token 棘轮一行上调 18;回滚即 revert 本 PR,无运行时影响。
- 先看:`skills/objectstack-platform/SKILL.md` 第 331-335
行(改写的规则);`scripts/check-skills-token-ratchet.mjs` 平台行注释(6145 -> 6163
的算账);`.changeset/35285-platform-declared-capability-boot.md`。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期平台行打印 `6163
tokens (ceiling 6163; headroom 0)` 且整体通过。
- 需要你做的:无,席位落地(`skills/**` 受管,需席位契约评审记录)。
## What changes
`skills/objectstack-platform/SKILL.md`, the "Declaring is a demand" rule
under `requires:`. Before: any capability the app declared whose
provider package is absent is a hard boot error. After: a declared token
of the provider table, or `ai` / `ai-studio`, with its package absent is
a hard boot error; one the platform auto-injects stays best-effort; a
declared enterprise / cloud token with no provider only warns at boot,
and `hierarchy-security`'s scopes then fall back to owner-only.
What `os serve` does, read at `origin/main` `f848e373`:
- Declared `CAPABILITY_PROVIDERS` token, provider import fails: throws
`missingProviderMessage(cap)` (module not found) or `Capability ...
failed to start` (crash); the outer boot catch exits 1.
`packages/cli/src/commands/serve.ts:5608-5628`. The same token
auto-injected (not in `declaredRequires`) only warns or logs and the
boot goes on: `serve.ts:5629-5633`.
- Declared `ai` / `ai-studio`: `resolveAiServiceLoad` answers `required`
(`packages/cli/src/utils/ai-service-auto-inject.ts:57-70`), and
`loadOptionalServicePlugin` throws for a required load whose package is
absent or crashes (`serve.ts:5311-5342`, called at `:5374-5378` and
`:5395-5405`).
- Declared known token with no `CAPABILITY_PROVIDERS` row and no tier,
which is `hierarchy-security` and the cloud-only `ai-seat`,
`governance`, `audit-compliance`, `access-policy-console`:
`judgeDeclaredCapabilities`
(`packages/cli/src/utils/capability-preflight.ts:413-432`) and every
finding is printed with `console.warn`; the code comment says "A
warning, never a refusal: the boot is unchanged" (`serve.ts:5472-5497`).
The resolver loop then `continue`s past these tokens silently
(`serve.ts:5499-5531`).
- With no hierarchy resolver mounted, the sharing layer answers
owner-only for the hierarchy-relative scopes: `if (!resolver) return
[me];`
(`packages/plugins/plugin-sharing/src/sharing-service.ts:2470-2477`).
Prior rulings read before writing, as the claim named: ADR-0116 Decision
(D1-D5, plugin ordering and init-service requirements) and ADR-0120 D5
(uniqueness authoring gates). Neither says a declared capability
provider must always be a hard boot error, so the skill is scoped to the
code, not the other way round.
Paid for under the standing ruling 「A:先削重复,余额按实测提高」 (ruling record
6513306068, letter B). Two restatements cut first, each keeping its
other home in the same sentence:
- ", not at boot" after "rejected by `defineStack` at authoring time".
- "— so new routes added to HttpDispatcher work automatically" after
"`createHonoApp` ... delegates everything else to it".
The platform row of `scripts/check-skills-token-ratchet.mjs` moves by
the measured remainder only, with its arithmetic note.
## Tests
No code changes; the gates below are the evidence.
Published-skills readings (`skills/**`):
- Edited file, whole-file lines: 421 -> 422. Tokens (ratchet convention,
stamp line excluded): 6145 -> 6163 (priced bytes 24577 -> 24649: cuts
-78, rule +150).
- Whole package, all `skills/*/SKILL.md` summed: 4830 -> 4831 lines.
Bundle total (whole shipped tree, ratchet report): 269946 -> 269964
tokens.
## Acceptance notes
- The "Declaring is a demand" sentence names the tier-gated tokens it
covers (`ai` / `ai-studio`) and leaves `i18n`, `ui` and `auth` unsaid:
their blocks take no `requires` intent (`serve.ts:4016-4048` warns on a
missing `@objectstack/service-i18n` whether or not declared). Not a
claim this PR makes either way.
- A declared `CAPABILITY_PROVIDERS` token whose package loads but does
not export its class only warns (`serve.ts:5538-5541`), unlike the tier
loader, which throws for a required load (`serve.ts:5319-5323`).
Observation only, not filed: no reach measured.
- `check:role-word` reports `skills/objectstack-platform/SKILL.md`
improved 2 -> 1; its ledger is outside this card's file surface, so
`--update` was not run.
## Verification
Head `811f56608`. Local subset: `node scripts/pm/dispatch-gates.mjs
--commands` derived 67 families for this diff; all 67 ran, `--ran`
reconciliation: "67 derived famil(ies) accounted for — 63 run, 4
NOT-MEASURED (4 DERIVED from a recorded exit 3)".
<details><summary>Gate readings</summary>
- `node scripts/check-skills-token-ratchet.mjs`: exit 0;
"skills/objectstack-platform/SKILL.md is 6163 tokens (ceiling 6163;
headroom 0)"; "59 authored bundle file(s) within their ceilings".
`--self-test`: exit 0, "104 cases pass".
- `pnpm --filter @objectstack/spec run check:skill-docs`,
`check:skill-links`, `check:skill-identifier-liveness`,
`check:skill-top-level-keys`, `check:skill-compatibility`,
`check:skill-frame-sync`, `check:doc-authoring`, `check:nul-bytes`,
`check:pm-skill-id-lint`, `check:role-word`,
`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`: exit 0.
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`:
first run exit 3 (PREREQUISITE NOT MET, `@objectstack/formula` and
`@objectstack/lint` unbuilt); rebuilt under the verify lock (VERDICT
command-exit 0), rerun exit 0.
- `pnpm check:pm-dispatch-gates`: exit 0, "2249 cases pass" (fast tier).
- NOT MEASURED, exit 3 PREREQUISITE NOT MET (they read a full workspace
build; this diff touches no package source): `check:dts-closure`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure`,
`check:sourcemap-no-sources-content`. CI's Build Core and Lint & Repo
Gates run them.
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: "VERDICT clean exit
0" against `origin/main` and #35279, #35268, #35129.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1134519 commit bc75bcd
3 files changed
Lines changed: 35 additions & 7 deletions
File tree
- .changeset
- scripts
- skills/objectstack-platform
| 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 | |
|---|---|---|---|
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
829 | 844 | | |
830 | 845 | | |
831 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
256 | | - | |
| 255 | + | |
257 | 256 | | |
258 | 257 | | |
259 | 258 | | |
| |||
323 | 322 | | |
324 | 323 | | |
325 | 324 | | |
326 | | - | |
| 325 | + | |
327 | 326 | | |
328 | 327 | | |
329 | 328 | | |
330 | 329 | | |
331 | 330 | | |
332 | | - | |
333 | | - | |
334 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
| |||
0 commit comments