Skip to content

docs(skills): scope "Declaring is a demand" to what os serve does - #35294

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-35285-declared-capability-serve
Nov 19, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/issue-35285-declared-capability-serve

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

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 continues 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)".

Gate readings
  • 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 docs(skills): the objectstack-ui router names action refusals #35279, docs(skills): the ask skill teaches withheldFields, the database top-N cut and totalGroups #35268, chore: version packages #35129.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7

A declared provider-table token or ai/ai-studio with its package absent
fails the boot; a declared enterprise / cloud token with no provider only
warns, and hierarchy-security's scopes fall back to owner-only. Paid by
two same-file restatement cuts; the platform ratchet row moves by the
measured remainder (6145 -> 6163).

Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 811f566085233a11d7c40dfce2601ea80f2088c0
Local-runs: none
Scope: skills/objectstack-platform/SKILL.md + scripts/check-skills-token-ratchet.mjs
Security-touching: yes

Basis: PR #35294 for card #35285. Read: the card body and its three comments (claim 6997737811, dev report 6998072382, first touch 6998127438), the PR body and file list (the PR has no comments or reviews yet and is a draft), the net diff from merge-base f848e373 to the head (3 files, 35 lines added, 7 removed), the 45 check-runs on the head, ruling record 6513306068, and the cited code, ADRs and sibling skills in the head tree (read, not reviewed). origin/main is at dc53d4a6; since the merge-base it has changed neither the platform skill, nor its ratchet row, nor any code or ADR file cited below. Nothing was built, run or re-run; the byte arithmetic in ④ is read off git blob sizes. The changeset is a prose face: it is noted for the seat's sentence check, not reviewed here.

The security line reads yes on purpose. The rewritten rule teaches what the hierarchy-relative permission scopes resolve to when the enterprise provider is missing (owner-only) and that the boot does not stop for it. That is record-visibility behaviour under a path name that does not show it, so the low-risk arm does not apply and the PR lands as Tier H, not on this record alone. The yes is about the class of the hunk, not a defect in it: the teaching is accurate and the fallback it describes fails closed (it narrows, it never widens). The seat adopting this record adds the security label.

① Derived judgments

Accept set and public surface: no change. The diff is one SKILL.md, its row in the token ratchet and one changeset. No package source, schema or export moves.

The rewritten rule (skills/objectstack-platform/SKILL.md:331-335), clause by clause, against the head tree:

  1. "A table token ... YOU declared whose provider package is absent is a hard boot error." Holds. The table's 22 tokens (SKILL.md:301-310) are exactly the 22 keys of CAPABILITY_PROVIDERS (packages/core/src/capability-providers.ts:64-237). "YOU declared" is declaredRequires, the stack's own tokens before the platform appends any (packages/cli/src/commands/serve.ts:3126-3128, packages/core/src/capability-composition.ts:124-125). The resolver imports the provider (serve.ts:5535-5536); its catch rethrows for a declared token, with missingProviderMessage when the module is not found (serve.ts:5608-5628). The loop sits directly in the body of the outer try of run() (serve.ts:2832), whose catch prints the message and calls this.exit(1) (serve.ts:6439-6469). The process refuses to start.
  2. "... or ai/ai-studio ..." Holds. Either token opens the ai tier (packages/core/src/stack-auth.ts:73-81, :88-99) and makes the base AI load required (packages/cli/src/utils/ai-service-auto-inject.ts:34-43, :57-70; serve.ts:5365-5378); Studio is required when ai-studio is declared (serve.ts:5394-5406). A required load whose package is absent throws (serve.ts:5330-5342), and nothing catches it before the same outer catch. Same exit 1.
  3. "one the platform auto-injects for you stays best-effort (warn and continue)." Text unchanged by the diff; holds (serve.ts:5629-5633, and the auto AI load at serve.ts:5343-5349).
  4. "An enterprise / cloud token with no provider only warns at boot." Holds for the five tokens the skill's own "Enterprise / cloud" bullet names (SKILL.md:318-321). They have no resolver row and no tier (serve.ts:5481-5486). judgeDeclaredCapabilities classifies them (packages/cli/src/utils/capability-preflight.ts:413-432; registry rows packages/spec/src/kernel/platform-capabilities.ts:231-239, classifier :433-454), and every finding, the ones os validate treats as errors included, is printed with console.warn (serve.ts:5487-5497; the code comment reads "A warning, never a refusal: the boot is unchanged"). The resolver loop then passes them with a bare continue (serve.ts:5499-5531). "With no provider" is exact: a hierarchy-security plugin wired into plugins[] yields no finding (capability-preflight.ts:340-399).
  5. "hierarchy-security's scopes then fall back to owner-only." Holds. resolveOwnerScopeIds returns the caller alone when no hierarchy-scope-resolver service is registered (packages/plugins/plugin-sharing/src/sharing-service.ts:2470-2477; the late-bound lookup is sharing-plugin.ts:796-799), on the read filter (sharing-service.ts:775) and on the write paths (:890, :1030). The CLI's own warning uses the same words, "behave as owner-only" (capability-preflight.ts:92-110).

