Browse Source

Update readme

Alvin Unreal 1 month ago
parent
commit
df09ed76ad

+ 1 - 1
README.md

@@ -566,7 +566,7 @@ Use this section as a map: start with installation, then jump to features, confi
 | Doc | What it covers |
 |-----|----------------|
 | **[Council](docs/council.md)** | Run multiple models in parallel and synthesize a single answer with `@council` |
-| **[Background Orchestration](docs/v2-background-orchestration.md)** | Scheduler-first orchestrator model built around native background subagents |
+| **[Background Orchestration](docs/background-orchestration.md)** | Scheduler-first orchestrator model built around native background subagents |
 | **[Multiplexer Integration](docs/multiplexer-integration.md)** | Watch agents work live in Tmux or Zellij panes |
 | **[Session Management](docs/session-management.md)** | Reuse recent child-agent sessions with short aliases instead of starting over |
 | **[Preset Switching](docs/preset-switching.md)** | Switch agent model presets at runtime with `/preset` |

+ 0 - 150
docs/background-job-board-lessons.md

@@ -1,150 +0,0 @@
-# Background Job Board Lessons
-
-This note captures what we learned while hardening background task tracking,
-cancellation, session reuse, and tmux pane cleanup.
-
-## What the Board Is For
-
-The Background Job Board is a compact prompt reminder for orchestrator-managed
-`task` delegations. It lets the orchestrator see:
-
-- which specialist tasks are still running,
-- which terminal tasks still need reconciliation,
-- which completed sessions can be resumed for related follow-up work,
-- what files a remembered specialist session already read.
-
-The board is not an authority over OpenCode runtime state. It is a coordination
-cache. Live OpenCode events, task output, `/session/status`, and session
-delete/abort behavior can disagree, so cancellation and reuse must be defensive.
-
-## Correct Prompt Contract
-
-The board prompt should say:
-
-```text
-Do not poll running jobs. Reconcile terminal jobs before final response.
-Reuse only completed sessions for the same specialist/context; never reuse
-cancelled or errored sessions.
-```
-
-The older wording was unsafe:
-
-```text
-Reuse any non-running session for the same specialist/context.
-```
-
-That allowed cancelled/error sessions to appear as reusable, for example:
-
-```text
-#### Reusable Sessions
-- ora-1 / ses_... / oracle / cancelled, reconciled
-```
-
-Cancelled and errored sessions are terminal, but they are not good continuation
-targets. They may contain partial state, aborted streams, or a failed prompt loop.
-Reusable sessions should be **completed and reconciled only**.
-
-## Cancellation Is Not Just Board State
-
-Marking a job `cancelled` is not enough. The child OpenCode session can continue
-running after the board says cancelled if we only trust plugin-local state.
-
-The reliable cancellation flow is:
-
-1. Resolve the job by parent-scoped alias or raw `ses_...` ID.
-2. Call `session.abort` to interrupt the active prompt runner.
-3. If the SDK supports it, call `session.delete` immediately after abort.
-4. Verify that the session is no longer busy.
-5. Only then mark the board job as cancelled and unreconciled.
-
-`session.abort` alone can produce a temporary idle event while the background
-task loop later starts another prompt step. `session.delete` is the stronger
-operation for cancellation because it removes the child session and emits
-`session.deleted`.
-
-## `/session/status` Can Be Misleading
-
-During testing, `/session/status` sometimes returned a map that did not include
-the child session, which looks like idle/missing, while the event stream later
-showed the same session was still busy.
-
-Implication:
-
-- Do not treat one missing status-map entry as proof of termination.
-- Use live `session.status` events to update `lastLiveBusyAt` in the job board.
-- If any busy event is observed after cancellation begins, the session is not
-  safely cancelled.
-- Prefer `session.delete` over a long idle polling window for explicit user
-  cancellation.
-
-## Transient Task Errors Are Ambiguous
-
-OpenCode can return:
-
-```text
-Task is not running in this process and has no final output.
-```
-
-That does not always mean the child task is done. It can mean the task is not
-known to the current process while the session is still live elsewhere.
-
-Treat this as a transient process-local error when there is evidence the session
-is still running. Do not terminalize the job or launch a duplicate specialist
-just because this error appeared.
-
-## Pane Cleanup Has Cross-Instance Races
-
-The multiplexer session manager keeps shared in-memory state for tracked panes.
-Multiple plugin instances can observe the same OpenCode event stream. Owner
-gating is useful for ordinary idle/missing cleanup, but it caused a race for
-deleted sessions:
-
-1. Child pane was spawned by instance A.
-2. `session.delete` emitted `session.deleted`.
-3. Instance B saw the delete event first.
-4. Instance B skipped close because it was not the owner.
-5. The pane remained visible until instance A later received another idle event.
-
-For `session.deleted`, any instance that sees the event should close the tracked
-pane by shared pane ID. Keep owner gating for normal idle/missing cleanup, but
-not for deletion.
-
-## Reconciliation Rules
-
-- Running jobs: wait for hook-driven completion.
-- Terminal unreconciled jobs: mention/reconcile before final response.
-- Completed + reconciled jobs: may be reusable if the same specialist/context
-  matches.
-- Cancelled/error jobs: hide from reusable sessions after reconciliation.
-- Cancelled writer tasks: inspect partial file changes before replacing the lane.
-
-## Useful Debug Logs
-
-When debugging cancellations, search plugin logs under
-`~/.local/share/opencode` for:
-
-- `[cancel-task] request received`
-- `[cancel-task] abort call returned`
-- `[cancel-task] deleting session after unstable abort`
-- `[cancel-task] session delete returned`
-- `[cancel-task] delete verification status`
-- `[task-session-manager] busy observed after cancel request`
-- `[multiplexer-session-manager] session deleted, closing pane`
-- `[multiplexer-session-manager] closing deleted pane as non-owner`
-- `[tmux] closePane`
-
-The important question is not whether `cancel_task` returned a cancelled-looking
-message. The important question is whether the logs show the child session was
-deleted and the pane close path ran.
-
-## Practical Takeaways
-
-- Board state is advisory; OpenCode session lifecycle is authoritative.
-- `abort` interrupts work; `delete` terminates the child session lifecycle.
-- Hook-driven completion is the normal path; explicit lifecycle checks are only
-  supporting evidence when diagnosing cancellation or pane cleanup.
-- Event-backed state catches runtime behavior that status maps can miss.
-- Prompt wording matters: “non-running” was too broad; “completed only” is the
-  safer reuse contract.
-- Pane cleanup must handle multi-instance event races, especially on
-  `session.deleted`.

