Tracking issue for the Lifecycle Manager (LCM) + Session Manager (SM) lane of the backend rewrite (Go daemon).
Goal
A deterministic supervisor for agent sessions on the OBSERVE → DECIDE → ACT loop:
- LCM — a synchronous reducer. Observers push raw facts; it runs a pure decision, persists, and fires reactions. Never polls.
- SM — the explicit-mutation plumbing: spawn / kill / restore / cleanup. Reports outcomes to the LCM; never derives state itself.
Approach: contract-first, single integration branch
feat/lcm-sm-contracts is the lane integration branch: every sub-PR branches off it and merges into it; the whole lane lands on main as one unit once complete.
PR sequence — implementation COMPLETE ✅
All implemented behind fakes; gofmt/build/vet/test -race green across domain, decide, lifecycle, session.
Integration phase — carried-forward items (must address as real adapters land)
Open contract questions (from #2) — for integration partners
- SCM facts — does
SCMFacts match what the poller can cheaply produce? (adil)
- Persistence —
LifecycleStore + LifecyclePatch boundary; lock vs ExpectedRevision. (Tom)
- API — is
SessionManager + the Session read-model OpenAPI-friendly? (aditi)
Key invariants (carried from the existing AO)
- Persist canonical state; derive the display status on read (single producer = the SM).
- One authority for death — only the decide pipeline (via
detecting) writes terminal states from inferred signals, plus the SM's explicit-kill path via OnKillRequested.
- Failed probe ≠ dead; PR facts dominate soft session states once a PR exists; worktree-remove safety on teardown.
Owner: @harshitsinghbhandari (+ coding-agents lane on Runtime/Agent/Workspace)
Tracking issue for the Lifecycle Manager (LCM) + Session Manager (SM) lane of the backend rewrite (Go daemon).
Goal
A deterministic supervisor for agent sessions on the OBSERVE → DECIDE → ACT loop:
Approach: contract-first, single integration branch
feat/lcm-sm-contractsis the lane integration branch: every sub-PR branches off it and merges into it; the whole lane lands onmainas one unit once complete.PR sequence — implementation COMPLETE ✅
backend/+frontend/— chore: scaffold backend/ and frontend/ skeletons for rewrite #1 (merged to main)domain/+ports/+ CI workflows — feat(backend): Lifecycle Manager + Session Manager lane #2 (= the integration branch)Apply*pipeline, per-session serialisation, store integration — feat(lifecycle): LCM Apply* pipeline (split A) #5TickEscalations— feat(lifecycle): ACT layer — reaction table + escalation engine (split B) #6feat/lcm-sm-contractsas the complete lane and merge tomain.All implemented behind fakes;
gofmt/build/vet/test -racegreen across domain, decide, lifecycle, session.Integration phase — carried-forward items (must address as real adapters land)
react()out-of-lock dispatch (feat(lifecycle): ACT layer — reaction table + escalation engine (split B) #6) — reactions fire after the per-session lock releases; under concurrent observers a dispatch can run on a stale snapshot / out of order. Documented inreactions.go; needs a per-session react queue or a re-check before dispatch once the live daemon runs concurrent observers.ExpectedRevisionunused (feat(lifecycle): LCM Apply* pipeline (split A) #5) — in-process per-session mutex covers a single daemon; multi-writer/CDC would need the optimistic-CAS the contract already exposes.Seed+Get(feat(session): Session Manager — spawn/kill/list/get/send/restore/cleanup #7) — two record-with-identity methods added toLifecycleStorefor the SM's create/read-model paths; Tom's real persistence layer must implement them (co-owned; documented inports/outbound.go).Open contract questions (from #2) — for integration partners
SCMFactsmatch what the poller can cheaply produce? (adil)LifecycleStore+LifecyclePatchboundary; lock vsExpectedRevision. (Tom)SessionManager+ theSessionread-model OpenAPI-friendly? (aditi)Key invariants (carried from the existing AO)
detecting) writes terminal states from inferred signals, plus the SM's explicit-kill path viaOnKillRequested.Owner: @harshitsinghbhandari (+ coding-agents lane on Runtime/Agent/Workspace)