Skip to content

feat: bounded native subagent dispatch MVP (pilot) — follow-up to #350 - #355

Merged
sergstack merged 2 commits into
mainfrom
codex/native-subagent-dispatch-mvp
Sep 2, 2026
Merged

feat: bounded native subagent dispatch MVP (pilot) — follow-up to #350#355
sergstack merged 2 commits into
mainfrom
codex/native-subagent-dispatch-mvp

Conversation

@sergstack

Copy link
Copy Markdown
Owner

Summary

Follow-up to #350. On the Claude Code surface the native subagent primitive is real (unlike the ChatGPT/Codex surface #350 audited), so this wires Invoke AI-OS to it as a bounded, owner-approved, pilot-only capability. Verdict from 3 real multi-owner executions: PASS. Recommendation: keep pilot-only; standardization is a separate owner decision.

Governance: the owner granted a bounded carve-out on 2026-09-02 ("Supervised AI-OS subagent dispatch (pilot)") — pilot-only, does not generalize, not a standard workflow.

What changed (2 commits)

54d4d97 — governance + binding + tests

  • AGENT_LOOP_PLAYBOOK.md: new allowed loop type + "Supervised AI-OS Subagent Dispatch (Pilot)" section carrying every mandatory bound (hub-and-spoke root→child→root, root is sole router, no child→child, one execution_id, reuse AES continuation/route_trace/guards/handoff/authority-provenance with no parallel model, PROJECT_CAPABILITIES.yaml stays sole registry, bounded project-context per child, no new authority, unchanged merge/deploy/production/destructive/external gates, no framework/runtime/DB, .gitignore unchanged, shared-fs risk, no timeout primitive, observable-evidence rule).
  • AGENTS.md / CURRENT_STATUS.md: the "agentic workflows" blocked item annotated with the single bounded exception; status line added.
  • AIOS_05 bundle + provenance audit regenerated.
  • PROJECT_CAPABILITIES.yaml: additive semantic executor block per capability (backend: claude_code_subagent, agent_type Plan / general-purpose, context_loader: project-context, write_capable, child_dispatch: forbidden). No AES-record schema change.
  • ai-os-orchestrator/SKILL.md: "Native subagent dispatch (pilot)" subsection — preconditions, bounded prompt, root-only route_trace + guard handling, mechanical (non-discretionary) after-child step, failure → AES defect.
  • project-context/SKILL.md: one line binding it as the child context loader.
  • tests/test_project_capabilities_executor.py (new, 8 invariants) + test_aios_dual_surface.py updated for the executor key.

20390ed — pilot evidence

  • docs/evidence/NATIVE_SUBAGENT_DISPATCH_PILOT_2026-09-02.md — full FACT/architecture/traces/defects/verdict.
  • Pointers in docs/evidence/README.md, MASTER_STATUS.md.

Pilot traces (observed)

Pilot Route execution_id Dispatches Result
A Thinking → root → Analytics → root → Thinking exec-pilotA-2026-09-02 3 one recommendation (advisory nightly, not blocking) + decision status + 5 revisit triggers
B AI OS → root → LLM → root → Codex (read-only) exec-pilotB-2026-09-02 3 bounded_context_check spec + verified minimal repo placement, zero writes
C ai_os → thinking → (refused repeat) → ai_os exec-pilotC-2026-09-02 3 + 1 refused 168-word governance note; loop guard shown both ways

Pilot C loop guard: repeat route to ai_os without evidence_deltarepeat_route_refused_missing_evidence_delta (not dispatched); with a material evidence_delta → allowed. All 14 owner acceptance criteria + the guard check pass (table in the evidence doc).

Defects (registered, not hidden)

  • DEF-001 external_dependency — dispatched children inherit the parent cwd/branch (shared FS) and read a stale local tree; domain reasoning was sound, decision outputs unaffected (later slices re-verified). Logged as a standardization blocker.
  • DEF-002 contract — orchestrator subsection lacked a "root after-child step is mechanical" constraint (AES §2.1). Fixed in this PR (one corrective fix).

Checks

6 canonical scripts + audit_bundle_provenance.py --check + pytest tests/ -q (215 passed, +8 new).

Rollback

