dsh-better-debug

Appends one short user message before the next step when the model is circling: the same absolute path written three times with no measurement landing in between, the same error episode (tool, target and normalised fingerprint) returning twice, or a write followed by two steps with no measurement — the last one only arms, and the message lands before the next write rather than interrupting reading. A measurement has two states: intent is judged from the tool arguments at call time, and the write streak is cleared only when the result comes back, only for that command directory. A failed test still counts, because it yields the line that is wrong. Hard measurements are `lsp_diagnostics`, `verify`, `run_tests` and `run_test`; `ops_bash`, `bash`, `shell` and `pwsh` count only when the command matches a measurement pattern, so `ls` no longer launders a blind edit streak. Signals fire once per episode, re-arm after a real measurement, and are capped per turn; a successful `present` sleeps the gate until the next write, and subagent sessions are skipped. Generated paths (build output, lock files, logs) are excluded. Error targets are read out of real `file:///` ESM stacks, so two different files never collapse into one episode, and `cd <dir> && cmd` counts as a measurement of that directory rather than its parent. Ships the `stuck-gate` skill at bundled rank 600 (a user-level copy at 400 overrides its wording) plus a read-only observation panel at `/better-debug` reporting firings, sessions covered, the first action after each message across six classes, and how many measurement loops actually closed. The log defaults to `$DSH_HOME/logs/better-debug.log` and is created on first write, so the panel has data right after install. Optional host services are subscribed dynamically

Overview

Appends one short user message before the next step when the model is circling: the same absolute path written three times with no measurement landing in between, the same error episode (tool, target and normalised fingerprint) returning twice, or a write followed by two steps with no measurement — the last one only arms, and the message lands before the next write rather than interrupting reading. A measurement has two states: intent is judged from the tool arguments at call time, and the write streak is cleared only when the result comes back, only for that command directory. A failed test still counts, because it yields the line that is wrong. Hard measurements are `lsp_diagnostics`, `verify`, `run_tests` and `run_test`; `ops_bash`, `bash`, `shell` and `pwsh` count only when the command matches a measurement pattern, so `ls` no longer launders a blind edit streak. Signals fire once per episode, re-arm after a real measurement, and are capped per turn; a successful `present` sleeps the gate until the next write, and subagent sessions are skipped. Generated paths (build output, lock files, logs) are excluded. Error targets are read out of real `file:///` ESM stacks, so two different files never collapse into one episode, and `cd <dir> && cmd` counts as a measurement of that directory rather than its parent. Ships the `stuck-gate` skill at bundled rank 600 (a user-level copy at 400 overrides its wording) plus a read-only observation panel at `/better-debug` reporting firings, sessions covered, the first action after each message across six classes, and how many measurement loops actually closed. The log defaults to `$DSH_HOME/logs/better-debug.log` and is created on first write, so the panel has data right after install. Optional host services are subscribed dynamically

Installation

Install from GitHub

dsh plugin --profile web add github:Leonlee114514/dsh-better-debug

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.