+ 0 - 0
docs/v2-background-orchestration.md → docs/background-orchestration.md


+ 4 - 14
docs/thirty-dollars-preset.md

@@ -2,7 +2,7 @@
 
 This preset is for people who want a strong setup built around **Codex Plus ($20/month)** and **GitHub Copilot Pro ($10/month)**.
 
-It uses Codex Plus for the OpenAI models and GitHub Copilot for the premium council/design models, giving you a mixed-provider setup for about **$30/month total**.
+It uses Codex Plus for the OpenAI models and GitHub Copilot for the premium design models, giving you a mixed-provider setup for about **$30/month total**.
 
 ---
 
@@ -12,22 +12,12 @@ It uses Codex Plus for the OpenAI models and GitHub Copilot for the premium coun
 {
     "preset": "thirtydollars",
     "presets": {
-      "thirtydollars": { "orchestrator": { "model": "openai/gpt-5.5", "skills": [ "*" ], "mcps": [ "*", "websearch"] },
+      "thirtydollars": { "orchestrator": { "model": "openai/gpt-5.5", "variant": "medium", "skills": [ "*" ], "mcps": [ "*", "websearch"] },
         "oracle": { "model": "openai/gpt-5.5", "variant": "high", "skills": [], "mcps": [] },
-        "council": { "model": "openai/gpt-5.5" },
         "librarian": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [ "websearch", "context7", "gh_grep" ] },
         "explorer": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [] },
-        "designer": { "model": "github-copilot/gemini-3.1-pro-preview", "skills": [], "mcps": [] },
-        "fixer": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [] }
-      }
-    },
-   "council": {
-      "presets": {
-        "default": {
-          "alpha":  { "model": "github-copilot/claude-sonnet-4.6" },
-          "beta": { "model": "github-copilot/gemini-3.1-pro-preview" },
-          "gamma": { "model": "openai/gpt-5.5" }
-        }
+        "designer": { "model": "github-copilot/gemini-3.5-flash", "skills": [], "mcps": [] },
+        "fixer": { "model": "openai/gpt-5.5", "variant": "low", "skills": [], "mcps": [] }
       }
     }
   }

