dsh-test-drive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The `drive-batch` background-job producer over `ctx.jobs`. One job drives a
3
+ * list of targets (serially or with bounded concurrency), streams per-target
4
+ * progress lines through `readOutput`, and on settlement writes the matrix
5
+ * record (JSON) into the storage domain and the latest-matrix pointer, so
6
+ * `drive_report` can fetch the Markdown/JSON pair by id.
7
+ *
8
+ * @module dsh-test-drive/batch
9
+ */
10
+ import type { Agent } from '@deepseek-ai/dsh-agent';
11
+ import type { Context } from '@deepseek-ai/cordis';
12
+ import type { JobId } from '@deepseek-ai/dsh-jobs';
13
+ import type { DriveDeps } from './drive.ts';
14
+ import type { MatrixRecord } from './result.ts';
15
+ /** The job kind this producer registers (declaration-merged into JobKindMap). */
16
+ export declare const DRIVE_BATCH_KIND: "drive-batch";
17
+ declare module '@deepseek-ai/dsh-jobs' {
18
+ interface JobKindMap {
19
+ 'drive-batch': typeof DRIVE_BATCH_KIND;
20
+ }
21
+ }
22
+ /** Everything one batch job needs; assembled by `src/index.ts`. */
23
+ export interface BatchDeps extends DriveDeps {
24
+ /** The jobs registry (public service). */
25
+ ctx: Context;
26
+ }
27
+ /** Settled matrix-write facts (tests assert the pointer landed). */
28
+ export interface BatchSettlement {
29
+ /** The matrix id written into the domain (also named in the job output). */
30
+ matrixId: string;
31
+ /** The final matrix record. */
32
+ matrix: MatrixRecord;
33
+ }
34
+ /** The batch work function shared by the job producer and direct tests. */
35
+ export declare function runBatch(deps: BatchDeps, targets: readonly string[], signal: AbortSignal, onProgress: (line: string) => void): Promise<BatchSettlement>;
36
+ /** One-line settlement summary for notices and the final flush. */
37
+ export declare function matrixSummary(matrix: MatrixRecord): string;
38
+ /**
39
+ * Start one `drive-batch` background job. The returned id doubles as the
40
+ * handle the model uses to read output and, via the final flush line, to find
41
+ * the matrix record for `drive_report`.
42
+ *
43
+ * @param deps - batch dependencies.
44
+ * @param targets - sanitized target specs.
45
+ * @param owner - the owning agent (from the command invocation).
46
+ * @param label - one-line model-facing label.
47
+ * @returns the registry-issued job id.
48
+ */
49
+ export declare function startBatchJob(deps: BatchDeps, targets: readonly string[], owner: Agent, label: string): JobId;
50
+ //# sourceMappingURL=batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAY,KAAK,EAAuB,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,aAAa,CAAA;AAG1D,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAG,aAAsB,CAAA;AAEtD,OAAO,QAAQ,uBAAuB,CAAC;IACrC,UAAU,UAAU;QAClB,aAAa,EAAE,OAAO,gBAAgB,CAAA;KACvC;CACF;AAED,mEAAmE;AACnE,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,0CAA0C;IAC1C,GAAG,EAAE,OAAO,CAAA;CACb;AAED,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,2EAA2E;AAC3E,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GACjC,OAAO,CAAC,eAAe,CAAC,CA8C1B;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAG1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CA0C7G"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The `/testdrive` slash command: parse a whitespace/comma-separated target
3
+ * list from the command input and start one `drive-batch` background job over
4
+ * `ctx.jobs`. The command itself never runs the drives — the job owns the
5
+ * work, the progress stream, and the final matrix.
6
+ *
7
+ * @module dsh-test-drive/command
8
+ */
9
+ import type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
10
+ import type { BatchDeps } from './batch.ts';
11
+ /** Split raw command input into target specs (whitespace and commas separate). */
12
+ export declare function parseTargets(rawInput: string): string[];
13
+ /**
14
+ * Execute `/testdrive <targets...>`: validate the target list against the
15
+ * configured batch cap and start the batch job for the invoking agent.
16
+ *
17
+ * @param deps - batch dependencies.
18
+ * @param invocation - the command invocation.
19
+ * @returns the command result naming the started job.
20
+ */
21
+ export declare function handleTestdrive(deps: BatchDeps, invocation: CommandInvocation): CommandResult;
22
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAKvD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,GAAG,aAAa,CAa7F"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Plugin configuration and its explicit resolve step. `resolveConfig` re-judges
3
+ * every default and bound so programmatic construction that bypasses
4
+ * Schemastery normalization still fails loud instead of running with hidden
5
+ * defaults (the explicit-resolve contract).
6
+ *
7
+ * @module dsh-test-drive/config
8
+ */
9
+ import z from '@deepseek-ai/schemastery';
10
+ /** Default profile template used inside each throwaway DSH_HOME. */
11
+ export declare const DEFAULT_PROFILE_NAME = "headless";
12
+ /** Default headless task text; the boot smoke runs a one-shot task with it. */
13
+ export declare const DEFAULT_HEADLESS_TASK = "Reply with exactly: ok";
14
+ /** Maximum length of the user-supplied headless task. */
15
+ export declare const MAX_HEADLESS_TASK_LENGTH = 2000;
16
+ /** Default per-stage timeout in milliseconds for the install (`dsh plugin add`). */
17
+ export declare const DEFAULT_INSTALL_TIMEOUT_MS = 600000;
18
+ /** Default per-stage timeout for `--dump-config`. */
19
+ export declare const DEFAULT_CONFIG_TIMEOUT_MS = 60000;
20
+ /** Default per-stage timeout for the headless boot smoke. */
21
+ export declare const DEFAULT_SMOKE_TIMEOUT_MS = 300000;
22
+ /** Default per-stage timeout for `dsh plugin remove`. */
23
+ export declare const DEFAULT_UNINSTALL_TIMEOUT_MS = 120000;
24
+ /** Bounds shared by every stage timeout. */
25
+ export declare const MIN_STAGE_TIMEOUT_MS = 1000;
26
+ export declare const MAX_STAGE_TIMEOUT_MS = 3600000;
27
+ /** Default cap on the sanitized output tail recorded per stage. */
28
+ export declare const DEFAULT_OUTPUT_TAIL_BYTES = 8000;
29
+ /** Bounds for the sanitized output-tail cap. */
30
+ export declare const MIN_OUTPUT_TAIL_BYTES = 256;
31
+ export declare const MAX_OUTPUT_TAIL_BYTES = 256000;
32
+ /** Default cap on targets one `/testdrive` batch accepts. */
33
+ export declare const DEFAULT_MAX_BATCH_TARGETS = 20;
34
+ /** Ceiling on batch targets (a job's row cap, not a model-input cap). */
35
+ export declare const MAX_BATCH_TARGETS = 200;
36
+ /** Default batch concurrency (serial: each target gets its own pnpm run). */
37
+ export declare const DEFAULT_BATCH_CONCURRENCY = 1;
38
+ /** Ceiling on batch concurrency. */
39
+ export declare const MAX_BATCH_CONCURRENCY = 4;
40
+ /** Default: a forwarded environment-name list is empty, so child profiles never see host credentials. */
41
+ export declare const DEFAULT_FORWARD_ENV: readonly string[];
42
+ /** Configuration for the dsh-test-drive install-smoke tools. */
43
+ export interface Config {
44
+ /** Profile template initialized inside each throwaway DSH_HOME (default 'headless': base + headless bundles). */
45
+ profileName?: string;
46
+ /** Absolute path to a dsh executable override; empty auto-detects the `dsh` on PATH (default ''). */
47
+ dshBin?: string;
48
+ /** Headless task text for the boot-smoke stage; empty skips that stage entirely (default 'Reply with exactly: ok'). */
49
+ headlessTask?: string;
50
+ /** Environment VARIABLE NAMES (never values) forwarded from the host into test-profile child processes (default []). */
51
+ forwardEnv?: string[];
52
+ /** Whether a blocked git `prepare` build is allowlisted in the test profile's pnpm-workspace.yaml and retried (default true). */
53
+ allowBuilds?: boolean;
54
+ /** Per-stage timeout for `dsh plugin add` in milliseconds (default 600000). */
55
+ installTimeoutMs?: number;
56
+ /** Per-stage timeout for `--dump-config` in milliseconds (default 60000). */
57
+ configTimeoutMs?: number;
58
+ /** Per-stage timeout for the headless boot smoke in milliseconds (default 300000). */
59
+ smokeTimeoutMs?: number;
60
+ /** Per-stage timeout for `dsh plugin remove` in milliseconds (default 120000). */
61
+ uninstallTimeoutMs?: number;
62
+ /** Cap on the sanitized output tail recorded per stage in bytes (default 8000). */
63
+ outputTailBytes?: number;
64
+ /** Keep temp dirs on failure instead of quarantining them, for forensics (default false). */
65
+ keepTempDirs?: boolean;
66
+ /** Maximum targets one `/testdrive` batch accepts (default 20). */
67
+ maxBatchTargets?: number;
68
+ /** Batch concurrency; targets share nothing, so >1 only adds pnpm-store contention (default 1). */
69
+ batchConcurrency?: number;
70
+ }
71
+ /** Fully resolved configuration captured at plugin load. */
72
+ export interface ResolvedConfig {
73
+ /** Profile template name used inside each throwaway DSH_HOME. */
74
+ profileName: string;
75
+ /** Absolute dsh executable override, or '' for auto-detection. */
76
+ dshBin: string;
77
+ /** Headless task text; '' skips the boot-smoke stage. */
78
+ headlessTask: string;
79
+ /** Forwarded environment names. */
80
+ forwardEnv: readonly string[];
81
+ /** Whether a blocked git prepare build is allowlisted and retried. */
82
+ allowBuilds: boolean;
83
+ /** Per-stage timeout for `dsh plugin add` in milliseconds. */
84
+ installTimeoutMs: number;
85
+ /** Per-stage timeout for `--dump-config` in milliseconds. */
86
+ configTimeoutMs: number;
87
+ /** Per-stage timeout for the headless boot smoke in milliseconds. */
88
+ smokeTimeoutMs: number;
89
+ /** Per-stage timeout for `dsh plugin remove` in milliseconds. */
90
+ uninstallTimeoutMs: number;
91
+ /** Cap on the sanitized output tail recorded per stage in bytes. */
92
+ outputTailBytes: number;
93
+ /** Whether temp dirs survive a failed run for forensics. */
94
+ keepTempDirs: boolean;
95
+ /** Maximum targets one batch accepts. */
96
+ maxBatchTargets: number;
97
+ /** Batch concurrency. */
98
+ batchConcurrency: number;
99
+ }
100
+ /** Schemastery schema for loader-validated configuration. */
101
+ export declare const Config: z<Config>;
102
+ /**
103
+ * Resolve raw config to the runtime policy, re-validating defaults and bounds.
104
+ *
105
+ * @param config - raw loader config; `undefined` for a bare row.
106
+ * @returns the frozen resolved config.
107
+ */
108
+ export declare function resolveConfig(config: Config | undefined): ResolvedConfig;
109
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,aAAa,CAAA;AAE9C,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,2BAA2B,CAAA;AAE7D,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,OAAQ,CAAA;AAE7C,oFAAoF;AACpF,eAAO,MAAM,0BA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mF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,6FAA6F;IAC7F,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mGAAmG;IACnG,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,4DAA4D;AAC5D,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAA;IACnB,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7B,sEAAsE;IACtE,WAAW,EAAE,OAAO,CAAA;IACpB,8DAA8D;IAC9D,gBAAgB,EAAE,MAAM,CAAA;IACxB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAA;IACtB,iEAAiE;IACjE,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oEAAoE;IACpE,eAAe,EAAE,MAAM,CAAA;IACvB,4DAA4D;IAC5D,YAAY,EAAE,OAAO,CAAA;IACrB,yCAAyC;IACzC,eAAe,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAc3B,CAAA;AAOF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CA0ExE"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * The `test-drive` storage domain: the durable home of drive-run records and
3
+ * batch matrices. Opened through `ctx.storageDomain` (a public service), with
4
+ * record schemas validated at the durable boundary; the domain stays open for
5
+ * the plugin's lifetime and closes through the registered effect.
6
+ *
7
+ * @module dsh-test-drive/domain
8
+ */
9
+ import { z } from 'zod';
10
+ /** Domain name (also the backend unit name; UNIT_NAME_RE forbids hyphens). */
11
+ export declare const DOMAIN_NAME = "test_drive";
12
+ /** Domain format version; bump when a record format changes incompatibly. */
13
+ export declare const DOMAIN_VERSION = 1;
14
+ /** Latest-matrix pointer value; `''` id means "no matrix yet". */
15
+ export declare const LatestMatrixSchema: z.ZodObject<{
16
+ matrixId: z.ZodString;
17
+ createdAt: z.ZodString;
18
+ }, z.core.$strip>;
19
+ /** Storage-domain spec: one table of per-run records, one of batch matrices, plus the latest pointer. */
20
+ export declare const driveDomainSpec: {
21
+ name: string;
22
+ version: number;
23
+ global: {
24
+ schema: z.ZodObject<{
25
+ matrixId: z.ZodString;
26
+ createdAt: z.ZodString;
27
+ }, z.core.$strip>;
28
+ initial: {
29
+ matrixId: string;
30
+ createdAt: string;
31
+ };
32
+ };
33
+ tables: {
34
+ runs: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, {
35
+ schema: "dsh-test-drive/v1";
36
+ run: {
37
+ runId: string;
38
+ startedAt: string;
39
+ finishedAt: string;
40
+ durationMs: number;
41
+ harnessVersion: string;
42
+ pluginVersion: string;
43
+ platform: string;
44
+ node: string;
45
+ };
46
+ target: {
47
+ kind: "repo" | "npm" | "path" | "tarball";
48
+ spec: string;
49
+ resolved?: {
50
+ packageName: string;
51
+ packageVersion: string;
52
+ hasBundleManifest: boolean;
53
+ } | undefined;
54
+ };
55
+ isolation: {
56
+ tempDshHome: boolean;
57
+ tempWorkspace: boolean;
58
+ tempStore: boolean;
59
+ hostHomeTouched: false;
60
+ };
61
+ stages: {
62
+ install: {
63
+ status: "pass" | "fail" | "skipped";
64
+ exitCode: number | null;
65
+ durationMs: number;
66
+ attempts: number;
67
+ summary: string;
68
+ outputTail: string;
69
+ allowBuildsNeeded: boolean;
70
+ };
71
+ config: {
72
+ status: "pass" | "fail" | "skipped";
73
+ exitCode: number | null;
74
+ durationMs: number;
75
+ attempts: number;
76
+ summary: string;
77
+ outputTail: string;
78
+ patchEffective: boolean;
79
+ layers: string[];
80
+ };
81
+ smoke: {
82
+ exitCode: number | null;
83
+ durationMs: number;
84
+ attempts: number;
85
+ summary: string;
86
+ outputTail: string;
87
+ status: "pass" | "fail" | "skipped" | "boot-ok";
88
+ bootFailed: boolean;
89
+ taskCompleted: boolean;
90
+ };
91
+ uninstall: {
92
+ status: "pass" | "fail" | "skipped";
93
+ exitCode: number | null;
94
+ durationMs: number;
95
+ attempts: number;
96
+ summary: string;
97
+ outputTail: string;
98
+ };
99
+ cleanup: {
100
+ status: "pass" | "fail" | "skipped";
101
+ quarantined: boolean;
102
+ removed: boolean;
103
+ summary: string;
104
+ };
105
+ };
106
+ verdict: "unknown" | "pass" | "fail" | "partial";
107
+ verdictReason: string;
108
+ }>;
109
+ matrices: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, {
110
+ schema: "dsh-test-drive/v1";
111
+ id: string;
112
+ createdAt: string;
113
+ durationMs: number;
114
+ rows: {
115
+ target: string;
116
+ kind: "repo" | "npm" | "path" | "tarball";
117
+ verdict: "unknown" | "pass" | "fail" | "partial";
118
+ install: "pass" | "fail" | "skipped";
119
+ smoke: "pass" | "fail" | "skipped" | "boot-ok";
120
+ durationMs: number;
121
+ summary: string;
122
+ }[];
123
+ totals: {
124
+ total: number;
125
+ pass: number;
126
+ fail: number;
127
+ partial: number;
128
+ unknown: number;
129
+ };
130
+ }>;
131
+ };
132
+ };
133
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/domain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,8EAA8E;AAC9E,eAAO,MAAM,WAAW,eAAe,CAAA;AAEvC,6EAA6E;AAC7E,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAA;AAEF,yGAAyG;AACzG,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ1B,CAAA"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The single-target drive pipeline: create an owned temp workspace, run
3
+ * install → dump-config → boot smoke → uninstall through the {@link DshDriver},
4
+ * and ALWAYS finish with the quarantine cleanup ladder — also on abort and
5
+ * unexpected pipeline errors (the `try/finally` discipline of §0.2). The
6
+ * resulting {@link DriveResult} is the structured record downstream consumers
7
+ * read.
8
+ *
9
+ * @module dsh-test-drive/drive
10
+ */
11
+ import type { Context } from '@deepseek-ai/cordis';
12
+ import type { Domain } from '@deepseek-ai/dsh-storage-domain';
13
+ import type { ResolvedConfig } from './config.ts';
14
+ import type { driveDomainSpec } from './domain.ts';
15
+ import { DshDriver } from './driver.ts';
16
+ import type { DriveResult } from './result.ts';
17
+ import { TempWorkspaceRegistry } from './workspace.ts';
18
+ /** id prefix of a single drive run. */
19
+ export declare const RUN_ID_PREFIX = "tdr_";
20
+ /** id prefix of a batch matrix. */
21
+ export declare const MATRIX_ID_PREFIX = "tdm_";
22
+ /** Fresh unique id with one of the plugin's prefixes. */
23
+ export declare function freshId(prefix: typeof RUN_ID_PREFIX | typeof MATRIX_ID_PREFIX): string;
24
+ /** Everything the pipeline needs at runtime; assembled by `src/index.ts`. */
25
+ export interface DriveDeps {
26
+ /** The mounting context (used for `ctx.subprocess`). */
27
+ ctx: Context;
28
+ /** Resolved plugin config. */
29
+ config: ResolvedConfig;
30
+ /** The CLI driver. */
31
+ driver: DshDriver;
32
+ /** Owned temp workspace registry. */
33
+ temp: TempWorkspaceRegistry;
34
+ /** Operator log sink. */
35
+ log: (line: string) => void;
36
+ /** Lazily-opened report domain (single-flight). */
37
+ domain: () => Promise<Domain<typeof driveDomainSpec>>;
38
+ }
39
+ /** Per-drive overrides (tool args may tighten config for one run). */
40
+ export interface DriveOptions {
41
+ /** Caller cancellation (tool signal or batch cancel). */
42
+ signal?: AbortSignal | undefined;
43
+ /** Optional headless task override; empty string skips the smoke stage (config default when absent). */
44
+ headlessTask?: string | undefined;
45
+ }
46
+ /** Derive one line of batch progress from a settled result. */
47
+ export declare function progressLine(index: number, total: number, result: DriveResult): string;
48
+ /**
49
+ * Drive one target through the complete install-smoke pipeline.
50
+ *
51
+ * @param target - raw target spec (repo, npm name, local path, tarball).
52
+ * @param options - per-drive overrides.
53
+ * @returns the structured result; never throws for expected stage failures.
54
+ */
55
+ export declare class DriveRunner {
56
+ private readonly deps;
57
+ private harnessVersion;
58
+ constructor(deps: DriveDeps);
59
+ /** Ask the CLI once per runner lifetime for its version. */
60
+ private version;
61
+ /** Persist one settled result; a failing medium is logged, never thrown. */
62
+ private record;
63
+ drive(target: string, options?: DriveOptions): Promise<DriveResult>;
64
+ }
65
+ //# sourceMappingURL=drive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../src/drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,SAAS,EAA0E,MAAM,aAAa,CAAA;AAG/G,OAAO,KAAK,EAGV,WAAW,EAKZ,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,uCAAuC;AACvC,eAAO,MAAM,aAAa,SAAS,CAAA;AAEnC,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,SAAS,CAAA;AAEtC,yDAAyD;AACzD,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,aAAa,GAAG,OAAO,gBAAgB,GAAG,MAAM,CAEtF;AAED,6EAA6E;AAC7E,MAAM,WAAW,SAAS;IACxB,wDAAwD;IACxD,GAAG,EAAE,OAAO,CAAA;IACZ,8BAA8B;IAC9B,MAAM,EAAE,cAAc,CAAA;IACtB,sBAAsB;IACtB,MAAM,EAAE,SAAS,CAAA;IACjB,qCAAqC;IACrC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,yBAAyB;IACzB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,CAAA;CACtD;AAED,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAChC,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAClC;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAEtF;AA8CD;;;;;;GAMG;AACH,qBAAa,WAAW;IAGV,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,cAAc,CAA6B;gBAEtB,IAAI,EAAE,SAAS;IAE5C,4DAA4D;IAC5D,OAAO,CAAC,OAAO;IAKf,4EAA4E;YAC9D,MAAM;IASd,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;CA2H9E"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * The `dsh` CLI driver: locates a spawnable dsh executable (config override,
3
+ * PATH lookup, or npm shim parsing on Windows), runs each stage as a managed
4
+ * subprocess with a throwaway DSH_HOME, and interprets the outputs the stages
5
+ * produce (the pnpm allowBuilds gate, the config-dump layer list, and boot
6
+ * failure markers). No shell is ever involved — argv is passed directly — so
7
+ * hostile target specs cannot inject commands.
8
+ *
9
+ * @module dsh-test-drive/driver
10
+ */
11
+ import type { Context } from '@deepseek-ai/cordis';
12
+ import type { ResolvedConfig } from './config.ts';
13
+ import type { TargetKind } from './result.ts';
14
+ /** Cap on collected output per stream (in-memory tail). */
15
+ export declare const COLLECT_MAX_BYTES: number;
16
+ /** Cap on the complete spill file per stream. */
17
+ export declare const SPILL_MAX_BYTES: number;
18
+ /** Grace between SIGTERM and SIGKILL for a stage process. */
19
+ export declare const STAGE_GRACE_MS = 5000;
20
+ /** Bootstrap bundles the `dsh plugin` template may add; the installed plugin is any OTHER bundle. */
21
+ export declare const TEMPLATE_BUNDLES: readonly string[];
22
+ /** Loader-failure markers that make a boot smoke fail regardless of exit code. */
23
+ export declare const BOOT_FAILURE_MARKERS: readonly RegExp[];
24
+ /** Outcome of one spawned stage process. */
25
+ export interface ChildRunResult {
26
+ /** Exit code; null when the tree was terminated or the spawn failed. */
27
+ exitCode: number | null;
28
+ /** Collected stdout tail (unbounded head recoverable via spill). */
29
+ stdout: string;
30
+ /** Collected stderr tail. */
31
+ stderr: string;
32
+ /** True when either stream exceeded the in-memory tail window. */
33
+ truncated: boolean;
34
+ /** Wall-clock duration in milliseconds. */
35
+ durationMs: number;
36
+ /** True when the stage's own timeout (not the caller's signal) stopped the process. */
37
+ timedOut: boolean;
38
+ }
39
+ /** Everything one stage needs about this run's isolation. */
40
+ export interface StageRunOptions {
41
+ /** Throwaway DSH_HOME. */
42
+ home: string;
43
+ /** Child working directory. */
44
+ cwd: string;
45
+ /** Redirected pnpm store. */
46
+ storeDir: string;
47
+ /** Stage deadline in milliseconds. */
48
+ timeoutMs: number;
49
+ /** Caller-owned cancellation (tool signal, batch cancel). */
50
+ signal?: AbortSignal | undefined;
51
+ }
52
+ /** One install stage attempt plus the allowBuilds facts. */
53
+ export interface AddOutcome {
54
+ /** The final attempt's process outcome. */
55
+ run: ChildRunResult;
56
+ /** Number of `add` spawns (2 when the allowBuilds retry ran). */
57
+ attempts: number;
58
+ /** True when pnpm blocked a git prepare build and the retry allowlisted it. */
59
+ allowBuildsNeeded: boolean;
60
+ }
61
+ /** Facts read from the installed package's own manifest. */
62
+ export interface InstalledPackage {
63
+ /** Package name (may be scoped). */
64
+ packageName: string;
65
+ /** Package version. */
66
+ packageVersion: string;
67
+ /** True when the manifest declares `dsh.bundle.patch` (a bundle layer). */
68
+ hasBundleManifest: boolean;
69
+ }
70
+ /** Parse the JS target out of an npm-generated `.cmd`/`.bat` shim. */
71
+ export declare function parseNpmShim(shimPath: string, shimText: string): string;
72
+ /** Regex escape for layer/row matching against package names. */
73
+ export declare function escapeRegex(source: string): string;
74
+ /** Whether a target spec names a git-hosted source (subject to pnpm's prepare gate). */
75
+ export declare function isGitLike(target: string): boolean;
76
+ /**
77
+ * Classify a sanitized target spec by how `dsh plugin add` addresses it.
78
+ * Pure: no filesystem or network access.
79
+ *
80
+ * @param spec - the sanitized target.
81
+ * @returns the address kind.
82
+ */
83
+ export declare function classifyTarget(spec: string): TargetKind;
84
+ /** Extract the package name pnpm reports as blocked: `Ignored build scripts: <name>.` */
85
+ export declare function parseIgnoredBuildScript(output: string): string | undefined;
86
+ /** Extract `# == <label>` layer labels from a `--dump-config` output. */
87
+ export declare function parseDumpLayers(dump: string): string[];
88
+ /**
89
+ * Whether the dump proves the installed package's patch took effect: a layer
90
+ * label mentions it, or a row names it.
91
+ */
92
+ export declare function dumpMentionsPackage(dump: string, packageName: string): {
93
+ mentioned: boolean;
94
+ layers: string[];
95
+ };
96
+ /** Whether the text contains any loader-failure marker. */
97
+ export declare function hasBootFailure(text: string): boolean;
98
+ /** Driver dependencies: the subprocess seam and the resolved config. */
99
+ export interface DshDriverDeps {
100
+ /** Context carrying `ctx.subprocess`. */
101
+ ctx: Context;
102
+ /** Resolved plugin config. */
103
+ config: ResolvedConfig;
104
+ /** Operator log sink. */
105
+ log: (line: string) => void;
106
+ }
107
+ /**
108
+ * Locate and run the `dsh` CLI. The located argv prefix is cached per driver
109
+ * instance, so every stage reuses one resolution.
110
+ */
111
+ export declare class DshDriver {
112
+ private readonly deps;
113
+ private located;
114
+ constructor(deps: DshDriverDeps);
115
+ /** Resolve the spawn argv prefix `[program, ...args]` for the dsh CLI. */
116
+ locate(): Promise<readonly string[]>;
117
+ private resolveLocation;
118
+ /** Compile the child environment: throwaway home, redirected store, deliberate forwards only. */
119
+ buildEnv(home: string, storeDir: string): Record<string, string>;
120
+ /**
121
+ * Run one dsh CLI invocation as a managed subprocess.
122
+ *
123
+ * @param args - dsh arguments (argv entries, never shell-interpreted).
124
+ * @param options - isolation facts and the stage deadline.
125
+ * @returns the collected outcome.
126
+ */
127
+ run(args: readonly string[], options: StageRunOptions): Promise<ChildRunResult>;
128
+ /** Write the profile's pnpm-workspace.yaml allowBuilds entry for one package. */
129
+ writeAllowBuilds(profileDir: string, packageName: string): Promise<void>;
130
+ /**
131
+ * Run the install stage: `dsh plugin --profile <name> add <target>`, with the
132
+ * documented allowBuilds retry for git-hosted sources.
133
+ */
134
+ add(target: string, options: StageRunOptions): Promise<AddOutcome>;
135
+ /** Run the config stage: `dsh --profile <name> --dump-config`. */
136
+ dumpConfig(options: StageRunOptions): Promise<ChildRunResult>;
137
+ /** Run the boot-smoke stage: `dsh --profile <name> <task>`. */
138
+ smokeTask(task: string, options: StageRunOptions): Promise<ChildRunResult>;
139
+ /** Run the uninstall stage: `dsh plugin --profile <name> remove <pkg>`. */
140
+ remove(packageName: string, options: StageRunOptions): Promise<ChildRunResult>;
141
+ /** Ask the CLI for its version (cached per driver instance). */
142
+ version(options: StageRunOptions): Promise<string>;
143
+ /**
144
+ * Read the installed plugin's own manifest from the profile's node_modules.
145
+ *
146
+ * @param profileDir - the profile directory `dsh plugin` manages.
147
+ * @returns the package facts, or undefined when no out-of-tree bundle is installed.
148
+ */
149
+ readInstalledPackage(profileDir: string): Promise<InstalledPackage | undefined>;
150
+ }
151
+ /** Resolve a relative local path target against the host's invoking directory. */
152
+ export declare function anchorLocalTarget(target: string): string;
153
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,QAAY,CAAA;AAE1C,iDAAiD;AACjD,eAAO,MAAM,eAAe,QAAc,CAAA;AAE1C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,OAAQ,CAAA;AAEnC,qGAAqG;AACrG,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAuF,CAAA;AAErI,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAMjD,CAAA;AAED,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,SAAS,EAAE,OAAO,CAAA;IAClB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAA;IAClB,uFAAuF;IACvF,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,sCAAsC;IACtC,SAAS,EAAE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;IAKxD;;;;;OAKG;IACG,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;CA+BtF;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * `dsh-test-drive` — isolated install-and-smoke test drives for DeepSeek
3
+ * Harness plugins.
4
+ *
5
+ * Host-only function plugin — no default export (the Loader unwraps
6
+ * `exports.default ?? exports`). It drives one target at a time through a
7
+ * throwaway profile: `dsh plugin add` → `--dump-config` patch check →
8
+ * headless boot smoke (FAILED-marker scan) → `dsh plugin remove` → owned
9
+ * quarantine cleanup. Results land as structured records (JSON) in the
10
+ * `test-drive` storage domain, render as Markdown, and feed scoring
11
+ * pipelines; batches run as `drive-batch` background jobs over `ctx.jobs`.
12
+ *
13
+ * @module dsh-test-drive
14
+ */
15
+ import type { Context } from '@deepseek-ai/cordis';
16
+ import { Config } from './config.ts';
17
+ export declare const name = "dsh-test-drive";
18
+ /**
19
+ * Public services only. `storageDomain` is deliberately OPTIONAL: the shipped
20
+ * `dsh-base` bundle (headless profile) does not mount it, and the plugin must
21
+ * still boot there — report persistence degrades to disabled with a logged
22
+ * reason, tools keep working.
23
+ */
24
+ export declare const inject: string[];
25
+ export { VERSION } from './version.ts';
26
+ export { Config, resolveConfig } from './config.ts';
27
+ export { RESULT_SCHEMA, verdictOf, DriveResultSchema, MatrixRecordSchema, totalsOf } from './result.ts';
28
+ export type { DriveResult, MatrixRecord, MatrixRow, StageStatus, SmokeStatus, DriveVerdict, TargetKind, StageResult } from './result.ts';
29
+ export { sanitizeTarget, sanitizeOutput, redactSecrets, tailText, redactTempPath, REDACTED } from './sanitize.ts';
30
+ export { TempWorkspaceRegistry, OWNED_PREFIX, QUARANTINE_PREFIX, removeWithRetries } from './workspace.ts';
31
+ export type { TempWorkspace, CleanupOutcome } from './workspace.ts';
32
+ export { DshDriver, classifyTarget, parseNpmShim, parseDumpLayers, dumpMentionsPackage, hasBootFailure, isGitLike, parseIgnoredBuildScript, TEMPLATE_BUNDLES, BOOT_FAILURE_MARKERS, anchorLocalTarget } from './driver.ts';
33
+ export type { ChildRunResult, InstalledPackage } from './driver.ts';
34
+ export { DriveRunner, freshId, progressLine, RUN_ID_PREFIX, MATRIX_ID_PREFIX } from './drive.ts';
35
+ export type { DriveDeps, DriveOptions } from './drive.ts';
36
+ export { DRIVE_BATCH_KIND, startBatchJob, runBatch, matrixSummary } from './batch.ts';
37
+ export { renderDriveResult, renderMatrix, statusMark, formatDuration } from './report.ts';
38
+ export { parseTargets } from './command.ts';
39
+ export { driveDomainSpec, DOMAIN_NAME, DOMAIN_VERSION } from './domain.ts';
40
+ /**
41
+ * Mount the plugin: resolve config, open the report domain (lazily), register
42
+ * the tools and the `/testdrive` command as effects, and own every temp
43
+ * directory through the quarantine registry (teardown sweeps leftovers).
44
+ *
45
+ * @param ctx - context carrying tools/commands/subprocess/jobs/storageDomain.
46
+ * @param config - raw loader config; defaults applied through {@link resolveConfig}.
47
+ */
48
+ export declare function apply(ctx: Context, config: Config): void;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAMlD,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAA;AAQnD,eAAO,MAAM,IAAI,mBAAmB,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,MAAM,UAA8C,CAAA;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EA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I,CAwCxD"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Pure Markdown renderers for drive results and batch matrices. These are the
3
+ * human-readable half of the report pair (JSON is the canonical record in the
4
+ * storage domain); the renderers are pure functions of their inputs so they
5
+ * stay replay-safe and trivially testable.
6
+ *
7
+ * @module dsh-test-drive/report
8
+ */
9
+ import type { DriveResult, MatrixRecord, SmokeStatus, StageStatus, DriveVerdict } from './result.ts';
10
+ /** Emoji/symbol mark for a stage or verdict status. */
11
+ export declare function statusMark(status: StageStatus | SmokeStatus | DriveVerdict): string;
12
+ /** Human-duration rendering for one number of milliseconds. */
13
+ export declare function formatDuration(ms: number): string;
14
+ /** Render one drive result as a Markdown report block. */
15
+ export declare function renderDriveResult(result: DriveResult): string;
16
+ /** Render one batch matrix as a Markdown report. */
17
+ export declare function renderMatrix(matrix: MatrixRecord): string;
18
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/report.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEpG,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CASnF;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,0DAA0D;AAC1D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CA6B7D;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAsBzD"}