rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:ruaibeite/dsh-preflight
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Forecast a task's steps, tokens, duration and cost from this machine's own session history, with a local price table for cost estimates · A DeepSeek Harness plugin
English: Before you run a task, open Settings → Preflight, describe the task, and see what similar past sessions on this machine cost: steps, input/output tokens, wall-clock duration and (when you configure prices) money — each as a P25 / P50 / P75 range. A local price table drives the cost estimate; nothing runs under the composer.
中文: 执行任务前,打开 设置 → 预检,输入任务描述,看看这台机器上相似的历史会话花了多少:步数、输入/输出 token、时长,以及(配置价格后)费用,都以 P25 / P50 / P75 区间给出。价格表只用于预测结果里的费用估算;输入框下方不再显示常驻预算条。
The plugin is read-only and local: it derives everything from the session projection cache DeepSeek Harness already writes, adds no prompt, tool or model call, writes no session, and never contacts the network.

Screenshots are taken from a demo profile seeded with synthetic sessions; no user data is shown.
Open the Harness settings and pick Preflight (「预检」) in the left navigation. One scroll, three blocks:
P25–P75 and the median,normal / low) derived from the spread of the token forecast,The page has four states: loading (skeletons while the first scan runs), error (with a Retry button), empty (no usable samples yet — explains how samples appear), and populated.
Three ways:
dsh-preflight (or 预检) in the plugin market and install.dsh plugin --profile <profile> add github:ruaibeite/dsh-preflightplugin_manager: install_bundle target=/path/to/dsh-preflightThe host row is injected by the package's own cordis.patch.yml. The browser half loads with the next page load; the host half registers at startup, so if the Preflight page appears but the data does not load, restart DSH once. Uninstall with plugin_manager: remove_bundle (or from the market), then restart the app so the host half unloads.
$DSH_HOME/storages/session_projcache/sessions/*.json
│ read-only parse: prompt · cwd · model · steps · tokens · duration
▼
$DSH_HOME/cache/preflight/samples.json (path + size + mtime, incremental)
│ similarity scoring over this machine's sessions
▼
GET|POST /dsh-preflight/api
│ report · predict · settings · save-settings
▼
Settings → Preflight
$DSH_HOME is DSH_HOME when set, ~/.dsh otherwise.
Every projection-cache file is parsed into one compact sample: the first prompt (turnOutline.turns[0].prompt, falling back to titleInput.first.text and the title), cwd (workingDirectory, falling back to identity.cwd), provider/model (modelSelection.lastUsed), steps/turns (sessionStats), the four token buckets (tokenUsage.totals), and duration (lastPromptAt - identity.createdAt when plausible, otherwise llmMs + toolMs). Sessions without steps, without token usage or without a timestamp are skipped and counted. Corrupt files are skipped, never fatal. The scan keeps an incremental cache keyed by path + size + mtime in $DSH_HOME/cache/preflight/samples.json, and readers share a 30-second in-process cache.
The forecast is a nearest-neighbour statistic, not a model call:
(uncached input × input price + cache read × input price × 10% + cache write × input price + output × output price) / 1M. No price, no guess.low when the interquartile range of total tokens is above 1.2× the median, otherwise ok.$DSH_HOME/cache/preflight/ and are written atomically (temp file + rename).GET|POST /dsh-preflight/api route the settings page calls on the DSH host. Nothing is uploaded..credentials.yaml or any provider credential, and it does not log prompts.cd dsh-preflight
npm test
Two plain-Node suites, no dependencies, no Harness process, no browser, no network, and no real $DSH_HOME (every filesystem test uses mkdtemp).
test/host.mjs covers projection-cache parsing (complete records, missing model/cwd, corrupt JSON, missing token usage), the incremental cache (reuse, rewrite, deletion), percentiles, similarity scoring and fallbacks, prediction and cost, settings validation/atomic write/read-back, all route actions and error paths (400/405/413/500), and apply() with a fake context.test/render.mjs loads the real client.js in a small in-repo React harness and checks the four page states, the price table form, the forecast card with and without prices, and that the bundled dictionaries match locale/*.json key-for-key.index.js host half: projcache parsing, prediction, settings, route, activation
client.js browser half: settings section, price table, forecast form
locale/zh.json bundled copy (registered through the locale service)
locale/en.json
test/host.mjs host tests
test/render.mjs browser-half tests CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。