+ 0 - 32
docs/v2-workstreams.md

@@ -1,32 +0,0 @@
-# Internal: V2 Workstreams Archive
-
-> **Internal historical planning doc.** This file tracked V2 feature branches
-> and beta integration while background orchestration was being built. It is not
-> current user-facing install or release guidance. For the default release, see
-> [Installation](installation.md) and
-> [Background Orchestration](v2-background-orchestration.md).
-
-This archive tracked focused V2 branches and local worktrees while background
-orchestration was being built. It is not current release guidance.
-
-| Branch | Worktree | Purpose | Status | Notes |
-|---|---|---|---|---|
-| `v2-beta` | repo root | V2 integration/release | Historical | Former source of truth for combined V2 pre-release validation. |
-| `v2/misc` | `.slim/worktrees/v2-misc` | Misc V2 cleanup | Merged | Removed custom subtask feature; can continue misc follow-ups here if desired. |
-| `v2/tui` | `.slim/worktrees/v2-tui` | TUI integration | Planned | No feature work merged yet. |
-
-Useful status commands:
-
-```bash
-git worktree list
-git branch --list 'v2/*' -vv
-git branch --merged v2-beta
-git log --oneline --decorate --graph --all --branches='v2/*'
-```
-
-After a feature branch is merged and no longer needed locally:
-
-```bash
-git worktree remove .slim/worktrees/v2-<feature-name>
-git branch -d v2/<feature-name>
-```

+ 0 - 621
docs/v2_core.md

