Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/pstack/skills/poteto-mode/references/model-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Rolling aliases:
| grok | external runner | external runner | explicit descriptor: external runner; `inherit-parent`, `auto`: native `spawn_subagent` | `read-only`, `isolated-write` | file | provider report | allowlist | Linux: Landlock and `bwrap`; macOS: any `/var/run/docker.sock` symlink points inside Grok's runtime-socket list |
| devin | external runner | external runner | external runner | `read-only`, `isolated-write`, `isolated-write-full-access` | file | provider report | allowlist | - |
| opencode | external runner | external runner | external runner | `read-only`, `isolated-write-full-access` | stdin | pinned argv | allowlist | - |
| dsh | external runner | external runner | external runner | `read-only`, `isolated-write` | stdin | pinned argv | allowlist | dsh 0.2.1-rc.2 exactly |
| dsh | external runner | external runner | external runner | `read-only`, `isolated-write` | stdin | pinned argv | allowlist | dsh 0.2.1-rc.2 on all hosts or 0.2.2-rc.3 on Windows |
| amp | external runner | external runner | external runner | `read-only`, `isolated-write-full-access` | stdin | pinned argv | allowlist | - |
| agy | external runner | external runner | external runner | `read-only`, `isolated-write-full-access` | stdin | pinned argv | allowlist | - |
| cursor | external runner | external runner | external runner | `read-only`, `isolated-write-full-access` | stdin | pinned argv | allowlist | - |
Expand Down Expand Up @@ -143,10 +143,10 @@ The runner refuses an access mode outside a provider's Access modes cell before
### dsh: DeepSeek Harness

