gaunt-sloth 2.3.1 → 2.4.1

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 @@
1
+ {"version":3,"file":"commandEvalRunner.js","sourceRoot":"","sources":["../../src/commands/commandEvalRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAczC,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,yCAAyC,CAAC;AAEjD,uFAAuF;AACvF,MAAM,aAAa,GAAG,KAAK,CAAC;AAC5B,sFAAsF;AACtF,MAAM,oBAAoB,GAA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;iBAC9G,CAAC;QACR,CAAC;QACD,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC;YACvC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,OAAO,EAAE,GAAG,IAAI,6BAA6B,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;aACzH,CAAC;IACR,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,SAAS,YAAY,CAAC,GAAqB;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,UAAU,CAAC,CAAC,CAAC,aAAa,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,4FAA4F;AAC5F,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACzF,CAAC"}
@@ -0,0 +1,68 @@
1
+ import type { CommandWorkspace } from '@gaunt-sloth/batch';
2
+ /**
3
+ * The absolute directory of a suite named by `readPath` (the path `gth eval` reads the suite by,
4
+ * relative to the project directory). A workspace `template`, `{{suite_dir}}` and a custom
5
+ * transcript decoder's path all resolve against it, through this one function, so they cannot
6
+ * disagree about where the suite lives.
7
+ */
8
+ export declare function resolveSuiteDir(readPath: string): string;
9
+ /**
10
+ * Make a fresh, empty-or-templated directory for one run of `caseId` and return its canonical path.
11
+ * Throws (with the directory already removed) when the template cannot be copied.
12
+ */
13
+ export declare function createWorkspaceDir(caseId: string, spec: CommandWorkspace): string;
14
+ /** Remove a workspace directory, retrying a busy one. Throws when it still cannot be removed. */
15
+ export declare function removeWorkspaceDir(dir: string): void;
16
+ /**
17
+ * Read one variable from `base`. Windows names are case-insensitive, and `process.env` honours
18
+ * that there, but a plain copy of it does not, so a non-`process.env` base is searched without
19
+ * case on win32 (`{{env.PATH}}` must find `Path`).
20
+ */
21
+ export declare function readEnvVar(base: NodeJS.ProcessEnv, name: string, platform?: NodeJS.Platform): string | undefined;
22
+ /**
23
+ * `overrides` set over a copy of `base`, in order. On win32 a variable the suite sets REPLACES every
24
+ * spelling of it in the base: a suite's `PATH` must not sit beside the inherited `Path`, where
25
+ * which one the child and the executable lookup use is down to key order.
26
+ *
27
+ * BATCH-63 — a `null` override REMOVES the variable: the key is deleted, never set to `''`, because
28
+ * a program that checks whether a credential is set (`GITHUB_TOKEN`, say) treats an empty value as
29
+ * set. On win32 every spelling is deleted, so `GITHUB_TOKEN: null` also removes an inherited
30
+ * `GitHub_Token`; anything less would leave the variable visible to a Windows child, which reads
31
+ * names without case.
32
+ */
33
+ export declare function mergeWorkspaceEnv(base: NodeJS.ProcessEnv, overrides: Record<string, string | null>, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
34
+ /**
35
+ * The case's environment: the suite's `env`, its tokens expanded, merged over `base`. A `null`
36
+ * value removes the variable (see {@link mergeWorkspaceEnv}). `{{env.NAME}}` still reads `base`,
37
+ * the environment gth was started with, so removing `NAME` here does not stop another value of
38
+ * the block from quoting it: removal is about what the child inherits, not what the suite reads.
39
+ */
40
+ export declare function buildWorkspaceEnv(spec: CommandWorkspace, dir: string, base: NodeJS.ProcessEnv, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
41
+ /**
42
+ * BATCH-63 — the directory the case's command starts in: the workspace, or its `cwd` resolved
43
+ * inside it. Called after `setup`, because the directory is usually one `setup` makes (a git
44
+ * worktree, say). Returns the canonical path to spawn in, or throws with the reason.
45
+ *
46
+ * ## Why realpath, and why after setup
47
+ *
48
+ * The parser already refused a `cwd` that leaves the workspace as written (`..`, absolute). It
49
+ * cannot see a symbolic link: the template or a `setup` step can make `work` a link to any
50
+ * directory on the machine, and the agent would then run, and write, there. So the path is
51
+ * resolved through every link and must land inside the workspace's own realpath, the same check
52
+ * BATCH-59's file assertions use ({@link isInsideDir}). The resolved path is the one spawned, so
53
+ * the directory checked is the directory the command gets: a link swapped between the check and
54
+ * the spawn cannot redirect it.
55
+ *
56
+ * Only the command starts here. `setup` and `after` steps run in the workspace root and
57
+ * `{{workspace}}` names the root, so a suite's checks do not change meaning when a case sets `cwd`.
58
+ */
59
+ export declare function resolveWorkspaceCwd(dir: string, cwd: string | undefined): string;
60
+ /**
61
+ * Why `cwd` could not be resolved, by the error's code. Each cause gets its own words because each
62
+ * sends the author somewhere different: a missing directory points at `setup`, a link loop at a
63
+ * link `setup` or the template made, and a permission error at the mode of a directory on the way.
64
+ * Calling all three "does not exist" would send the author looking for the wrong mistake.
65
+ */
66
+ export declare function describeCwdError(dir: string, cwd: string, full: string, error: unknown): string;
67
+ /** A setup step's argv with its tokens expanded, element by element (never re-split). */
68
+ export declare function expandSetupArgv(argv: readonly string[], spec: CommandWorkspace, dir: string, base: NodeJS.ProcessEnv): string[];
@@ -0,0 +1,235 @@
1
+ /**
2
+ * BATCH-58 — the file-system and environment half of a `command` case's workspace: make the fresh
3
+ * directory, copy the template into it, build the case's environment, and remove the directory.
4
+ * The process half (running `setup`, then the command) is in `commandEvalRunner.ts`, which owns
5
+ * the spawn seam, the tree kill and the exit hook.
6
+ *
7
+ * ## One directory per run of a case, never per case id
8
+ *
9
+ * {@link createWorkspaceDir} is called once per `RunCellFn` call, and nothing is cached by case id.
10
+ * Two cases editing the same fixture file under `-j` each see only their own edit, and a future
11
+ * repeat of one case (BATCH-60) gets a fresh copy each time rather than the previous run's leftovers.
12
+ *
13
+ * ## Choices that keep the fixture safe and the paths honest
14
+ *
15
+ * - **`mkdtemp` under `os.tmpdir()`, then `realpath`.** On macOS the temp directory sits behind
16
+ * the `/var` → `/private/var` symlink, and a Windows runner can hand back an 8.3 short path. The
17
+ * canonical path is what the child sees as its cwd, so it is the one `{{workspace}}` expands to.
18
+ * - **`cpSync` with `verbatimSymlinks`.** Without it Node rewrites a RELATIVE symlink in the copy
19
+ * into an absolute one pointing back into the template, so an agent writing through the link
20
+ * would edit the committed fixture. `cpSync` keeps file modes on POSIX, so an executable stub in
21
+ * the template stays executable.
22
+ * - **A junction in the template may arrive as a real directory on Windows.** Node 24's JS `cpSync`
23
+ * (`lib/internal/fs/cp/cp-sync.js`) hands a recursive copy with no `filter` to the native
24
+ * `cpSyncCopyDir`, whose source is not in this repository, so the JS does not say how it treats a
25
+ * junction. The Windows cells show a template junction to an outside directory arriving as
26
+ * something the containment check does not see as leading outside, which fits a copy of the
27
+ * directory's contents. That is acceptable: the template is the suite author's, and trusted. What
28
+ * the containment check guards against is a link the AGENT makes during its run, and the specs
29
+ * pin that case on every platform.
30
+ * - **Removal retries.** On Windows a process that has just exited (or a virus scanner) can hold a
31
+ * handle for a moment, and `rm` fails with `EBUSY`/`EPERM`; Node's `maxRetries` backs off and
32
+ * tries again. A removal that still fails is reported by the caller and never fails the case: the
33
+ * case's result is already decided by then.
34
+ *
35
+ * @module
36
+ */
37
+ import { cpSync, mkdtempSync, realpathSync, rmSync, statSync } from 'node:fs';
38
+ import { tmpdir } from 'node:os';
39
+ import { dirname, join, resolve } from 'node:path';
40
+ import { expandWorkspaceTemplate } from '@gaunt-sloth/batch/workspaceTemplate.js';
41
+ import { getProjectDir } from '@gaunt-sloth/core/utils/systemUtils.js';
42
+ import { isInsideDir } from '#src/commands/commandWorkspaceChecks.js';
43
+ /**
44
+ * The absolute directory of a suite named by `readPath` (the path `gth eval` reads the suite by,
45
+ * relative to the project directory). A workspace `template`, `{{suite_dir}}` and a custom
46
+ * transcript decoder's path all resolve against it, through this one function, so they cannot
47
+ * disagree about where the suite lives.
48
+ */
49
+ export function resolveSuiteDir(readPath) {
50
+ return resolve(getProjectDir(), dirname(readPath));
51
+ }
52
+ /** Removal attempts for a busy directory, and the linear back-off step between them. */
53
+ const REMOVE_MAX_RETRIES = 10;
54
+ const REMOVE_RETRY_DELAY_MS = 100;
55
+ /**
56
+ * Make a fresh, empty-or-templated directory for one run of `caseId` and return its canonical path.
57
+ * Throws (with the directory already removed) when the template cannot be copied.
58
+ */
59
+ export function createWorkspaceDir(caseId, spec) {
60
+ const prefix = `gth-eval-${caseId.slice(0, 40)}-`;
61
+ const dir = realpathSync.native(mkdtempSync(join(tmpdir(), prefix)));
62
+ if (spec.template !== undefined) {
63
+ try {
64
+ cpSync(spec.template, dir, { recursive: true, verbatimSymlinks: true });
65
+ }
66
+ catch (error) {
67
+ removeWorkspaceDir(dir);
68
+ throw new Error(`could not copy the workspace template "${spec.template}": ` +
69
+ (error instanceof Error ? error.message : String(error)));
70
+ }
71
+ }
72
+ return dir;
73
+ }
74
+ /** Remove a workspace directory, retrying a busy one. Throws when it still cannot be removed. */
75
+ export function removeWorkspaceDir(dir) {
76
+ rmSync(dir, {
77
+ recursive: true,
78
+ force: true,
79
+ maxRetries: REMOVE_MAX_RETRIES,
80
+ retryDelay: REMOVE_RETRY_DELAY_MS,
81
+ });
82
+ }
83
+ /**
84
+ * Read one variable from `base`. Windows names are case-insensitive, and `process.env` honours
85
+ * that there, but a plain copy of it does not, so a non-`process.env` base is searched without
86
+ * case on win32 (`{{env.PATH}}` must find `Path`).
87
+ */
88
+ export function readEnvVar(base, name, platform = process.platform) {
89
+ const direct = base[name];
90
+ if (direct !== undefined || platform !== 'win32')
91
+ return direct;
92
+ const upper = name.toUpperCase();
93
+ const key = Object.keys(base).find((candidate) => candidate.toUpperCase() === upper);
94
+ return key === undefined ? undefined : base[key];
95
+ }
96
+ /**
97
+ * `overrides` set over a copy of `base`, in order. On win32 a variable the suite sets REPLACES every
98
+ * spelling of it in the base: a suite's `PATH` must not sit beside the inherited `Path`, where
99
+ * which one the child and the executable lookup use is down to key order.
100
+ *
101
+ * BATCH-63 — a `null` override REMOVES the variable: the key is deleted, never set to `''`, because
102
+ * a program that checks whether a credential is set (`GITHUB_TOKEN`, say) treats an empty value as
103
+ * set. On win32 every spelling is deleted, so `GITHUB_TOKEN: null` also removes an inherited
104
+ * `GitHub_Token`; anything less would leave the variable visible to a Windows child, which reads
105
+ * names without case.
106
+ */
107
+ export function mergeWorkspaceEnv(base, overrides, platform = process.platform) {
108
+ const merged = { ...base };
109
+ for (const [name, value] of Object.entries(overrides)) {
110
+ if (platform === 'win32') {
111
+ const upper = name.toUpperCase();
112
+ for (const key of Object.keys(merged)) {
113
+ if (key.toUpperCase() === upper)
114
+ delete merged[key];
115
+ }
116
+ }
117
+ if (value === null)
118
+ delete merged[name];
119
+ else
120
+ merged[name] = value;
121
+ }
122
+ return merged;
123
+ }
124
+ /**
125
+ * The case's environment: the suite's `env`, its tokens expanded, merged over `base`. A `null`
126
+ * value removes the variable (see {@link mergeWorkspaceEnv}). `{{env.NAME}}` still reads `base`,
127
+ * the environment gth was started with, so removing `NAME` here does not stop another value of
128
+ * the block from quoting it: removal is about what the child inherits, not what the suite reads.
129
+ */
130
+ export function buildWorkspaceEnv(spec, dir, base, platform = process.platform) {
131
+ const values = {
132
+ suiteDir: spec.suiteDir,
133
+ workspace: dir,
134
+ readEnv: (name) => readEnvVar(base, name, platform),
135
+ };
136
+ const expanded = Object.fromEntries(Object.entries(spec.env).map(([name, value]) => [
137
+ name,
138
+ value === null ? null : expandWorkspaceTemplate(value, values),
139
+ ]));
140
+ return mergeWorkspaceEnv(base, expanded, platform);
141
+ }
142
+ /**
143
+ * BATCH-63 — the directory the case's command starts in: the workspace, or its `cwd` resolved
144
+ * inside it. Called after `setup`, because the directory is usually one `setup` makes (a git
145
+ * worktree, say). Returns the canonical path to spawn in, or throws with the reason.
146
+ *
147
+ * ## Why realpath, and why after setup
148
+ *
149
+ * The parser already refused a `cwd` that leaves the workspace as written (`..`, absolute). It
150
+ * cannot see a symbolic link: the template or a `setup` step can make `work` a link to any
151
+ * directory on the machine, and the agent would then run, and write, there. So the path is
152
+ * resolved through every link and must land inside the workspace's own realpath, the same check
153
+ * BATCH-59's file assertions use ({@link isInsideDir}). The resolved path is the one spawned, so
154
+ * the directory checked is the directory the command gets: a link swapped between the check and
155
+ * the spawn cannot redirect it.
156
+ *
157
+ * Only the command starts here. `setup` and `after` steps run in the workspace root and
158
+ * `{{workspace}}` names the root, so a suite's checks do not change meaning when a case sets `cwd`.
159
+ */
160
+ export function resolveWorkspaceCwd(dir, cwd) {
161
+ if (cwd === undefined)
162
+ return dir;
163
+ const full = join(dir, ...cwd.split('/'));
164
+ let real;
165
+ try {
166
+ real = realpathSync.native(full);
167
+ }
168
+ catch (error) {
169
+ throw new Error(describeCwdError(dir, cwd, full, error));
170
+ }
171
+ const root = realpathSync.native(dir);
172
+ if (!isInsideDir(root, real)) {
173
+ throw new Error(`the workspace cwd "${cwd}" resolves to "${real}", which is outside the workspace "${root}"`);
174
+ }
175
+ if (!statSync(real).isDirectory()) {
176
+ throw new Error(`the workspace cwd "${cwd}" is not a directory (it resolves to "${real}")`);
177
+ }
178
+ return real;
179
+ }
180
+ /**
181
+ * Why `cwd` could not be resolved, by the error's code. Each cause gets its own words because each
182
+ * sends the author somewhere different: a missing directory points at `setup`, a link loop at a
183
+ * link `setup` or the template made, and a permission error at the mode of a directory on the way.
184
+ * Calling all three "does not exist" would send the author looking for the wrong mistake.
185
+ */
186
+ export function describeCwdError(dir, cwd, full, error) {
187
+ const code = error?.code;
188
+ const at = `the workspace cwd "${cwd}" (looked for "${full}")`;
189
+ switch (code) {
190
+ case 'ENOENT':
191
+ case 'ENOTDIR':
192
+ return firstNonDirectoryParent(dir, cwd)
193
+ ? `${at} does not exist after setup: a part of the path is not a directory`
194
+ : `${at} does not exist after setup`;
195
+ case 'ELOOP':
196
+ return `${at} could not be resolved: its symbolic links form a loop`;
197
+ case 'EACCES':
198
+ case 'EPERM':
199
+ return `${at} could not be resolved: permission denied (${code})`;
200
+ default:
201
+ return `${at} could not be resolved: ${error instanceof Error ? error.message : String(error)}`;
202
+ }
203
+ }
204
+ /**
205
+ * Whether some parent of `cwd`, below the workspace root `dir`, exists and is not a directory.
206
+ *
207
+ * The errno alone cannot say so on every platform. POSIX `realpath` of `f/x`, where `f` is a
208
+ * regular file, fails with `ENOTDIR`, but Windows reports `ENOENT` for the same path, which would
209
+ * read as "setup did not make it" when the real mistake is a file where a directory was meant. So
210
+ * on either code the parents are walked from the root down, and the first one found decides: a
211
+ * non-directory there gives the "not a directory" wording, and a missing one stops the walk (that
212
+ * is a plain missing directory). `statSync` follows links, so a link to a file counts as a file and
213
+ * a dangling link as missing.
214
+ */
215
+ function firstNonDirectoryParent(dir, cwd) {
216
+ const segments = cwd.split('/');
217
+ for (let depth = 1; depth < segments.length; depth += 1) {
218
+ const stats = statSync(join(dir, ...segments.slice(0, depth)), { throwIfNoEntry: false });
219
+ if (stats === undefined)
220
+ return false;
221
+ if (!stats.isDirectory())
222
+ return true;
223
+ }
224
+ return false;
225
+ }
226
+ /** A setup step's argv with its tokens expanded, element by element (never re-split). */
227
+ export function expandSetupArgv(argv, spec, dir, base) {
228
+ const values = {
229
+ suiteDir: spec.suiteDir,
230
+ workspace: dir,
231
+ readEnv: (name) => readEnvVar(base, name),
232
+ };
233
+ return argv.map((arg) => expandWorkspaceTemplate(arg, values));
234
+ }
235
+ //# sourceMappingURL=commandWorkspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandWorkspace.js","sourceRoot":"","sources":["../../src/commands/commandWorkspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;A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,EAAE,CAAC;IACpG,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,uBAAuB,CAAC,GAAW,EAAE,GAAW;IACvD,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACxD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1F,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAC7B,IAAuB,EACvB,IAAsB,EACtB,GAAW,EACX,IAAuB;IAEvB,MAAM,MAAM,GAAG;QACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,GAAG;QACd,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC;KAClD,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { WorkspaceFileContainsCheck, WorkspaceMustNotExistCheck } from '@gaunt-sloth/batch';
2
+ /**
3
+ * A workspace entry that the check could not look at: a permission error, or any other read error
4
+ * that is not "it is not there". Thrown out of {@link checkFileContains} and
5
+ * {@link checkMustNotExist}, and graded by the runner as a HARNESS error, never an assertion
6
+ * failure.
7
+ *
8
+ * ## Why a harness error
9
+ *
10
+ * A check that could not look is not evidence about the agent. Reporting it as a FAIL would charge
11
+ * the agent with a file it may have written correctly; reporting it as a pass, or as "missing",
12
+ * would be worse, because the check never saw the entry at all. So it is `ok: false` (exit 2 when
13
+ * every case is like that), the same class as an `after` step that cannot start, and the reason
14
+ * names the path and the error code so the author can see which entry the harness tripped on.
15
+ */
16
+ export declare class WorkspaceUnreadableError extends Error {
17
+ constructor(message: string);
18
+ }
19
+ /** Whether `candidate` is `root` or inside it. Both must be canonical (realpath) paths. */
20
+ export declare function isInsideDir(root: string, candidate: string): boolean;
21
+ /**
22
+ * Grade `file_contains`. A file that does not exist fails with its own reason, distinct from one
23
+ * that exists and lacks a string, because "the agent deleted it" and "the agent wrote the wrong
24
+ * thing" are different findings.
25
+ *
26
+ * ## The run-time containment check
27
+ *
28
+ * The parser already refuses a path that names something outside the workspace. That cannot stop
29
+ * a symbolic link: the agent (or the template) can make `src/greet.mjs` a link to any file on the
30
+ * machine, and reading through it would grade a file the agent never had to touch, or quote a
31
+ * stranger's file into a report. So the path is resolved through every link with `realpath`, and a
32
+ * file that lands outside the workspace's own realpath is a failure that is never read.
33
+ */
34
+ export declare function checkFileContains(workspaceDir: string, checks: readonly WorkspaceFileContainsCheck[]): string[];
35
+ /**
36
+ * Every entry under `workspaceDir`, as a workspace-relative path joined with `/` on every platform
37
+ * (so a glob reads the same on Windows). Symbolic links are listed and never followed: a link to a
38
+ * directory is one entry, so a link to `/` cannot make the walk read the whole machine, and nothing
39
+ * outside the workspace can match a glob.
40
+ */
41
+ export declare function listWorkspaceEntries(workspaceDir: string): string[];
42
+ /**
43
+ * Grade `must_not_exist`: one reason per glob that matched anything, naming what it matched. Dot
44
+ * entries are matched like any other (see `workspaceChecks.ts` for the dialect), so `notes/*`
45
+ * catches `notes/.hidden`.
46
+ */
47
+ export declare function checkMustNotExist(workspaceDir: string, checks: readonly WorkspaceMustNotExistCheck[]): string[];
@@ -0,0 +1,187 @@
1
+ /**
2
+ * BATCH-59 — the file-system half of a `command` case's workspace assertions: `file_contains` and
3
+ * `must_not_exist`, read from the case's workspace after its command finished and before the
4
+ * directory is removed. The `after` steps are run by `commandEvalRunner.ts`, which owns the spawn
5
+ * seam. The parse-time half (the path guard and the glob dialect) is the batch package's
6
+ * `workspaceChecks.ts`.
7
+ *
8
+ * Each function returns one reason per assertion that did not hold, and nothing for one that did.
9
+ * A reason is an assertion FAILURE: what the agent left in its workspace is the agent's result. An
10
+ * entry the check could not look at is the one exception, thrown as a
11
+ * {@link WorkspaceUnreadableError} and graded as a harness error.
12
+ *
13
+ * @module
14
+ */
15
+ import { lstatSync, readFileSync, readdirSync, realpathSync, statSync } from 'node:fs';
16
+ import { isAbsolute, join, relative, resolve, sep } from 'node:path';
17
+ import { matchesWorkspaceGlob } from '@gaunt-sloth/batch/workspaceChecks.js';
18
+ /** How many matching entries a `must_not_exist` reason names before it summarises the rest. */
19
+ const MAX_LISTED_MATCHES = 5;
20
+ /**
21
+ * A workspace entry that the check could not look at: a permission error, or any other read error
22
+ * that is not "it is not there". Thrown out of {@link checkFileContains} and
23
+ * {@link checkMustNotExist}, and graded by the runner as a HARNESS error, never an assertion
24
+ * failure.
25
+ *
26
+ * ## Why a harness error
27
+ *
28
+ * A check that could not look is not evidence about the agent. Reporting it as a FAIL would charge
29
+ * the agent with a file it may have written correctly; reporting it as a pass, or as "missing",
30
+ * would be worse, because the check never saw the entry at all. So it is `ok: false` (exit 2 when
31
+ * every case is like that), the same class as an `after` step that cannot start, and the reason
32
+ * names the path and the error code so the author can see which entry the harness tripped on.
33
+ */
34
+ export class WorkspaceUnreadableError extends Error {
35
+ constructor(message) {
36
+ super(message);
37
+ this.name = 'WorkspaceUnreadableError';
38
+ }
39
+ }
40
+ /** Whether `error` means "the entry is not there" rather than "it could not be looked at". */
41
+ function isAbsentError(error) {
42
+ const code = error?.code;
43
+ return code === 'ENOENT' || code === 'ENOTDIR' || code === 'ELOOP';
44
+ }
45
+ function unreadable(label, error) {
46
+ const code = error?.code ?? 'unknown error';
47
+ const message = error instanceof Error ? error.message : String(error);
48
+ return new WorkspaceUnreadableError(`${label}: the workspace entry could not be read (${code}), so the check could not look: ${message}`);
49
+ }
50
+ /** What a non-regular entry is, for a reason: "a directory", "a named pipe (FIFO)", … */
51
+ function describeEntryType(stats) {
52
+ if (stats.isDirectory())
53
+ return 'a directory';
54
+ if (stats.isFIFO())
55
+ return 'a named pipe (FIFO)';
56
+ if (stats.isSocket())
57
+ return 'a socket';
58
+ if (stats.isCharacterDevice())
59
+ return 'a character device';
60
+ if (stats.isBlockDevice())
61
+ return 'a block device';
62
+ return 'not a regular file';
63
+ }
64
+ /** Whether `candidate` is `root` or inside it. Both must be canonical (realpath) paths. */
65
+ export function isInsideDir(root, candidate) {
66
+ const rel = relative(root, candidate);
67
+ // `..` alone, or `..` followed by a separator, leaves `root`; a name such as `..cache` does not.
68
+ // An absolute `rel` happens on win32 when the two are on different drives.
69
+ return rel === '' || (!(rel === '..' || rel.startsWith(`..${sep}`)) && !isAbsolute(rel));
70
+ }
71
+ /**
72
+ * Grade `file_contains`. A file that does not exist fails with its own reason, distinct from one
73
+ * that exists and lacks a string, because "the agent deleted it" and "the agent wrote the wrong
74
+ * thing" are different findings.
75
+ *
76
+ * ## The run-time containment check
77
+ *
78
+ * The parser already refuses a path that names something outside the workspace. That cannot stop
79
+ * a symbolic link: the agent (or the template) can make `src/greet.mjs` a link to any file on the
80
+ * machine, and reading through it would grade a file the agent never had to touch, or quote a
81
+ * stranger's file into a report. So the path is resolved through every link with `realpath`, and a
82
+ * file that lands outside the workspace's own realpath is a failure that is never read.
83
+ */
84
+ export function checkFileContains(workspaceDir, checks) {
85
+ if (checks.length === 0)
86
+ return [];
87
+ const root = realpathSync.native(workspaceDir);
88
+ const failures = [];
89
+ for (const check of checks) {
90
+ const label = `file_contains "${check.path}"`;
91
+ const full = resolve(root, ...check.path.split('/'));
92
+ try {
93
+ lstatSync(full);
94
+ }
95
+ catch (error) {
96
+ if (!isAbsentError(error))
97
+ throw unreadable(label, error);
98
+ failures.push(`${label}: the file does not exist in the workspace`);
99
+ continue;
100
+ }
101
+ let real;
102
+ try {
103
+ real = realpathSync.native(full);
104
+ }
105
+ catch (error) {
106
+ if (!isAbsentError(error))
107
+ throw unreadable(label, error);
108
+ failures.push(`${label}: it is a symbolic link whose target does not exist`);
109
+ continue;
110
+ }
111
+ if (!isInsideDir(root, real)) {
112
+ failures.push(`${label}: it resolves outside the workspace (to ${real}) through a symbolic link, so it ` +
113
+ 'was not read');
114
+ continue;
115
+ }
116
+ // Only a REGULAR file is ever opened. A named pipe the agent left at the path would block the
117
+ // synchronous read below forever (no writer, no deadline: the case's timeout covers its
118
+ // processes, not this read), and a starved event loop never runs gth's SIGINT handler, so even
119
+ // Ctrl+C could not stop the run. A socket or a device is no better. So every other entry type is
120
+ // a failure naming what was there, and is never opened.
121
+ let text;
122
+ try {
123
+ const stats = statSync(real);
124
+ if (!stats.isFile()) {
125
+ failures.push(`${label}: it is ${describeEntryType(stats)}, not a regular file`);
126
+ continue;
127
+ }
128
+ text = readFileSync(real, 'utf8');
129
+ }
130
+ catch (error) {
131
+ throw unreadable(label, error);
132
+ }
133
+ for (const substring of check.substrings) {
134
+ if (!text.includes(substring)) {
135
+ failures.push(`${label}: the file does not contain ${JSON.stringify(substring)}`);
136
+ }
137
+ }
138
+ }
139
+ return failures;
140
+ }
141
+ /**
142
+ * Every entry under `workspaceDir`, as a workspace-relative path joined with `/` on every platform
143
+ * (so a glob reads the same on Windows). Symbolic links are listed and never followed: a link to a
144
+ * directory is one entry, so a link to `/` cannot make the walk read the whole machine, and nothing
145
+ * outside the workspace can match a glob.
146
+ */
147
+ export function listWorkspaceEntries(workspaceDir) {
148
+ const entries = [];
149
+ const walk = (dir, prefix) => {
150
+ let dirents;
151
+ try {
152
+ dirents = readdirSync(dir, { withFileTypes: true });
153
+ }
154
+ catch (error) {
155
+ throw unreadable(`must_not_exist could not list "${prefix || '.'}"`, error);
156
+ }
157
+ for (const dirent of dirents) {
158
+ const rel = prefix === '' ? dirent.name : `${prefix}/${dirent.name}`;
159
+ entries.push(rel);
160
+ if (dirent.isDirectory())
161
+ walk(join(dir, dirent.name), rel);
162
+ }
163
+ };
164
+ walk(workspaceDir, '');
165
+ return entries.sort();
166
+ }
167
+ /**
168
+ * Grade `must_not_exist`: one reason per glob that matched anything, naming what it matched. Dot
169
+ * entries are matched like any other (see `workspaceChecks.ts` for the dialect), so `notes/*`
170
+ * catches `notes/.hidden`.
171
+ */
172
+ export function checkMustNotExist(workspaceDir, checks) {
173
+ if (checks.length === 0)
174
+ return [];
175
+ const entries = listWorkspaceEntries(workspaceDir);
176
+ const failures = [];
177
+ for (const check of checks) {
178
+ const matched = entries.filter((entry) => matchesWorkspaceGlob(check.segments, entry));
179
+ if (matched.length === 0)
180
+ continue;
181
+ const listed = matched.slice(0, MAX_LISTED_MATCHES).join(', ');
182
+ const more = matched.length > MAX_LISTED_MATCHES ? ` and ${matched.length - MAX_LISTED_MATCHES} more` : '';
183
+ failures.push(`must_not_exist "${check.pattern}": the workspace has ${listed}${more}`);
184
+ }
185
+ return failures;
186
+ }
187
+ //# sourceMappingURL=commandWorkspaceChecks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandWorkspaceChecks.js","sourceRoot":"","sources":["../../src/commands/commandWorkspaceChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAc,MAAM,SAAS,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,+FAA+F;AAC/F,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B;;;;;;;;;;;;;GAaG;A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AAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,MAAM,IAAI,GACR,OAAO,CAAC,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,MAAM,GAAG,kBAAkB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAChG,QAAQ,CAAC,IAAI,CAAC,mBAAmB,KAAK,CAAC,OAAO,wBAAwB,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -2,6 +2,14 @@ import { Command } from 'commander';
2
2
  import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
3
  import type { RunLevelEvalConfig } from '@gaunt-sloth/core/config.js';
4
4
  import type { RunToolCoverageSource, RunToolCoverageSpec } from '@gaunt-sloth/batch';
5
+ /**
6
+ * BATCH-66 — does a case id match any `--only` pattern? A pattern with no `*` matches the id
7
+ * exactly; a `*` matches any run of characters, anchored at both ends. It is core's
8
+ * `toolNameMatchesPattern`, the matcher `must_call` and the coverage `waive:` list already use, so
9
+ * one glob dialect covers every name list in an eval. Case ids are `[\w.-]` only, so `*` is the one
10
+ * metacharacter an id pattern needs.
11
+ */
12
+ export declare function caseMatchesOnly(caseId: string, patterns: readonly string[]): boolean;
5
13
  /** Split each collected `--reporter` value on `,`, flatten, trim, drop blanks, and de-duplicate
6
14
  * (order-preserving), so `-r junit,text` and `-r junit -r text` both yield `['junit','text']`. */
7
15
  export declare function normalizeReporterNames(collected: string[]): string[];