Tasks: retained tmux sessions + session announcement comments
Phase 3 of 3 (requirements → design → tasks). DAG — a task starts once its dependencies are checked.
- [x] T1 — tmux
remain-on-exit+ pane liveness.runner.py:TmuxResult.output;TmuxRunner(remain_on_exit=True); best-effortset-option -w remain-on-exit onafter spawn;has_live_session()vialist-panes -F "#{pane_dead}";deliver()guards on liveness. (AC2.1–2.3) — depends on nothing. - [x] T2 —
AnnounceConfig+announcement_body. Newcli/the_loop/announce.py: config mirror withfrom_mapping, pure body builder using only registry-derived fields. (AC3.1, AC3.2, AC3.5, AC3.6) — depends on nothing. - [x] T3 —
SessionAnnouncer. No-op ladder (disabled, non-tmux, non-github, malformed owner/repo, missingghwarn-once),gh apiPOST to the issue comments endpoint,session.announced/session.announce_failed, never raises. (AC3.1–3.5, AC4.2, AC4.3) — depends on T2. - [x] T4 — Dispatcher retention.
TmuxConfiginRoutingConfig; runner built withremain_on_exit; PR-close keeps the tmux session by default, logging the attach command and emittingsession.retained; kills whenkeepSessionOnClose: false. (AC1.1, AC1.2, AC1.4, AC1.6, AC4.1) — depends on T1. - [x] T5 — Dispatcher announcement. Optional
announcerctor param (override survivesreload);_spawn_tmuxannounces after registration without affecting its return value;_respawn_tmuxdeliberately does not (first spawn only). (AC3.1–3.4) — depends on T3, T4. - [x] T6 —
sessions close/sessions attach.closehonourskeepSessionOnClosewith--keep-tmux/--kill-tmuxoverrides;attachfalls back to a closed work item's retained session (with a note) and stops refusing dead panes. (AC1.3, AC2.4, AC2.5) — depends on T1, T4. - [x] T7 — Event-log types. Register
session.retained,session.announced,session.announce_failedineventlog.EVENT_TYPES. (AC4) — depends on nothing. - [x] T8 — Config schema + example.
routing.tmuxandrouting.announcein.the-loop/cli-config.schema.json(defaults documented) and the dogfood blocks in.the-loop/cli-config.yaml(+ the packaged template if it carries the same blocks);make validategreen. (AC1.2, AC3.5) — depends on T1, T2. - [x] T9 — Unit tests.
test_announce.pyplus thetest_tmux_runner.pyadditions per the design's testing strategy. — depends on T1–T3. - [x] T10 — Integration + CLI tests. Retention / kill-on-close, respawn through a dead retained pane, announce-on-spawn, no re-announce on respawn, no-announce for process mode, announcer failure is inert;
sessions close --keep/--kill-tmuxandsessions attachto a closed-but-retained session. — depends on T5, T6. - [x] T11 — Docs.
cli/README.mdconfig tables +sessionscommand notes;docs/capabilities/interactive-sessions.mdbehaviour bullets and history row. — depends on T5, T6. - [x] T12 — Gates.
make check(ruff, markdownlint, format, pyright, validate, pytest) fully green; evidence inexecution-log.md. — depends on T1–T11.