Repository navigation
Commit 171cf6d
feat(spec): requires accepts audit-compliance and access-policy-console, two cloud-loader capability tokens beside governance (#32039)
domain:spec#3 · os-support-ai · session_01WGufzgudmrzv5ZGMtfJQKc
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBX5AKQ7ZjuoowRzDFy9HZig)_
Fixes #32011
Clause-②: yes (widening: two new accepted `requires` tokens)
Metadata-protocol: added
Skills-docs: follow-up #32041 — skills/objectstack-platform/SKILL.md
(L318-320, the "Enterprise / cloud" bullet, names `ai-seat` and
`governance` as the tokens only cloud's objectos-runtime resolves and
now omits `audit-compliance` and `access-policy-console`; `skills/**` is
outside this card). No `content/docs/**` sentence lists the cloud-loader
tokens (`git grep -n -e ai-seat -e governance -- skills content/docs
':!content/docs/releases'` at 36864c4: 1 hit, that SKILL.md line;
control `hierarchy-security`: 6 hits in 4 files)
Prior rulings read:
platform_capability_tokens,governance,audit-compliance,access-policy-console
→ 9 hits; ADR-0027 Decision §14, ADR-0033 Decision §10, ADR-0076 D3,
ADR-0076 D4/D5/D6/D8, ADR-0076 D8, ADR-0086 D6, ADR-0086 D7, ADR-0104
D3; thread: none; repo: objectstack-ai/objectstack. Every hit is on the
word "governance" in another sense (authoring governance, authz
governance); none rules on the capability vocabulary. ADR-0033 §6 puts
audit and publish governance in the paid tier, which agrees with a
cloud-only token.
Carried: objectstack-ai/cloud#4218 (repo:cloud#1, `Notify: serial ·
#4218 behind #32011`, 6755116793): cloud's loader adds the two
`CAPABILITY_PROVIDERS` entries after a pin carries this, flipping the
hosted catalog column for audit compliance (cloud#3665) and the
access-policy console (cloud#3668). Until then `defineStack` accepts
both tokens and no runtime provides them; the open edition's `os build`
preflight reports them unavailable.
## 维护者速读
- 改了什么:`requires` 新接受两个能力 token:`audit-compliance` 和
`access-policy-console`,与 `governance` 同组(只由云端 objectos-runtime
加载器提供);provider 表各加一行,`package: null`、`edition: 'cloud'`,与 `governance`
同形。
- 为什么改:云端有这两项按环境开通的能力,没有 token 就无法在 stack 里声明,云端只能把它们标成不可用。
-
风险与回滚:只放宽;原来能过的照旧能过,近似拼写(`audit_compliance`、`access-policy`)照旧拒收。本仓不装任何包,开源版
`os build` 对这两个 token 的处理与 `governance` 完全一致(判为仅云端可用并失败)。回滚即还原本 PR。
- 先看:`packages/spec/src/kernel/platform-capabilities.ts`(token 组与两行
provider);`packages/spec/src/stack-requires.test.ts` 新增的 describe。
- 两分钟验证:`pnpm --filter @objectstack/spec exec vitest run
src/stack-requires.test.ts src/kernel/platform-capabilities.test.ts`,预期
2 个文件全绿。
- 需要你做的:无,席位落地。
## What changes
- **`PLATFORM_CAPABILITY_TOKENS`**
(`packages/spec/src/kernel/platform-capabilities.ts`):
`audit-compliance` and `access-policy-console` join the enterprise /
cloud-runtime group after `governance`. The group comment now names all
four cloud-loader tokens (`ai-seat`, `governance`, `audit-compliance`,
`access-policy-console`) and says this repository installs nothing for
them. The `PlatformCapabilityProvider.package` docblock that lists the
`null`-package tokens names the two new ones too.
- **`PLATFORM_CAPABILITY_PROVIDERS`**: `'audit-compliance': { package:
null, edition: 'cloud', note: 'cloud audit-compliance tier' }` and
`'access-policy-console': { package: null, edition: 'cloud', note:
'cloud access-policy console' }`. No package name is invented: cloud's
loader resolves both, and nothing here could install one.
- **Changeset**: `@objectstack/spec` minor, carrying the declaration
lines above.
What does not move: `defineStack`'s refusal path (an unknown token still
gets `STACK_CAPABILITY_UNKNOWN`, 422), the `os build` / `os validate`
preflight code (it reads the provider table, so both tokens classify
`unavailable` exactly as `governance` does), `objectstack serve` (a
known token with no core `CAPABILITY_PROVIDERS` row is skipped quietly,
as for `ai-seat` / `governance`), and the CLI vocabulary-drift test,
which does not enumerate the cloud-only set and needed no edit.
## Tests
- `packages/spec/src/stack-requires.test.ts`, new top-level describe:
`defineStack` accepts `requires: ['audit-compliance']` and
`['access-policy-console']` and passes each through untouched, and
accepts all four cloud-loader tokens together. The near misses
`audit_compliance`, `auditCompliance`, `access-policy` and
`access_policy_console` are each refused with the ADR-0112 envelope:
`code` `STACK_CAPABILITY_UNKNOWN`, `status` 422, one `issues` entry
naming the token.
- `packages/spec/src/kernel/platform-capabilities.test.ts`, new
top-level describe: the `package: null` rows are exactly `ai-seat`,
`governance`, `audit-compliance`, `access-policy-console`; each of the
four is in the vocabulary with `edition: 'cloud'`, `package: null` and a
note; both new tokens classify `unavailable` even when every package
resolves; the near-miss spellings are not in the vocabulary.
<details><summary>Test readings at 36864c4</summary>
- `pnpm --filter @objectstack/spec test` (under os-verify-lock): Test
Files 829 passed (829), Tests 26276 passed and 1 todo; VERDICT
command-exit 0.
- `pnpm --filter @objectstack/spec typecheck`: VERDICT command-exit 0;
its `check:test-typecheck` leg reads "52 file(s) / 240 error(s) / 131
pinned signature(s) held in test-typecheck-debt.json", so both edited
test files compile with no new error.
- `pnpm --filter @objectstack/spec check:generated` after the spec
build: exit 0, every artifact up to date (nothing to regenerate: the
vocabulary is a constant, not a Zod schema, and no reference page lists
it).
- CLI, after `pnpm --filter '@objectstack/cli^...' build`: `vitest run
test/serve-capability-vocabulary.test.ts
test/capability-preflight.test.ts`: Test Files 2 passed, Tests 38
passed.
- Ablation, once, on `src` (both spec test files import `src`, no `dist`
hop): `node scripts/ablation-replace.mjs` removed the
`'audit-compliance'` entry from `PLATFORM_CAPABILITY_TOKENS` (anchor 1 →
0, blob 87b422b → 18b32c27). The two edited files went red: Tests 4
failed, 75 passed (79): the provider-map 1:1 pin, the cloud-row pin for
`audit-compliance`, and both `defineStack` acceptance pins (refused with
"requires: 'audit-compliance' is not a known platform capability").
Restore: blob back to 87b422b, equal to HEAD, `git diff HEAD` empty. A
first attempt used a replacement that was a substring of the anchor; the
tool refused it before any test ran, so that run measured nothing.
</details>
## Acceptance notes
- Two comments outside this card's file surface still name only the
older cloud tokens as examples:
`packages/cli/src/commands/serve.ts:5370` ("`ai-seat`/`governance` by
cloud's objectos-runtime — stay quiet for those") and the
`validateKnownCapabilities` docblock in
`packages/spec/src/stack.zod.ts:6227` ("(`hierarchy-security` /
`ai-seat` / `governance`)"). Both describe behaviour that holds for the
new tokens too; neither is a defect. Noted, not filed.
- PR body: the seat signature line is first and the project attribution
block follows it, the shape this project's card PRs use.
## Verification
<details><summary>Local gates at 36864c4</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 85 families for the 4 changed paths. All 85
ran after a full `npx turbo run build --concurrency=2` (exit 0), each
exit 0. `--ran`: "85 derived, 85 run, 0 NOT-MEASURED, 0 UNRUN", exit 0.
- `node scripts/check-changeset-no-major.mjs --base origin/main --event`
with this body as the `pull_request` payload: exit 0, "declares clause-②
`yes (widening)` and metadata-protocol `added`" and no package moved at
`patch`. Control, the same body with `Metadata-protocol: narrowed`: exit
1, naming the missing `(narrowing)` arm.
- `node scripts/pm/check-prior-rulings.mjs --card 32011 --terms ...`:
exit 0, the 9 hits named above.
- `origin/main` moved 8 commits after the branch point (60f8149 →
09bf7de) before this PR opened; none touches the four changed paths
(the only `packages/spec/src/kernel` change is
`public-auth-features.ts`), so the branch was not re-merged. CI runs the
merged tree.
- Every CI family (`Lint & Repo Gates`, `TypeScript Type Check`, `Test
Core`, the rest) is read from this PR's check-runs, not re-run locally.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzgudmrzv5ZGMtfJQKc)_
<!-- signed: domain:spec#3 · os-support-ai ·
session_01WGufzh7cM8EmUX4T2CBNHX -->
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8523ef9 commit 171cf6d
4 files changed
Lines changed: 100 additions & 3 deletions
File tree
- .changeset
- packages/spec/src
- kernel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
142 | | - | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| 238 | + | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
50 | 89 | | |
51 | 90 | | |
52 | 91 | | |
| |||
0 commit comments