Skip to content

minidsh 1.1.0

Choose a tag to compare

@github-actions github-actions released this 27 Sep 10:37
· 154 commits to main since this release

The record and authority planes, built across three sessions, reviewed as one system and released: durable execution you can read cold, consent that says what will run, and a shell that runs on every platform under an honest boundary.

Added

  • Read a stored session without resuming it. minidsh sessions verify <id> says whether a log is intact — ok, interrupted (a crash a resume will close) and torn exit 0; damaged, invalid (a rule the runtime holds every write to is broken) and a newer, unreadable format exit 1 — and sessions inspect <id> reports what each part of the log was written under, the authority it ends under, undecided approvals, queued input, children, cost, and exactly what a resume would append. Neither takes the session's lock nor writes a byte, so both are safe on a log another process holds, and such a log reads as in flux rather than crashed. --json on each.
  • Salvage a damaged session. minidsh fork <id> --salvage branches a log whose bytes are unreadable past some point from what is still readable, leaving the original untouched; every tool call it cannot account for is marked outcome-unknown, the fork records where its source stopped, and the command says so on stderr, because damage between turns leaves the model nothing to see.
  • The audit shows what calls did. sessions show --audit now lists each file write and shell command the providers recorded (path and hash, mode, enforcement, exit status), each call whose outcome was lost with a crash, and, for a crashed session nobody has resumed, what a resume would record — marked as such, and never for a session another process is still running.
  • An approval says what the runtime will do, not what the model said about it. The line a person answers now carries a subject the harness builds from the validated call arguments — the command, and the mode and enforcement it would run under — plus the whole call as the log recorded it, up to a bound past which the surfaces refuse the shortcut and point at sessions show <id> --json rather than hiding a command's tail. The model's justification sits beside that, never in place of it. Control characters in a subject are escaped rather than flattened, so two different commands can never render as one line.
  • A yes can outlive one call without outliving the run. Where the host offers it, a in the terminal (or the browser's button) extends a one-shot approval to that exact action — same tool, same command, same authority — for the rest of that run of the session. It is a durable event, it is offered by the runtime rather than invented by a surface, it dies the moment any authority knob moves or the run ends (a resume or a fork asks again, once), and /grants and /revoke <id> list and withdraw it. A near-miss asks again: this is not a policy language.
  • A session can accept the enforcement its host can actually deliver. --accept none (or /accept none, or the browser's control, or session/authority) records that this session will run a shell command a host cannot confine — under its own sandbox mode, with the in-process file fence intact. On Windows, which has no confinement backend, that replaces paying a danger-full-access escalation per command, which used to drop the file fence as well. It is inert wherever a backend exists, it applies only to the mode it was given for, and a delegated child inherits it as a pin it cannot change.
  • Decisions record who made them: policy, a standing consent (and which one), a person, or an automatic answerer. sessions show --audit and both clients print it.
  • An unattended run can approve exactly what a deployment declared. approval-headless takes an allow list of exact subjects, answered auto — a middle rung between --approve (all of them) and the fail-closed default (none).
  • Crash repair closes every bracket the log left open (from the durable-execution work that preceded this): an interrupted delegation, an interrupted compaction, and the tool calls of an interrupted step, with a durable fact recorded between a tool's approval gate and its body so repair can tell "never started" from "outcome unknown". Effects that land — file writes and shell commands — are recorded by the provider that caused them, after the fact.

Security

  • --accept on serve, web and chat now does something. It was accepted, advertised and dropped before reaching the sandbox, so wire-hosted sessions kept refusing. It now applies, and a weakened acceptance is written into the log of every session it opens, for every mode a command can be confined under, so a stored session says what it accepted (a line, or full by its absence), a resume keeps it, and an approved escalation never runs under one the log does not name. A delegated child's acceptance applies to the mode it was delegated for; any mode it narrows into is strict.
  • A shell refusal is on the record as a refusal. On a host that cannot confine the shell, an unescalated command's refusal is now a coded error result (SANDBOX_UNAVAILABLE, same words) instead of a successful one, so the audit and every surface show it as refused.
  • A shell child no longer inherits this deployment's provider keys. The harness builds the child's environment instead of passing its own through, withholding every credential name a provider row declared (including one a config file renamed; the list is read at every spawn) and every MINIDSH_* — and nothing for merely looking like a secret: a GOOGLE_APPLICATION_CREDENTIALS or an API key you set for your own tools is yours and reaches your shell. On Windows the names are compared the way the environment compares them. This is defence in depth, not a boundary: reads are still unfenced, so a credentials file remains readable, and any secret the deployment did not declare passes through.
  • Measured: a confined shell writes through a hard link that already exists in the workspace, because the operating system confines paths; the documents had said a confined host was unaffected. Under bubblewrap and under Seatbelt alike (a test in pnpm check now measures both), and neither lets a confined command create such a link across the workspace boundary, nor write an outside file by its outside path because it also has a workspace name.
  • The terminal neutralizes the streamed answer. Every line the terminal printed went through the control-character filter except the one a person reads most, the model's own streamed text; an escape sequence in it could repaint the line above the next [y/N]. It is filtered like the rest, and the log is untouched.
  • A client can no longer answer an approval in a session it does not watch. approval/answer now applies the same visibility rule that decides which connections are asked in the first place.

Fixed

  • A detached session refuses appends. After a session was detached, an append still succeeded in memory while persistence had already closed its file and dropped the event without an error: the log in memory and the log on disk could part ways silently. The store now closes the session before session/disposed, and a later append throws SESSION_CLOSED.
  • The browser shows every event the terminal shows. The browser's event projection was an untested hand-copy of the terminal's and had drifted: a step's effective route (request/context) and a delegated child's route never appeared in the browser. The projection is now a typed, DOM-free module (web/rows.js) that a test holds to the terminal's visibility, kind by kind.
  • resume <id> --json and fork <id> --json without --headless are refused instead of printing the interactive terminal where a script expected frames.
  • A content-less DeepSeek stream that named no finish reason ended as an empty message the retry policy never saw; it is EMPTY_RESPONSE, and retried, like the same stream with one.
  • sessions verify and inspect on an odd log. A malformed salvage claim passed verify and crashed inspect; the claim is now held to its shape at every append. A log whose only unfinished thing is a compaction bracket (an ordinary quit mid-/compact) is described as an open bracket, not as a crash.
  • sessions show --audit would list an escalation refused past a delegation ceiling with the other authority denials (no shipped path produces one: a delegated child's approval pin refuses the ask first).

Changed

  • A checkpoint is on disk. The session log is fdatasynced at every durability checkpoint (and a new log's directory entry, on Linux and macOS), so crash repair can tell a call that never passed its approval gate from one that may have run even after a power cut. Measured cost per checkpoint: 0.7–3.6 ms (median) on Windows NTFS, 2.4–10 ms under WSL 2, varying with host load; a tool call pays up to two. A flush never reports a write synced that no sync covered, and a torn tail is never truncated unless its sidecar copy is complete.
  • Forking a session another process is still running answers every tool call it left open as outcome-unknown, never "not started": that process may still run it.
  • Each part of a log says what wrote it. Every new, resumed or forked session opens its segment with a record of what its writer guaranteed, and the composition record names the build (minidsh 1.1.0); crash repair trusts only those claims, so logs from 1.0.0 are still read and repaired, conservatively, and 1.0.0 reads a 1.1.0 log (checked against the published package). The session format's rule is written down: the header's version is the only format mark, and a malformed line is damage, not a newer format.
  • The default model is deepseek-flash, the id DeepSeek lists. deepseek-v4-flash, the 1.0.0 default, is unlisted but still accepted and served as the same model, so a stored session or a setting naming it keeps working; the log records the id that was requested.
  • Releases are published from CI. A v* tag runs the whole gate, packs, drafts the GitHub release, publishes through npm trusted publishing (no token anywhere), installs the public package and verifies its provenance attestation before the release goes public. The live workflow's Linux and macOS legs now fail, rather than branch, when the host cannot confine the shell.
  • docs/ARCHITECTURE.md corrected in about twenty places where the code did not honour the text (what Windows really costs per shell command, what crash repair does not close, what a tool deadline does to its body, how the format version is stamped). docs/BLUEPRINT.md carries the post-1.0 route. references/ is new: a curated, pinned map of DeepSeek Harness with a ledger of what MiniDSH assumes about it.