Все плагины

dsh-limit-break

dsh-limit-break · Версия 1.10.0 · Обновлён 29 нояб. 2026 г.

Добавляет инструменты для задач, которые агентам обычно недоступны, например извлечение данных из памяти с оценкой. Инструменты доступны сразу после установки, зависимости не нужны. При сбое возвращается только объект ошибки, хост продолжает работать.

  • проверка каждой версии
  • Память
  • MIT
  • Загрузок: 0

Описание

Ниже — оригинальный текст автора.

dsh-limit-break

Four small tools for DeepSeek Harness that came out of a self-benchmark: two things an agent is normally told it cannot do, made cheap enough to just do.

ToolWhat it does
memory_recallRanked search over a JSON fact store that outlives the session. Omit query to list everything.
memory_saveWrite or overwrite one fact: { id, statement, value?, unit?, details?, tags?, source? }.
resilient_fetchFetch with a four-rung ladder and a report of which rung answered.
memory_statsWhere the store is, how many facts, how big.

Zero npm dependencies. No import-time side effects. Everything fails soft — a broken store or a dead network returns an error object, never an exception that could take the host down.

Recall quality. memory_recall is measured, not vibed: tools/recall-bench.mjs runs 20 hand-labelled questions against the live store and prints hit@1 / hit@3 / MRR, next to a nine-question held-out set that was written after the ranking change and never used to pick it. At 1.5.0 the ranking skips English stopwords, stems, matches whole words (with a prefix fallback, so ray finds raytracer), splits dotted ids into segments, weights each query token by inverse document frequency, and rewards a whole-phrase hit. At 1.9.0 the store had grown from 20 to 38 facts and hit@1 had slipped to 0.85: a long id was winning ties, because every id segment scored the same — env.dsh_renderer_spinner_cpu beat env.cpu for "which CPU is in this machine" and bench.gpu_monte_carlo beat bench.cpu_suite for "monte carlo pi benchmark on the CPU". Id hits are now scaled by 1/sqrt(id segments), so env.cpu (2 segments) counts for more than a four-segment id that merely contains cpu; square-root rather than full normalisation, because dividing by the id length over-punished legitimate three-segment ids such as bench.cpu_suite. hit@1 0.85 → 1.00, hit@3 0.95 → 1.00, MRR 0.900 → 1.000 on the 20 tuned questions; the held-out nine scored 9/9 both before and after, so that is evidence of no regression, not proof of generalisation. Treat the numbers as this store's, not as a promise about yours. Three sets now run side by side: the tuned twenty, the nine held-out questions, and a frozen paraphrase set (2026-11-26, 1.10.0) written in words the facts do not use — "which graphics chip is fitted to this machine", "磁盘空间一共腾出来多少". The paraphrase set scores hit@1 0.333 / MRR 0.486, which is the honest floor of a lexical scorer (ties between equal scores are broken by id, so the number reproduces across stores): if the question shares no rare word with the fact, matching cannot reach it. That set was not used to pick anything, and fixing it means synonyms or embeddings, not re-weighting fields.

Runtime requirement: curl. Rung 1 of the fetch ladder is plain fetch and needs nothing; rungs 2–4 (IPv6 → IPv4 → sibling hostname) shell out to curl, so it has to be on PATH. Windows 10+, macOS and mainstream Linux all ship it. Without it the ladder degrades to rung 1 and says so in the report instead of pretending it climbed.

Why these four

Memory. A session starts from zero. A store on disk plus a read at the start is enough to beat that. Measured with two brand-new agents, zero context, the same five questions: 5/5 with the store, 0/5 without — and the control did not hallucinate, it answered "I don't have that" five times.

Network. The reflex "this host is unreachable" is wrong more often than it is right. Measured on one network, same edge IP, 75 seconds apart: api.wikimedia.org → 200 in 0.43 s, en.wikipedia.org → connection reset in 1.21 s, api.wikimedia.org again → 200 in 0.39 s. The block was keyed on the TLS hostname, not the address. So the ladder tries, in order: plain fetch → IPv6 → IPv4 → a sibling hostname of the same service whose certificate still verifies (*/wiki/Title → api.wikimedia.org/core/v1/wikipedia/<lang>/page/<Title>).

It does not disable certificate verification and does not route through a proxy that would impersonate the origin. Those are MITM, not workarounds.

The ladder learns. A fallback rung that worked is written back as network.route.<host> and the next call to that host starts there; if a plain fetch starts working again the route is deleted (host self-heals). Measured on en.wikipedia.org/wiki/Monte_Carlo_method, 12 s per-rung timeout: cold 12.1 s (rung 1 burned the timeout, rung 4 answered) → warm 1.08 s / 1.14 s, one attempt instead of two — 11.2× faster. Numbers come from tools/fetch-route-bench.mjs.

