Skip to content

feat: session observability & loop control (Phase 16)#4

Merged
Catafal merged 1 commit into
mainfrom
feat/session-observability
Jun 10, 2026
Merged

feat: session observability & loop control (Phase 16)#4
Catafal merged 1 commit into
mainfrom
feat/session-observability

Conversation

@Catafal

@Catafal Catafal commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Implements PRD #3 in full — all four phases.

What's new

  • Session radar: bach sessions list/adopt/resume/watch — discovers ALL Claude Code and Codex sessions on the machine (Bach-launched or not) with liveness states (running/idle/ended), task linkage, previews, filters and --json; REPL /sessions view.
  • Codex parity: Codex launches now get sidecars; explicit bach hooks install <runtime> installers (parse-merge-rewrite, abort on unparseable settings, never clobber unrelated hooks). Supersedes the ADR-007 Codex exception (ADR-015).
  • Observer: per-session run-and-exit watcher tailing transcript + hook-event spool; judge LLM (reuses run_codex_json + normalize_model) returning {summary, suggested_status, needs_human, confidence}; conservative authority enforced at the status write path — observer may only do executing→qa and {executing,qa,afk_queue}→hitl_queue, never done, never backward.
  • Loop control (ADR-016): opt-in stop-hook verification gating (exit-2 continuation with failure output, max-continuation cap → hitl_queue), and a bounded headless AFK runner (max turns + wall-clock budget, never sets done).

Architecture

Two deep modules firewall all undocumented upstream knowledge: runtimes/session_discovery.py (on-disk stores + liveness) and runtimes/transcript.py (record parsing, never raises — unknown records preserved). Documented hook payloads are the control plane; transcript parsing only feeds previews/judge context, never gating.

Quality

  • Built TDD by a 12-agent DAG workflow on strictly disjoint file sets
  • 3-lens taste review: 3 STOP + 3 DRIFT + 3 WATCH findings — all fixed (watcher transcript-path placeholder, AFK overwriting hitl escalation, sessions watch wiring crash, frontmatter split corruption, installer overwrite-on-parse-failure, liveness age cap, shlex quoting, flock on spool, observability gaps)
  • QA smoke against real machine session stores (radar found genuine orphan sessions; --state running correctly identified the live implementing session)
  • Tests: 537 → 883 passed, gate green

Closes #3

🤖 Generated with Claude Code

Implements PRD #3: session radar (bach sessions list/adopt/resume/watch),
Codex sidecar parity + explicit hook installers (supersedes ADR-007
exception, ADR-015), observer watcher + judge with conservative authority
enforced at the status write path, and loop control (stop-hook verification
gating + bounded AFK runner, ADR-016).

Closes #3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Catafal Catafal merged commit b963b53 into main Jun 10, 2026
2 checks passed
@Catafal Catafal deleted the feat/session-observability branch June 10, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PRD: Session observability & loop control — radar, watcher + judge, Stop-hook gating, AFK runner

1 participant