Watch for connector requests with a one-shot background watcher, not Monitor
Summary
Replace the expiring Monitor watch with a one-shot background request watcher. Each invocation reads complete connector-output lines, returns unhandled requests once, and exits. The session reads its output, records the ids, starts the next watcher, and handles the requests.
- Replays the output from the start, so requests arriving between watcher invocations are not skipped.
- Ignores partial lines, deduplicates repeated ids, handles literal backslashes in paths, and refuses unusable inputs.
- Supports
--onceto drain the output when the connector stops. - Updates the skill and post-compaction wording to describe the watcher. The existing skill-size checks remain enforced.
Verification
- Full local
bin/cipasses after rebasing onto current main. - 14 focused regressions are committed to the existing BATS suite: usage, missing/empty inputs, handled-file creation, handled ids and exact matching, duplicate lines, other event types, partial lines, escaped content, literal paths, unusable handled paths, loss of the handled file between startup and scanning (both modes), and delivery after a new line arrives.
- Mutation checks reject removing the complete-line guard, removing per-run deduplication, and passing a literal handled path through
awk -v. - Existing skill layout and command-drift checks pass. No new testing harness or server is introduced.
Review boundary
The session must restart the watcher after each completion; it is not an independent supervisor for an unavailable session. Recording handled ids before dispatch also retains the documented interruption trade-off. No fresh real-session, macOS-runtime, laptop-sleep, or expired-login recovery claim is made by these script tests.
The newer alternative in #958 addresses sleep/expired-login recovery with a recurring heartbeat and monitor re-arming. These are alternative approaches and should not both land unchanged. This PR is being verified on its own scope, not presented as covering that broader recovery scenario.