The ladder remembers failures too. A URL whose every rung died is not retried for ten minutes: the same call returns the recorded failure in milliseconds instead of burning another timeout per rung. Measured on en.wikipedia.org/robots.txt (no alternate hostname applies there), default 12 s per rung: cold 34.81 s (3 dead rungs) → retry 0.01 s (cached, retryAfterMs tells you when) — 3481× faster. Only slow failures are remembered (a fast 404/403 is not a network verdict), the entry lives in a sidecar next to the store rather than facts.json (a transient blip is not durable knowledge), a different path on the same host still gets a real attempt, and the entry is deleted as soon as the URL answers. Numbers come from tools/fetch-fail-bench.mjs.

Install

sole plugin --profile <profile> add dsh-limit-break

Then restart that profile. In the desktop app, install it from Settings → Plugins instead — the desktop profile is owned by the app's plugin manager.

The package declares dsh.bundle and ships cordis.patch.yml, so sole plugin add mounts it with no manual editing. If you are mounting it by hand, add to profiles/<profile>/cordis.patch.yml:

- insert:
    - id: limit-break
      name: dsh-limit-break

A hand-mounted entry still needs the package on the profile's dependency list — a bare insert for a package the profile does not declare is silently ignored.

The store

$DSH_HOME/memory/facts.json, schema:

{ "schema_version": 1,
  "facts": [ { "id": "", "topic": "", "statement": "", "value": "", "unit": "",
               "details": "", "source": "", "timestamp": "", "tags": [] } ] }

Plain JSON on purpose: anything that can read a file can use it, with or without this plugin. Writes are tmp-file + rename, and a save takes a .facts.lock (created O_EXCL, stolen after 15 s if its writer died) around the whole read-modify-write, so two sessions saving at the same moment both keep their facts. tools/concurrency-selftest.mjs states the numbers: 16–17 of 48 saves lost before the lock, 0 after.

Disable / remove

  • Hot: set disabled: true on the entry in cordis.patch.yml — Cordis recomposes in about a second.
  • Cold: sole plugin remove dsh-limit-break, then restart.
  • The store is not deleted by either. It lives in $DSH_HOME/memory/ and is safe to keep.

Known limits

Measured, not guessed — each line is something a session actually hit.

  • A question worded without any of the fact's words is not found. Ranking is lexical: it stops English words, stems, merges CJK bigrams and weighs rare words, but it has no synonym table or embedding. "graphics chip" does not reach a fact that says "GPU", and the frozen paraphrase set measures exactly that gap (hit@1 0.333, 2026-11-26).
  • Tools are visible only to sessions opened after the mount. A session created before the plugin mounted keeps its tool snapshot; new tools do not appear until a new session. Not fixable from the plugin side (the tool list is materialised per session).
  • Concurrent saves serialise, and wait at most 8 s. A second session saving at the same moment waits for the lock instead of losing its fact; if the holder is wedged, the save returns { ok: false, code: "memory.locked" } rather than hanging. Read paths take no lock, so a save still cannot stop a reader from seeing the previous snapshot.
  • The fetch ladder is hostname-level. It does not defeat IP-level blocks, TLS interception, or a proxy that terminates the connection; it does not skip certificate verification.
  • A remembered route is a bet with a 14-day expiry. The ladder trusts network.route.<host> for two weeks and drops it as soon as a direct request works; if the winning rung starts failing the call still walks the rest of the ladder, it just pays that one rung first.
  • A remembered failure blinds that one URL for ten minutes. If a host recovers faster than that, the exact URL still reports the cached failure (with retryAfterMs) until the entry expires — the deliberate trade for not paying ~35 s on every retry of a dead URL. A different path on the same host, or a different host, is still attempted normally.
  • memory_recall ranks by keyword overlap only (id/topic/tags/statement/details), no embeddings: stopword-filtered, crudely stemmed word matching weighted by idf, so it is good at "which fact did I mean" and bad at paraphrase. tools/recall-bench.mjs states the current numbers (hit@1 1.00 on the 20 tuned questions of a 38-fact store, 9/9 on a held-out set); a query that shares no word with a fact still misses it, and nothing here handles paraphrases the words do not cover.
  • resilient_fetch reads at most 2 MiB per response and returns at most 20 000 characters; bigger payloads are truncated, not streamed.

Privacy

Nothing leaves the machine. resilient_fetch makes the request you asked for; the memory tools read and write one local file.

License

MIT.

История версий

  • 1.10.029 нояб. 2026 г. · 51 KB