git revert the two commits. executor block is inert data once the orchestrator subsection reverts; no schema migration, no runtime store, no .gitignore change. Prompt-level Invoke AI-OS, Goal Mode, AES records, existing routing unaffected.

AES statuses

execution_state: completed · overall_delivery: pass · qa_status: pass · judge_verdict: not_run · authority_status: owner_review_pending · merge_status: open · production_status: not_applicable

Recommendation

Keep pilot-only. Standardization → separate owner decision, gated on: DEF-001 fixed (deterministic child checkout / mandatory worktree isolation); structural hub-and-spoke for the write path (codex executor currently general-purpose, can nest — prompt-enforced only); 2–3 more executions incl. a runtime-failure case to calibrate the four guard thresholds; a named cost/latency owner.

🤖 Generated with Claude Code

Claude Code and others added 2 commits September 2, 2026 10:55
…ce + binding + tests

Owner-approved bounded carve-out (2026-09-02) for "supervised AI-OS subagent
dispatch (pilot)". Pilot-only; not a standard workflow; does not generalize.

Governance clarification:
- ChatGPT/[AI OS]/Knowledge/AGENT_LOOP_PLAYBOOK.md: new allowed loop type +
  a "Supervised AI-OS Subagent Dispatch (Pilot)" section with all mandatory
  bounds (hub-and-spoke, root-only routing, no child->child, one execution_id,
  reuse AES continuation/route_trace/guards, bounded project-context, no new
  authority, unchanged gates, no framework/runtime/DB, .gitignore unchanged,
  shared-fs risk, no timeout primitive, observable evidence).
- AGENTS.md / CURRENT_STATUS.md: annotate the "agentic workflows" blocked item
  with the single bounded exception; add a status line.
- Regenerated AIOS_05 bundle + provenance audit.

Runtime binding (Option 1, native built-in subagents only):
- PROJECT_CAPABILITIES.yaml: additive semantic executor block per capability
  (backend claude_code_subagent, agent_type Plan / general-purpose,
  context_loader project-context, write_capable, child_dispatch forbidden).
  Registry stays the only capability registry; no AES-record schema change.
- .agents/skills/ai-os-orchestrator/SKILL.md: "Native subagent dispatch
  (pilot)" subsection — dispatch preconditions, bounded prompt, root-only
  route_trace + guard handling, failure -> AES defect.
- .agents/skills/project-context/SKILL.md: one line binding it as the child
  context loader.

Tests: tests/test_project_capabilities_executor.py (8 deterministic invariants);
tests/test_aios_dual_surface.py updated for the new executor key.

Checks: 6 canonical scripts + provenance audit + pytest (215) all pass.
No behavioral pilot has run yet — evidence doc follows in the next commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t PASS

Ran the bounded pilot end-to-end on the Claude Code surface:

- Pilot A: Thinking -> root -> Analytics -> root -> Thinking (exec-pilotA)
- Pilot B: AI OS -> root -> LLM -> root -> Codex (read-only) (exec-pilotB)
- Pilot C: multi-hop; loop guard exercised both ways (exec-pilotC) —
  bare repeat route refused (repeat_route_refused_missing_evidence_delta),
  repeat route allowed after a material evidence_delta.

9 real native subagent dispatches. One execution_id per pilot, root-only
routing, bounded project-context per child, no child->child, Closure Review
against the original goal, one final result each. All 14 owner acceptance
criteria + the Pilot C guard check observed.

Defects registered (not hidden):
- DEF-001 external_dependency: children inherit the parent cwd/branch
  (shared filesystem) and read a stale tree; domain reasoning unaffected;
  logged as a design risk for standardization.
- DEF-002 contract: orchestrator subsection lacked a "root after-child step
  is mechanical, not discretionary" constraint (AES 2.1 boundary). Fixed —
  closed-trigger wording added to ai-os-orchestrator/SKILL.md (one fix).

Evidence: docs/evidence/NATIVE_SUBAGENT_DISPATCH_PILOT_2026-09-02.md
Pointers: docs/evidence/README.md, MASTER_STATUS.md.

Verdict: PASS. Recommendation: keep pilot-only; standardization needs a
separate owner decision gated on DEF-001 fix, structural hub-and-spoke for
the write path, 2-3 more executions to calibrate guard thresholds, and a
cost owner.

