Skip to content
Projects

LarryE135/dsh-flash-presets

View on GitHub

About

降低 DeepSeek V4.1 Flash 的 Token 消耗(精简预设 + 计划模式 + 内置 Windows fl-bash)/ Raising token efficiency for DeepSeek V4.1 Flash without losing performance

Other Projects

How these counts are measured

Measured star growth

in 24h
+7
in 7 days
+32
in 15 days
+51
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en.md

Original

dsh-flash-presets

中文 | English

GitHub stars npm npm downloads

dsh-flash-presets

An efficiency bundle for DeepSeek Harness (DSH) tuned for DeepSeek V4.1 Flash. Ships as a single DSH bundle (dsh.bundle) containing lean PTC agent presets, two-phase plan mode, run_code runtime speed-ups, and a bundled Windows Bash tool (fl_bash) — without modifying host source files.

The premise is straightforward: compact context earlier, trim oversized tool output, disable rarely used tools, batch calls through run_code, and replace slow PowerShell / Git Bash cold starts on Windows with a single-binary native Bash interpreter. None of this raises the model's reasoning ceiling; it cuts the tokens and wall time spent on tasks the model can already solve.

Current version: 0.3.5 (for npm, always verify with npm view dsh-flash-presets version) · previous official release 0.3.4 · mis-published 0.3.3 (deprecated on npm, not an official release) · presets lean-v3 / balance · plan mode plan-mode v1 (1.0.0) · requires DSH >=0.2.1-rc.5 <0.2.3-0 (CI-tested on 0.2.1-rc.5, 0.2.2-rc.1, 0.2.2-rc.3, and 0.2.2-rc.5 including Windows real-host runs)

