Review v0.5.65 capability-owned delegation - #67
Open
seanzqliang wants to merge 1 commit into
Open
seanzqliang wants to merge 1 commit into
seanzqliang wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review status
This is a review-only PR for the
v0.5.65candidate. The base branch is pinned tov0.5.64so reviewers can inspect the exact release diff.Do not merge this PR into
review/v0.5.65-base. Affan's review and approval are required before tagging, publishing the GitHub Release/npm packages, publishing the starter image, or performing any production rollout.Why this PR exists
PilotSwarm currently allows an ad hoc
spawn_agent(task=...)child to inherit the parent'stoolNameswhile removing the parent's named-agent binding. For package-provided tools, that separates the executable tool from the agent definition that owns it.The failure was reproduced in a real delegated workflow:
initialRequiredToolcould not repair this because it only applies after a named agent has already been bound.This is a generic orchestration defect, not a domain-specific prompt problem. Prompt guidance alone cannot guarantee package ownership across delegation, shared/private package shadowing, worker movement, or session rehydration.
Problems solved
1. Deterministic capability routing
spawn_agentnow acceptsrequired_tool.required_tool="x"resolves the unique caller-visible, user-creatable agent that declaresx.agent_name + required_toolis an ownership assertion. It fails if that named agent does not declare the tool; it never attaches the capability to another agent.This lets orchestration ask for a capability without hard-coding a package-specific agent name while preserving the ownership boundary.
2. Exact package-copy identity across workers
A bound child now carries the exact resolved package ID through durable creation config. Every worker revalidates that package copy against the session owner before applying its prompt, MCP configuration, or handlers.
This prevents a session selected from a private/shared shadow set from silently rebinding to a different copy after worker movement or rehydration.
3. No package or role leakage into ad hoc children
Custom task-only children no longer inherit:
boundAgentNameor package IDInherited package tool names are dropped. Package tool names explicitly requested through
tool_namesare rejected with a non-retryable ownership error. Legacy direct SDK sessions retain their existing behavior; the stricter policy is attached to delegated custom children.4. Reserved-name quarantine
Package installation rejects tool names that collide with Copilot-native tools, PilotSwarm control tools, or deployment-registered tools. A package cannot impersonate
spawn_agent, filesystem tools, or another platform capability and then become its apparent owner.5. Replay-safe orchestration upgrade
The new caller-aware resolution activity changes the durable yield sequence, so released orchestration
1.0.73is frozen in its own module tree. New sessions use1.0.74; in-flight sessions continue replaying against1.0.73.Deterministic package-binding failures are returned as
retryable: falserather than entering activity retry loops.6. Windows snapshot hydration reliability
The full unit suite exposed transient Windows directory-handle failures during atomic snapshot replacement. Snapshot hydration now retries only
EACCES,EBUSY,ENOTEMPTY, andEPERM, with eight bounded attempts and increasing 20 ms backoff. Other errors still fail immediately.Security and compatibility properties
1.0.73handler.Validation completed
Build and dependency graph
npm cifrom the synchronized0.5.65lockfile: passednpm run build: passedpilotswarm-sdkTypeScript buildpilotswarm-horizon-storeTypeScript buildgit diff --check: passedComplete pure SDK suite
npm run test:unit --workspace=packages/sdkFocused ownership, persistence, replay, and storage tests
The focused pure-unit run covered:
1.0.73freeze and1.0.74registrationResult: 45 passed, 0 failed.
Focused inline and durable delegation tests
The focused Vitest run covered:
required_toolschema and forwardingagent_name + required_toolownership assertionResult: 78 passed, 0 failed across 5 files.
Packaging
All three
npm pack --dry-run --jsonchecks passed:pilotswarm-sdk@0.5.65— 1,260 entriespilotswarm-horizon-store@0.5.65— 72 entriespilotswarm@0.5.65— 303 entries; app prepack rebuilt portal and MCP successfullyGitHub checks
34516426858was rejected before runner allocation because the protectedcopilotenvironment allows onlymain; no test step executed.34517057279targets candidate commitf0b36a27and is currently waiting for Affan's protected-environment approval.Pending before release
34517057279.v0.5.65be tagged and the GitHub Release be published.Release topology note
The release candidate is already present on
mainas the required single squash commitf0b36a27because the protected full-test environment accepts onlymain. This PR uses the temporaryreview/v0.5.65-basebranch solely to preserve the exactv0.5.64 -> v0.5.65review diff. Approval of this PR is a review gate, not an instruction to merge the temporary base.