@@ -1,621 +0,0 @@
-# Internal: V2 Core Refactor Plan
-
-> **Internal historical planning doc.** This file records the V2 implementation
-> plan that led to the current default background-orchestration release. It is
-> not the beta user guide and may mention branch or rollout details that are now
-> historical. For user-facing setup, see [Installation](installation.md) and
-> [Background Orchestration](v2-background-orchestration.md).
-
-This archival document records the implementation plan for the V2 orchestration
-core. It is retained for maintainers who need the design history.
-
-Scope for this pass:
-
-- core prompts,
-- scheduler/job-board behavior,
-- native `task` and hook-driven completion integration,
-- task-session-manager changes,
-- tmux/zellij multiplexer compatibility.
-
-Out of scope for this pass:
-
-- Divoom integration,
-- install/startup flag checks,
-- README/index documentation updates,
-- legacy fallback behavior.
-
-V2 assumes native OpenCode background subagents are available and enabled.
-
----
-
-## Core Thesis
-
-V2 changes the orchestrator from a worker-with-delegation into a scheduler.
-
-V1 mental model:
-
-```text
-orchestrator works directly → delegates when useful → waits for result
-```
-
-V2 mental model:
-
-```text
-orchestrator plans → dispatches background specialists → monitors jobs
-→ reconciles terminal results → verifies final state
-```
-
-The orchestrator should not be the default implementation worker. Specialists do
-the work; the orchestrator manages the work.
-
----
-
-## Native Background Task Lifecycle
-
-OpenCode background task semantics are the foundation:
-
-```text
-task(background: true)
-  → returns immediately with task_id
-  → child session continues elsewhere
-  → OpenCode injects completion when terminal
-  → orchestrator consumes terminal result
-```
-
-Important distinction:
-
-- `task` result means **launched**.
-- Injected terminal completion means **finished**.
-- Finished is not the same as reconciled.
-
-V2 must model these as separate states.
-
----
-
-## Core State Model
-
-Introduce a small scheduler/job-board model for background delegates.
-
-Suggested state shape:
-
-```ts
-type BackgroundJobState =
-  | 'running'
-  | 'completed'
-  | 'error'
-  | 'cancelled'
-  | 'reconciled';
-
-interface BackgroundJobRecord {
-  taskID: string;
-  parentSessionID: string;
-  agent: string;
-  description: string;
-  objective: string;
-  ownership?: string[];
-  dependencies?: string[];
-  state: BackgroundJobState;
-  launchedAt: number;
-  updatedAt: number;
-  completedAt?: number;
-  timedOut?: boolean;
-  terminalUnreconciled?: boolean;
-  resultSummary?: string;
-}
-```
-
-Native task output states are `running`, `completed`, `error`, and
-`cancelled`. A wait timeout is not a terminal native state; represent it as a
-`timedOut` overlay while the job remains `running`.
-
-This does not need to be persisted initially. Start in memory, scoped to the
-parent orchestrator session.
-
-Start with minimal reliable fields:
-
-```ts
-{
-  taskID,
-  parentSessionID,
-  agent,
-  description,
-  objective,
-  state,
-  timedOut,
-  terminalUnreconciled,
-  launchedAt,
-  updatedAt,
-  completedAt,
-  resultSummary,
-}
-```
-
-Keep `ownership` and `dependencies` advisory until there is a reliable data
-source. Native `task` arguments do not contain those fields, so initial V2 should
-not pretend the plugin can infer them perfectly.
-
-### Shared scheduler module
-
-Do not bury this state inside `task-session-manager`.
-
-Create a small shared utility, for example:
-
-- `src/utils/background-job-board.ts`, or
-- `src/hooks/scheduler-state/` if it grows into a hook-owned subsystem.
-
-It should expose methods such as:
-
-```ts
-registerLaunch(record)
-updateStatus(taskID, status)
-markReconciled(taskID)
-hasRunning(parentSessionID)
-hasTerminalUnreconciled(parentSessionID)
-formatForPrompt(parentSessionID)
-```
-
-Then pass the shared state into:
-
-- task-session-manager,
-- any future prompt/system-context hook that needs scheduler state.
-
-### Reconciliation rule
-
-The plugin needs one concrete reconciliation transition.
-
-Initial rule:
-
-1. Task output or an auto-injected completion message marks a job terminal and
-   `terminalUnreconciled: true`.
-2. The next orchestrator assistant turn after that terminal result is treated as
-   the reconciliation turn for all terminal unreconciled jobs visible in context.
-3. On orchestrator assistant turn completion, when the parent session returns to
-   idle after that assistant response, mark the terminal unreconciled jobs that
-   were injected into that turn's prompt as `reconciled`.
-
-This is intentionally simple. It avoids terminal jobs living forever while still
-forcing at least one orchestrator turn to see and account for each result.
-
-**Important:** Idle-based reconciliation is a heuristic. Reconciled status means
-a terminal result was injected into an orchestrator turn that completed and the
-parent returned to idle; it is not proof the result was explicitly acknowledged
-or used by the orchestrator. Initial V2 should not try to infer from free text
-whether the orchestrator mentioned, ignored, blocked, or failed a job. If a more
-precise protocol is needed later, add an explicit marker/tool for reconciliation.
-
----
-
-## Prompt Refactor
-
-Primary file:
-
-- `src/agents/orchestrator.ts`
-
-Related reminder file:
-
-- `src/config/constants.ts`
-
-### Role rewrite
-
-Replace the current role framing with scheduler-first language:
-
-```text
-You are a workflow manager for coding work. Your job is to plan, schedule,
-delegate, monitor, reconcile, and verify specialist-agent work. You are not the
-default implementation worker.
-```
-
-The orchestrator may directly:
-
-- ask clarifying questions,
-- read minimal context required to route work,
-- manage todos,
-- dispatch specialists,
-- track task state through hook-driven completion,
-- synthesize results,
-- run final checks when that is the simplest verification path.
-
-The orchestrator should delegate:
-
-- broad search,
-- external docs/API research,
-- implementation,
-- test writing or test updates,
-- UI polish,
-- architecture review,
-- visual/media analysis.
-
-### Replace blocking execution section
-
-Remove the V1 text that says delegated specialists block the parent until result.
-
-New execution model:
-
-```text
-### OpenCode V2 scheduler model
-- Delegated specialists should be launched as background tasks whenever work can
-  run independently using `task(..., background: true)`.
-- A dispatch returns a task/session ID immediately; it does not mean completion.
-- Track each task ID with specialist, objective, state, and any advisory
-  ownership/dependency labels available from the dispatch plan.
-- Continue orchestration while tasks run: planning, scheduling independent lanes,
-  preparing synthesis, and asking needed user questions.
-- Wait for hook-driven completion before consuming
-  outputs or starting dependent work.
-- Parallel background tasks are allowed only when their write scopes do not
-  conflict.
-- Final response requires relevant tasks to be terminal and reconciled.
-```
-
-### Replace execute workflow
-
-V2 workflow should be:
-
-```text
-## Dispatch
-1. Split work into independent and dependency-ordered lanes.
-2. Plan advisory ownership for write-capable lanes.
-3. Dispatch independent specialists as background tasks.
-4. Record task IDs, state, and advisory ownership/dependency labels.
-5. Continue only independent orchestration while jobs run.
-6. Wait for terminal results via hook-driven completion.
-7. Reconcile results, resolve conflicts, and gate dependent lanes.
-8. Dispatch follow-up jobs if needed.
-9. Verify final state.
-```
-
-### Phase reminder rewrite
-
-Update `PHASE_REMINDER_TEXT` so it reinforces scheduler behavior:
-
-```text
-Build a short work graph with independent lanes, dependencies, and advisory
-ownership.
-Dispatch independent specialists as background tasks, record task/session IDs,
-then continue orchestration. Wait for hook-driven completion and only consume outputs or advance
-dependent work when results are terminal.
-```
-
----
-
-## Task Prompt Contract
-
-Each background task prompt should be self-contained and bounded.
-
-Include:
-
-- objective,
-- constraints,
-- relevant files or search scope,
-- ownership boundaries,
-- whether edits are allowed,
-- expected output format,
-- validation expectations,
-- what not to do.
-
-Good prompt:
-
-```text
-Inspect src/hooks/task-session-manager for assumptions that a task result means
-child work is finished. Do not edit files. Return exact files/functions,
-background-task risks, and recommended changes.
-```
-
-Bad prompt:
-
-```text
-Look into background tasks.
-```
-
----
-
-## Task Session Manager Refactor
-
-Primary files:
-
-- `src/hooks/task-session-manager/index.ts`
-- `src/utils/task.ts`
-- `src/utils/background-job-board.ts`
-
-Current behavior:
-
-- `src/index.ts` creates one shared `BackgroundJobBoard` using
-  `backgroundJobs` caps/context config and passes it to task-session-manager,
-  cancel-task, and multiplexer integration.
-- `tool.execute.before(task)` validates `subagent_type`, strips stale/invalid
-  `task_id` aliases when they cannot safely resolve, and only resolves reusable
-  aliases for matching completed/reconciled jobs.
-- No `task_status` hook is installed; upstream no longer exposes that tool
-  running or terminal tasks.
-- `tool.execute.after(task)` parses native launch output and records running
-  jobs in the shared board; it does not treat launch as completion.
-- `tool.execute.after(task)` and synthetic completion messages parse
-  status output into running/terminal job-board state.
-- Prompt injection is owned by the job board: running and terminal unreconciled
-  jobs appear under `### Background Job Board`; completed/reconciled jobs appear
-  only in the reusable section.
-
-V2 behavior:
-
-- `task` tool output creates or updates a job as `launched` or `running`.
-- Task output updates the job to `running`, `completed`, `error`, or
-  `cancelled`; timeout is metadata while the job remains `running`.
-- only terminal jobs become ready for reconciliation.
-- only reconciled/appropriate sessions should be offered for reuse.
-
-### Required changes
-
-1. Split parsing helpers:
-
-   ```ts
-   parseTaskLaunchOutput(output) → { taskID, state: 'running' | ... }
-   parseTaskStatusOutput(output) → { taskID, state, result? }
-   ```
-
-2. Store background job records in `src/utils/background-job-board.ts`, scoped by
-   parent orchestrator session.
-
-3. Update `tool.execute.after` for `task`:
-
-   - parse launch output,
-   - register job as launched/running,
-   - do not treat it as completed.
-
-4. Handle task output and injected completions:
-
-   - parse status output,
-   - update job state,
-   - attach result summary for terminal states.
-
-5. Update system-context injection:
-
-   - inject the unified `### Background Job Board`,
-   - include compact running/terminal unreconciled jobs,
-   - keep aliases short.
-
-6. Do not expose running background jobs as resumable sessions. A running job
-   alias should not be used with running `task(task_id=...)`. Only completed and
-   reconciled sessions should enter the reusable section.
-
----
-
-## Background Job Board Prompt Context
-
-The orchestrator needs a compact view of active work.
-
-Target injected shape:
-
-```text
-### Background Job Board
-Do not poll running jobs. Reconcile terminal jobs before
-final response.
-
-- exp-4 / ses_abc / explorer / running
-  Objective: Map multiplexer flow
-  Ownership: read-only
-  Dependencies: none
-
-- fix-2 / ses_def / fixer / completed, unreconciled
-  Objective: Update task-session-manager task output handling
-  Ownership: src/hooks/task-session-manager/**
-```
-
-Keep this small. The point is scheduling state, not full task transcripts.
-
----
-
-## Task Completion Integration
-
-Primary files:
-
-- `src/index.ts`
-- `src/hooks/task-session-manager/index.ts`
-
-Track native `task` output and injected completion messages.
-
-Target flow:
-
-```text
-tool.execute.after(task)
-  → parse task_id + state
-  → update job board
-  → if terminal, attach compact result summary
-  → mark as terminal/unreconciled
-```
-
-The orchestrator prompt should then see terminal jobs and reconcile them before
-continuing dependent work.
-
-Do not rely only on OpenCode auto-resume notifications. The plugin should build
-its own compact scheduler state from tool results and events.
-
-### Auto-injected completion path
-
-Native background tasks can also complete through an OpenCode-injected parent
-message as a synthetic completion message. V2 must ingest that path too.
-
-Parse this in the chat/message transform path that already inspects parent
-conversation messages, most likely `experimental.chat.messages.transform` in the
-same hook family as task-session-manager context injection. If native OpenCode
-adds a dedicated event later, move the parser to that event path.
-
-Add parsing for synthetic completion content containing fields like:
-
-```text
-Background task completed: <description>
-task_id: <id>
-state: completed | error
-
-<task_result>
-...
-</task_result>
-```
-
-That path should update the same shared job-board state as task output.
-Initially parse verified auto-message states only. `cancelled` can still be
-handled through task output unless verified in auto-injected
-messages.
-
-```text
-auto-injected completion message
-  → parse task_id + state + result
-  → update job board
-  → mark terminal/unreconciled
-```
-
----
-
-## Multiplexer Integration
-
-Primary files:
-
-- `src/multiplexer/session-manager.ts`
-- `src/multiplexer/tmux/index.ts`
-- `src/multiplexer/zellij/index.ts`
-- `src/index.ts`
-
-Current multiplexer behavior is already close to V2:
-
-- child session created → spawn pane,
-- child session busy → ensure pane exists,
-- child session idle/deleted → close pane,
-- fallback polling checks `/session/status`.
-
-V2 requirements:
-
-1. Panes represent child sessions, not parent blocking state.
-2. Parent may continue while panes run.
-3. Pane title should make background work understandable.
-4. Cleanup should be tied to actual child session idle/deleted state, not parent
-   task-tool return.
-5. Tests should cover long-running background children and delayed completion.
-
-Likely first implementation can keep close-on-idle if native child sessions emit
-accurate idle events. Verify with real background tasks before changing cleanup
-semantics.
-
-Potential later improvement:
-
-```text
-[BG explorer] exp-4 Map multiplexer flow
-[BG fixer] fix-2 task-session-manager
-```
-
----
-
-## Agent Lane Reframing
-
-V2 should describe specialists as execution lanes, not optional helpers.
-
-- Explorer: discovery lane.
-- Librarian: external knowledge lane.
-- Fixer: implementation lane.
-- Designer: UI/UX lane.
-- Oracle: review/risk/architecture lane.
-- Council: high-stakes decision lane.
-- Observer: visual/media lane.
-
-The orchestrator schedules lanes according to dependency and ownership.
-
----
-
-## Implementation Phases
-
-### Phase 0 — Pre-Prompt Groundwork
-
-Before changing the prompt, build enough parser/job-board behavior that the
-prompt can rely on visible scheduler state.
-
-### Phase 1 — Parser And Job Board Core
-
-- add task launch/status parsers,
-- parse only `task` output with `state: running` as a background launch,
-- add shared in-memory scheduler state,
-- keep timeout as an overlay on `running`, not a native state,
-- keep ownership/dependencies advisory until reliable.
-
-### Phase 2 — Prompt Core
-
-- rewrite orchestrator role,
-- rewrite execution model,
-- rewrite dispatch workflow,
-- update phase reminder,
-- reframe specialists as lanes.
-
-### Phase 3 — Prompt Job Board Injection
-
-- inject compact job board into orchestrator context.
-
-### Phase 4 — Task Completion Handling
-
-- hook `task` output,
-- update job states from status output,
-- mark terminal jobs as unreconciled,
-- keep running jobs visible.
-
-### Phase 5 — Auto-Injected Completion Handling
-
-- parse OpenCode background completion messages,
-- update the same shared job board,
-- prevent jobs from staying stale when the parent auto-resumes.
-
-### Phase 6 — Reconciliation Transition
-
-- mark terminal jobs injected into a prompt as reconciled after the next
-  orchestrator assistant turn completes and the parent session returns idle,
-- test this transition directly.
-
-### Phase 7 — Session/Mux Safety
-
-- verify tmux/zellij pane lifecycle with real background tasks,
-- add tests for delayed completion,
-- adjust close-on-idle only if native events prove insufficient.
-
-## First Code Targets
-
-Start here:
-
-1. `src/utils/task.ts`
-   - task launch/status parsing helpers.
-
-2. `src/utils/background-job-board.ts` or equivalent shared scheduler module
-   - background job state, queries, reconciliation marking, prompt formatting.
-
-3. `src/hooks/task-session-manager/index.ts`
-   - register launches/statuses with the shared job board and avoid exposing
-     running jobs as resumable sessions.
-
-4. `src/index.ts`
-   - route `task` after-hooks into the task-session-manager hook.
-
-5. `src/agents/orchestrator.ts`
-   - prompt role and workflow rewrite after scheduler state exists.
-
-6. `src/config/constants.ts`
-   - phase reminder rewrite.
-
-7. `src/multiplexer/session-manager.test.ts`
-   - keep multiplexer lifecycle coverage aligned with background-job-board-owned
-     task state.
-
----
-
-## Success Criteria For Core V2
-
-Core V2 is working when:
-
-- orchestrator prompt consistently schedules rather than implements,
-- background `task` output registers running jobs,
-- terminal task output updates job board state,
-- orchestrator context shows running and terminal unreconciled jobs,
-- dependent work waits for terminal results,
-- prompt-level advisory ownership reduces conflicting background workers,
-- multiplexer panes show background child sessions while parent continues,
-- final responses do not depend on unresolved background jobs.
-
-The core invariant:
-
-```text
-task creates jobs; task output or auto-completion finishes jobs; orchestrator
-reconciles jobs.
-```