Skip to content

feat(pinet): stage worker subtree supervision#764

Draft
tmustier wants to merge 1 commit into
mainfrom
feat/761-worker-subtrees
Draft

feat(pinet): stage worker subtree supervision#764
tmustier wants to merge 1 commit into
mainfrom
feat/761-worker-subtrees

Conversation

@tmustier
Copy link
Copy Markdown
Collaborator

Summary

Refs #761.

Stages the safe broker-side groundwork for Pinet worker subtrees using real broker-connected followers, not local Agent subagents:

  • adds typed agent hierarchy fields and schema migration v18 (parentAgentId, rootAgentId, treeDepth, spawnedByAgentId, supervisionState, launchId, subtreeRole, laneId)
  • accepts hierarchy metadata during real follower registration and rejects dead parents, self-parenting, and hierarchy cycles
  • scopes A2A routing so parent/child/ancestor/descendant supervision works while unrelated workers cannot message supervised children
  • keeps broker emergency override trusted via broker self id rather than follower-supplied role: broker metadata
  • excludes supervised/orphaned/stopping children from default broadcast/backlog assignment while preserving explicit preferred target recovery
  • adds lifecycle notices for child exit and parent orphaning/reaping
  • extends pinet action=agents with subtree inspection (scope=children|subtree, parent_agent)
  • adds docs/design note in plans/761-pinet-worker-subtrees.md

#406 caveat / spawn status

pinet action=spawn is intentionally a safe validation surface for now. It validates the child task/scope request, but fails safely with missing_broker_connected_worker_launcher until the #406 broker-connected worker bootstrap/launcher exists.

This PR does not spawn local Agent subagents and does not claim end-to-end child follower startup yet.

Validation

  • pnpm --filter @gugu910/pi-broker-core typecheck
  • pnpm --filter @gugu910/pi-slack-bridge typecheck
  • pnpm --filter @gugu910/pi-broker-core lint
  • pnpm --filter @gugu910/pi-slack-bridge lint
  • pnpm --filter @gugu910/pi-broker-core test — 3 files / 44 tests
  • pnpm --filter @gugu910/pi-slack-bridge test -- broker/helpers.test.ts broker/integration.test.ts pinet-tools.test.ts pinet-mesh-ops.test.ts runtime-agent-context.test.ts — 76 files / 1344 tests
  • pnpm --filter @gugu910/pi-broker-core build
  • pnpm --filter @gugu910/pi-slack-bridge build
  • Push pre-push hook also passed full repo pnpm lint && pnpm typecheck && pnpm test before branch upload.

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.

1 participant