Version pinning: Always pin the exact version ([email protected] or github:LarryE135/dsh-flash-presets#v0.3.5). Do not use a ^0.3 range (it may resolve to the deprecated 0.3.3), and do not install 0.2.5 (cannot create sessions on DSH 0.2.2-rc.1, #19). On release day, pnpm 11's default 24-hour minimumReleaseAge cooldown can silently pull the previous release for bare package names — pinning @0.3.5 or #v0.3.5 avoids that.


Contents


What Ships in One Bundle Card

Installing this bundle adds 4 components to the DSH Plugins page (streamlined from 6 in 0.3.4), alongside profile-wide ptc-runtime persistence and lean context defaults:

Component Row ID Default Role
Lean PTC v3 (lean-v3) preset-flash-lean-ptc-v3 Enabled (default preset) 13 behavioral rules + 25% compaction threshold + output trimming + PTC tool surface
Lean PTC v3 balance preset-flash-lean-ptc-v3-balance Enabled Same compaction/trimming/PTC framework, keeping only 3 core rules
Flash Lean Presets (runtime) flash-presets Enabled (deliveryGate off) Single row hosting 4 runtime features: glob/grep read-only concurrency, plan-mode host, legacy preset-id alias layer, and opt-in delivery gate
fl-bash (Windows Bash) fl-bash On by default (Windows x64) Bundled flash-sh.exe (~1.7 MB) providing fl_bash with zero Git Bash / WSL dependency; gracefully skipped on other platforms

Profile-wide runtime effects: Three things apply across the target profile, not only to this package's presets — the resident PTC runtime (ptc-runtime: persistent-in-memory, removed only by removing the plugin card), glob/grep read-only concurrency (DSH_FLASH_PRESETS_CONCURRENCY=0 disables it), and the in-memory legacy preset-id alias layer (DSH_FLASH_PRESETS_ALIAS=0 disables it). Two input-side lean patches are also applied (tool-skill.catalogDescriptionMaxLength: 60 and disabling two DeepSeek-specific upload rows).


Quick Install & Verification

Option 1: Plugin Manager (Recommended)

Installs the full bundle card (presets + plan mode + run_code speed-ups + legacy-id layer + fl-bash):

# From npm (pin exact version)
dsh plugin --profile web add [email protected]

# Or install the identical code from GitHub tag
dsh plugin --profile web add github:LarryE135/dsh-flash-presets#v0.3.5
  • --profile is typically web or desktop (entering the same spec in GUI Plugins → Add plugin is equivalent; presets do not activate under headless, and acp is untested).
  • To track unreleased fixes merged on main, replace #v0.3.5 with #main.
  • Applying changes: reload the page for web; fully quit and restart the app for desktop (profile patches are read at startup only).

Option 2: Offline / Install Script (Presets Only)

Download an archive from Releases or clone the tag (uses the DSH 0.1.7+ plugin-row patch mechanism; the pre-0.1.7 directory layout was removed in 0.2.6):

git clone --depth 1 -b v0.3.5 https://github.com/LarryE135/dsh-flash-presets.git
cd dsh-flash-presets
bash scripts/install.sh --profile web            # Windows: scripts\install.ps1 -Profile web
  • Writes a single managed block (the two preset rows) into cordis.patch.yml with automatic backup & pruning; pass --with-runtime (-WithRuntime in PowerShell) to also add ptc-runtime: persistent-in-memory.
  • Plan mode, legacy preset-id resolution, glob/grep concurrency, and fl-bash ship only via the plugin card.
  • Either/or: uninstall the script block (--uninstall) before switching to the plugin card to avoid duplicate preset rows (the installer refuses stacking with exit 4 by default).

Verify Installation

dsh --profile web --dump-config | grep -c 'id: preset-'           # Expect 6 (4 built-in + 2 from this bundle)
dsh --profile web --dump-config | grep -c 'persistent-in-memory'  # Expect 1
dsh --profile web --dump-config | grep -c '^- id: flash-presets$' # Expect 1
dsh --profile web --dump-config | grep -c '^- id: fl-bash$'       # Expect 1
node scripts/doctor.mjs --profile web                             # Version, duplicates, !!js, YAML & exe integrity check

For plugin-manager installs, the doctor script lives inside the profile: node ~/.dsh/profiles/web/node_modules/dsh-flash-presets/scripts/doctor.mjs --profile web.

Update & Uninstall

  • Update: pinned versions do not drift on dsh plugin update; re-run dsh plugin --profile web add dsh-flash-presets@<new-version>.
  • Uninstall:
dsh plugin --profile web remove dsh-flash-presets   # Plugin-manager install
bash scripts/install.sh --uninstall --profile web   # Script install (Windows: scripts\install.ps1 -Uninstall)

Benchmarks

Every number below is tied to its own benchmark setup and sample size; do not compare absolute scores across different task sets.

1. End-to-End Agent Efficiency — DSH-Bench (110 Tasks × 6 Runs, Four Arms)

Same tasks, same model, same order (660 answered runs per arm; net wall time excludes startup and queueing): lean-v3 incurs no measurable accuracy drop while cutting both tokens and wall time.

Accuracy across the four arms (overall / coding / knowledge / long-horizon / office, axis starts at 60)

Setup Accuracy Tokens vs Standard Cost / Answer Net Time
Standard 84.1% 128.63 M — ¥0.0805 12.2 h
Native PTC 85.0% 98.00 M −23.8% ¥0.0724 11.1 h
lean-v3 · Windows 84.1% 83.77 M −34.9% ¥0.0634 9.8 h
lean-v3 · WSL 84.8% 63.08 M −51.0% ¥0.0551 7.0 h

Net answering time across the four arms (mean / median / per correct answer)

Token mix and cost across the four arms (cache reads / uncached input / output)

How to read it:

  • All five dimensions (overall / coding / knowledge / long-horizon / office) stay within ±4 points; 0.1-point differences sit inside noise — the honest conclusion is "no measurable drop", not "smarter".
  • Comparing against Native PTC isolates the preset's net impact from the PTC tool surface: −14.5% tokens on Windows / −35.6% on WSL. Quote the conservative Windows column by default.
  • This 110-task × 6-run set is distinct from the 160-task dsh-bench v1 set and earlier n = 3 runs. Full breakdowns and reproduction steps: DSH-Bench four-arm report (Chinese).

2. Windows Shell Performance — fl_bash vs Git Bash vs pwsh

On Windows, DSH ships only pwsh, forcing models into an unfamiliar shell while paying heavy PowerShell or Git Bash login-shell startup overhead on every command. Measured on Windows with the bundled Rust single-binary flash-sh.exe and its warm --standby pool:

Startup Latency & Memory

Shell Cold Start Min Startup RAM grep 23MB Peak
fl_bash 14.4 ms 12.5 ms 5.3 MB 5.6 MB
cmd.exe 14.3 ms 13.0 ms — —
gitbash -c 49.5 ms 44.6 ms 11.1 MB —
pwsh -NoProfile 350.6 ms 335.3 ms 80.7 MB 265.2 MB
gitbash -lc 385.4 ms 354.5 ms 13.2 MB 13.3 MB

Real DSH Tool-Layer Wait Time (End-to-End, ms)

Through the real DSH tool pipeline (fl_bash warm standby hits as low as 3 ms):

Task fl_bash Tool gitbash (via pwsh Tool) pwsh Tool
echo 39 (min 3) 871 559
grep 23MB 24 886 1679
find 3000 files 114 937 607
git log 50 commits 61 964 666

12 Workloads (Single-Call Median, ms)

Workload fl_bash gitbash -c gitbash -lc pwsh fl vs gitbash -lc fl vs pwsh
No-op command 14.4 49.5 385.4 350.6 26.8× 24.3×
grep -c 23MB 33.8 84.0 410.3 1499.6 12.1× 44.4×
wc -l 23MB 33.2 99.2 424.8 2543.4 12.8× 76.6×
CSV sum (300k rows) 102.1 110.7 476.8 1631.1 4.7× 16.0×
Sort 100k integers 30.4 138.6 469.6 844.4 15.4× 27.8×
Recursive find (3000 files) 121.0 113.9 466.6 379.9 3.9× 3.1×
git log 50 commits 72.3 126.9 496.5 419.5 6.9× 5.8×
Shell loop (10k iters) 18.4 98.5 418.6 301.9 22.8× 16.4×
base64 23MB 80.4 122.9 454.3 305.5 5.7× 3.8×
cat 23MB byte count 23.3 101.7 475.6 364.5 20.4× 15.6×
sed replace (300k rows) 45.8 259.2 570.1 3145.0 12.4× 68.7×
Spawn Python child 60.0 94.5 431.7 364.5 7.2× 6.1×
Expand: Net work time excluding startup (ms)
Workload fl_bash gitbash -c gitbash -lc pwsh
grep 23MB 19.4 34.5 24.9 1149
wc 23MB 18.8 49.7 39.4 2193
CSV sum 87.7 61.2 91.4 1280
Sort 100k 16.0 89.1 84.2 494
find 3000 107 64.4 81.2 29.3
git log 57.9 77.4 111 69
Loop 10k 4.0 49.0 33.2 ≈0
base64 23MB 66.0 73.4 68.9 ≈0 (.NET)
cat 23MB 8.9 52.2 90.2 13.9 (.NET)
sed 300k rows 31.4 209.7 184.7 2794

Components in Detail

1. Lean Presets & Four Token-Saving Mechanisms

Mechanism When It Acts Setting Effect
Turn compaction Stored context grows large thresholdRatio: 0.25, retainTokens: 20000 (default: 0.8) Replaces old history with summaries earlier in long sessions
Output trimming Tool result enters context Threshold 8192, keeps first 4096 / last 1024 chars Prevents one huge tool output from blowing context
Disabled plugins System prompt assembly 6 rarely used plugins set to disabled: true Drops fixed tool schema overhead
Behavioral rules Every model step lean-v3 (13 rules) / balance (3 rules) Encourages cheap probes, batched calls, incremental edits, single-pass delivery
Preset ID Rules Compaction When to Use
Lean PTC v3 (lean-v3) flash-lean-ptc-v3 13 0.25 / 20k Default. Best token efficiency for day-to-day coding and scripting
Lean PTC v3 balance flash-lean-ptc-v3-balance 3 0.25 / 20k Minimal guardrails (scope/language, no secrets, switch after 2 failures) when the model needs more room

Implementation notes with source line references: four mechanisms write-up (Chinese). Compared to the official PTC preset, this bundle omits time-context (no current date/time) and tool-schedule, and sets 6 rarely used plugins (tool-plugin-manager, tool-workflow, tool-ralph, workflow-ptc, tool-subagent-codex, tool-subagent-claude-code) to disabled: true.

2. fl-bash: Built-In Windows x64 Bash Tool (On by Default)

  • Self-contained: lib/fl-bash.js and vendor/win32-x64/flash-sh.exe (~1.7 MB, single-binary Rust shell with built-in coreutils / grep / sed / awk / jq / diff / find / xargs; open-source at LarryE135/fl-bash) ship inside this package and never shadow bash, pwsh, or run_code.
  • Platform behavior: Registers fl_bash on Windows x64 only; macOS, Linux, and Windows ARM64 log one info line and skip gracefully. If the standalone fl-bash package is also installed, a process coordinator registers fl_bash only once (this bundle takes precedence).
  • Security boundary (important): when DSH has a sandbox provider (ctx.sandbox), every fl_bash run is wrapped with ctx.sandbox.confine into the same file sandbox as the built-in pwsh / bash tools (read-only / workspace-write / full-access behave the same), and approvals match the built-in tools: you are asked only when the model retries a sandbox-denied command with sandbox_permissions (allowed once, never remembered). Two extra cases always prompt: writes to workspace paths other tools run as code (.git/, package.json, .npmrc, .env*, *.ps1/*.sh, …, including writes whose target cannot be seen on the command line, such as sh -c, inline interpreters, or writes wrapped in env/xargs) and force-push / remote-branch deletion / publishing (npm publish, cargo publish, gh release create, …). To turn the sandbox off: sandbox: off or DSH_FL_BASH_SANDBOX=0. When no sandbox is available it falls back to the per-command approval below (never unconfined without approval), and fl_bash then runs outside DSH's file sandbox with your user privileges:
    • Default approval: "sandboxed": prompts for confirmation in every non-full-access session and fails closed if approval cannot be obtained;
    • Pure read-only commands (ls/cat/grep/find without -exec/-delete, etc., with every file on the command line inside the workspace) run without a prompt (jq is not on that list, since it is looked up on PATH first);
    • Other safe commands are remembered per session by individual command name and feature: |, plus > and & bound to the command that uses them (approving echo … > f does not let cat write files); git is allow-listed: only read-only subcommands (status/log/diff/show/blame/…) share the git name; every other subcommand (commit/add/checkout/…) is remembered per subcommand, and ones that rewrite hooks/config/refs, unknown subcommands, aliases (git co) and git flow are confirmed every time; git lfs is remembered per lfs subcommand (sub:git lfs pull), except install/uninstall/update/migrate, which always prompt. Dangerous commands always prompt: writes to paths other tools run as code or config (.git/, .husky/, package.json, .npmrc, .env*, conftest.py, setup.py, build.rs, *.ps1/*.sh, …), archive extraction (tar -x, unzip, 7z x), rm -rf, out-of-workspace writes resolved via realpath, UNC/device paths, bash -c/eval/source/. script/inline interpreter execution, ${!name} indirect expansion, dangerous tar/git flags, mutations to PATH/NODE_OPTIONS/etc., and any unparseable syntax (guarded by 348 adversarial cases + 52 read-only/memory bypass cases + 165 cross-command borrowing / sensitive-write / extraction / git-subcommand / dot-source cases). Sensitive paths are checked against the write targets visible on the command line; see the plugin README for exactly what is covered;
    • Strips credential-like environment variables (*KEY*, *PASSWORD*, *PASSWD*, *SECRET*, *TOKEN*, *CREDENTIAL*, *COOKIE*, *JWT*, *OAUTH*, *_PASS, *_PWD, *_PAT, *_AUTH excluding GIT_AUTHOR_*, plus prefixes DSH_*, AWS_*, GITHUB_*, GH_*, NPM_CONFIG_*, YARN_NPM_*, AZURE_DEVOPS_*) and URLs containing credentials before spawning;
    • Full documentation and compatibility notes: plugins/flash-sh/README.md (Chinese) and SECURITY.md.
  • Turning it off: toggle fl-bash off in the DSH Plugins page, set - id: fl-bash with config: { enabled: false } in cordis.patch.yml, or set DSH_FL_BASH=0 (legacy DSH_FLASH_SH=0 also works).

3. run_code Runtime Speed-Ups

  • Persistent PTC runtime: cordis.patch.yml configures ptc-runtime: persistent-in-memory, cutting per-program startup cost from 108 ms to ~0 ms and nested tool calls from 44 ms to 15 ms (benchmark notes, Chinese).
  • Read-only glob / grep concurrency: the toolConcurrency sub-feature of flash-presets marks read-only search tools as concurrency-safe at runtime and prints a one-line startup self-check:
[tool-concurrency] v0.3.5 生效|targets=glob,grep|sweep=500ms|witness=glob=true grep=true|scopes=1

Setting DSH_FLASH_PRESETS_CONCURRENCY=0 disables only glob/grep concurrency; it does not disable the profile-wide persistent PTC runtime.

4. Plan Mode (plan-mode v1, 1.0.0)

Composer icon and upward panel to the left of the input box, independent of your selected preset:

  • off: inactive; switching to off immediately exits native plan mode opened by this plugin (user-initiated /plan sessions stay untouched; run /plan off to exit manually).
  • light (recommended default): bridges DSH's native plan review card; after approval, execution follows the model's normal flow.
  • full: bridges the native plan review card, then automatically steers PHASE 2 execution in the same turn upon approval, requiring P0-EXEC.yml with measured acceptance results.
  • Key capabilities:
    • Scope (scope): auto (default: plans on turn 1 and re-plans when task scope shifts), always, or first; every turn gated for planning enters the native plan review card rather than silently skipping review on later turns.
    • Auto-approve (autoApprove): optionally approves exit_plan_mode automatically (v1.1 animated glyph) without touching normal ask_user_question prompts.
    • PTC 10-minute review timeout guard (#29): blocks run_code calls invoking exit_plan_mode / ask_user_question without timeoutMs >= 600000 (DSH_FLASH_PRESETS_REVIEW_GUARD=0 disables).
    • Headless / CI: DSH_PLAN_MODE_UI_HEADLESS=off disables plan mode completely; prompt injects text without bridging review cards.
    • Host-identity authentication: every GET/POST route under /api/plan-mode/* and /api/flash-presets/core authenticates the DSH host owner identity first (fail-closed: ctx.connection.admit / requestRejection on DSH 0.2.1-rc.5–0.2.2-rc.5, and route auth: "required" + owner peer on DSH 0.2.3+; 401 unauthenticated, 403 untrusted/non-owner, 503 if host auth is unavailable), followed by supplemental Sec-Fetch-Site, Origin, and x-plan-mode-client: 1 write checks. For LAN or reverse-proxy access, configure trustedHosts on DSH's client-connection.

5. Legacy Preset-ID Alias Layer & Delivery Gate

  • Legacy preset-id compatibility (alias): all 5 historical preset IDs (flash-lean-ptc-v3-lite, flash-lean-ptc-v1, flash-lean-ptc-v2, flash-lean-ptc, flash-lean) resolve in memory to flash-lean-ptc-v3 (all marked rulesDiffer: true, logging a notice on first hit — including -v3-lite since rule 7 changed in 0.3.2). No code in this package ever scans or rewrites sessions/. See preset ID contract (Chinese) and presets/legacy-preset-map.json.
  • Delivery gate (deliveryGate, off by default): when enabled, runs workspace-contained verify.ps1 (Windows) or verify.sh (Linux/macOS) at turn stop (realpath-confined to workspace), steering failure exit codes and output tails back to the model (up to maxRounds: 2). Enable via deliveryGate.enabled: true or DSH_DELIVERY_GATE=1.

Runtime Component Switches

Override only the sections you need in ~/.dsh/profiles/<name>/cordis.patch.yml (environment variables take precedence):

- id: flash-presets
  config:
    toolConcurrency: { enabled: true }   # glob/grep concurrency (env: DSH_FLASH_PRESETS_CONCURRENCY=0)
    alias:           { enabled: true }   # legacy preset IDs (env: DSH_FLASH_PRESETS_ALIAS=0)
    planMode:        { enabled: true }   # plan-mode host; todoSync / lagTurns go here too
    deliveryGate:    { enabled: false }  # delivery gate (env: DSH_DELIVERY_GATE=0/1); maxRounds / scripts / timeoutMs

- id: fl-bash
  config:
    enabled: true                        # Windows x64 Bash tool (env: DSH_FL_BASH=0)
    approval: sandboxed                  # sandboxed | read-only | off
    approvalMemory: session              # session | off (reuse per-class approval in-session; dangerous commands always prompt)
    sandbox: auto                        # auto | off (0.3.5+: run inside the DSH sandbox; off = per-command approval; env: DSH_FL_BASH_SANDBOX=0/1)

Overrides written against pre-0.3.4 row IDs (flash-presets-core, plan-mode-ui, flash-presets-alias, delivery-gate, flash-sh) are automatically read back and translated at startup. To turn off only plan mode, set planMode: { enabled: false } — do not disable the whole flash-presets row, or legacy-session support and concurrency optimization will also stop.


Upgrading from Older Releases

  • Stable preset IDs: the two active presets stay flash-lean-ptc-v3 and flash-lean-ptc-v3-balance. All 5 historical IDs resolve in memory via the plugin card's alias layer (add your own profile row from tag v0.2.5 if you need verbatim v1/v2 rules).
  • Script installs lack the alias layer: if your old patch contained flash-lean-ptc-v3-lite, merge-presets keeps an order: 99 compatibility row; for v1/v2 sessions, switch to the plugin card.
  • 0.3.2 → 0.3.4: plugin page rows consolidated from 6 to 4; if you previously wrote config.enabled: false on plan-mode-ui or flash-presets-alias (ignored in 0.3.2), it now takes effect — remove it if unintended.
  • Sessions stuck in plan mode prior to 0.3.4 (#45): pre-0.3.4 sessions lack persisted ownership metadata; run /plan off once in that session to clear it.
  • Remove any standalone dsh-plan-mode-ui or legacy dsh-flash-sh packages before installing this bundle to avoid duplicate registration.

Fit, Troubleshooting & Known Limitations

Good fit: coding, scripting, data processing, and deliverable-driven tasks with clear verification criteria, long sessions, and Windows workflows where shell startup latency hurts. Poor fit: competition-grade problems beyond the model's ceiling (standard mode holds up better; see measured evidence), workflows relying on time-context/schedules/in-chat plugin installs, DSH < 0.2.1-rc.5, or untested non-Flash models.

Troubleshooting

Run diagnostics first:

node scripts/doctor.mjs --profile web --all
node scripts/diag-preset-load.mjs --profile desktop
Symptom Likely Cause Fix
Preset card shows "failed to load" Custom preset still references removed .../dsh-tool-subagent-control/list-agents subpath (0.2.2-rc.1+) Locate with diag-preset-load.mjs and delete that row
Slash commands vanish / tool executor is unavailable Hot reload disposed an open session's composition Restart DSH, or set DSH_FLASH_PRESETS_SELFCHECK_HEAL=1
Duplicate presets in picker Script managed block stacked with bare rows or plugin card Re-run installer to adopt bare rows, or --uninstall before using plugin card
js-yaml reports unknown tag Raw preset source containing !!js copied manually Run node scripts/doctor.mjs --profile web --fix
Presets disappear after DSH upgrade DSH version exceeded engines.dsh (<0.2.3-0) Upgrade this bundle, or override via dsh plugin allow-version
Tools (glob/grep) silently missing Stale local @deepseek-ai/* copy mismatched with host DSH version Follow section [9] of doctor.mjs output

Known Limitations

  • Under the headless profile, presets and plan mode stay pending (acp is untested); use web or desktop.
  • macOS has not been tested on physical hardware; scripts follow bash 3.2 rules and pass CI across Ubuntu, Windows, and macOS.
  • Plan-mode state is visible to other plugins watching planMode; if a third-party plugin prompts during plan mode on pure Q&A turns, switch plan mode to off.
  • Raise the model output token limit (≥ 120K, ideally 384K) and use one problem per session for long-thinking models.

Using It from DSH Go (Mobile App)

  • Local mode (DSH runs on the phone): fl_bash registers only on Windows x64, so it is not registered on the phone and the shell is DSH's native bash; presets, the run_code speed-ups, plan mode, and the delivery gate work as usual.
  • Remote mode (the phone connects to DSH on a computer, e.g. DSH Remote or SSH "connect only"): fl_bash approvals appear on the app's native approval card. The card shows only the first 3 lines of the reason, so since 0.3.5 the reason reads "command / why it asks / inside or outside the sandbox", with the command on the first line (long commands are cut, with the number of hidden characters shown) and a Chinese version for Chinese UIs; the full explanation is visible in DSH Web on the computer.
  • Use "Allow all in this chat" with care: once tapped, the app answers "allow once" to every later approval in that chat, including the commands fl_bash deliberately asks about every time (force pushes, publish commands such as npm publish, writes to .git/hooks / package.json, and so on). The plugin receives the same answer as a manual "Allow" and cannot tell the difference.
  • Change remote-host settings on the computer: remote hosts have no DSH Go bridge, so fl-bash settings (sandbox, approval, …) cannot be changed in the app; use the plugin page in DSH Web on the computer, or edit cordis.patch.yml.

Development & Verification

npm run verify                             # 13 authoritative checks (sync-lib, sync-fl-bash, core, session compat, YAML, structure, lint, bench leak guard, versions, compat gate, bench table, bash 3.2, ps1)
node plugins/flash-sh/test/unit.mjs        # fl-bash unit tests
node plugins/flash-sh/test/adversarial.mjs # fl-bash adversarial security suite (348 adversarial + 29 benign + 52 read-only/memory bypass + 165 borrowing/sensitive-write/extraction/git-subcommand/dot-source + 50 memory-still-works + 8 pathological glob)
bash scripts/selftest.sh                   # Installer / uninstall / merger / publish-guard E2E tests
node scripts/verify-session-compat.mjs     # 10 synthetic legacy-session checks + negative controls

These commands require a full git clone (scripts/ contains 51 files in the repo; the npm tarball ships only runtime/diagnostic files per package.json files). cordis.patch.yml is generated via npm run build (scripts/compose-bundle-patch.mjs), and lib/ / vendor/ mirrors are synced by sync-lib.mjs and sync-fl-bash.mjs — never edit derived files by hand. See CONTRIBUTING.md.


Version History

Full changelog: CHANGELOG (Chinese). Compatibility matrix: versions & compatibility (Chinese).

v0.3.5

  • Security fix (P0): bundled flash-sh.exe updated to fl-bash 1.0.2. The 0.3.4 package on npm shipped flash-sh 0.1.9 (flash-sh --version prints 0.1.9; exe sha256 04c44cee…a60cd1), where ${!x} (indirect expansion) parsed the variable's value as code — e.g. x='a}$(touch /tmp/PWNED)${b'; echo "${!x}" actually ran touch. fl-bash 1.0.0 (swapped into main after 0.3.4, never published to npm) and 1.0.1 are affected too; versions before 0.1.9 were not tested but are most likely affected — seeing 0.1.9 does not mean you are safe. 1.0.2 reports invalid variable name and runs nothing. fl-bash users should upgrade to 0.3.5.
  • Behavior change: fl_bash now runs inside the DSH sandbox by default (#69). When DSH provides a sandbox (ctx.sandbox) and the session is not full-access, every run is wrapped with ctx.sandbox.confine into the same file sandbox as the built-in pwsh / bash tools, and per-command approval is turned off: ordinary reads and writes in the workspace, git commit / git push, npm test / npm run build and so on no longer prompt. Measured on a full development session (search + edit files + npm + git, 40 commands): 18 → 0 prompts. Writes outside the workspace (e.g. npm install of a new dependency writes the global cache, git config --global) are denied by the sandbox; when the model retries with sandbox_permissions you are asked once (that call only, never remembered), so a session that installs new dependencies usually still sees one escalation prompt. Still confirmed every time: writes to paths that run as code outside the sandbox (.git/, package.json, .npmrc, .env*, *.sh/*.ps1, …, including writes whose target is not visible on the command line: sh -c '…', python3 -c / node -e inline code, writes wrapped in env/timeout/xargs, curl -O/wget downloads named after the URL, git apply / git am patches, hand-built git objects (git update-index --cacheinfo, read-tree, …), git fetch / git pull from a URL on the command line, package-manager config writes (yarn config set, yarn set version, npm config set --location project), …; dd of=, git mv, curl -o, ln and chmod are judged by the files on the command line), force-push / remote-branch deletion, and publishing (npm publish (including the npm pub abbreviation) / unpublish / owner / access / dist-tag / deprecate, pnpm -r publish, cargo publish, twine upload, gh release create/upload/delete, … — on both routes, never released by session memory).
    • New setting sandbox: auto | off (default auto) and environment variable DSH_FL_BASH_SANDBOX (0 off, 1 on; overrides the setting). To turn the sandbox off, set config: { sandbox: off } under - id: fl-bash in cordis.patch.yml, or DSH_FL_BASH_SANDBOX=0; then, and whenever DSH has no sandbox or it fails to start, fl_bash falls back to per-command approval (the 0.3.4-style classifier; approved command classes are remembered for the session).
  • fl-bash approvals (round-4 audit): git global options that switch repository (--git-dir / --work-tree / -C / --bare …), git after cd, git clone and fetch / ls-remote / pull with a URL or path are confirmed every time; unzip counts as listing only when every option is a listing option; mv / cp / install -t / --target-directory check DIR/<source name> against sensitive paths and cp -rT always asks; glob bracket expressions follow bash rules; files written by gunzip / unzstd / xz -d … are write targets, and jar / cpio / pax / expand … always ask.
  • Includes the sixth-round audit fixes and the fl-bash read-only auto-approval work (#66) merged to main after 0.3.4; see CHANGELOG.

v0.3.4 (2026-11-27)

  • Plugin page 6 → 4 consolidation: merged flash-presets-core, plan-mode-ui, flash-presets-alias, and delivery-gate into one flash-presets row with automatic legacy-override translation.
  • Bundled fl-bash (on by default on Windows x64): ships the 1.7 MB flash-sh.exe (0.1.9 with warm --standby pool) and fail-closed approval classifier inside the package.
  • Stability & CI: three-state plan detection, subCallId-paired PTC in-flight tracking, #45 clean goal-mode exit after switching plan mode off, and a real DSH 0.2.2-rc.5 dual-OS host-probe matrix in CI.
  • Round-six full-repo audit remediation & fl-bash v1.0.0 alignment on main (queued for the next release): fixed Issue #56 multi-turn plan-review bypass, closed all 9 P0 fl-bash classifier bypasses + StandbyPool/spill hardening, fixed delivery-gate / plan-mode-ui locking, state machine, and native Windows test pass (34/34), closed script/publish-guard/CI/docs gaps, and aligned the bundled flash-sh.exe with the open-sourced LarryE135/fl-bash v1.0.0 release (see CHANGELOG).

v0.3.2 (2026-11-17, previous official release)

  • Auto-approve button v1.1 glyph & trigger animation, default context trimming, delivery gate reverted to off by default, scope default auto, #29 PTC 10-minute review timeout guard, plus round-three and round-four audit fixes. Earlier releases: CHANGELOG.

Explore related projects

Loading…