Skip to main content
H

dsh-clear-debug

high-landway/dsh-clear-debug

Requires the agent to declare the scope of a code change before editing source, refuses edits outside it, verifies the claimed result against output recorded in the session, and records one executable invariant per fix. It gates only the agent's edit and write tools; your own editor is never blocked.

Install

dsh plugin --profile web add github:high-landway/dsh-clear-debug

README

dsh-clear-debug

An agent's only verifiable signal is that the reported error stopped. A local patch restores that signal cheaply, so it wins by default over a change whose correctness has no oracle. This plugin replaces "did the error go away" with "is the change inside a boundary you can state, and does the evidence you cite actually exist".

It is a process constraint, not a diagnostician. It makes shallow work visible and expensive. It does not tell a correct diagnosis from a plausible one.

What it gates: only the agent's edit and write tool calls. Your own editor is outside DSH and is never blocked. A file you change there during an open scope is reported at close as a warning — "this changed outside DSH, if it was you the change stands" — not refused.

What it enforces

RequirementHow it is checked
No source edit without a declarationedit and write are refused
Edits stay inside the declared targetspath match against targets
A deep fix names where state departs from intentobservation.command, expected ≠ actual, site exists and lies inside targets
The expectation is frozen before the fixrevise cannot change it
A deep fix names the broken contract, the defect class, and a sweepcause.contract, cause.class, cause.sweep
A deep rewrite says what must disappear, and it doesidentifiers in discard are searched in the touched files
Close proves the same step now produces the frozen valueverification must match command and value
The verification output really exists in the sessiona real tool/call with the command plus its tool/result containing the value
A rewrite with an unchanged public surface is not a rewritefingerprint comparison
A fix that only added conditionals is not a root fixbranch-count comparison
One invariant per change, keyed and executabledocs/invariants.json, rendered to docs/INVARIANTS.md
Every recorded invariant can actually failaction: "verify" runs each check via the host subprocess service

What it does not do

  • It cannot tell whether the observation crosses the actual cause. The command is chosen by the agent.
  • It cannot verify a sweep is complete; the entries are statements, not results.
  • A shell command that writes files is not gated.
  • An invariant with no check is a claim nothing defends; verify reports it as unchecked rather than passing.

Install

Bring the package into the profile as a bundle (a local directory works during development). The bundle inserts one row, clear-debug.

Files it creates in your workspace

PathPurpose
docs/invariants.jsonsource of truth for invariants
docs/INVARIANTS.mdgenerated view; a hand-written file is copied to INVARIANTS.manual.md once
.dsh/change-scope/per-session scope records, survive reload
.dsh/site-history.jsonper-file attribution history surfaced on declare
.dsh/ledger.jsonfinding counts, aged out after 180 days

Add .dsh/ to your ignore file if the records should not be committed.

Environment

  • A check starting with node runs on the host's own executable, so it works without node on PATH.
  • The git history in a declaration briefing is optional: it needs git in the provider's execution world and a workspace that is a repository. Otherwise the briefing says so.

Related plugins