Skip to content

fix(sdk): scope the Base V2 capability inventory to platform and own packages (#442) - #446

Draft
waldemort-auto[bot] wants to merge 1 commit into
mainfrom
waldemort/issue-442-v2-capability-scope
Draft

waldemort-auto[bot] wants to merge 1 commit into
mainfrom
waldemort/issue-442-v2-capability-scope

Conversation

@waldemort-auto

@waldemort-auto waldemort-auto Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #442.

A Base V2 session bound to a named agent now lists and loads only the PilotSwarm platform packages and the agent's own package. The capability index, the load_skill catalog and the CLI skill directories use one scope (sessionCapabilityScope).

Behavior

Session Listed and loaded by name
Bound to a named agent Platform packages (SDK system and management plugins, SDK skill directories, bundled default agents) and the agent's own package.
Not bound to an agent Every deployment package and the session owner's packages, one copy per package name (the private copy before the shared copy).

Other packages stay reachable through search_capabilities and an exact reference.

Decisions (please confirm)

Topic Choice Reason
Unbound general sessions Keep deployment + owner listing, deduplicated They have no own package; the app default prompt routes to deployment agents and skills.
Deployment team packages (pluginDirs) Not platform: hidden from a bound agent's index, catalog and CLI skill dirs Affan: "only own packages and the system packages".
Out-of-scope deployment skill, load_skill by exact name Still served, unlisted (listed: false) App base prompts tell every agent to load_skill("<deployment skill>"), often from a different deployment package. Owner packages outside the scope are never served by name, so an unrelated private skill can no longer shadow a deployment skill.
Bound agent's own package published by another user (other_shared) Listed and loadable (skills and workflows only, not tools/MCP); never replaces a deployment skill name (case-insensitive) The session runs that agent.
Workflow child pinned to an earlier package revision (R18) Own package matched by id and revision; a skill-only pinned package is added for index, load_skill and search; other revisions' skills and workflows are hidden; the live revision's skill directory is never used Keep the pinned revision consistent.

Changes

  • capability-catalog.ts: CapabilitySource.platform, sessionCapabilityScope, liveSkillDirectoryScope; the inventory takes a scope.
  • worker.ts: marks platform sources, stamps capabilitySourceId on every agent copy, maps each skill directory to its source, forwards the scope to _getBaseV2SkillDirectories, exposes installed pinned sources.
  • session-manager.ts: one scope per turn for the index, the load_skill catalog and the CLI skill directories; the catalog uses the same turn snapshot; the dehydrate-retry handle builds no catalog.
  • managed-session.ts: load_skill names only listed skills on a miss and points to search_capabilities (V2 only).
  • base-v2.md, docs/developer/building/plugins.md, CHANGELOG.md.

Tests

New tests fail on 24bdf9082 and pass on this branch:

An independent GPT-6.2 review ran four rounds; every blocker and major finding is fixed.

All-providers run

./scripts/run-tests.sh --all-providers on tree 6c776e526ccf (the commit dc245a390681 of this PR), builder pse-devws2 (PG16 local, live HorizonDB wdmchk-pse-hdb1, westus3), 3 parallel SDK files, model azure-openai:gpt-5.6-sol. Finished 2026-12-02 09:47Z.

Phase Suite Pass Fail Skip
PG16 deploy-scripts 402 0 43
PG16 mcp-server unit 3 0 0
PG16 SDK unit (node --test) 3,244 0 1
PG16 SDK unit (Vitest) 42 0 0
PG16 packages/app 2,512 0 0
PG16 SDK local (Vitest) 4,755 10 44
HorizonDB horizon-store integration 149 0 0
HorizonDB SDK local (Vitest) 2,083 4 7

Every failure was rerun on base 24bdf9082 and on this branch. None is caused by this change.

Failing test (file) Phase Rerun on this branch Rerun on base Cause
cms-seq-nodemap, contracts, durability, turn-control, wait-affinity, workflow-definition-test, wait-interrupt, sub-agents/keep-alive-after-task PG16 pass pass Timeouts under load on a 4-CPU builder
workflow-default-worker-agent-real-model (UXP-AC-01) PG16 pass 3/3 pass 3/3 Live-model nondeterminism
workflow-release-features-real-model PG16 MODEL_HTTP_429 fails on base too Model rate limit
durability, workflow-sean-scenario, workflow-package-agent-dependencies HorizonDB pass pass Timeouts and an AccessShareLock race on HorizonDB
sweeper-final-check T4 HorizonDB pass 2/2 alone pass The test's lock-wait check catches another file's CREATE INDEX CONCURRENTLY

GitHub PR checks: pass.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…packages (#442)

A Base V2 session bound to a named agent now lists and loads only the
PilotSwarm platform packages (system, management, SDK skill directories,
bundled default agents) and the bound agent's own package. The capability
index, the load_skill catalog and the CLI skill directories share one
scope (sessionCapabilityScope). Unbound sessions keep the deployment and
owner listing, with one copy per owner package (private before shared).
Out-of-scope packages stay reachable through search_capabilities; an
out-of-scope deployment skill still loads by exact name, unlisted.

Fixes #442

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Base V2 capability index lists every static and owner package regardless of the session's agent (no scoping, duplicate copies, ~15K tokens per call)

0 participants