- Executable: `dsh`.
- Host prerequisites: dsh 0.2.1-rc.2 exactly.
- Host prerequisites: dsh 0.2.1-rc.2 on all hosts or 0.2.2-rc.3 on Windows.
- State paths: `<receipt>.provider/`, the lane's own `DSH_HOME`: the sessions (`sessions/<cwd-slug>/<session-id>/`), projection cache (`storages/session_projcache/`), `profiles/headless/` and `.anonymous-user-id` that dsh writes on every run; The stored key `<DSH_HOME, else ~/.dsh>/.credentials.yaml`, which the lane reads in place and does not copy.
- Child environment: only `PATH` `HOME` `USER` `LOGNAME` `SHELL` `TMPDIR` `LANG` `TERM` `COLORTERM` `TZ` `HTTP_PROXY` `HTTPS_PROXY` `NO_PROXY` `ALL_PROXY` `http_proxy` `https_proxy` `no_proxy` `all_proxy` `SSL_CERT_FILE` `SSL_CERT_DIR` `NODE_EXTRA_CA_CERTS` `DEEPSEEK_API_KEY`, and variables starting with `LC_`, `XDG_`; sets `DSH_HOME=<receipt>.provider`.
- Measured with dsh 0.2.0-rc.2, a developer preview, and rechecked on 0.2.1-rc.2 for the patch rows, the stored-login preflight and the writer. The runner checks `dsh --version` before the preflight and refuses any version but 0.2.1-rc.2 as `unavailable-cli`/69. Recheck on an upgrade: the config row IDs the patch names (dsh silently ignores a patch row it does not have, so a renamed row would drop that part of the lockdown), the SIGTERM exit 0 with a partial `final`, the hardcoded `/tmp` writable root, the session-log upload being on by default, that dsh reads only the cwd's `.env` and skips a directory there, the transport retry row, and the `credentials` row's `path` config. dsh 0.2.1-rc.2 ships the `credentials` row disabled, so the patch enables it.
- Measured with dsh 0.2.0-rc.2, a developer preview, and rechecked on 0.2.1-rc.2 for the patch rows, the stored-login preflight and the writer. The runner checks `dsh --version` before the preflight and refuses versions outside the host-specific list as `unavailable-cli`/69. On Windows, dsh 0.2.2-rc.3 passed headless patch, stored-login, read-only and bounded-writer checks. Its headless profile has no `tool-subagent-list-agents` row. Recheck on an upgrade: the config row IDs the patch names (dsh silently ignores a patch row it does not have, so a renamed row would drop that part of the lockdown), the SIGTERM exit 0 with a partial `final`, the hardcoded `/tmp` writable root, the session-log upload being on by default, that dsh reads only the cwd's `.env` and skips a directory there, the transport retry row, and the `credentials` row's `path` config. dsh 0.2.1-rc.2 ships the `credentials` row disabled, so the patch enables it.
- Model and effort are config, not flags. Each lane gets a run-owned `--patch` file at `<receipt>.provider/patch.yml` (directory 0700, file 0600) that pins `agent-default-model` to provider `deepseek-official`, the lane's model and, unless the effort is `default`, its `reasoningEffort`. dsh offers efforts `off`, `low`, `high` and `max`, and fails `medium` locally.
- Each lane runs with `DSH_HOME` set to its `<receipt>.provider/` directory, and the allowlist drops every inherited `DSH_*` name. dsh creates the `headless` profile there on first use with no network or `pnpm` install (about 70 ms), so no user layer (`profiles/headless/cordis.patch.yml`) and no home `.env` from the operator's dsh home loads. Measured with `--dump-config`: a planted user layer that redirected `llm-deepseek.config.baseURL`, moved `fs-sandbox.config.cwd`, picked another `agent-default-model` provider and disabled `bash-sandbox` changed nothing, and the composed tree was the default rows plus the lane's patch. The patch's `credentials` row points the credential store at `<the parent's DSH_HOME, else ~/.dsh>/.credentials.yaml`, read in place. A key kept only in the operator's `<DSH_HOME>/.env` no longer authenticates; store it or export `DEEPSEEK_API_KEY`.
- The patch pins `sandbox-policy` to `read-only` for a read-only lane and `workspace-write` for an `isolated-write` lane, with the lane's cwd as the workspace root, and `approval` to `ask`, which overrides `DSH_PERMISSION_MODE`. The other sandbox rows keep dsh's defaults, including the bash tool's own timeout; the runner adds no deadline. Seatbelt enforces it on macOS for bash and the file tools. Headless has no approval channel, so an escalation request fails closed. Bash keeps network access, and the `read` tool is not confined to the cwd.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from "bun:test";
import { readFileSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { join, resolve } from "node:path";
import type { ModelRun } from "../registry/contract.ts";
import type { LaneRequest } from "../registry/index.ts";
import { modelFailureStatus } from "../types.ts";
Expand All @@ -27,7 +27,8 @@ describe("dsh launch", () => {

it("pins read-only mode, the stored login in place, the model and effort, and turns off the lockdown rows", () => {
const saved = process.env.DSH_HOME;
process.env.DSH_HOME = "/srv/dsh";
const credentialHome = resolve("/srv/dsh");
process.env.DSH_HOME = credentialHome;
const patch = dsh.launch.sidecar!.config!.content(lane({ model: "deepseek-v4-pro", effort: "low", cwd: "/tmp/a dir: #x" }));
if (saved === undefined) delete process.env.DSH_HOME;
else process.env.DSH_HOME = saved;
Expand All @@ -42,7 +43,7 @@ describe("dsh launch", () => {
"- id: credentials",
" disabled: false",
" config:",
" path: \"/srv/dsh/.credentials.yaml\"",
` path: ${JSON.stringify(join(credentialHome, ".credentials.yaml"))}`,
"- id: agent-default-model",
" config:",
" provider: deepseek-official",
Expand All @@ -63,8 +64,9 @@ describe("dsh launch", () => {
it("reads the stored login from the parent's DSH_HOME, resolved as dsh resolves it, else ~/.dsh", () => {
const saved = process.env.DSH_HOME;
try {
process.env.DSH_HOME = "/srv/dsh home";
expect(dsh.launch.sidecar!.config!.content(lane())).toContain("- id: credentials\n disabled: false\n config:\n path: \"/srv/dsh home/.credentials.yaml\"\n");
const credentialHome = resolve("/srv/dsh home");
process.env.DSH_HOME = credentialHome;
expect(dsh.launch.sidecar!.config!.content(lane())).toContain(`- id: credentials\n disabled: false\n config:\n path: ${JSON.stringify(join(credentialHome, ".credentials.yaml"))}\n`);
for (const [value, home] of [
[undefined, join(homedir(), ".dsh")],
[" \t", join(homedir(), ".dsh")],
Expand Down Expand Up @@ -101,13 +103,22 @@ describe("dsh launch", () => {
});

describe("dsh preflight", () => {
it("accepts rc.3 only on Windows and preserves the baseline version", () => {
const check = (stdout: string) => dsh.preflight.guard!.check({ exitCode: 0, stdout, stderr: "" });
expect(check("0.2.1-rc.2\n")).toBeNull();
const windowsRelease = check("0.2.2-rc.3\r\n");
if (process.platform === "win32") expect(windowsRelease).toBeNull();
else expect(windowsRelease).toMatchObject({ status: "unavailable-cli" });
expect(check("0.2.2-rc.4")).toMatchObject({ status: "unavailable-cli" });
});

it("runs a positional task with the lane's patch, then the shipped preflight patch", () => {
const argv = dsh.preflight.argv(lane(), testFacts(dsh).providerSidecar);
expect(argv).toEqual([
"--profile", "headless", "--patch", "/tmp/receipt.json.provider/patch.yml",
"--patch", join(import.meta.dir, "dsh-preflight.yml"), "--json", "preflight",
]);
expect(readFileSync(argv[5]!, "utf8")).toContain("baseURL: http://127.0.0.1:1\n- id: llm-retry\n disabled: true\n");
expect(readFileSync(argv[5]!, "utf8").replace(/\r\n/g, "\n")).toContain("baseURL: http://127.0.0.1:1\n- id: llm-retry\n disabled: true\n");
});

it("passes TRANSPORT with fixed evidence that the key is not validated", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ function parse(run: ModelRun): ParseResult {
return { kind: "complete", text, metadata };
}

const VERSION = "0.2.1-rc.2";
const BASELINE_VERSION = "0.2.1-rc.2";
const WINDOWS_VERSION = "0.2.2-rc.3";
const supportedVersions = process.platform === "win32" ? [BASELINE_VERSION, WINDOWS_VERSION] : [BASELINE_VERSION];

// dsh has no status command. The preflight turn's error code says only whether a key is stored or exported.
function classify(run: ChildRun) {
Expand All @@ -172,9 +174,9 @@ export const dsh = adapter({
// dsh ignores a patch row it does not have, so another version could drop the lockdown silently.
guard: {
argv: ["--version"],
check: (run) => run.stdout.trim() === VERSION ? null : {
check: (run) => supportedVersions.includes(run.stdout.trim()) ? null : {
status: "unavailable-cli",
message: `dsh ${run.stdout.trim()} is not the measured ${VERSION}; the adapter must be re-measured before it runs this version`,
message: `dsh ${run.stdout.trim()} is outside the measured versions for ${process.platform} (${supportedVersions.join(", ")}); the adapter must be re-measured before it runs this version`,
},
},
},
Expand All @@ -198,13 +200,13 @@ export const dsh = adapter({
},
docs: {
name: "DeepSeek Harness",
hostPrerequisites: ["dsh 0.2.1-rc.2 exactly"],
hostPrerequisites: [`dsh ${BASELINE_VERSION} on all hosts or ${WINDOWS_VERSION} on Windows`],
statePaths: [
"`<receipt>.provider/`, the lane's own `DSH_HOME`: the sessions (`sessions/<cwd-slug>/<session-id>/`), projection cache (`storages/session_projcache/`), `profiles/headless/` and `.anonymous-user-id` that dsh writes on every run",
"The stored key `<DSH_HOME, else ~/.dsh>/.credentials.yaml`, which the lane reads in place and does not copy",
],
notes: [
"Measured with dsh 0.2.0-rc.2, a developer preview, and rechecked on 0.2.1-rc.2 for the patch rows, the stored-login preflight and the writer. The runner checks `dsh --version` before the preflight and refuses any version but 0.2.1-rc.2 as `unavailable-cli`/69. Recheck on an upgrade: the config row IDs the patch names (dsh silently ignores a patch row it does not have, so a renamed row would drop that part of the lockdown), the SIGTERM exit 0 with a partial `final`, the hardcoded `/tmp` writable root, the session-log upload being on by default, that dsh reads only the cwd's `.env` and skips a directory there, the transport retry row, and the `credentials` row's `path` config. dsh 0.2.1-rc.2 ships the `credentials` row disabled, so the patch enables it.",
"Measured with dsh 0.2.0-rc.2, a developer preview, and rechecked on 0.2.1-rc.2 for the patch rows, the stored-login preflight and the writer. The runner checks `dsh --version` before the preflight and refuses versions outside the host-specific list as `unavailable-cli`/69. On Windows, dsh 0.2.2-rc.3 passed headless patch, stored-login, read-only and bounded-writer checks. Its headless profile has no `tool-subagent-list-agents` row. Recheck on an upgrade: the config row IDs the patch names (dsh silently ignores a patch row it does not have, so a renamed row would drop that part of the lockdown), the SIGTERM exit 0 with a partial `final`, the hardcoded `/tmp` writable root, the session-log upload being on by default, that dsh reads only the cwd's `.env` and skips a directory there, the transport retry row, and the `credentials` row's `path` config. dsh 0.2.1-rc.2 ships the `credentials` row disabled, so the patch enables it.",
"Model and effort are config, not flags. Each lane gets a run-owned `--patch` file at `<receipt>.provider/patch.yml` (directory 0700, file 0600) that pins `agent-default-model` to provider `deepseek-official`, the lane's model and, unless the effort is `default`, its `reasoningEffort`. dsh offers efforts `off`, `low`, `high` and `max`, and fails `medium` locally.",
"Each lane runs with `DSH_HOME` set to its `<receipt>.provider/` directory, and the allowlist drops every inherited `DSH_*` name. dsh creates the `headless` profile there on first use with no network or `pnpm` install (about 70 ms), so no user layer (`profiles/headless/cordis.patch.yml`) and no home `.env` from the operator's dsh home loads. Measured with `--dump-config`: a planted user layer that redirected `llm-deepseek.config.baseURL`, moved `fs-sandbox.config.cwd`, picked another `agent-default-model` provider and disabled `bash-sandbox` changed nothing, and the composed tree was the default rows plus the lane's patch. The patch's `credentials` row points the credential store at `<the parent's DSH_HOME, else ~/.dsh>/.credentials.yaml`, read in place. A key kept only in the operator's `<DSH_HOME>/.env` no longer authenticates; store it or export `DEEPSEEK_API_KEY`.",
"The patch pins `sandbox-policy` to `read-only` for a read-only lane and `workspace-write` for an `isolated-write` lane, with the lane's cwd as the workspace root, and `approval` to `ask`, which overrides `DSH_PERMISSION_MODE`. The other sandbox rows keep dsh's defaults, including the bash tool's own timeout; the runner adds no deadline. Seatbelt enforces it on macOS for bash and the file tools. Headless has no approval channel, so an escalation request fails closed. Bash keeps network access, and the `read` tool is not confined to the cwd.",
Expand Down
4 changes: 2 additions & 2 deletions plugins/pstack/skills/poteto-mode/scripts/runner/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,7 @@ process.exit(130);`);
expect(existsSync(interrupted.outputPath)).toBe(false);
});

it("refuses a dsh other than the measured version before the preflight", async () => {
it("refuses an unmeasured dsh version before the preflight", async () => {
fakeDsh(TRANSPORT, OBSERVE, "0.3.0");
const input = dshOptions("dsh-version");
const result = await runLane(laneOf(input));
Expand All @@ -2503,7 +2503,7 @@ process.exit(130);`);
status: "unavailable-cli",
preflight: { status: "not-run" },
error: {
message: "dsh 0.3.0 is not the measured 0.2.1-rc.2; the adapter must be re-measured before it runs this version",
message: expect.stringContaining(`dsh 0.3.0 is outside the measured versions for ${process.platform}`),
evidence: "0.3.0",
},
});
Expand Down