Repository navigation
feat(agents): declarative spawn policy for Custom Agents (PR 1/6, agent-oriented workflow) - #107
Open
tournierjc wants to merge 1 commit into
Open
tournierjc wants to merge 1 commit into
tournierjc wants to merge 1 commit into
Conversation
Add x-mavis.spawnMode (subagent-only | master-only | both) and x-mavis.canSpawn to the canonical agent.md, evaluated by a single gate per entry point: - task spawns (foreground + background runners) deny master-only targets from task children and enforce the canSpawn parent allowlist, failing closed on an explicit restriction; - user-facing Session create (lifecycle application) denies subagent-only targets; - the policy rides out through the management listAgents response (spawnMode/canSpawn on AgentDetail) for client-side graph UIs. Agents without a declared policy behave exactly as before: the gate fails open on missing policy, missing port, and unreadable files. Built-in Agents keep the runtime-owned feature policy untouched. Kinetick-only behavior, documented in docs/tui-capabilities.md.
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.
Part 1/6 of the agent-oriented workflow redefinition (spawn policy; follow-ups: model chain, session defaults, knowledge autoUpdate flag, containment, relationship panel).
What
Gives every Custom Agent a declarative spawn policy in its canonical
agent.md:How
x-mavis.spawnMode/canSpawnincanonical-agent-config.ts(KNOWN_MAVIS_FIELDS, strict validation with diagnostics, round-trip serialization).service/agent/domain/spawn-policy.ts—evaluateAgentSpawnGate+LocalAgentService.getSpawnPolicy.evaluateLocalTaskSpawnGateinlocal-task-runner.ts, called by both foreground and background runners after name resolution and before the task row — a denied spawn reads likeUnknown agentwith the policy reason. Parent identity is resolved to the stable owner name;canSpawnfails closed on an explicit restriction with unresolvable parent. Port plumbing viaLocalAgentSpawnPolicyPort(fail-open when unbound).SessionLifecycleApplication.assertUserCreatableAgentrejectssubagent-onlytargets with403 AGENT_SPAWN_MODE_FORBIDDEN(TUI/CLI/HTTPPOST /sessions).AgentDetail.spawnMode/canSpawnon the managementlistAgentsresponse → available tomavis agent listand remote clients (feeds the future relationship panel, PR 6).Composition / compatibility
features.delegationgate and canonical role tool ceilings decide capability; this decides permission between named Agents. Built-ins carry no Custom-file policy.Verification (run on this commit)
run-vitest-suite.mjs capability: 231 files / 5630 passed (incl. 2 new suites registered intest/vitest-suites.json: gate table + canonical parsing/round-trip + master/subagent-only/canSpawn/fail-closed cases)policy142 passed,status-contract9 passedcheck:source+check:tsconfigpass;public-source.jsonregenerated (only the 4 added files)docs/tui-capabilities.md§ 'Agent spawn policy' (Kinetick-only section)Co-Authored-By: Hermes noreply@nousresearch.com