Skip to content

Commit bc75bcd

Browse files
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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): `objectstack-platform` says which declared capabilities fail the boot and which only warn
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The "Declaring is a demand" rule taught that any capability an app declares in `requires` with its provider package absent is a hard boot error. `os serve` does that for the tokens of the provider table and for `ai` / `ai-studio`. A declared enterprise or cloud token (`hierarchy-security`, `ai-seat`, `governance`, `audit-compliance`, `access-policy-console`) with no provider only prints a warning and the boot goes on; for `hierarchy-security` the hierarchy-relative scopes then fall back to owner-only. The rule now says so, so an agent no longer reads a clean boot as proof that those scopes are enforced, nor tells a user the app will refuse to start when it starts with narrower visibility.
11+
12+
Two restatements in the same file were cut to pay for the sentence.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,22 @@ export const CEILINGS = new Map([
825825
// -> 6145 tokens: the 5 tokens of headroom are absorbed and the ceiling moves
826826
// 6011 -> 6145 (+134), the measured remainder only. Pinned AT the measurement.
827827
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24577 / 4)
828-
['skills/objectstack-platform/SKILL.md', 6145],
828+
// 6145 -> 6163 (card #35285): the "Declaring is a demand" rule is scoped to
829+
// what `os serve` does — a declared token of the provider table or
830+
// `ai`/`ai-studio` with its package absent fails the boot, a declared
831+
// enterprise / cloud token with no provider only warns, and
832+
// `hierarchy-security`'s scopes then fall back to owner-only. Raise path the
833+
// standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068,
834+
// letter B). PAID DOWN FIRST — two restatements cut, each keeping its other
835+
// home in the same sentence: ", not at boot" after "rejected by `defineStack`
836+
// at authoring time", and "— so new routes added to HttpDispatcher work
837+
// automatically" after "delegates everything else to it". Arithmetic in
838+
// priced bytes (stamp line excluded): on `origin/main` the text was 24577
839+
// bytes (6145 tokens, headroom 0); the cuts remove 78 and the rule adds 150,
840+
// so the LANDED priced text is 24649 bytes -> 6163 tokens: the ceiling moves
841+
// 6145 -> 6163 (+18), the measured remainder only. Pinned AT the measurement.
842+
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24649 / 4)
843+
['skills/objectstack-platform/SKILL.md', 6163],
829844
// `skills/objectstack-pm-dispatch/SKILL.md` (9708) and its
830845
// `rules/dev-template.md` (1838) left this table on 2026-09-10 with the files:
831846
// the maintainer deleted the published PM skill whole (verbatim:

‎skills/objectstack-platform/SKILL.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ that `basePath` is not inside **refuses at boot**, naming both values.
252252
### Architecture
253253

254254
`createHonoApp` creates an `HttpDispatcher`, mounts explicit
255-
routes for auth and discovery, and delegates everything else to it — so **new
256-
routes added to HttpDispatcher work automatically**.
255+
routes for auth and discovery, and delegates everything else to it.
257256

258257
---
259258

@@ -323,15 +322,17 @@ through it:
323322

324323
The authoritative list is `PLATFORM_CAPABILITY_TOKENS`
325324
(`@objectstack/spec`, `kernel/platform-capabilities.ts`) — an unknown token is
326-
**rejected by `defineStack` at authoring time**, not at boot.
325+
**rejected by `defineStack` at authoring time**.
327326

328327
Six rules that change what you write:
329328

330329
- **Precedence:** `requires` › `tiers` › `--preset` › built-in default. An
331330
explicit instance in `plugins:` always shadows capability resolution.
332-
- **Declaring is a demand.** A capability YOU declared whose provider package is
333-
absent is a hard boot error; one the platform auto-injects for you stays
334-
best-effort (warn and continue).
331+
- **Declaring is a demand.** A table token or `ai`/`ai-studio` YOU declared
332+
whose provider package is absent is a hard boot error; one the platform
333+
auto-injects for you stays best-effort (warn and continue). An enterprise /
334+
cloud token with no provider only warns at boot; `hierarchy-security`'s
335+
scopes then fall back to owner-only.
335336
- **`auth` implies `email`**, even under `--preset minimal`: auth callbacks
336337
need the mail service.
337338
- **Keep `automation` whenever `plugins:` lists a connector** — connector

0 commit comments

Comments
 (0)