Checks: 6 canonical scripts + provenance audit + pytest (215) all pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the needs-human-review Human review is required before merge label Sep 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge gate: protected paths changed. Auto-merge is disabled and owner review is required via CODEOWNERS.

@sergstack
sergstack merged commit 0a7ee18 into main Sep 2, 2026
2 checks passed
@sergstack
sergstack deleted the codex/native-subagent-dispatch-mvp branch September 2, 2026 08:30
sergstack added a commit that referenced this pull request Sep 2, 2026
…ow-up to #355 (#356)

* feat(orchestrator): harden dispatch — mandatory worktree isolation + structural no-nesting

Closes the two standardization blockers from PR #355's DEF-001 / residual risks,
using native runtime enforcement, not prompt text.

Blocker 1 (DEF-001, workspace isolation):
- Every executor gains workspace: isolated_worktree. The orchestrator MUST
  dispatch with Agent isolation: "worktree" — child works in a clean, locked
  git worktree at a deterministic revision, never the parent working tree.
  Audit: observed a probe child land in .claude/worktrees/agent-<id> on a clean
  HEAD, isolated from the parent branch.

Blocker 2 (structural no-nesting on the write path):
- Audit finding: a general-purpose child CAN spawn a nested sub-agent (probe
  did it). Plan/Explore agent types are defined "All tools except Agent, ...
  Write, Edit" -> structurally cannot nest and cannot write.
- Every executor.agent_type is now Plan (was general-purpose for codex).
  write_capable is false for all. An implementation slice returns a patch +
  validation commands; the ROOT applies and validates. Root is the only agent
  holding Agent + Write.

Files: PROJECT_CAPABILITIES.yaml (executor: +workspace, agent_type Plan,
write_capable false), ai-os-orchestrator/SKILL.md (structural invariants +
mandatory isolation + patch-return flow + bounded failure recovery),
AGENT_LOOP_PLAYBOOK.md bounds (+ regenerated AIOS_05 + provenance),
tests/test_project_capabilities_executor.py (DEF-001 regression + non-nesting
+ no-write-capable-child invariants).

Checks: 6 canonical scripts + provenance audit + pytest (216) pass.
Additional observed executions + measurement evidence + decision memo follow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(evidence): standardization decision memo — 3 more executions, verdict STANDARDIZE BOUNDED (conditional)

Native enforcement audit + Pilots D/E/F on the hardened dispatch:

- Pilot D (runtime failure): Plan child structurally lacks Write -> honest
  failure, no workaround -> DEF-P D-001 -> bounded recovery (patch-return,
  root applied + validated), no silent retry.
- Pilot E (write path): Plan child in isolated worktree returned a clean
  2-file unified diff + validation commands; root applied and validated.
  subagent_tokens 41558, tool_uses 11, duration 93s.
- Pilot F (long multi-hop): 5 owner transitions
  ai_os->thinking->analytics->codex->ai_os, one execution_id
  exec-pilotF-2026-09-02, root-only routing, guard-gated repeat, Closure
  Review. Pilot's own multi-owner verdict: STANDARDIZE BOUNDED WITH
  CONDITIONS.

Measurement evidence: 16 total dispatches (7 hardened), isolated-worktree
landing 7/7=100%, structural write refusal 1/1, nested spawn by non-nesting
executor 0, silent retries 0, latency captured n=2 (93s/149s), telemetry
captured opportunistically only.

Risks CLOSED (native, not prompt): DEF-001 workspace isolation (mandatory
isolation:"worktree", registry + test + fail-closed SKILL wording);
structural no-nesting (all executors Plan = no Agent tool; write-capable
child removed; patch-return + root applies).

Risks REMAINING: R1 unverified live spawn args (irreducible for a
prompt-level controller); R2 thin measurement base; R3 worktree isolates
VCS state only; R7 no cost owner.

SKILL.md gains fail-closed spawn wording. No AES-record schema change, no
ROUTING_RULES/registry-role/authority/gate change, no framework.

Recommendation: STANDARDIZE BOUNDED (conditional) on a 4-item punch-list
(fail-closed evidence linter, telemetry schema, >=15-dispatch sample, cost
owner); else KEEP PILOT-ONLY until it lands.

Checks: 6 canonical scripts + provenance audit + pytest (216) pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Code <sstegancev@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human-review Human review is required before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant