Skip to content

feat(core): delegation — budget carve, depth 2 (max 3), write lease and mandatory report #585

Closed

Description

@ajianaz

What problem does this solve?

The orchestrator must delegate to profiles (who may delegate one level further) without multiplying cost, losing auditability or letting parallel writers collide. Today child agents are capped at depth 1 and inherit the parent environment.

Proposed solution

A deep Delegation module (delegate(profile, task, mode) -> Handle, poll(handle)), per docs/profiles-collaboration-secrets.md A6, A8:

  • Budget carve: a child's tokens/minutes/steps come from its parent's remaining budget; no count cap. A machine guard delegation.max_live_processes only queues spawns, visibly.
  • Depth: delegation.max_depth default 2, hard ceiling 3; the delegate tool is registered only where depth < max_depth.
  • Authority: child allowlist = parent ∩ profile; Destructive unreachable; non-allowlisted Writes bubble to the orchestrator's single approval surface.
  • Writers: parallel writers get their own git worktree (existing --agents-worktree); writers in one workspace serialize on a write lease (ledger claim); only the orchestrator merges, with owner approval.
  • Mandatory report: a run cannot settle done without a completion report (changes, files, diff ref, checks run, risks); otherwise incomplete.
  • Audit: the ledger records the tree; tole audit <goal> prints it with drill-down into sessions.
  • Results flow up one level through the existing uteke mailbox room.

Updates the threat model (the depth-1 invariant changes).

Alternatives considered

Keep depth 1 (owner decided otherwise); read-only children (makes coding delegation impractical).

Are you willing to contribute the implementation?

Yes, I can do it

Before submitting

  • I searched existing issues and didn't find a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions