You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #5160 (SHAFT multi-ticket already orchestrates) and #5126 (local-coding sequential dispatch). This ticket does not reopen those. It specifies the remaining orchestrator-mode harness contract so a multi-task session cannot drift back into the main thread doing the work.
Checked current policy: chaos-engine/skills/chaos-engine/SKILL.md (solo-or-orchestrate), chaos-engine/references/delegation.md, chaos-engine/references/roles.md, chaos-engine/profiles/shaft/entrypoint.md.
This is harness guidance + contract tests, not a Java product API.
🎯 Problem Statement
When the owner gives ChaosEngine more than one task, the main thread still sometimes implements, skips a living status board, leaves finished subagents alive, or finishes a chunk without routing learnings into source-controlled Memory / issues. #5160 made SHAFT multi-issue assignments orchestrate sequentially. That is not enough:
"Multiple tasks" is broader than "multiple GitHub issues."
Portable text still allows up to four concurrent writers as the default shape, while the owner default is one writer at a time unless they ask to parallelize.
Delegates are not required to end with the reflective Learning Loop; only the session wrap-up is.
There is no required, updated-in-the-open status table the owner can read while the orchestrator stays available.
The owner must be able to talk to the orchestrator at any time. The orchestrator must not disappear into implementation.
💡 Proposed Solution
Codify orchestrator mode as the automatic mode whenever the owner has two or more in-flight tasks (unrelated work streams, or two or more SHAFT issues — existing #5160 rule stays). In that mode the harness details below are mandatory and tested.
Orchestrator does no task work
The main thread does no product, guidance, test, or implementation work.
It does not edit, run long jobs, or install.
It keeps: status, owner commands, consult/decompose, dispatch, review gate, merge babysit, and Learning Loop routing of leftovers the delegates failed to persist.
It stays available for the owner in the same conversation.
Delegation and lifetime
Every scoped task is assigned to a subagent (own worktree for writers).
Each subagent loads the ChaosEngine entrypoint and follows the full workflow for its chunk: research receipt → implement/verify → independent review as required → PR/checkpoint if it made a retained commit → reflective self-learning (Learning Loop) before it reports done.
Switching: finish or hand over anything the main thread already holds; do not start an edit in the same breath as adopting orchestrator mode.
A host with no subagent primitive cannot orchestrate; it stays sequential solo and still owes the review gate (existing portable rule).
Live status table
After every dispatch and after every subagent finishes, the orchestrator posts/updates a status table the owner can read without reconstructing the session. Minimum columns:
ID / work item
Mode stream
Status
Owner / agent
Dependency
Last update
Details / evidence
Next action
Status values at least: planned, in progress, blocked, review, completed, out of scope.
The table must include completed, in progress, planned, and out of scope rows (out of scope stays visible so it is not silently dropped). Enhance with: blocker, PR/issue links, HEAD SHA, Learning Loop result (memory / issue / nothing durable).
Nothing durable is dropped
The orchestrator verifies that every subagent's Learning Loop actually landed in a source-controlled place before killing it:
Failures, traps, and gotchas → native Memory on the task branch, or a new GitHub issue after duplicate search.
Actionable leftover / future work → its own standalone issue (constraint.every-actionable-learning-requires-its-own-standalone-github-issue).
Worthy reflections that change procedure → Memory or guidance, never chat-only.
Secrets stay out of .memory/memory (.memory/private/ only).
"Nothing durable" is a valid explicit result and must be recorded in the status table, not used to skip the check.
If a delegate omitted this, the orchestrator files the missing issue/Memory as an owner-command (allowed) and records that recovery in the table. It still does not implement the leftover work.
Every multi-task session. The owner talks to one orchestrator, sees a current board, and never loses a finding that only lived in a dead subagent transcript.
User Scenarios & Testing
User Story 1 - Auto-switch and no self-implementation (Priority: P1)
Independent Test: A harness/router contract test (or pinned phrase + scenario fixture) fails if orchestrator mode is not selected for two owner tasks, or if the orchestrator-mode text still allows the main thread to implement.
Acceptance Scenarios:
Given one owner request that names two unrelated tasks, When triage runs, Then mode is orchestrator without the owner saying "orchestrate."
Given orchestrator mode, When a product/guidance chunk is ready, Then it is dispatched to a subagent; the main thread does not edit those files.
User Story 2 - Serial default, parallel on request (Priority: P1)
Independent Test: Policy pins plus a dispatch test: default concurrency is 1; owner-requested cap is honored up to 4; 5 is refused.
Acceptance Scenarios:
Given three independent streams and no parallel request, When dispatch runs, Then only one writer is live.
Given the owner asks to parallelize with cap 3, When four independent streams exist, Then at most three writers are live.
Given two streams that share files, When parallel is requested, Then they still run sequentially.
User Story 3 - Kill after finish + Learning Loop (Priority: P1)
Independent Test: Delegation/lifecycle contract asserts: completed assignment is closed; a new chunk is a new instance; dispatch text requires Learning Loop before done.
Acceptance Scenarios:
Given a writer reports done, When the orchestrator accepts the report, Then that agent is terminated and the status table shows Learning Loop result.
Given a writer omitted an actionable leftover, When the orchestrator checks the report, Then it files/searches a standalone issue before marking the row complete.
User Story 4 - Status table (Priority: P1)
Independent Test: Guidance names the required columns and statuses; a fixture/example in tests or the playbook matches.
Acceptance Scenarios:
Given a multi-task session just entered orchestrator mode, When the first status is posted, Then planned, in-progress, completed, and out-of-scope sections/rows exist as applicable.
Given a subagent finishes, When the orchestrator replies, Then the table is updated in that same turn (not deferred).
Edge Cases
Reviewer is never a work stream and does not consume a writer slot (existing rule).
Host with no subagent primitive: stay solo sequential; still show the status table.
Switching from solo mid-task: no new edit until the handoff is recorded.
Parallel cap of 1 equals the default.
Do not put secrets in the status table or Memory.
Functional Requirements
FR-001: Document orchestrator mode in the portable entrypoint and/or delegation.md so every host sees: no self-implementation, stay available, serial default, optional parallel cap (default max 4, owner-settable), auto-switch on multiple tasks.
FR-002: Require every dispatched writer to end with the Learning Loop; orchestrator verifies source-controlled landing before kill.
FR-003: Require the live status table and update-after-each-agent rule.
FR-004: Kill finished agents; no resume of a completed assignment.
Related to #5160 (SHAFT multi-ticket already orchestrates) and #5126 (local-coding sequential dispatch). This ticket does not reopen those. It specifies the remaining orchestrator-mode harness contract so a multi-task session cannot drift back into the main thread doing the work.
✅ Pre-submission Checklist
chaos-engine/skills/chaos-engine/SKILL.md(solo-or-orchestrate),chaos-engine/references/delegation.md,chaos-engine/references/roles.md,chaos-engine/profiles/shaft/entrypoint.md.🎯 Problem Statement
When the owner gives ChaosEngine more than one task, the main thread still sometimes implements, skips a living status board, leaves finished subagents alive, or finishes a chunk without routing learnings into source-controlled Memory / issues. #5160 made SHAFT multi-issue assignments orchestrate sequentially. That is not enough:
The owner must be able to talk to the orchestrator at any time. The orchestrator must not disappear into implementation.
💡 Proposed Solution
Codify orchestrator mode as the automatic mode whenever the owner has two or more in-flight tasks (unrelated work streams, or two or more SHAFT issues — existing #5160 rule stays). In that mode the harness details below are mandatory and tested.
Orchestrator does no task work
Delegation and lifetime
followup_task/ resume a completed assignment. A new review or a new chunk is a new instance (Harness: a completed subagent is being re-invoked repeatedly with the same instruction, burning ~85k tokens per cycle #4083 is the prior burn).ChaosEngine/*branch off fetchedorigin/main(SHAFT profile: multi-ticket assignments orchestrate, load all issues, fewest PRs, sequential chunks #5160).Default serial, optional parallel
1–4). The harness must refuse a requested cap above 4.Automatic switch
Live status table
After every dispatch and after every subagent finishes, the orchestrator posts/updates a status table the owner can read without reconstructing the session. Minimum columns:
Status values at least:
planned,in progress,blocked,review,completed,out of scope.The table must include completed, in progress, planned, and out of scope rows (out of scope stays visible so it is not silently dropped). Enhance with: blocker, PR/issue links, HEAD SHA, Learning Loop result (
memory/issue/nothing durable).Nothing durable is dropped
The orchestrator verifies that every subagent's Learning Loop actually landed in a source-controlled place before killing it:
constraint.every-actionable-learning-requires-its-own-standalone-github-issue)..memory/memory(.memory/private/only).If a delegate omitted this, the orchestrator files the missing issue/Memory as an owner-command (allowed) and records that recovery in the table. It still does not implement the leftover work.
🔄 Alternatives Considered
🗂️ Area of the Framework
chaos-engine/skills/chaos-engine/SKILL.md,references/delegation.md,references/roles.md, SHAFTentrypoint.md, router/harness tests)📈 Use Case & Impact
Every multi-task session. The owner talks to one orchestrator, sees a current board, and never loses a finding that only lived in a dead subagent transcript.
User Scenarios & Testing
User Story 1 - Auto-switch and no self-implementation (Priority: P1)
Independent Test: A harness/router contract test (or pinned phrase + scenario fixture) fails if orchestrator mode is not selected for two owner tasks, or if the orchestrator-mode text still allows the main thread to implement.
Acceptance Scenarios:
User Story 2 - Serial default, parallel on request (Priority: P1)
Independent Test: Policy pins plus a dispatch test: default concurrency is 1; owner-requested cap is honored up to 4; 5 is refused.
Acceptance Scenarios:
User Story 3 - Kill after finish + Learning Loop (Priority: P1)
Independent Test: Delegation/lifecycle contract asserts: completed assignment is closed; a new chunk is a new instance; dispatch text requires Learning Loop before done.
Acceptance Scenarios:
User Story 4 - Status table (Priority: P1)
Independent Test: Guidance names the required columns and statuses; a fixture/example in tests or the playbook matches.
Acceptance Scenarios:
Edge Cases
Functional Requirements
delegation.mdso every host sees: no self-implementation, stay available, serial default, optional parallel cap (default max 4, owner-settable), auto-switch on multiple tasks.test_agent_router_contract.py/ portable-core / SHAFT profile tests as applicable).Success Criteria
Assumptions
Out of scope
📝 Additional Context
Current anchors to update or extend, not replace blindly:
chaos-engine/skills/chaos-engine/SKILL.md— Solo or orchestratechaos-engine/references/delegation.md— Main-thread duties, agent lifetimechaos-engine/references/roles.md— Orchestratorchaos-engine/profiles/shaft/entrypoint.md— Multi-ticket assignment orchestrationchaos-engine/references/work-github-playbook.md— Learned-lessons workflow