rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:jjjjjjjjnnjnn/dsh-remedy
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
dsh-remedy is a patch set for DeepSeek Harness (DSH) — fifty-two defects, each registered with the seam it touches, the symptom it removes, the mechanism that was measured, and the limits it does not cross. Three of those seams are resident (llm/stream, agent/request-error and agent/error, the one a preparation-time refusal reaches); the rest are the CLI, the build side, and one seam that has been measured but deliberately not mounted.
When an upstream provider relay packs two tool calls into one index, @earendil-works/pi-ai receives {...}{...} and throws. dsh-llm-pi-ai converts this into LlmError(..., 'MALFORMED_RESPONSE'), and dsh-agent-loop aborts the turn because MALFORMED_RESPONSE is not in retryableCodes. Upstream discussion deepseek-ai/deepseek-harness #4427 describes the same failure family.
Tool call "<name>": Unexpected non-whitespace character after JSON at position N
Received arguments: {...}{...}
Measured over this machine's session directory: 78 session files, 393 attempts, 38 fused calls, 44 MALFORMED_RESPONSE failures of which 39 are repairable, and 0 unreadable lines.
The turn census of the same directory counted 293 turns: 94 completed, 88 max_tokens, 100 error and 11 aborted. The error codes it named are MALFORMED_RESPONSE 44, UNSUPPORTED_REASONING_EFFORT 37, SERVER 16, UNKNOWN 1, MISSING_CREDENTIAL 1 and INVALID_REQUEST 1.
Two of those classes needed different treatment, and both are now visible:
MALFORMED_RESPONSE is a fusion, so it is repaired when the split can be proven.UNSUPPORTED_REASONING_EFFORT is a deterministic refusal: a profile asked for a level the adapter does not offer (provider "opendesign" model "deepseek-v4.1-flash-eco" does not support reasoning effort "xhigh"). Retrying it spends a request to learn the same answer twice, so the plugin names it once and refuses to touch it.The registry is the single source: packages/core/src/registry.ts for the claims, dsh-remedy status to print it, and dsh-remedy explain to answer which of them cover a failure class your machine actually hits.
| seam | patches | what each one settles |
|---|---|---|
llm/stream (resident) |
P-0001, P-0002, P-0003, P-0005, P-0027, P-0030, P-0033, P-0034, P-0036, P-0037 | split a proven fusion; a rescue must be provable, attributable and atomic; a refusal must be observable; reseal a bare member value or refuse it; a fragment dispatched under a name nobody proved; the proof reads the schema the host sends; a call with no identity never reaches the log with an empty id; a stream that failed is never booked as a quiet one; a delta-only call keeps the id the stream proved; one dropped closing delimiter is restored only when the proof is unique |
agent/request-error (resident) |
P-0011 | the contract for who owns the decision, with a bounded retry budget |
agent/error (resident) |
P-0013, P-0045 | name the deterministic refusals instead of retrying them; a refusal thrown before the stream starts reaches this seam and never agent/request-error |
| CLI | P-0004, P-0006, P-0009, P-0010, P-0016, P-0025, P-0041, P-0042, P-0044, P-0047, P-0050, P-0051, P-0052 | scan fidelity and redaction shapes; the turn census; a session header is dated by createdAt; the usage text must match the binary; coverage is declared by the patch, not restated by the command; an unread profile is not a finding; the installed bin runs on POSIX instead of exiting 0 silently; a refused effort the profile still fixes becomes one CONFLICT line; a truncated turn now says whether it answered anyone; so does a completed turn that answered nobody; a resume that drops a tool this session called is counted, and the command a person runs names it as a finding; a completed turn that ends on the tool call the UI does not read is counted separately |
| build side | P-0007, P-0008, P-0012, P-0014, P-0017, P-0018, P-0019, P-0020, P-0021, P-0022, P-0023, P-0024, P-0026, P-0028, P-0029, P-0031, P-0032, P-0035, P-0038, P-0039, P-0040, P-0043, P-0046, P-0048, P-0049 | a copy channel that can name its failures; a byte budget a script checks; one cap per load path; the project's own description must be true; the two npm pages; a Windows exit code is not a registry answer; the outward pages described a project that had stopped existing; a listing that pins git bytes while advertising a registry version; an export that named a module that never existed; a drift test that repaired the drift; a doc rule no gate read; the two package pages finally inside the copy channel; the release procedure had two homes; the published sample that carried this machine's home path; the live pointers a successor acts on; the engine finally has a budget; the ledger stops repeating its patch docs; a patch-layer row that named a module nothing resolved; a guard that could not see the fixture it protects; a first screen one patch short and one release behind; the macOS sentence turned into a CI job; the fact pack counted a patch set it no longer described |
| measured, not mounted | P-0015 | what a rejected agent/pre-step decision does, so a later patch can use that seam on measured ground |
Nine patches are verified: a real host ran them and left a data/results/live-* artifact. The other forty-three are tested: unit tests, a negative control and a measured fixture, scan or corpus, but nothing a resident journal can witness. The status section below names which is which.
Install the plugin into a DSH profile:
dsh plugin --profile <name> add dsh-remedy
Install as a project dependency:
pnpm add dsh-remedy dsh-remedy-core
Version 0.3.0 of the plugin cannot be installed from the registry, because npm published its raw workspace manifest with a literal workspace:* dependency. Every release after it ships a pnpm-packed tarball instead. Version 0.3.1 carried the same manifest fix but was superseded before it reached the registry.
Source workflow for contributors:
git clone https://github.com/jjjjjjjjnnjnn/dsh-remedy.git
cd dsh-remedy
pnpm install
pnpm run verify
dsh-remedy buffers incoming tool-call deltas on the llm/stream Cordis seam:
Input chunks:
block-start { id: "call_01", name: "ops_bash" }
tool-call-delta '{"command":"ls"}{"command":"pwd"}'
finish { kind: 'error', error: LlmError('MALFORMED_RESPONSE') }
Repaired output:
block-start { id: "call_01", name: "ops_bash" }
block-end { arguments: '{"command":"ls"}' }
block-start { id: "call_01#remedy-1", name: "ops_bash" }
block-end { arguments: '{"command":"pwd"}' }
finish { kind: 'stop' }
The repair is all-or-nothing. Every open buffer must parse into top-level JSON objects. If all of them are proven, each call gets its own block-start and block-end and the error finish becomes {kind:'stop'}. If any buffer cannot be proven, nothing is emitted and the original failure goes out untouched.
A second listener runs on agent/request-error, which the loop calls after a failed attempt:
no code, empty code, or an aborted signal → next()
UNSUPPORTED_REASONING_EFFORT, → name it once per step and code, then next()
INVALID_REQUEST, MISSING_CREDENTIAL,
EMPTY_RESPONSE
IMAGE_OFFLOAD_REQUIRED, INVALID_CREDENTIAL → next()
MALFORMED_RESPONSE with budget left → { kind: 'retry' }
anything else, or budget spent → next()
That order follows the contract the runtime documents: a handling listener returns { kind: 'retry' } without calling next(), and a listener that does not own the decision must return next(). Calling next() first and then overriding its answer would discard what the default chain decided, and context compaction authorizes its own retry on exactly that path.
Retry is off by default (retryOnMalformed: 0). The budget is a bounded cache of 256 entries per process, which is far more than one turn needs and small enough that a long-lived desktop session cannot grow it.
dsh-remedy explain reads the registry, an optional profile layer and an optional session directory, and prints one row per failure class: how often this machine hit it, which patch covers it, and whether that patch is switched on in the profile you named.
dsh-remedy explain --sessions ~/.dsh/sessions --profile-file ~/.dsh/profiles/<name>/cordis.patch.yml
failure class turns covered by enabled here
--------------------------- ----- ------------------- -------------------
completed 124 (none) (none)
max-tokens 88 by design no (by design)
MALFORMED_RESPONSE 47 P-0001…P-0005,P-0011 P-0001…P-0005
UNSUPPORTED_REASONING_EFFORT 37 P-0013 P-0013
SERVER 16 by design no (by design)
MISSING_CREDENTIAL 1 P-0013 P-0013
Without --sessions it prints no counts rather than a row of zeros, and without --profile-file it says the answer is unknown rather than assuming the default. A class this machine hits, that a patch covers, but that your profile switched off, makes it exit 1.
}{ inside a JSON string is not a boundary.<id>#remedy-N.journalPath is configured.retryOnMalformed defaults to 0 because retry is a stop-gap, not the fix.missing-name) and never dispatched.name-changed) and the original failure is re-thrown.replayState is preserved across a repaired finish.block-end repair is held until the tool-call phase ends; a later rejection in the same stream withdraws it (rolled-back) and the original chunks go out.maxCalls bounds the calls synthesized for the whole stream, not per block.consumer-abort, never as quiet.block-start plus a block-end, never a bare block-end.maxCalls budget.max-tokens stream is counted as truncated, never as an unrepaired fusion.errors.refused and never fused.too-many-calls) raises fused, refused and unrepaired, because no repair happened.unmeasured, quiet, degraded, repaired), evaluated in that order; only the counter line grew, to eight names plus the optional resealed.bare-value-unproven; two or more is refused as ambiguous-bare-value instead of guessed.repaired, never quiet.IMAGE_OFFLOAD_REQUIRED, INVALID_CREDENTIAL, MISSING_CREDENTIAL) are passed through and never retried.scan reads a multi-frame zstd log through decompressSessionLog, the same reader the plugin ships.--since reports what it dropped as before_since instead of hiding it.turn/end (completed, max_tokens, aborted, error) and names every reason.error.code.fused_calls and fusion_failures alone.| Limit | Reality |
|---|---|
| Attribution | Stops at the assembled text: the plugin cannot prove whether the relay or the adapter glued the objects. |
| Truncation | A max-tokens cut is missing bytes and is not repaired. |
| Localized messages | The fallback parses the English Received arguments: text; a localized host message disables that fallback, though delta buffering still works. |
| Headless session files | A headless profile does not persist assistant/attempt streams, so the artifact reports 0 fused calls; the journal counters and the synthetic id carry the proof. |
| Synthetic IDs | <id>#remedy-N are traceability aids, not durable identities. |
| Desktop completion | The desktop artifact records turn_end=aborted because the operator stopped after the answer. |
| App cache | Verification applies to the recorded tarball's sha256, not to whatever a running app has cached. |
| Verdict granularity | One verdict word cannot express "observed and correctly refused"; only the counter line can. |
| Journal migration | Existing journal lines are not migrated; in a mixed journal status --json reports the shape of the last line. |
| Custom index tracking | An adapter that closes blocks itself and keeps its own index bookkeeping is still unmeasured (BS-11). |
| Request retries | Off by default. SERVER, TRANSPORT and TIMEOUT are already retried upstream, so this plugin only retries MALFORMED_RESPONSE, and only inside a budget you set. |
| Reasoning effort | The plugin can tell you a configured effort will be refused, but it never changes it for you. agent/pre-step is not mounted, and that is now a measured decision: P-0015 records what a rejection does — the turn closes as blocked with no step opened, the claimed input is discarded, and the CLI exits 1 — so a patch may use the seam, but it must rewrite the message with {kind:'enter'} rather than refuse. The desktop rendering of blocked is still unmeasured (BS-17). |
| Mid-stream withdrawal | Measured unreachable on this host: none of the persisted attempt streams carried a provable fusion inside a block-end, which is what rolled-back requires (BS-14). |
dsh-remedy verify
dsh-remedy scan ~/.dsh/sessions --json
dsh-remedy explain --sessions ~/.dsh/sessions
pnpm run verify
node scripts/gate.mjs --mutate
Every artifact in data/results/ is script-produced and has a .sha256 sidecar. Two are worth opening first: the live run data/results/live-2026-11-12T12-20-00.000Z.json and the corpus replay data/results/malformed-replay-2026-11-12T11-30-00.000Z.json.
The whole MALFORMED_RESPONSE corpus on one machine was replayed through the built engine: 47 turns, 39 repaired, 8 refused, and no repaired case dispatched a call whose arguments failed to parse. A generated stress pass of 300000 argument texts asserts the same invariant with a recorded seed.
Nine patches are verified on a real host: P-0001 on a headless profile and on the desktop app, P-0002 on a 2026-11-10 headless run that repaired a real two-call fusion and saw the synthesized call dispatched, P-0003 on a 2026-11-10 headless run whose journal wrote a non-zero refused after the code declined to repair a budget refusal, and P-0033 on an isolated harness whose endpoint replays the incomplete tool call of upstream discussion #13211: without the plugin the turn dies at V4 admission, with it the call carries a traceable id and the same session completes a second turn. P-0037 and P-0041 were verified on Linux (WSL2 Ubuntu 26.04): the one-delimiter-short call of upstream discussion #12819 is repaired inside a real host process and dispatched, and the installed bin — a symlink, the way npm installs it there — prints its result instead of exiting 0 silently. P-0011, P-0013 and P-0045 were verified in one R56 probe: a local OpenAI-compatible endpoint answers the #12819 shape once, and the live journal shows two main-step requests with the retry, a completed turn and exit 0 against the plugin-free control's one request and exit 1; the same artifact shows an xhigh profile that the released bytes left with an empty journal writing exactly one diagnosis on the seam the host actually uses.
The other forty-two are tested, not verified. Each carries unit tests, a negative control and a measured artifact where one exists: P-0004, P-0006, P-0009 and P-0044 change an offline reader; P-0005 has no live bare-value shape yet; P-0007, P-0008, P-0012, P-0014, P-0017, P-0018, P-0019, P-0020, P-0024, P-0026, P-0028, P-0029, P-0031, P-0035, P-0038, P-0039 and P-0040 are build-side or a corpus; P-0010, P-0016 and P-0025 change text a command prints; P-0015 is a measurement on an isolated profile rather than a mount; P-0027, P-0030, P-0034 and P-0036 narrow what a repaired, failed or delta-only turn is allowed to claim, with unit tests and a measured fixture but no live run of their own; P-0032 moved prose, not behaviour; P-0042 is a CLI reader that names a configuration conflict the seam cannot fix; P-0044 counts what the census never asked; P-0043 widened the shipped-sample guard and moved the fixture to <home>; P-0046 makes a public page name every patch it counts; P-0047 asks the same question of a completed turn that P-0044 asked of a truncated one; P-0048 turns the macOS sentence into a CI criterion; P-0049 makes the fact pack count the registry it describes and puts the missing changelog sections back; P-0050 counts a resume that stopped declaring a tool this session had already used; P-0051 makes the same count a finding line when explain runs, without a profile, because a lost tool belongs to the session rather than to a profile; P-0052 counts a completed turn whose last step still carries a tool call, the shape the UI renders without a reply, and explain names it; P-0037 and P-0041 are the two patches verified on Linux rather than on this machine.
Release status: 0.4.18 is published and is the registry latest for both dsh-remedy and dsh-remedy-core; it carries fifty-two patches and the tree this page describes is the published one. A cold directory installed 0.4.18 from the registry and dsh-remedy verify printed OK 8 fixture(s). 0.4.17 carried fifty-one patches and shipped P-0047 through P-0051. The previous release is 0.4.17 with fifty-one patches, then 0.4.16 with forty-six patches, then 0.4.15 with forty-four, 0.4.14 with forty-three, 0.4.13 with forty-two, 0.4.11 with thirty-nine, 0.4.10 with thirty-six, 0.4.9 with thirty-five, 0.4.8 with thirty-three, 0.4.7 with thirty-one, 0.4.6 with thirty, 0.4.5 with twenty-eight, 0.4.4 with twenty-seven, 0.4.3 with twenty-six, 0.4.2 with twenty-six, and 0.4.1 with twenty-three.
Package sizes:
bb4c505883fe4167ef143bfcd7aa74a4a2d81f6d.783d5538fd9e406d690b23856edfba90651516ed.5a8c1f95b6a3c6f059a33eaf0ef9770fc62efad7.e5b2e00f4bcc53aedfb9fea6bd7c129bf0ba5454.623c4cc7d380931e91826948f194ab3b0ac43d84.43bde005968b4fa97131770d1fdef70aab188433.cd717926bd9ecec01326d8bd1c055290341f665b.c6577a61dd3af4df57bf234d5e6d9bb4dd2c2b84.80fc4414a9997a467fffe2f51fdb7d771bff1bcd.b2474efb54c1a9c9719422238e264656d16c35e7.02d0747ac766408c0525bfcfb09df4581039af9d.b825fe0b8b523411a17714abf41cc916c14e6273.b9122c89b04a4c18a92b0404dfe939af3ba8f54e.d58321d7ad1087b2937fad53f3f91231c7948fc8.884693a5584eb2d8b39902b56296bb34ea1f130c.2a528bb1c232fa287d3ea78cbb1babbcb57ac14b.dcc33f65e7e0401800348c7f992830879f290ed7.75b4744e4681ad1e752308671889312a5006c20e.24eaaaf51169adbfcb7d59add2340993dcc4a6ee.f2b5593d588d9a06d31afa9e13c3d143c858b470.6f42b4423117c7f3fc79f5458b18f3c35e2004ad.2567629d4c28766622d546d2a22519029611fde7.6c1a19a8890d73916b0732983aa5d72096ee8bb9.68931b34abaad1c40cc3e635584784585c6b951d.1cd6d75a93620192be920ac5e76ba7353fef971c.f18fb209e2d9aaf26a492424bf6019a0d7f88eb9.dac640ea140aadf9249685ebcc98964db8a3adbf.c9a081bf4e5f8c7ae82973e2a56d0bd93244e727.dd3b764dd57d09d4cf85e312867da23360a4e06f.48d449b75bb7fa06f4bc16181433e617d2ca5a66.3bc47df12f21fe7d68336f595d397ff868b3d4d7; core: 26551 bytes compressed, 21 files, 83461 bytes unpacked, shasum 0df993f85589e101b15b830fa105e7ef8c66c5d5.The emitted plugin budget is three checks: residency 40902 of 44000 bytes (the modules a mounted plugin loads), cli 41957 of 42000 bytes (the modules only a command loads), and a total of 82859 of 83000 bytes. Per-file caps: repair-stream.js 28000, session-scan.js 14000, cli.js 12000. A patch that crosses a per-file number splits that file instead of absorbing it. These three are measured on this tree, and this tree is the published 0.4.18 tarball. The engine has its own two numbers, measured on the same tree: core 103869 of 104000 bytes, and registry.js 66049 of 68000.
pnpm install
pnpm run verify
pnpm run gate
node scripts/gate.mjs --mutate
Six gates run on every change: ssot, registry, namespace, step-review, copy, size. --mutate breaks each one on purpose and requires every one to go red; it currently catches 6 of 6. The suite of 0.4.18 is 420 tests and 0 failing, on Windows and on Linux (WSL2 Ubuntu 26.04).
pnpm run verify must pass, and node scripts/gate.mjs --mutate must catch every gate.audit/gate_ledger.json.dsh-remedy-core.verified without a data/results/live-* artifact.docs/copy/facts/public-repo-facts.md, and the bytes must match docs/copy/manifest.json.Security reports should use GitHub private vulnerability reporting on the public repository: https://github.com/jjjjjjjjnnjnn/dsh-remedy/security/policy
MIT. Independent project; not affiliated with DeepSeek.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。