Metadata
| Status | done |
|---|---|
| Assigned | agent-872 |
| Agent identity | 603daf069cd2ae4a26357aa66e8c6124154b648711a0816ffd8b660ee3b23815 |
| Created | 2026-07-26T10:23:02.359307417+00:00 |
| Started | 2026-07-26T10:30:54.406210119+00:00 |
| Completed | 2026-07-26T11:09:28.745386344+00:00 |
| Tokens | 35590176 in / 52534 out |
Description
Objective
Take a complete, evidence-backed inventory of WG task lifecycle management before further redesign. The observed system repeatedly reopens/retries tasks, lets messages or helper machinery affect scheduling in surprising ways, creates evaluation satellites eagerly, conflates resource deferral with failure, and has multiple reconciliation/recovery mechanisms that sometimes amplify faults. Determine exactly what is happening rather than patching another symptom.
Survey scope
- Enumerate the complete persisted Task/attempt state machine: every status, transition, guard, side effect, timestamp, assignment/session/worktree field, evaluation lifecycle field, and terminal/nonterminal distinction.
- Identify every transition authority and caller: CLI commands, worker wrapper, dispatcher tick, reconciler, message send/read/poll, wait conditions, dead-agent reaper, spawn/admission/circuit breaker, retry/reset/recover, cleanup, profile/service reload, agency assign/evaluate/FLIP/rescue, verifier, and legacy migration.
- Trace message semantics end-to-end. Reproduce whether sending an irrelevant message can reopen, resume, make eligible, refresh liveness, prevent reaping, or otherwise alter a task. Distinguish ordinary inbox messages from explicit
wait --until messageand chat-control traffic. - Map source attempt identity, exact route/session pinning, worktree ownership/merge-back, and how daemon restart/concurrent writers/replay affect them.
- Catalogue every helper intended to improve reliability and its failure direction: eager scaffolding, auto-rescue, auto-reconcile, status repair, historical gate migration, cleanup/reaping, breaker cooldown, implicit completion, and downstream resume propagation.
- Compare documented intent, tests, and actual live behavior/history. Identify duplicate sources of truth, cyclic transitions, non-idempotent handlers, temporal coupling, and impossible/ambiguous states.
- Build a transition/invariant matrix and sequence diagrams for normal completion, message delivery, crash/retry, resource deferral, evaluation, worktree merge, daemon restart, and operator recovery.
- Use credential-free live graph fixtures/model-based traces to falsify key assumptions. Do not mutate this production graph except through disposable isolated fixtures.
Deliverable
Produce docs/studies/task-lifecycle-coordinator-deep-survey.md with:
- current state machine and transition-authority map,
- ranked failure/foot-gun catalogue with source and live evidence,
- helpers classified as keep/simplify/remove,
- minimal invariants a rebuilt core must enforce,
- staged simplification/rebuild options with migration risk,
- concrete regression/model-based test plan.
No production implementation changes.
Validation
- Every status and every writer/caller has source references.
- Message-triggered reopen/resume behavior is reproduced or conclusively disproved with a disposable live flow.
- At least normal, crash, deferral, evaluation, retry, message, merge, and restart traces are modeled.
- Recent incidents map to specific violated invariants rather than generic explanations.
- Recommendations reduce transition authorities and implicit side effects measurably.
- Unknowns and unproven hypotheses are labeled explicitly.
- Artifact is sufficient to derive a ratified simplified lifecycle design without another source audit.
Depends on
Required by
Log
- 2026-07-26T10:23:02.329276243+00:00 Task paused
- 2026-07-26T10:25:30.969035445+00:00 Task published
- 2026-07-26T10:30:54.541732311+00:00 Spawned by coordinator --executor pi --model openai-codex:gpt-5.6-sol --isolation required-worktree
- 2026-07-26T10:31:10.573100712+00:00 Starting deep source audit, fixture reproduction, and lifecycle design survey
- 2026-07-26T11:01:29.516432553+00:00 Drafted evidence-backed lifecycle survey; incorporated requested deterministic wg why-not-ready gate/origin design and full readiness/admission inventory. Beginning validation and artifact commit.
- 2026-07-26T11:09:04.557259624+00:00 Incorporated concrete cross-graph nightmare trace and mapped every hop to explicit invariants: first-terminal-wins, evaluation-no-reopen, wait-only message semantics, atomic process/worktree lease fencing, breaker-neutral stale ownership, reset readiness ownership, and transition-loop diagnosis.
- 2026-07-26T11:09:28.745397855+00:00 Task marked as done
- 2026-07-26T11:47:20.969795711+00:00 Resurrection: created child task '.respond-to-deep-survey-of' (1 pending message(s), downstream active)