feat: session observability & loop control (Phase 16)#4
Merged
Conversation
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>
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements PRD #3 in full — all four phases.
What's new
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/sessionsview.bach hooks install <runtime>installers (parse-merge-rewrite, abort on unparseable settings, never clobber unrelated hooks). Supersedes the ADR-007 Codex exception (ADR-015).run_codex_json+normalize_model) returning{summary, suggested_status, needs_human, confidence}; conservative authority enforced at the status write path — observer may only doexecuting→qaand{executing,qa,afk_queue}→hitl_queue, neverdone, never backward.hitl_queue), and a bounded headless AFK runner (max turns + wall-clock budget, never setsdone).Architecture
Two deep modules firewall all undocumented upstream knowledge:
runtimes/session_discovery.py(on-disk stores + liveness) andruntimes/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
sessions watchwiring crash, frontmatter split corruption, installer overwrite-on-parse-failure, liveness age cap, shlex quoting, flock on spool, observability gaps)--state runningcorrectly identified the live implementing session)Closes #3
🤖 Generated with Claude Code