--- name: decompose-and-dispatch description: Let the human-selected Lead coordinate a goal into coherent model-assigned tasks, dependency-aware parallel lanes and verified integration joins. --- # Decompose, allocate, execute, learn Use before substantial dispatch and whenever execution reveals a bad boundary. `` below is the tools directory of the active package root: `common/tools/` in the installed package, `src/common/tools/` in a source checkout. The Lead owns the engineering outcome and assigns each engineering leaf, even when small, to a native Worker. A business executor running inside the product being built handles that product's user task and is not the engineering Worker for this session. Keep the Lead role whether or not a child has started; do not silently take over every engineering leaf. Use independent review only when the claim and risk justify it. Allowed Worker, Adviser, Reviewer and Tester models come from the allowed tiers: fast tier glm-5.3-flash or minimax-3.1-flash, frontier tier gpt-6-luna, glm-5.3 or gpt-6.1-sol; resolve exact live catalog IDs before dispatch, with no silent fallback. An assigned leaf does not recursively hire. Keep its graph compact. An already delegated leaf with no-delegation does not hire recursively. ## Resolve uncertainty before distributing it Specify the complete user outcome and its observable acceptance. Identify facts, unknowns, shared contracts and existing work. Lead/Adviser decides difficult architecture; use the optional allowed-model adviser challenge when independent reasoning can change the decision. Research can itself be parallelized when its questions are independent. Create coherent nodes, not line-count or token-sized fragments. Each node has a clear goal, known inputs, dependencies, owned mutable paths/resources, acceptance check and next checkpoint. A cheap executor should not have to reconstruct the whole architecture or choose an unmade product decision. Use `../model-routing/SKILL.md` for each meaningful allocation. Estimate each node from its actual work and verification: minimum/maximum minutes, known steps or comparable evidence, and the specific uncertainty widening the range. Plan small, independently useful pieces around 15 minutes, including verification; this is planning granularity, never an actual execution cutoff or rejection rule. Split larger work at meaningful proof boundaries before dispatch. Keep implementation leaves independently useful; add one result-level review after their integration join for Full-cycle, then deploy, test the real consumer and push on the configured route. Do not create a review leaf per worker or wave. Local tests remain part of implementation. Twenty minutes remains a checkpoint, not a duration target. Do not manufacture arbitrary time boxes or an overall range. ## Parallelism with joins A lane is ready only when its required input contracts/results exist. Independent work can run concurrently. Shared writes, a mutable input produced by another lane, shared test-account state and resource limits can make otherwise separate files dependent. Freeze interfaces, isolate mutable fixtures, designate one owner, or sequence the conflicting work. Do not parallelize dependent steps for appearance. Every decomposed objective also keeps its machine-readable task graph next to the task record as `plan.graph.json`, written when the graph is decomposed and updated with the live plan report at every plan boundary. The procedure — record, graph, report, render, check — is the `plan-artifacts` skill; the canonical format is the TASK_GRAPH protocol of the common bundle, `common/protocols/TASK_GRAPH.md`. Render it with one command so the user sees what is done, what runs now, what is blocked, the rough finish and the parallelism without asking for a status: ```sh python3 "/lhc_grid.py" render /plan.graph.json -o /plan.html ``` When a graph is useful, run the optional offline checker from the LastHumanCommit repository: `python3 scripts/lhc_validate_graph.py `. See `references/execution-graph.json`. The checker is repository tooling; installed skills do not assume that a source checkout exists beside the common bundle. It checks only declared path/dependency conflicts, not runtime semantics, resource locks, real model capability or whether tasks are conceptually independent. Use available concurrency rather than launching all ready jobs without regard to quota, context, tool capacity or real costs. Preserve existing workspace conventions; creating extra worktrees is not a mandatory part of this method. For independent parallel writes, Lead may allocate canonical branches and worktrees through the active SHARED_WORKTREE protocol and its common tool. Record primary root, `lhc/`, `.worktrees/`, immutable base commit and owner. Give the harness that existing path; never let it create a second private checkout. The resolved permitted dev integration target and task-owned cleanup remain Lead-owned. No PR per worker is required; L merges the leaf branches into the task branch, then integrates the reviewed task branch through a PR only when packaged pr_stage=on. PR-off still requires the authorized final merge and verification. The target branch follows `AGENTS.md` Delivery: `main` in the owner's repository, the owner's own branch (e.g. `megamen32-dev` in Airlock) in someone else's. Show which ready lanes will actually dispatch together and the available slots. Explain each serialization by a dependency, shared mutable resource or capacity limit. Quote total effort separately from delivery duration: effort sums nodes; delivery bounds come from a feasible schedule respecting dependencies, capacity and shared resources. Each concurrent wave contributes its longest lane plus required sequential joins/review/testing. Include external waits separately; do not mistake a dependency-only longest path for scheduled elapsed. Show the arithmetic and each uncertainty rather than doubling a global buffer. The checker can summarize declared per-node estimates, but its dependency-only critical path is a lower bound until capacity, resource conflicts and waits are accounted for. It does not measure active time or run a scheduler. Use `"/lhc_task_budget.py"` per TIME_CONTROL to flag decomposition candidates and calculate effort sums; its dependency-only bounds also exclude capacity and waits, so Lead still owns the feasible elapsed schedule. ## Dispatch and close Lead initializes, verifies and repairs actual active accounting through the existing TIME_CONTROL mechanism (`"/lhc_active_time.py"`); each role records/reports its own intervals and source/coverage. Unknown historical gaps stay unknown. Idlecap estimates are estimates, never measured active time; summed parallel effort is not elapsed. Choose the least capable reliable model per bounded node, preferring fast cheap executors. Default to zero-knowledge dispatch: fresh context with a self-contained contract and only the required inputs, not the parent conversation or unrelated history. Lead keeps the global context and controls dependencies, concurrency and acceptance. Use the adapter's real role/model delivery and event/receipt mechanisms. When source lives outside the worker's native cwd, put its canonical product root and exact product-relative owned paths in the native assignment itself, alongside the task/outcome identity. A brief pointer or combined file-read output alone does not bind those files. Keep session-state cwd and product root distinct. Reuse research context within the same bounded task when it avoids rework. Independent Reviewer/Tester/challenger runs remain fresh; task resumption does not remove them. At joins, verify the accepted result of each predecessor and test the combined behavior. A set of independent PASS receipts is not an integration test. New uncertainty returns to the Lead/adviser decision layer instead of cascading guesses. Use Overseer for material drift, repeated failure, overrun or inefficient model allocation. Overseer demands a BUSINESS RESULT; re-decompose rather than defending the original graph. Learn after substantial overrun (SELF_IMPROVE.md threshold), repeated errors and cycle end, retaining the maximum 120-wall-clock-minute interval during unfinished work. Verified learning or its paperwork never authorizes continuation without a justified route to the accepted result. Do not invent a scheduler or background continuation.