Which boot takes which path:

  • os serve, and os dev and os start through the serve child they spawn, take the path above: throw, outer catch, exit 1 for clauses 1 and 2; one console.warn line and an unchanged boot for clause 4. os start compiles first when it finds no artifact (packages/cli/src/commands/start.ts:242-280); that step is the os build door, not the boot. See N3.
  • A host that boots the runtime itself (Runtime plus plugins, or createHonoApp over its own kernel) takes none of it. @objectstack/runtime only carries requires through for the CLI to read (packages/runtime/src/standalone-stack.ts:1191-1194) and resolves no token, so there is neither the hard error nor the warning, and the owner-only fallback is silent (the open card runtime: the owner-only fallback for a missing hierarchy-security provider logs nothing outside the CLI #35172). The rule sits under "requires: — which service plugins boot", which opens with "The CLI expands each token", so it is scoped to the boot it describes. See N1.
  • bootStack of @objectstack/verify throws for any table provider it cannot build, declared or always-on (packages/verify/src/required-providers.ts:52-59, :87-99), and mounts and prints nothing for hierarchy-security (:40-42); os verify reports that token as an advisory.

ADRs: neither named ADR requires a hard error, so the skill contradicts no accepted ADR and no maintainer question arises.

Rest of the published catalog, grepped under skills/ for "Declaring is a demand", "hard boot error", "hierarchy-security", "owner-only" and "fails the boot":

  • The platform skill's other statements agree with the new rule: the tier-gated and enterprise bullets (SKILL.md:315-321), AIServicePlugin as cloud / EE only (:286), the precedence rule (:329-330). The list still holds six rules.
  • skills/objectstack-platform/evals/config-plugins-ops.json:45 keeps the short form "Declaring is a demand (missing provider = hard boot error)". Its case is requires: ['automation', 'triggers'], both table tokens, so it stays true. See N5.
  • skills/objectstack-data/SKILL.md:415-419 and its eval row (evals/hooks-security-seeds-datasources.json:17) say the hierarchy-relative scopes "fail closed to own" without the enterprise plugin and that defineStack errors without the token. Consistent: the data skill gives the authoring rule and the runtime fallback, the platform skill now gives the boot behaviour. The open sibling PR docs(skills): name the capability advisory, the plugins[] wiring check and os verify --json capabilities #35281 (head bc862b7e) rewrites those rows to "The CLI only advises on a missing or unwired plugin: os validate warns", which is also consistent; the two PRs share no file.
  • skills/objectstack-project/SKILL.md:92 lists "a provider for every required capability" under os validate. Not contradicted. See N3.
  • No other file under skills/ states the rule.

② Semver level

'@objectstack/skills': patch, Clause-②: no, Metadata-protocol: none: all three correct, and the same two lines are in the PR body and the changeset body. The shipped agent is taught a narrower claim about the boot (two classes named in place of "any declared capability") and one new fact (the owner-only fallback). Nothing a metadata author can write is added, refused or given a new meaning, and no code moves, so the kind is none and none takes patch. It is not a (narrowing) either: skill prose narrows no accepted set. Check Changeset is green on the head.

③ Boundary flags

Dev report 6998072382, open_questions: none. security_findings: none; this record agrees, the diff changes no behaviour.

Deviations and notes, each answered:

  • Commit trailer is the model-free pair: correct, it is the AGENTS.md form, read on the head commit.
  • Four build-reading gates not measured locally (exit 3, prerequisite not met): answered by CI on this head. All 45 check-runs are complete: 29 success, 16 skipped, none failed, none pending. Lint · repo & tooling gates, Lint · docs & code guards, Lint · scoped · tooling self-tests, Build Core, Check Changeset, PR-body guards and Governed Surface Queue Guard are among the green ones.
  • check:role-word reports the platform skill improved 2 to 1 and --update was not run: the gate passes, and scripts/role-word-baseline.json:44 keeps 2 as the ceiling. See N6.
  • Out-of-scope note, a declared table token whose package loads but lacks its export only warns (serve.ts:5538-5541) while the tier loader throws for a required load (serve.ts:5319-5323): read and confirmed. It is outside the rule's condition ("provider package is absent") and reaching it takes a provider package that loads without its named export, which is a version-skewed install. Not a finding on this PR; whether it is a card is the seat's filing-gate call.
  • PR Acceptance note that i18n, ui and auth are left unsaid: confirmed as read (serve.ts:4016-4048 warns on a missing @objectstack/service-i18n whether or not the token is declared). See N2.

SQL push-down check: the diff has no query code, so no id materialisation and no in-app join.

The PR author is objectstack-fleet[bot], so no off-relay author note is owed.

④ Design judgment

skills/objectstack-platform/SKILL.md: the change holds against the code it describes and against the card's scenario (an agent telling a user whether the app boots). Before, the rule was false for the five enterprise / cloud tokens, and for hierarchy-security in the direction the card names: the agent announces a refusal and the app starts with narrower visibility. After, each clause is true of os serve as shown in ①, the two classes map onto the two groups the same section already defines (the provider table, and the "Enterprise / cloud" bullet), and the consequence for the one token whose absence changes who sees what is named. It also closes the opposite misreading, a clean boot taken as proof that hierarchy scopes are enforced, as far as a CLI boot goes.

scripts/check-skills-token-ratchet.mjs (the gate that enforces the file's ceiling): the row agrees with the ruling it claims. Ruling record 6513306068 (on #27847, letter B, part 2) and the ratchet header (scripts/check-skills-token-ratchet.mjs:156-170) put three conditions on a raise and leave the first two to this record:

  • The diff shows deletion of restatement in the same file: yes, two deletions in the platform skill, 13 and 65 bytes.
  • The PR body quotes the ruling: yes, both the 2026-10-27 words 「A:先削重复,余额按实测提高」 and record 6513306068, letter B. The row comment repeats them.
  • The row moves by the measured remainder, pinned at the measurement: yes. The head blob is 24669 bytes; minus the 20-byte stamp line (SKILL.md:20) that is 24649 priced bytes, and ceil(24649 / 4) is 6163. The base blob is 24597 bytes, 24577 priced, 6145. Cuts 78, rule plus 150, net plus 72 bytes, plus 18 tokens, headroom 0. Every figure in the row comment matches.

The 10402 principle (no growth for a small feature) is not engaged: the growth corrects a false sentence and adds no feature.

The cuts lose no instruction:

  • ", not at boot": the sentence still says where the refusal happens ("rejected by defineStack at authoring time"). What goes is the contrast that the boot does not refuse an unknown token (it warns and ignores it, serve.ts:5519-5530). Nothing an author writes depends on it.
  • "so new routes added to HttpDispatcher work automatically": a corollary of "delegates everything else to it", which stays. It told the reader to do nothing, and a reader can still derive it.

Both are restatements in the ruling's sense: the fact keeps a home in the same sentence.

Findings. No must-fix. No should-fix. Six nits, none of which touches correctness or the contract; all are accepted as they stand on this head.

  • N1 (nit). "At boot" means the CLI boot. A host that boots the runtime without the CLI gets neither the hard error nor the warning, and the owner-only fallback is silent there. The section's lead sentence scopes it to the CLI, and the first clause of the rule had the same scope before this PR. The runtime side is card runtime: the owner-only fallback for a missing hierarchy-security provider logs nothing outside the CLI #35172.
  • N2 (nit). i18n, ui and auth are now covered by no clause. The old sentence was wrong for at least i18n (a missing package warns, serve.ts:4037-4047); the new one makes no claim. Saying what each does would cost more tokens than the rule itself. A follow-up is the seat's call.
  • N3 (nit, the one with most substance). "Only warns" is true at boot and only there for the four cloud-only tokens (ai-seat, governance, audit-compliance, access-policy-console): os validate and os build exit 1 on them (packages/cli/src/commands/validate.ts:1036-1075, packages/cli/src/commands/compile.ts:1014-1060), and so does os start when it compiles first, before any boot (start.ts:271-280). For hierarchy-security, the token the card is about, the sentence holds at every door: a warning at os validate and os build, a warning and an unchanged boot under os serve. The sentence says "at boot", the refusal at the other doors names its own remedy, and skills/objectstack-project/SKILL.md:92 carries the provider check under os validate, so nothing taught is false. If the seat wants the refusal stated, its home is the os validate row, not this rule.
  • N4 (nit). Two corners of clause 1 that predate this PR. The triggers extras (trigger-schedule, trigger-api) are skipped silently when absent (serve.ts:5591-5606); all three trigger packages are CLI dependencies, so this is a broken install. And an explicit AIServicePlugin in plugins[] skips the whole AI block, Studio included (serve.ts:5269, :5370); the precedence rule one bullet up already says an explicit instance shadows resolution.
  • N5 (nit). The eval's expected output at skills/objectstack-platform/evals/config-plugins-ops.json:45 keeps the unscoped short form. True in its case, not an assertion string, no change needed.
  • N6 (nit). The role-word ledger keeps 2 for this file while the file now counts 1. The gate passes; recording the lower count (node scripts/check-role-word.mjs --update) is an ordinary tooling follow-up outside this PR's file surface.

Implemented-by: claude/issue-35285-declared-capability-serve
Reviewed-by: session_01Utp6CbUb7TcZK1XUAddUmQ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

维护者速读

  • 改了什么:平台技能「Declaring is a demand」重写为与代码一致的三档:声明了 provider 表里的能力或 ai/ai-studio 而缺包,os serve 启动即失败;企业/云专属能力缺包只告警;hierarchy-security 缺提供方回落为「只看自己的记录」。棘轮该行 6145 → 6163(+18)。
  • 为什么改:旧句说「凡声明缺包都启动报错」,而 os serve 对 hierarchy-security 只告警并照常启动,模型会对用户说错(platform skill: "Declaring is a demand" says a missing declared provider is a hard boot error, but os serve only warns for hierarchy-security #35285,源自 skills: hierarchy-scope rows and os verify output do not name the new capability advisory and the capabilities field #35171 的范围外发现)。
  • 风险与回滚:只改一份发布技能文字、棘轮一行与 changeset;无代码。回滚 = revert。
  • 先看:skills/objectstack-platform/SKILL.md 的「Declaring is a demand」段;scripts/check-skills-token-ratchet.mjs 平台行。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期平台行 6163 / 6163,末行 ✓。
  • 需要你做的:审阅并合并或批准(Tier H:动了棘轮脚本,且审查判定 Security-touching: yes)。合同审查 PASS 6998607248,Head-sha 811f566085233a11d7c40dfce2601ea80f2088c0。席位意见:三档与代码逐条对得上,两份 ADR 不要求硬错误,可合。

席位核对 — ACCEPT · repo:objectstack#5 · head 811f566085233a11d7c40dfce2601ea80f2088c0 · 2026-11-19T03:17Z

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 19, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 19, 2026 03:19
@os-zhuang
os-zhuang enabled auto-merge November 19, 2026 03:19
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit bc75bcd Nov 19, 2026
51 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-35285-declared-capability-serve branch November 19, 2026 03:36
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 19, 2026
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/s 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.

platform skill: "Declaring is a demand" says a missing declared provider is a hard boot error, but os serve only warns for hierarchy-security

3 participants