fix(webui): triage review leftovers, the Stop hook records the last prompt it checked, fence and host P3s, a steadier snapshot read (#1873) #1987

Merged
jason.woltje merged 5 commits from triage-p3s into refactor 2026-11-18 17:12:02 +00:00
Owner

What changes

The small findings left by the Triage reviews. No route is wired: production still passes route: null, so Triage still does not start.

  • Unslop Stop hook. The hook records, per session, the last prompt whose turn it checked, in <log>.stop.json next to its log. A transcript that still ends with that prompt is stale, and the hook waits for it as before, up to 2 s. This closes the two stale cases #1986 left: an input with no last_assistant_message, and a reply whose text equals the last turn's last reply.
  • Route fences. The real path of each fixed path is looked up once. A test covers a fixed path that is a link. The refuse list gains the optional env names the last re-check named. The plugins README names the refused hooks.
  • Triage host. A reply settles its message only when it is the runner's RESULT answer. A progress note that names the message leaves it queued.
  • Triage snapshot. It reads every organization's bus and processing sockets at once and limits only the config checks, which start node children. Two tests with tight timing are steadier without longer sleeps.

How

  • tools/unslop-hook/claude-hook.js, its README and tests.
  • packages/seat/src/sandbox.mjs (hostedBinds helpers only; binds() and sandboxArgv() are unchanged), hosted-binds.test.mjs.
  • packages/webui/src/triage-host.mjs, triage-snapshot.mjs and their tests; packages/plugins/README.md.
  • No schema, vocabulary, policy or HTTP route change.

Tests

  • Each fix red before its change.
  • Lane gate on 56cc7b59d: 53 test files plus test-unslop-check.js, 739 pass, 0 fail, 0 skipped.
  • Lead check on 56cc7b59d in a clean environment: the five Triage files, all seat and plugins test files, and the harness runner and session files: 646 pass, 0 fail. tools/unslop-hook/test-unslop-check.js 32/32.

Review

One fresh claude-opus-5-5 reviewer: changes, three P3s. All three are fixed in the last commit: a stronger linked-path test, corrected hook notes, README names. No second reviewer read that last commit.

Left for later

  • After a hard Console kill, the Triage sandbox and runner keep running, and the next start begins a second runner on the same session. Not built here. It needs a choice: record the pid at spawn and stop that process group on the next start.
  • The model's own send tool can still mark a note as RESULT. Closing that needs a relay protocol change.
  • Two Stop hook cases remain. After a late fallback the hook has no prompt recorded, so a later Stop can take that turn for its own. And a Stop hook that blocks causes a second Stop in the same turn, which waits 2 s and checks only the last message.
## What changes The small findings left by the Triage reviews. No route is wired: production still passes `route: null`, so Triage still does not start. - **Unslop Stop hook.** The hook records, per session, the last prompt whose turn it checked, in `<log>.stop.json` next to its log. A transcript that still ends with that prompt is stale, and the hook waits for it as before, up to 2 s. This closes the two stale cases #1986 left: an input with no `last_assistant_message`, and a reply whose text equals the last turn's last reply. - **Route fences.** The real path of each fixed path is looked up once. A test covers a fixed path that is a link. The refuse list gains the optional env names the last re-check named. The plugins README names the refused hooks. - **Triage host.** A reply settles its message only when it is the runner's RESULT answer. A progress note that names the message leaves it queued. - **Triage snapshot.** It reads every organization's bus and processing sockets at once and limits only the config checks, which start node children. Two tests with tight timing are steadier without longer sleeps. ## How - `tools/unslop-hook/claude-hook.js`, its README and tests. - `packages/seat/src/sandbox.mjs` (`hostedBinds` helpers only; `binds()` and `sandboxArgv()` are unchanged), `hosted-binds.test.mjs`. - `packages/webui/src/triage-host.mjs`, `triage-snapshot.mjs` and their tests; `packages/plugins/README.md`. - No schema, vocabulary, policy or HTTP route change. ## Tests - Each fix red before its change. - Lane gate on 56cc7b59d: 53 test files plus `test-unslop-check.js`, 739 pass, 0 fail, 0 skipped. - Lead check on 56cc7b59d in a clean environment: the five Triage files, all seat and plugins test files, and the harness runner and session files: 646 pass, 0 fail. `tools/unslop-hook/test-unslop-check.js` 32/32. ## Review One fresh claude-opus-5-5 reviewer: changes, three P3s. All three are fixed in the last commit: a stronger linked-path test, corrected hook notes, README names. No second reviewer read that last commit. ## Left for later - After a hard Console kill, the Triage sandbox and runner keep running, and the next start begins a second runner on the same session. Not built here. It needs a choice: record the pid at spawn and stop that process group on the next start. - The model's own send tool can still mark a note as RESULT. Closing that needs a relay protocol change. - Two Stop hook cases remain. After a late fallback the hook has no prompt recorded, so a later Stop can take that turn for its own. And a Stop hook that blocks causes a second Stop in the same turn, which waits 2 s and checks only the last message.
jason.woltje added 5 commits 2026-11-18 17:11:59 +00:00
jason.woltje merged commit 56cc7b59dd into refactor 2026-11-18 17:12:02 +00:00
Sign in to join this conversation.