Repository navigation
fix(cli): serve does not report a cloud capability the host mounted itself as unmounted - #39261
Conversation
…ounted Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
…ning Claude-Session: https://claude.ai/code/session_01TsNV8Bsjqmw7aXCo2QuLU1 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 41 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 ec5b66d76ba8d15733695a9aa3fbaa8015122393 && git checkout ec5b66d76ba8d15733695a9aa3fbaa8015122393
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 93e03541031a9b62f740c25afe0026bb07ed9190 46229786b69d868023688f6fda33dfbe9702fdb4 && git checkout -B drift-repro 93e03541031a9b62f740c25afe0026bb07ed9190 && git merge --no-ff 46229786b69d868023688f6fda33dfbe9702fdb4
node scripts/docs-audit/affected-docs.mjs --json 93e03541031a9b62f740c25afe0026bb07ed9190 |
Fixes #38972
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/cli/src/utils/capability-preflight.ts: newCLOUD_TIER_PROVIDER_IDENTITIES(token to the provider plugin's registerednameand class name, for the four packagelesscloudregistry rows:ai-seat,governance,audit-compliance,access-policy-console) andhostMountsCloudTierProvider(token, plugins), an exact-identity match throughprovidesCapability(@objectstack/core). A token with no row is never matched, so every other token is judged as before.packages/cli/src/commands/serve.ts: the start-up filterunmountedKnownTokensdrops a token whose provider the host's ownplugins[]already holds, before the judgement runs. One conjunct inside the existing function, plus the import.cloudrow withpackage: nullhas no package to resolve and no exports to match, sojudgeDeclaredCapabilitiescannot see a host-mounted provider at all.os verifyandos validateare left as they are (see Acceptance notes).@objectstack/security-enterprise(objectstack-ai/cloud at072e0d10a):AiSeatPluginiscom.objectstack.security.ai-seat,AiGovernancePluginiscom.objectstack.security.ai-governance,AuditCompliancePluginiscom.objectstack.security.audit-compliance,AccessPolicyConsolePluginiscom.objectstack.security.access-policy-console. These are the same exports each cloud loader row names. The pattern follows serve's existing check for the closedAIStudioPluginby name and class.@objectstack/clipatch.Read first (by risk):
packages/cli/src/commands/serve.ts, theunmountedKnownTokensfilter. This is the one behaviour change in the boot path.packages/cli/src/utils/capability-preflight.ts, the identity table: exact names, no substring match.packages/cli/test/serve-host-mounted-cloud-capabilities.integration.test.ts, the real-boot pin and its in-boot control.Tests
test/serve-host-mounted-cloud-capabilities.integration.test.ts(new, integration tier, one realos serveboot): the config mounts fixtures that carry the providers' names and class names, and declaresrequires: ['governance', 'ai-seat', 'audit-compliance']. Expected: no start-up line forgovernanceorai-seat. CONTROL in the same boot:audit-compliance, which nothing mounts, still gets the "provided only by a cloud runtime … Remove it fromrequires" line.test/capability-preflight.test.ts, newdescribein the existing harness file: every table key is a packagelesscloudregistry row; both measured tokens are matched when mounted, by name alone and by class name alone. Controls: an unmounted token, an empty or absent list, a consumer whose name contains the token, and tokens with no row are never matched.Ablation was done once at
2b22eeaa6withscripts/ablation-replace.mjs(the anchor hit, the restore matched the HEAD blob, andgit diff HEADwas empty afterwards). Both suites run fromsrc/(bin/run-dev.js/ direct../srcimport), so no dist leg is involved.true: the boot pin went red,× governance and ai-seat, both mounted by the config: no start-up line,Tests 1 failed | 2 passed (3),VERDICT command-exit 1. The control and the ready-banner cases stayed green.return false;:Tests 2 failed | 54 passed (56). The two failures were the mounted cases. All controls stayed green.Local runs (at 4622978 unless noted)
@objectstack/cli^...:os-verify-lock: VERDICT command-exit 0.pnpm --filter @objectstack/cli typecheck(tsc pluscheck:test-typecheck):VERDICT command-exit 0,check:test-typecheck: OK.capability-preflight,normalized-call-sites,package-union-readers,serve-capability-vocabulary,capability-edition-advisoryand the new boot pin:Test Files 6 passed (6),Tests 97 passed (97),VERDICT command-exit 0.unitproject: NOT MEASURED. The run exceeded the 10-minute foreground cap on a shared container and was stopped after 43 files passed and 0 failed. The full suite is left to CI.Derived gates (`dispatch-gates.mjs --commands`, 76 families, at 4622978)
PREREQUISITE NOT MET(exit 3), because this worktree built only the cli dependency closure:check:dual-build-cjs-loads,check:i18n,check:i18n-coverageandcheck:i18n-walk-parity. These are NOT MEASURED locally and left to CI.dispatch-gates.mjs --ran:76 derived famil(ies) accounted for — 72 run, 4 NOT-MEASURED.Acceptance notes
os verifyprints the same "no open-edition provider … Remove it fromrequires" advisory for a stack whoseplugins[]carries one of these providers. It is left unchanged on purpose: its advisory recordsos validate's verdict (validate: 'error'), andos validatereads noplugins[]and still refuses such a stack. Making those two doors agree with a host-mounted provider is a separate question that this card does not ask.PlatformCapabilityProvider). That would change the shape of a published export, so the table stays CLI-local and is pinned to the registry rows instead.origin/main. None of them touch the changed files or the capability judgement (incoming cli paths:serve-host-config-metadata-door.pin.test.tsandmetadata-file-name.ts), so no merge was taken before opening.Verification
pnpm --filter @objectstack/cli exec vitest run test/serve-host-mounted-cloud-capabilities.integration.test.ts. Expect 3 passed: no start-up line forgovernanceorai-seat, and the line foraudit-compliance.Generated by Claude Code