@molecule/api-ai-tools 1.9.16 → 1.9.18

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,180 @@
1
+ /**
2
+ * "This command starts a server, and a server never exits" — ONE reading of a server launch,
3
+ * shared by the `exec_command` refusal, the over-budget advice, and the platform's own-server note
4
+ * (`molecule-dev/api/src/ai/own-server-note.ts` imports {@link SERVER_PROGRAM} and
5
+ * {@link BACKGROUNDED} from here), so every surface that names a server names the same commands.
6
+ *
7
+ * X1 xr-molecule-flash-m167 (+19:16 → +24:04) wrote `/tmp/probe.mts` whose body imports the app's
8
+ * `api/src/server.ts` and calls its `create(0)`, then ran it in the FOREGROUND:
9
+ * `npx tsx --env-file=.env /tmp/probe.mts 2>&1 | tail -15`. The scaffold's `create()` calls
10
+ * `server.listen(port)` and returns the server, so the process never exits — and behind `| tail`
11
+ * it printed nothing until it did. The tool waited its whole 290 s budget and answered with "run
12
+ * a smaller unit", advice about the wrong axis for a process that was never going to return.
13
+ *
14
+ * A server started in the background is a different thing: it is the launch the platform records
15
+ * and hands a task id for, and the over-budget advice below keeps it off the foreground budget.
16
+ *
17
+ * @module
18
+ */
19
+ import { commandSegments } from './command-position.js';
20
+ import { withoutHeredocs } from './suite-overlap.js';
21
+ /**
22
+ * A background launch: a single `&` (not `&&`, not a `2>&1`) or an explicit detacher. A
23
+ * backgrounded launch never holds the tool, so every reading here stops at it.
24
+ */
25
+ export const BACKGROUNDED = /(?:^|[^&>])&(?!&|>)|\b(?:nohup|setsid)\b/;
26
+ /**
27
+ * A program that SERVES: the scaffold's entry (`server.ts`/`server.js`), a package manager's
28
+ * `start`/`dev`/`serve`/`preview` script, a Vite dev or preview server, `next start|dev`, or a
29
+ * Python WSGI server. Matched against a command segment's own text, and against a script's SOURCE
30
+ * when the command only names the script file.
31
+ */
32
+ export const SERVER_PROGRAM = /\bserver\.[cm]?[jt]s\b|\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:start|dev|serve|preview)\b|\bvite\s+(?:preview|dev|serve)\b|\bvite(?![.\w-])(?!\s+(?:build|optimize)\b)|\bnext\s+(?:start|dev)\b|\b(?:uvicorn|gunicorn)\b|\bflask\s+run\b|\bpython\d?\s+-m\s+http\.server\b/;
33
+ /** Programs that run a script FILE, so the file's own source decides whether it serves. */
34
+ const SCRIPT_RUNNERS = new Set([
35
+ 'bun',
36
+ 'deno',
37
+ 'node',
38
+ 'nodejs',
39
+ 'tsx',
40
+ 'ts-node',
41
+ ]);
42
+ /** Programs that serve by themselves, read against {@link SERVER_PROGRAM}. */
43
+ const SERVER_PROGRAMS = new Set([
44
+ 'bun',
45
+ 'deno',
46
+ 'flask',
47
+ 'gunicorn',
48
+ 'next',
49
+ 'node',
50
+ 'nodejs',
51
+ 'python',
52
+ 'python3',
53
+ 'tsx',
54
+ 'ts-node',
55
+ 'uvicorn',
56
+ 'vite',
57
+ ]);
58
+ /** A file a script runner executes. */
59
+ const SCRIPT_FILE = /\.(?:[cm]?[jt]s|tsx)$/;
60
+ /** A test file is a test, even when it imports the server to exercise it. */
61
+ const TEST_FILE = /(?:^|\/)__tests__\/|\.(?:test|spec)\.[cm]?[jt]sx?$/;
62
+ /** Package-manager scripts that keep serving instead of finishing. */
63
+ const SERVE_SCRIPTS = /^(?:start|dev|serve|preview)$/;
64
+ /** Test runners: their command line names a suite, never a server to leave running. */
65
+ const TEST_RUNNERS = /^(?:hurl|jest|mocha|playwright|vitest)$/;
66
+ /** A script's SOURCE that binds a listener even when it does not name a server file. */
67
+ const STARTS_LISTENING = /\b(?:server|app)\.listen\s*\(/;
68
+ /** A word with its shell quotes taken off (`'src/server.ts'` → `src/server.ts`). */
69
+ function bare(word) {
70
+ const match = /^(['"])(.*)\1$/s.exec(word);
71
+ return match?.[2] ?? word;
72
+ }
73
+ /**
74
+ * Whether one parsed statement starts a server: a package manager's serving script, or a program
75
+ * that IS a server, named in command position (so `cat server.ts` is a read, not a launch).
76
+ *
77
+ * @param segment - One statement of the command.
78
+ * @returns True when the statement starts a server that does not exit.
79
+ */
80
+ function runsServerProgram(segment) {
81
+ if (TEST_RUNNERS.test(segment.program))
82
+ return false;
83
+ if (/^(?:npm|pnpm|yarn|bun)$/.test(segment.program)) {
84
+ const words = segment.args.map(bare);
85
+ const script = words[0] === 'run' ? words[1] : words[0];
86
+ if (script !== undefined && SERVE_SCRIPTS.test(script))
87
+ return true;
88
+ }
89
+ return SERVER_PROGRAMS.has(segment.program) && SERVER_PROGRAM.test(segment.text);
90
+ }
91
+ /**
92
+ * The script file a runner statement executes, when it names one.
93
+ *
94
+ * @param segment - One statement of the command.
95
+ * @returns The script's path as written, or null when the statement runs no script file.
96
+ */
97
+ function scriptPath(segment) {
98
+ if (!SCRIPT_RUNNERS.has(segment.program))
99
+ return null;
100
+ for (const arg of segment.args) {
101
+ const word = bare(arg);
102
+ if (word.startsWith('-'))
103
+ continue;
104
+ if (SCRIPT_FILE.test(word) && !TEST_FILE.test(word))
105
+ return word;
106
+ }
107
+ return null;
108
+ }
109
+ /**
110
+ * Whether a command, read from its TEXT alone, starts a server that stays up in the foreground.
111
+ *
112
+ * The over-budget reader's shape: at that point the command has already run, and only its text is
113
+ * left to say whether "run a smaller unit" was ever the right advice.
114
+ *
115
+ * @param command - The command as the executor sent it.
116
+ * @returns True when a foreground statement of the command starts a server.
117
+ */
118
+ export function startsServerProgram(command) {
119
+ const text = withoutHeredocs(command);
120
+ if (BACKGROUNDED.test(text))
121
+ return false;
122
+ return commandSegments(text).some((segment) => runsServerProgram(segment));
123
+ }
124
+ /**
125
+ * A FOREGROUND command that starts a server, including one that only names a script whose SOURCE
126
+ * imports the app's server and calls its `create()`/`listen()`.
127
+ *
128
+ * The script read is best-effort: a path the backend will not answer for is a command this reading
129
+ * cannot classify, never a refusal. A backgrounded launch, a test runner and a test file are all
130
+ * left alone.
131
+ *
132
+ * @param command - The command as the executor sent it.
133
+ * @param readScript - Reads a script file the command names (`backend.readFile`).
134
+ * @returns The serving program, or null when the command starts no server in the foreground.
135
+ */
136
+ export async function foregroundServerCommand(command, readScript) {
137
+ const text = withoutHeredocs(command);
138
+ if (BACKGROUNDED.test(text))
139
+ return null;
140
+ for (const segment of commandSegments(text)) {
141
+ if (runsServerProgram(segment))
142
+ return { program: segment.program };
143
+ const script = scriptPath(segment);
144
+ if (script === null)
145
+ continue;
146
+ let source;
147
+ try {
148
+ source = await readScript(script);
149
+ }
150
+ catch (_error) {
151
+ // A script the backend cannot read is not classified: the refusal must never be a guess.
152
+ continue;
153
+ }
154
+ if (SERVER_PROGRAM.test(source) || STARTS_LISTENING.test(source)) {
155
+ return { program: `${segment.program} ${script}` };
156
+ }
157
+ }
158
+ return null;
159
+ }
160
+ /**
161
+ * The refusal for a foreground command that starts a server: why it would never return, and the
162
+ * two shapes that do work — a background launch, or a probe of the API already running.
163
+ *
164
+ * @param server - The serving program, from {@link foregroundServerCommand}.
165
+ * @param budgetSeconds - The tool's budget, which a foreground server would consume whole.
166
+ * @returns The refusal sentence.
167
+ */
168
+ export function serverCommandRefusal(server, budgetSeconds) {
169
+ return (`\`${server.program}\` starts a server, and a server never exits: run in the foreground it ` +
170
+ `would hold this tool for its whole ${budgetSeconds} s budget and return nothing. Start it ` +
171
+ 'with `run_in_background: true` and collect it with `wait_for_task`, or probe the API already ' +
172
+ 'running on :4000 with a command that finishes.');
173
+ }
174
+ /**
175
+ * The closing advice on an over-budget message for a command recognised as a server start: there
176
+ * is no tally to split, and the run has to leave the foreground budget to keep serving.
177
+ */
178
+ export const SERVER_OVER_BUDGET_ADVICE = 'A server is not a bigger unit to split: it never exits, so stopped here it reports nothing. ' +
179
+ 'Start it with `run_in_background: true` (it keeps serving and hands back a task id to ' +
180
+ '`wait_for_task`), or probe the API already running on :4000.';
@@ -139,6 +139,16 @@ export interface SuiteRunInFlight {
139
139
  export declare function suiteRunInTheWay<T extends SuiteRunInFlight>(candidate: {
140
140
  target: string;
141
141
  }, inFlight: readonly T[]): T | null;
142
+ /**
143
+ * What a caller knows about the run being judged beyond its command text.
144
+ */
145
+ export interface DiagnosisRunContext {
146
+ /**
147
+ * The test titles the person's request excludes by name — the same reading molecule-dev's
148
+ * `excludedTestTitles` gives the rest of the platform.
149
+ */
150
+ approvedExclusions?: readonly string[];
151
+ }
142
152
  /**
143
153
  * Whether a command walks a PART of a suite instead of all of it: a cap that stops it at a failure
144
154
  * count, the failures the last run printed (`--last-failed`, `--only-changed`), a title filter, or
@@ -166,8 +176,17 @@ export declare function suiteRunInTheWay<T extends SuiteRunInFlight>(candidate:
166
176
  * diagnosis. A command that starts no Playwright run is not one either (false): the question is
167
177
  * about a run already read as a Playwright suite.
168
178
  *
179
+ * A `--grep-invert` is only a narrowing when it excludes MORE than the request already excludes.
180
+ * When the caller passes those approved titles ({@link DiagnosisRunContext}) and the inverted
181
+ * pattern names one of them — the request's own "except …" scope written as the flag, which
182
+ * molecule-dev's `invertDecision` reads the same way — the run still walks the whole proof scope,
183
+ * and it is not a diagnosis. xr-molecule-flash-m170 (+33:16): the deployed proof carried exactly
184
+ * that exclusion, the rewriter added `--retries=0` to it, and the run lost the suite's retries on
185
+ * the one walk where a network blip is likeliest.
186
+ *
169
187
  * @param command - The command as the executor sent it.
188
+ * @param context - The request's approved exclusions, when the caller knows them.
170
189
  * @returns True when the run is a diagnosis or a re-run, not the whole suite.
171
190
  */
172
- export declare function isDiagnosisRun(command: string): boolean;
191
+ export declare function isDiagnosisRun(command: string, context?: DiagnosisRunContext): boolean;
173
192
  //# sourceMappingURL=suite-overlap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suite-overlap.d.ts","sourceRoot":"","sources":["../src/suite-overlap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAQH;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EA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,7 +31,7 @@
31
31
  import { posix } from 'node:path';
32
32
  import { commandSegments, locatedCommandSegments } from './command-position.js';
33
33
  import { commandRunsNoTests } from './no-test-run.js';
34
- import { shellQuote, suiteRunStatements } from './utilities.js';
34
+ import { matchingExcludedTitles, shellQuote, suiteRunStatements } from './utilities.js';
35
35
  /**
36
36
  * A command with its heredoc bodies removed: the runs, kills and hosts it names in a file it
37
37
  * WRITES are not what the command itself does.
@@ -325,6 +325,36 @@ const PLAYWRIGHT_RUN = /^(?:@playwright\/test|playwright)(?:@\S+)?\s+test(?=\s|$
325
325
  * the tests the run before it printed (`--last-failed`, `--only-changed`).
326
326
  */
327
327
  const NARROWED_RUN = /\.(?:spec|test)\.[cm]?[jt]sx?\b|\.[cm]?[jt]sx?:\d+|(?:^|\s)(?:-g|--grep(?:-invert)?|--last-failed|--only-changed)\b/;
328
+ /**
329
+ * A `--grep-invert` (or its `-G` alias) with the pattern Playwright takes: quoted or bare, `=` or
330
+ * whitespace between flag and value, the last occurrence winning as it does on the runner's own
331
+ * command line. The flag's own name has to be followed by `=` or whitespace, so `--grep` never
332
+ * matches `--grep-invert`; and a value never crosses a shell separator, so a flag written last
333
+ * cannot eat the statement after it.
334
+ */
335
+ const GREP_INVERT_VALUE = /(?:^|[\s;&|(])(?:--grep-invert|-G)(?:=|\s+)(?:'([^']*)'|"([^"]*)"|([^\s;&|]+))/g;
336
+ /**
337
+ * The `--grep-invert` pattern a Playwright invocation carries, or null when it carries none.
338
+ *
339
+ * @param run - The Playwright invocation's command-position text.
340
+ * @returns The pattern as the command wrote it, or null.
341
+ */
342
+ function grepInvertPattern(run) {
343
+ const last = [...run.matchAll(GREP_INVERT_VALUE)].at(-1);
344
+ if (!last)
345
+ return null;
346
+ return last[1] ?? last[2] ?? last[3] ?? null;
347
+ }
348
+ /**
349
+ * The invocation without its `--grep-invert` flags, so the OTHER narrowers can be read on their
350
+ * own: a run that greps AND names a file is still a diagnosis whatever its inversion excludes.
351
+ *
352
+ * @param run - The Playwright invocation's command-position text.
353
+ * @returns The same text with every `--grep-invert`/`-G` flag and value taken out.
354
+ */
355
+ function withoutGrepInvert(run) {
356
+ return run.replace(GREP_INVERT_VALUE, ' ');
357
+ }
328
358
  /**
329
359
  * The Playwright invocation's text when the command starts one, or null.
330
360
  *
@@ -383,10 +413,19 @@ function boundsFailures(command) {
383
413
  * diagnosis. A command that starts no Playwright run is not one either (false): the question is
384
414
  * about a run already read as a Playwright suite.
385
415
  *
416
+ * A `--grep-invert` is only a narrowing when it excludes MORE than the request already excludes.
417
+ * When the caller passes those approved titles ({@link DiagnosisRunContext}) and the inverted
418
+ * pattern names one of them — the request's own "except …" scope written as the flag, which
419
+ * molecule-dev's `invertDecision` reads the same way — the run still walks the whole proof scope,
420
+ * and it is not a diagnosis. xr-molecule-flash-m170 (+33:16): the deployed proof carried exactly
421
+ * that exclusion, the rewriter added `--retries=0` to it, and the run lost the suite's retries on
422
+ * the one walk where a network blip is likeliest.
423
+ *
386
424
  * @param command - The command as the executor sent it.
425
+ * @param context - The request's approved exclusions, when the caller knows them.
387
426
  * @returns True when the run is a diagnosis or a re-run, not the whole suite.
388
427
  */
389
- export function isDiagnosisRun(command) {
428
+ export function isDiagnosisRun(command, context) {
390
429
  if (boundsFailures(command))
391
430
  return true;
392
431
  const run = playwrightRun(command);
@@ -396,5 +435,11 @@ export function isDiagnosisRun(command) {
396
435
  // the suite either, and is not the whole-suite run the retries belong on.
397
436
  if (commandRunsNoTests(run))
398
437
  return true;
399
- return NARROWED_RUN.test(run);
438
+ const inverted = grepInvertPattern(run);
439
+ if (inverted === null)
440
+ return NARROWED_RUN.test(run);
441
+ // A file, a line, a `-g`, `--last-failed` … narrows the run whatever the inversion also drops.
442
+ if (NARROWED_RUN.test(withoutGrepInvert(run)))
443
+ return true;
444
+ return matchingExcludedTitles(inverted, context?.approvedExclusions ?? []).length === 0;
400
445
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],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AI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiCxB;AA2GD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CA8pFxF"}
package/dist/tools.js CHANGED
@@ -13,6 +13,7 @@ import { guardToolExecute, missingParamError, ToolInputError } from './input-nor
13
13
  import { diffLineCount } from './line-diff.js';
14
14
  import { pipelineExitCodeNote } from './pipeline-exit-note.js';
15
15
  import { TOOL_SCHEMAS } from './schemas.js';
16
+ import { foregroundServerCommand, SERVER_OVER_BUDGET_ADVICE, serverCommandRefusal, startsServerProgram, } from './server-command.js';
16
17
  import { leadingSleepPeek } from './sleep-peek.js';
17
18
  /**
18
19
  * Total waiting, per background task, after which wait_for_task reports it
@@ -421,12 +422,23 @@ async function backgroundTaskState(backend, command, seconds, ceilingMs) {
421
422
  }
422
423
  import { suiteCommandTarget } from './suite-overlap.js';
423
424
  import { diagnosisTraceCommand } from './trace-artifacts.js';
424
- import { checkBlockedCommand, declaredBudgetSeconds, DEFAULT_SEARCH_EXCLUDED_DIRS, directoryReadHint, earlyReturnCause, emptyCallError, failureCausesNote, findPathArgs, findPatternArgs, fusedLine, htmlOutline, isCommandTimeout, isEnvFilePath, isOutsideRoot, isPlaywrightRunCommand, isSuiteRunCommand, isValidGlob, linesWithinSerialized, literalDirPrefix, MAX_BATCH_READ_FILES, MAX_FIND_RESULTS, MAX_HTML_INLINE_CHARS, MAX_OUTPUT_SIZE, MAX_READ_CALL_CHARS, MAX_READ_RETURN_CHARS, MAX_READ_SIZE, MAX_SEARCH_CONTEXT_LINES, MAX_SEARCH_RESULTS, MAX_WRITE_SIZE, outputIsWithheldUntilExit, outputRedirectTarget, parseCheckCommand, parseCheckProblem, pathArgError, printsOnlySource, READ_RESULT_ENVELOPE_CHARS, redactSecrets, redactSecretsInCode, repeatingFailure, repeatingFailureNote, resolvePath, RUNNING_FAILURE_LINES, runningCauseCommand, runningOutputSliceCommand, searchTimeoutError, serializedChars, shellQuote, sliceLines, SMALL_FILE_WHOLE_CHARS, streamingBackgroundCommand, stripControlChars, suiteRunPipelinePlacement, suiteRunPriorityLaunch, TOOL_RESULT_CHARS, truncateMiddle, universalCause, whitespaceTolerantReplace, withoutSuiteTimeout, } from './utilities.js';
425
+ import { checkBlockedCommand, declaredBudgetSeconds, DEFAULT_SEARCH_EXCLUDED_DIRS, directoryReadHint, earlyReturnCause, emptyCallError, failureCausesNote, findPathArgs, findPatternArgs, fusedLine, htmlOutline, isCommandTimeout, isEnvFilePath, isOutsideRoot, isPlaywrightRunCommand, isSuiteRunCommand, isValidGlob, linesWithinSerialized, literalDirPrefix, MAX_BATCH_READ_FILES, MAX_FIND_RESULTS, MAX_HTML_INLINE_CHARS, MAX_OUTPUT_SIZE, MAX_READ_CALL_CHARS, MAX_READ_RETURN_CHARS, MAX_READ_SIZE, MAX_SEARCH_CONTEXT_LINES, MAX_SEARCH_RESULTS, MAX_WRITE_SIZE, outputIsWithheldUntilExit, outputRedirectTarget, parseCheckCommand, parseCheckProblem, pathArgError, printsOnlySource, READ_RESULT_ENVELOPE_CHARS, redactSecrets, redactSecretsInCode, repeatedSuiteRunError, repeatingFailure, repeatingFailureNote, resolvePath, RUNNING_FAILURE_LINES, runningCauseCommand, runningOutputSliceCommand, searchTimeoutError, serializedChars, shellQuote, sliceLines, SMALL_FILE_WHOLE_CHARS, streamingBackgroundCommand, stripControlChars, suiteRunBudgetCommand, suiteRunPipelinePlacement, suiteRunPriorityLaunch, TOOL_RESULT_CHARS, truncateMiddle, universalCause, whitespaceTolerantReplace, withoutSuiteTimeout, } from './utilities.js';
425
426
  /**
426
427
  * How long exec_command waits for a command it backgrounded only because the
427
428
  * command asked for more than the tool's ceiling, before handing back a task id.
428
429
  */
429
430
  const OVER_CEILING_GRACE_MS = 45_000;
431
+ /**
432
+ * The machine-readable mark on a result whose run carried the supplied suite's own settings
433
+ * ({@link ToolBuildConfig.suiteBudget}) — the flags actually written, so a consumer's notes can
434
+ * treat those settings as equal to the suite's instead of re-reading the config.
435
+ *
436
+ * @param pinned - The flags put on the command.
437
+ * @returns The result field, or nothing when no flag was placed.
438
+ */
439
+ function suiteBudgetField(pinned) {
440
+ return pinned.length === 0 ? {} : { suiteBudget: { pinned: [...pinned] } };
441
+ }
430
442
  /**
431
443
  * The closing advice on an over-budget message for a command that is not a test
432
444
  * suite: the work it was chaining is what to split.
@@ -2258,11 +2270,38 @@ export function buildTools(backend, config) {
2258
2270
  if (blocked)
2259
2271
  return { error: blocked };
2260
2272
  }
2261
- // A diagnosis run of a suite whose config records no trace gets one recorded anyway
2273
+ // A command that starts the suite more than once is refused BEFORE anything runs, in the
2274
+ // foreground as well as in the background: each walk measures the same code, and only the
2275
+ // last one is rewritten here. The background launcher already refused it; a foreground
2276
+ // command ran both, and the platform's note read the first walk's tally beside the second
2277
+ // walk's host (X1 xr-molecule-flash-m170 +06:02). ONE reading — {@link repeatedSuiteRunError}
2278
+ // — so every launch site refuses the same commands.
2279
+ const repeatedSuiteRun = repeatedSuiteRunError(rawCommand);
2280
+ if (repeatedSuiteRun)
2281
+ return { error: repeatedSuiteRun };
2282
+ // A FOREGROUND command that starts a server never returns: it holds this tool for its whole
2283
+ // budget and — behind `| tail`, the way these probes are usually written — prints nothing
2284
+ // until it does. X1 xr-molecule-flash-m167 (+19:16 → +24:04) sent
2285
+ // `npx tsx --env-file=.env /tmp/probe.mts | tail -15` where the script imports the app's
2286
+ // `api/src/server.ts` and calls `create(0)`, whose `listen()` keeps the process alive; the
2287
+ // run waited 290 s and was then told to "run a smaller unit". Refused BEFORE anything runs,
2288
+ // with the two shapes that work: a background launch (which the platform tracks and hands a
2289
+ // task id for) or a probe of the API already on :4000.
2290
+ if (input.run_in_background !== true) {
2291
+ const server = await foregroundServerCommand(rawCommand, (path) => backend.readFile(path));
2292
+ if (server) {
2293
+ return {
2294
+ error: serverCommandRefusal(server, Math.max(1, Math.round((commandBudgetMs ?? 290_000) / 1000))),
2295
+ };
2296
+ }
2297
+ }
2298
+ // A Playwright run of a suite whose config records no trace gets one recorded anyway
2262
2299
  // (`diagnosisTraceCommand`, trace-artifacts.ts): the failing tests' own network log is what
2263
2300
  // tells a swallowed request error from a selector, and X1 xr-molecule-flash-m100 spent the
2264
2301
  // last minutes of its run hand-writing Chromium probes for what the trace it never wrote
2265
- // down would have said. The whole rule is that function's; the proof run is never touched.
2302
+ // down would have said. The whole rule is that function's; the whole-suite proof run gets it
2303
+ // too, since a trace is retained only for a failing test (m163's proof run left none and the
2304
+ // executor hunted one that did not exist).
2266
2305
  const traced = await diagnosisTraceCommand({
2267
2306
  command: rawCommand,
2268
2307
  cwd,
@@ -2290,6 +2329,32 @@ export function buildTools(backend, config) {
2290
2329
  };
2291
2330
  }
2292
2331
  }
2332
+ // The supplied suite's own budget. A run whose runner config sets a different per-test
2333
+ // timeout or worker count measures a run the grader never sees: xr-molecule-flash-m169 wrote
2334
+ // a 60 s wrapper config, the platform proved the suite on it, and the official 15 s grader
2335
+ // then failed five tests the proof could never show. The suite's values are put back on the
2336
+ // runner's own arguments — the one place Playwright lets them win over every config — and the
2337
+ // result carries the sentence. The consumer reads the configs (it knows where the suite and
2338
+ // its base live); this tool only writes the flags where they belong. Before the background
2339
+ // branch, so a task launch and a foreground run carry them alike.
2340
+ let budgetNote = null;
2341
+ let budgetPinned = [];
2342
+ if (config?.suiteBudget !== undefined && isPlaywrightRunCommand(command)) {
2343
+ try {
2344
+ const pin = await config.suiteBudget(command, cwd);
2345
+ if (pin !== null && pin !== undefined) {
2346
+ budgetNote = pin.note;
2347
+ if (pin.flags.length > 0) {
2348
+ const pinned = suiteRunBudgetCommand(command, pin.flags);
2349
+ command = pinned.command;
2350
+ budgetPinned = pinned.placed;
2351
+ }
2352
+ }
2353
+ }
2354
+ catch (_error) {
2355
+ // A consumer's scan that fails changes nothing: the command runs exactly as asked.
2356
+ }
2357
+ }
2293
2358
  // Detached: start it, hand back a handle, let the turn continue. A
2294
2359
  // command that outlives the tool's ceiling is otherwise simply lost —
2295
2360
  // measured across six agent runs, ten of them were killed at the
@@ -2346,7 +2411,12 @@ export function buildTools(backend, config) {
2346
2411
  command = lifted.command;
2347
2412
  // Keep the log growing while it runs (see streamingBackgroundCommand):
2348
2413
  // an empty log is what wait_for_task reads as stuck.
2349
- const streaming = streamingBackgroundCommand(command);
2414
+ // The request's own exclusions ride along: a `--grep-invert` that names one of them is
2415
+ // the proof scope written as a flag, not a diagnosis, so it keeps the suite's retries
2416
+ // (xr-molecule-flash-m170 +33:16). The getter is the host's, read here at launch time.
2417
+ const streaming = streamingBackgroundCommand(command, {
2418
+ approvedExclusions: excludedTestTitles?.() ?? [],
2419
+ });
2350
2420
  // A command that starts the suite more than once is refused here, before anything is
2351
2421
  // written or launched: each walk measures the same code, and only the last is rewritten
2352
2422
  // (X1 xr-molecule-flash-m157 +14:02 — two whole walks chained with `;`).
@@ -2428,6 +2498,7 @@ export function buildTools(backend, config) {
2428
2498
  ? { truncated: true, fullOutput: log }
2429
2499
  : {}),
2430
2500
  error: (sleepNote ? `${sleepNote} ` : '') +
2501
+ (budgetNote ? `${budgetNote} ` : '') +
2431
2502
  cutRunSentence(cut) +
2432
2503
  // A suite stopped in the background is never sent to the background again:
2433
2504
  // the sentence says what to do, and the advice's reason (it “takes the run
@@ -2454,6 +2525,7 @@ export function buildTools(backend, config) {
2454
2525
  : pipelineExitCodeNote(streaming.command, reported, output);
2455
2526
  const notes = [
2456
2527
  ...(sleepNote ? [sleepNote] : []),
2528
+ ...(budgetNote ? [budgetNote] : []),
2457
2529
  ...streaming.changes,
2458
2530
  ...(exitNote === null ? [] : [exitNote]),
2459
2531
  ];
@@ -2464,6 +2536,7 @@ export function buildTools(backend, config) {
2464
2536
  ...(pipeNote === null ? {} : { exitCodeNote: pipeNote }),
2465
2537
  ...(output.length > MAX_OUTPUT_SIZE ? { truncated: true, fullOutput: log } : {}),
2466
2538
  ...(notes.length ? { note: notes.join(' ') } : {}),
2539
+ ...suiteBudgetField(budgetPinned),
2467
2540
  };
2468
2541
  }
2469
2542
  await new Promise((r) => setTimeout(r, 1_500));
@@ -2474,7 +2547,9 @@ export function buildTools(backend, config) {
2474
2547
  log,
2475
2548
  exitFile,
2476
2549
  ...(peekedTask?.slice.trim() ? { outputSoFar: sanitizeOutput(peekedTask.slice) } : {}),
2550
+ ...suiteBudgetField(budgetPinned),
2477
2551
  note: (sleepNote ? `${sleepNote} ` : '') +
2552
+ (budgetNote ? `${budgetNote} ` : '') +
2478
2553
  (overCeiling
2479
2554
  ? declaredSeconds > ceilingSeconds
2480
2555
  ? `This command asks for ${declaredSeconds}s, more than this tool's ${ceilingSeconds}s, and its ` +
@@ -2575,6 +2650,7 @@ export function buildTools(backend, config) {
2575
2650
  // count) says the same sentence with the total the output alone cannot give.
2576
2651
  cutRun: cut,
2577
2652
  error: (sleepNote ? `${sleepNote} ` : '') +
2653
+ (budgetNote ? `${budgetNote} ` : '') +
2578
2654
  `${cutLead} ` +
2579
2655
  // The tool's own budget stopping a run that printed nothing: keep the sentence that
2580
2656
  // says why the output is empty, since nothing else in the result can say it.
@@ -2583,7 +2659,11 @@ export function buildTools(backend, config) {
2583
2659
  ? ' — and a pipe through tail/head holds everything back until the command ends, so it printed nothing: run it without the pipe (use a line reporter and let the output stream)'
2584
2660
  : ''}. `
2585
2661
  : '') +
2586
- (isSuiteRunCommand(command) ? SUITE_OVER_BUDGET_ADVICE : SPLIT_WORK_ADVICE),
2662
+ (startsServerProgram(command)
2663
+ ? SERVER_OVER_BUDGET_ADVICE
2664
+ : isSuiteRunCommand(command)
2665
+ ? SUITE_OVER_BUDGET_ADVICE
2666
+ : SPLIT_WORK_ADVICE),
2587
2667
  };
2588
2668
  }
2589
2669
  // A pipeline reports its LAST stage's code: `tsc | head` says 0 beside a printed type
@@ -2597,9 +2677,10 @@ export function buildTools(backend, config) {
2597
2677
  exitCode: result.exitCode,
2598
2678
  ...(exitCodeNote === null ? {} : { exitCodeNote }),
2599
2679
  ...(peekedTask?.slice.trim() ? { outputSoFar: sanitizeOutput(peekedTask.slice) } : {}),
2600
- ...(sleepNote || ceilingNote || traced.change
2680
+ ...suiteBudgetField(budgetPinned),
2681
+ ...(sleepNote || ceilingNote || traced.change || budgetNote
2601
2682
  ? {
2602
- note: [sleepNote, ceilingNote, traced.change].filter(Boolean).join(' '),
2683
+ note: [sleepNote, ceilingNote, traced.change, budgetNote].filter(Boolean).join(' '),
2603
2684
  }
2604
2685
  : {}),
2605
2686
  };
@@ -159,6 +159,26 @@ export interface TraceContextEvidence {
159
159
  */
160
160
  requests: TraceRequest[];
161
161
  }
162
+ /**
163
+ * The text a failing assertion waited for that a same-page API response carried and the page never
164
+ * rendered.
165
+ *
166
+ * The assertion's own error names the text (a `has-text(…)` / `getByText(…)` / `toContainText(…)`
167
+ * argument), and the trace's network log holds the response that contained it. That pair is the
168
+ * whole diagnosis: the API returned the value and the page dropped it before rendering, so the cut
169
+ * is in the component that maps the response onto the list — not in the API, the route or the
170
+ * selector. xr-molecule-flash-m169 (+13:09) spent its fix rounds on the wrong component and on a
171
+ * markup detail while `GET /api/tags` was returning the missing "trending" and `PopularTags`
172
+ * sliced the response to its first 20 entries (the m99 top-N class, in the frontend).
173
+ */
174
+ export interface TraceMissingText {
175
+ /** The text the assertion waited for (`trending`). */
176
+ text: string;
177
+ /** The method of the response that carried it (`GET`). */
178
+ method: string;
179
+ /** The path of the response that carried it (`/api/tags`). */
180
+ path: string;
181
+ }
162
182
  /** What one trace says: the test it belongs to, the requests it made, and its console lines. */
163
183
  export interface TraceArtifact {
164
184
  /** The failure's spec file, relative to the run's directory, when the trace names one. */
@@ -224,6 +244,17 @@ export interface TraceArtifact {
224
244
  * and on traces read before this field existed.
225
245
  */
226
246
  otherContexts?: TraceContextEvidence[];
247
+ /**
248
+ * The text the failing assertion waited for and a same-page API response carried, when the trace
249
+ * recorded both. The note leads with it: the value reached the browser and the page did not
250
+ * render it, so the next read is where that response is mapped — never the API or the selector
251
+ * (xr-molecule-flash-m169).
252
+ *
253
+ * Absent when the assertion waited for no text (a text-free selector, a strict-mode violation),
254
+ * when no page-scoped `fetch`/`xhr` answered 2xx/3xx with the text in its body, and on traces
255
+ * read before this field existed.
256
+ */
257
+ missingText?: TraceMissingText;
227
258
  }
228
259
  /** How many traces one read reports, newest first. */
229
260
  export declare const MAX_TRACE_ARTIFACTS = 12;
@@ -379,6 +410,14 @@ export interface TraceRunReport {
379
410
  * contradicts it.
380
411
  */
381
412
  productionBuildAdvised?: boolean;
413
+ /**
414
+ * The endpoints the app's own auth config names for a credential exchange — a login, a
415
+ * registration, a token endpoint (`loginEndpoint: '/users/login'`, resolved from the app's
416
+ * source). A 401/403 there answers credentials the app was ASKED to check, never a token the
417
+ * client failed to attach, so the note says so even when the path is mounted somewhere unusual.
418
+ * Empty when the caller could not read the app's config.
419
+ */
420
+ authEndpoints?: readonly string[];
382
421
  }
383
422
  /**
384
423
  * The note a failed suite run's result carries: what each failing test's page actually sent, and
@@ -457,6 +496,13 @@ export interface TraceRunReport {
457
496
  * xr-molecule-flash-m148 (+29:18) hit this exactly: six local walks read
458
497
  * `POST …/favorite → 401 {"errors":{"token":["is missing"]}}` as a handler bug.
459
498
  *
499
+ * A credential EXCHANGE (a login/registration/token endpoint, read from the app's auth config, the
500
+ * path or the body) is never that shape: the request's purpose is to obtain a token, so an absent
501
+ * header is not a client omission ({@link isCredentialExchange}). xr-molecule-flash-m165's login
502
+ * 401 was answered as one for 40 minutes; the trace also showed the suite's SET-UP traffic going
503
+ * to `https://api.realworld.show/api` instead of this app, which is what the note leads with
504
+ * ({@link foreignOriginApiRequests}).
505
+ *
460
506
  * @param items - The traces {@link parseTraceArtifacts} read.
461
507
  * @param target - Where the run went — the deployed host, as the note names it.
462
508
  * @param earlierFailures - The failing `file:line`s earlier walks of this suite left, so a repeat
@@ -497,15 +543,21 @@ export interface DiagnosisTraceRewrite {
497
543
  change: string | null;
498
544
  }
499
545
  /**
500
- * The command a DIAGNOSIS run needs to leave a readable trace behind, when the suite's config
546
+ * The command a Playwright run needs to leave a readable trace behind, when the suite's config
501
547
  * would record none.
502
548
  *
503
549
  * The failing tests' requests are only readable if the run wrote them down (see the module doc),
504
550
  * and the config is where the decision about that lives — the platform does not edit the suite's
505
- * config, so it passes the flag instead, and only where it can do no harm: on a run narrowed to a
506
- * part of the suite or capped ({@link isDiagnosisRun}), never on the whole-suite proof run, and
507
- * never over a `--trace` the executor wrote itself. A capped walk is exactly the run whose
508
- * failures someone is about to work on; the proof run is graded as it is.
551
+ * config, so it passes the flag instead, on every Playwright run that starts tests and does not
552
+ * already decide its own `--trace`. That includes the whole-suite proof run, which an earlier
553
+ * version of this function skipped on the reasoning that its flags are graded: the flag changes
554
+ * what is RETAINED, not what passes. `retain-on-failure` keeps the trace only of a test that
555
+ * fails — Playwright records it and deletes it when the test passes (playwright's
556
+ * `_shouldAbandonTrace` unlinks the temporary trace files of a passing test) — so a green proof
557
+ * run keeps nothing extra. A failing one keeps the network log its failures need.
558
+ * xr-molecule-flash-m163 (+24:58) is why the proof run is no longer skipped: its one deployed
559
+ * failure left only an `error-context.md`, the executor spent the next calls hunting a `trace.zip`
560
+ * that could not exist, and then shipped a guessed fix.
509
561
  *
510
562
  * @param args - The command, the directory it starts in, and the backend's file read.
511
563
  * @returns The command to run and the sentence to report, or the command unchanged.
@@ -1 +1 @@
1
- {"version":3,"file":"trace-artifacts.d.ts","sourceRoot":"","sources":["../src/trace-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAA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