Repository navigation
feat(cli): name enterprise and cloud capabilities no provider enforces in os validate, os verify and os serve - #35168
Conversation
… validate, verify and serve os verify now runs the capability provider check os validate runs and reports it as advisories (capabilities on --json). os validate adds the wiring check: an enterprise token whose package resolves but no plugins[] entry provides. The enterprise message names the owner-only consequence, and os serve says it once at start-up. Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…token and through both doors Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…ocument verify's capability advisories Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…reads in the call-site ledgers Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…terprise-capability-finding
📓 Docs Drift CheckThis PR changes 1 package(s): 20 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 39 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 064d8c5c1767ad02fd4974b68e6fdc2e6e2928f9 && git checkout 064d8c5c1767ad02fd4974b68e6fdc2e6e2928f9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4b1eb0eab7ac41708a6775d1e6116ac4c038a5a3 d04836d59af212b7ed07c5f3f50949f15c468212 && git checkout -B drift-repro 4b1eb0eab7ac41708a6775d1e6116ac4c038a5a3 && git merge --no-ff d04836d59af212b7ed07c5f3f50949f15c468212
node scripts/docs-audit/affected-docs.mjs --json 4b1eb0eab7ac41708a6775d1e6116ac4c038a5a3
|
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 full · REWORK (one declaration line) · Head-sha: Net diff against merge base Must fix
Should fix (seat-side)
Checked, holds
Nits (no change asked)
Still owed
|
…pabilities key `os verify --json` gains the documented `capabilities` key, an additive change to a documented CLI JSON contract; nothing accepted before is refused. Metadata-protocol stays none and the level stays patch. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Contract-review-claim: session_01JQwxbaX2qDxUq9sF93EqqL · head |
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 delta · ACCEPT · Head-sha: I read the delta only, from
Not mine, still owed before landing
|
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Contract reviewServed-tier: Face: declaration ( ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…ired enterprise capability The new enterprise wiring warning rides the warnings list --strict counts, so os validate --strict (both faces) now exits 1 on a stack it passed before. Without --strict, and in os build, the exit is unchanged. Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Contract-review-claim: session_01JQwxbaX2qDxUq9sF93EqqL · head |
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Contract reviewServed-tier: Face: declaration. This is a delta record over the FAIL record 6975671274 at Inputs:
I used read-only git on the fetched head. Nothing was checked out, built or run. What stands. The delta touches no code, test or doc file. Every judgment in 6975671274 that is not M1 stands unchanged and is not repeated here: ① for ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 delta · ACCEPT · Head-sha: I read the delta only, from
Nothing else is owed from L1. Landing goes through the seat. |
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Landing · 2026-11-18T10:48Z. Head
Marked ready, and auto-merge is armed. |
Fixes #34726
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
os verify现在会跑os validate已有的「能力提供方检查」并以提示(advisory)形式输出(--json新增capabilities字段);os validate/os build增加「已安装但没接进plugins[]」的检查;企业版能力的提示写明后果(层级可见范围在开源版按「只看自己的记录」处理);os serve启动时对没有提供方的企业版/云端能力打印一行提示。requires: ['hierarchy-security']却没有企业版提供方时,os verify全绿、os serve无声、运行时静默退回 owner-only,开发者无从得知;按维护者指示「os verify 点名企业版能力」。os verify对云端能力仍为 0,与os validate的 exit 1 不一致,见 Acceptance notes)。唯一例外是os validate --strict:它本来就把所有警告当失败,所以「装了企业包但没接进plugins[]」(或包装上了却加载失败)的应用,在--strict下会从 exit 0 变成 exit 1;不加--strict和os build不受影响;运行时行为不变,仍 fail-closed;回滚即 revert 本 PR。packages/cli/src/utils/capability-preflight.ts(preflightProviderWiring与企业版后果文案)、packages/cli/src/commands/verify.ts(runCapabilityAdvisories)、packages/cli/src/commands/serve.ts(启动提示,能力解析循环之前)。pnpm --filter @objectstack/cli exec vitest run --project integration test/capability-edition-advisory.test.ts,预期 2 个用例通过:开源版应用在 validate 与 verify--json中都出现hierarchy-security提示,接上提供方后两边都没有。What changes
The capability registry (
PLATFORM_CAPABILITY_PROVIDERS) already tags eachrequirestoken with an edition, andos validatealready classified declared tokens against it (packages/cli/src/utils/capability-preflight.ts). This PR extends that one classifier; no new lint rule, no spec change.os verifysurfaces the capability-provider check (stage 1, after the author-time rules). Every findingos validateraises for a declared token is reported as an advisory: a line on the text face, andcapabilities: [{ token, message, validate }]on the--jsonreport, wherevalidateiserrorwhenos validaterefuses the stack over it andwarningwhen it only reports it.[]when there is none. The exit code is unchanged for every token, cloud tokens included.preflightProviderWiring), inos validate,os buildand through (1)os verify. Anenterprise-edition token whose package resolves but which noplugins[]entry provides is a warning. Nothing mounts an enterprise provider fromrequires, so a resolvable package alone enforces nothing. Aplugins[]entry provides the token when it is an instance of a class the package exports (or carries thatname), the exact identity matchserveuses (providesCapability), or a string entry naming the package. A package that resolves but cannot be loaded is reported asunloadable, never read as wired. Which tokens areenterpriseis the registry's edition tag.own_and_reports,unit,unit_and_below) behave as owner-only, and no log line says so." The remedy reads "Install PKG and add its plugin toplugins[], or remove the token fromrequires", in place of the oldpnpm add PKG.ENTERPRISE_ABSENCE_CONSEQUENCEonly sharpens that sentence; a future enterprise token with no row gets a generic consequence, and a test pins every row to an enterprise registry token.os servestart-up line. A declared token with no resolver row and no tier block (todayhierarchy-security,ai-seat,governance,audit-compliance,access-policy-console) used to pass the capability loop in silence. It now prints the same sentence once, as a warning, when nothing inplugins[]provides it. The boot is unchanged.ai/ai-studioalready fail the boot through their tier block with the edition-aware message.index,permission-sets,permissions-matrix,positions,administrator-guide) now say the enterprise edition enforces them and the open edition treats them as owner-only.deployment/cli.mdxdocuments verify's new stage and thecapabilitiesfield.Runtime behaviour is unchanged:
SharingService.resolveOwnerScopeIdsstill fails closed to owner-only without the resolver.Tests
packages/cli/test/capability-preflight.test.ts(unit): a battery derived from the registry, one pair of cases per non-opentoken (7 today:hierarchy-securityenterprise;ai,ai-studio,ai-seat,governance,audit-compliance,access-policy-consolecloud) with a floor so an emptied registry cannot pass vacuously. No provider gives exactly one finding naming the token. Provider present gives none, except the packageless cloud tiers, which have no provider to be present. Wiring cases: plugins empty, unrelated plugin only, exported class present, string entry (never loads), unloadable, unresolved (not this check's finding), per-package attribution, open/cloud tokens never reach it. The consequence rows are pinned to enterprise tokens.packages/cli/test/capability-edition-advisory.test.ts(integration, spawned source CLI): the open-edition stack (requires: ['hierarchy-security']and aunit_and_belowgrant) gets the finding inos validate --jsonwarningsand inos verify --jsoncapabilities, the same sentence, both exit 0. The control, the same stack with a package of the provider's name declared and its exported plugin class inplugins[], gets none from either door.normalized-call-sites.test.tsclassifies verify's top-levelrequiresread (handed to the same top-level-else-bodies rule);validate-build-gate-parity.test.tslistspreflightProviderWiringas a shared gate (wired into bothvalidate.tsandcompile.ts).Readings (local, shared box, under the verify lock)
origin/maina6cf988, which carries the merged fix(spec,metadata-protocol)!: retire the seed modes insert and replace, which inserted every record again on each replay #34791), afterpnpm install --frozen-lockfileand a rebuild of@objectstack/cli...pluspnpm --filter @objectstack/cli typecheck(VERDICT command-exit 0):pnpm --filter @objectstack/cli exec vitest run --project integration --maxWorkers=2 test/capability-edition-advisory.test.ts:Test Files 1 passed (1) · Tests 2 passed (2), duration 40.83 s.pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2:Test Files 428 passed (428) · Tests 6122 passed (6122).... --project unit test/normalized-call-sites.test.ts test/validate-build-gate-parity.test.ts test/capability-preflight.test.ts && pnpm --filter @objectstack/cli typecheckat 33fdceb:Test Files 3 passed (3) · Tests 97 passed (97), typecheck clean,VERDICT command-exit 0.integrationproject as a whole: declared to CI.Ablations (each: committed fix, mutation through scripts/ablation-replace.mjs, restore proven by HEAD blob hash)
preflightProviderWiring's verdict forced to "wired" (return undefined; // ABLATION-34726-A): anchor 1 to 0, blob e346e1a9 to 94041a75;capability-preflight.test.tswent red,Tests 4 failed | 43 passed (47)(the unwired, unrelated-plugin, per-package and owner-only cases). Restored blob e346e1a9 equals HEAD.capabilitiesdropped from verify's--jsonreport: anchor 1 to 0, blob 0250b1f3 to 77f996e0;capability-edition-advisory.test.tswent red,Tests 2 failed (2)("expected undefined to deeply equal ..."). Restored blob 0250b1f3 equals HEAD,git diff HEADempty.Acceptance notes
ai,ai-studio,ai-seat,governance,audit-compliance,access-policy-console).os validaterefuses such a stack with exit 1;os verifynow reports the same sentence undercapabilitieswithvalidate: 'error'but still exits 0, by this card's ruling (advisory only). Whetheros verifyshould matchos validate's exit 1 is a separate decision: filed cli: should os verify fail like os validate on cloud capability tokens with no provider (exit parity) #35170.SharingService.resolveOwnerScopeIds,if (!resolver) return [me];) still logs nothing; the CLI now says it at start-up foros serve, but a host that boots without the CLI (cloud's objectos-runtime) gets no line from this change. Filed runtime: the owner-only fallback for a missing hierarchy-security provider logs nothing outside the CLI #35172.plugins[]instance of ANY class the provider package exports counts as wired.@objectstack/security-enterpriseexports several plugins (SecurityEnterprisePluginregisters the hierarchy resolver; others such as the AI-seat plugin do not), so wiring only an unrelated plugin from that package silences the warning. The registry carries no plugin identity per token; tightening this needs a registry field (spec, out of this card's surface). Filed capabilities: the registry has no per-token provider identity, so the CLI wiring check matches any security-enterprise class #35173.serve's host importer.os servealready loads it on boot;os validate/os buildnow do too in that one case.os buildgets the wiring warning as well: the closed gate-parity ledger requires a gate invalidate.tsto be incompile.tstoo or recorded as a validate-only gap; wiring it in both was the smaller change.skills/**text describing hierarchy scopes (which edition enforces them, and the new verifycapabilitiesfield) is follow-up card skills: hierarchy-scope rows and os verify output do not name the new capability advisory and the capabilities field #35171;skills/**is not edited here.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsderived 106 families at 528e8c1; all 106 exit 0 (each exit code captured before any pipe).--ranreconciliation: "106 derived famil(ies) accounted for — 106 run, 0 NOT-MEASURED". The other CI families (artifact rosters, wide-population, type-check lanes, Build Core, dogfood) are CI's.Verification
Manual readings at 45f1303 (source CLI,
bin/run-dev.js), fixtures in a temp dir:os validate --jsonexit 0, onewarningsentry forhierarchy-securitynaming owner-only;os verify --jsonexit 0,capabilitiesholds the same sentence,hardFailures0.plugins[]empty:os validate --jsonexit 0 with the unwired warning;os verify --jsonthe same undercapabilities.requires: ['governance', 'hierarchy-security']:os verifytext face prints both, the cloud one suffixed "os validaterefuses this stack.", exit 0;os serve --devprints both lines at start-up and boots (discovery 200); with the provider wired,os serveprints neither.Generated by Claude Code