werkmeister-core 0.90.2 → 0.90.4
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.
- package/CHANGELOG.md +9 -0
- package/dist/fixture_fakes.d.ts +2 -0
- package/dist/fixture_fakes.js +6 -2
- package/dist/fixture_workspace.d.ts +14 -0
- package/dist/fixture_workspace.js +38 -2
- package/dist/harness/claude/claude_md.js +13 -3
- package/dist/harness/claude/hooks_gen.js +6 -0
- package/dist/strategies/icm_templates.js +6 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# sandbox-core
|
|
2
2
|
|
|
3
|
+
## 0.90.4
|
|
4
|
+
|
|
5
|
+
## 0.90.3
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- 4941f67: `with-fixture-workspace` takes `--running <file>` and `--queue <feature>[,<feature>]...`, so a capacity wait runs through the built CLI. Each `--running` line (`feature<TAB>workspace<TAB>startedAt<TAB>memoryBytes<TAB>nanoCpus`) is a container the fixture's fake `docker ps -q` / `docker inspect` show the scheduler as running; the workspace is a folder name created empty in the fixture, so the holder is a person's and never preempted. `--queue` seeds `scheduler/queue.json`. With `--config` `budget: { cpus: 6 }` and a 6-CPU holder, `feature up` exits 75 naming the holder, and `budget status` lists it under Running. `withFixtureWorkspace` takes the same as `containers` and `queue`.
|
|
10
|
+
- b61338b: `with-fixture-workspace` and `withFixtureWorkspace` point the dead daemon address (`WERKMEISTER_HOST`) at a port just bound and closed, instead of `127.0.0.1:1`, which fetch rejects as a "bad port" (a TypeError with no `cause.code`) before connecting. A fixture run now sees a refused connection (`ECONNREFUSED`), as with a real stopped daemon, so the refused, restart and fallback paths can be exercised through the fixture.
|
|
11
|
+
|
|
3
12
|
## 0.90.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/fixture_fakes.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface FakeWorld {
|
|
|
26
26
|
rules?: unknown[];
|
|
27
27
|
/** Containers the fake docker shows as running, to the gate's `ps --format {{.Names}}…` only. */
|
|
28
28
|
running?: string[];
|
|
29
|
+
/** `docker inspect` lines (`feature\tworkdir\tstartedAt\tmemory\tnanoCpus`) the scheduler reads as running features (SW-685). */
|
|
30
|
+
containers?: string[];
|
|
29
31
|
/** Set: `docker exec` runs its last argument (the gate row's command) with `sh -c` here and exits with its code. Absent: exit 0. */
|
|
30
32
|
execCwd?: string;
|
|
31
33
|
}
|
package/dist/fixture_fakes.js
CHANGED
|
@@ -10,7 +10,8 @@ import * as path from "node:path";
|
|
|
10
10
|
// Unknown verbs exit 1, so a code path a fake doesn't cover fails loudly (SW-148).
|
|
11
11
|
// `pr list` prints nothing: pr open's --jq leaves no URL when no PR is open.
|
|
12
12
|
// Only the gate's `ps --format {{.Names}}\t{{.State}}` sees running containers; every other `ps`
|
|
13
|
-
// (-q/-aq by label) finds none, so no teardown of a pre-rename project runs on a fake hit.
|
|
13
|
+
// (-q/-aq by label) finds none, so no teardown of a pre-rename project runs on a fake hit. Only the
|
|
14
|
+
// scheduler's exact feature-label `ps -q` and its NanoCpus `inspect` see `containers` (SW-685).
|
|
14
15
|
const FAKE_JS = `import { spawnSync } from "node:child_process";
|
|
15
16
|
import * as fs from "node:fs";
|
|
16
17
|
const [, , tool, dir, ...args] = process.argv;
|
|
@@ -66,8 +67,11 @@ if (tool === "gh") {
|
|
|
66
67
|
switch (args[0]) {
|
|
67
68
|
case "ps":
|
|
68
69
|
if (args.some((a) => a.includes("{{.Names}}"))) out((world.running ?? []).map((c) => c + "\\trunning\\n").join(""));
|
|
70
|
+
else if (args.join(" ") === "ps -q --filter label=com.werkmeister.feature") out((world.containers ?? []).map((_, i) => "c" + i + "\\n").join(""));
|
|
71
|
+
break;
|
|
72
|
+
case "inspect":
|
|
73
|
+
out(args[1] === "--format" && args[2].includes("NanoCpus") ? (world.containers ?? []).map((l) => l + "\\n").join("") : "false\\n");
|
|
69
74
|
break;
|
|
70
|
-
case "inspect": out("false\\n"); break;
|
|
71
75
|
case "exec":
|
|
72
76
|
if (world.execCwd) process.exit(spawnSync("sh", ["-c", args.at(-1)], { cwd: world.execCwd, stdio: "inherit" }).status ?? 1);
|
|
73
77
|
break;
|
|
@@ -49,6 +49,20 @@ export interface FixtureOptions {
|
|
|
49
49
|
changeBranch?: string;
|
|
50
50
|
/** Top-level keys added to the fixture's config.yaml, e.g. `{ budget: { host_load: 0.01 } }` (SW-670); fixturePreset refuses any key but CONFIG_KEYS. */
|
|
51
51
|
config?: Record<string, unknown>;
|
|
52
|
+
/** Containers the fake docker shows the scheduler as running, so a start can wait for capacity (SW-685). */
|
|
53
|
+
containers?: FixtureContainer[];
|
|
54
|
+
/** Features in the waiting queue, `scheduler/queue.json` (SW-685). */
|
|
55
|
+
queue?: string[];
|
|
56
|
+
}
|
|
57
|
+
/** One running container as `docker inspect` reports it to the scheduler. */
|
|
58
|
+
export interface FixtureContainer {
|
|
59
|
+
feature: string;
|
|
60
|
+
/** A folder name, created empty under the fixture's workspaces root: a person's workspace, never preempted. */
|
|
61
|
+
workspace: string;
|
|
62
|
+
startedAt: string;
|
|
63
|
+
/** Bytes reserved. */
|
|
64
|
+
memory: number;
|
|
65
|
+
nanoCpus: number;
|
|
52
66
|
}
|
|
53
67
|
export interface FixturePresets {
|
|
54
68
|
/** An approved PR for a one-file change in packages/lib, with `demo-lib` running, for `pr gate`. */
|
|
@@ -13,6 +13,8 @@ import { dotDir } from "./dot_dir.js";
|
|
|
13
13
|
import { writeFakes } from "./fixture_fakes.js";
|
|
14
14
|
import { gitEnv } from "./proc.js";
|
|
15
15
|
import { prDir, stageDirs, templateFor } from "./strategies/icm_templates.js";
|
|
16
|
+
// Names become folders under the fixture and lines in the fakes, from a pre-approved wrapper's input.
|
|
17
|
+
const NAME = /^[a-z0-9][a-z0-9-]*$/;
|
|
16
18
|
// The only config.yaml keys --config may add: others (jira, github_ingest, paths…) reach real services or repos from a pre-approved run.
|
|
17
19
|
const CONFIG_KEYS = ["budget"];
|
|
18
20
|
export const FIXTURE_FEATURE = "demo";
|
|
@@ -76,6 +78,20 @@ export function fixturePreset({ gate, bare, change, ...opts }) {
|
|
|
76
78
|
const refused = Object.keys(opts.config ?? {}).filter((k) => !CONFIG_KEYS.includes(k));
|
|
77
79
|
if (refused.length)
|
|
78
80
|
throw new Error(`--config may not set ${refused.join(", ")}: only ${CONFIG_KEYS.join(", ")}`);
|
|
81
|
+
for (const c of opts.containers ?? []) {
|
|
82
|
+
const bad = !NAME.test(c.feature)
|
|
83
|
+
? c.feature
|
|
84
|
+
: !NAME.test(c.workspace)
|
|
85
|
+
? c.workspace
|
|
86
|
+
: Number.isNaN(Date.parse(c.startedAt))
|
|
87
|
+
? c.startedAt
|
|
88
|
+
: [c.memory, c.nanoCpus].find((n) => !Number.isSafeInteger(n) || n < 0);
|
|
89
|
+
if (bad !== undefined)
|
|
90
|
+
throw new Error(`--running: bad value ${JSON.stringify(bad)}: feature and workspace are lowercase names, startedAt a date, memory and nanoCpus whole numbers`);
|
|
91
|
+
}
|
|
92
|
+
const badName = opts.queue?.find((f) => !NAME.test(f));
|
|
93
|
+
if (badName !== undefined)
|
|
94
|
+
throw new Error(`--queue: bad feature ${JSON.stringify(badName)}: lowercase names, comma-separated`);
|
|
79
95
|
const libChange = "packages/lib/index.js";
|
|
80
96
|
const gateChange = change ?? (opts.fragmentChange === undefined ? libChange : undefined);
|
|
81
97
|
if (gate && opts.services && gateChange === libChange) {
|
|
@@ -207,11 +223,19 @@ ${githubProject(repos.map((r) => r.name))}${opts.config ? YAML.stringify(opts.co
|
|
|
207
223
|
// leasesPath() beside configFile: the env that points it here isn't set yet in this process.
|
|
208
224
|
write(path.join(path.dirname(configFile), "scheduler", "leases.json"), JSON.stringify(leases));
|
|
209
225
|
}
|
|
226
|
+
if (opts.queue)
|
|
227
|
+
write(path.join(path.dirname(configFile), "scheduler", "queue.json"), JSON.stringify(opts.queue));
|
|
228
|
+
const containers = (opts.containers ?? []).map((c) => {
|
|
229
|
+
const ws = path.join(root, "ws", c.workspace);
|
|
230
|
+
fs.mkdirSync(ws, { recursive: true });
|
|
231
|
+
return [c.feature, ws, c.startedAt, c.memory, c.nanoCpus].join("\t");
|
|
232
|
+
});
|
|
210
233
|
const home = path.join(root, "home");
|
|
211
234
|
fs.mkdirSync(home);
|
|
212
235
|
const fakes = writeFakes(path.join(root, "bin"), {
|
|
213
236
|
prUrl: `https://github.com/${FIXTURE_REPO_SLUG}/pull/1`,
|
|
214
237
|
running: opts.running ?? [],
|
|
238
|
+
containers,
|
|
215
239
|
prState: opts.merged ? "MERGED" : undefined,
|
|
216
240
|
issue: yml["issue_id"] ? FIXTURE_ISSUE : undefined,
|
|
217
241
|
// shortcut: every exec runs in the first code repo; map container → repo when a fixture has two.
|
|
@@ -247,15 +271,27 @@ ${githubProject(repos.map((r) => r.name))}${opts.config ? YAML.stringify(opts.co
|
|
|
247
271
|
GH_TOKEN: "",
|
|
248
272
|
GITHUB_TOKEN: "",
|
|
249
273
|
// Dead even when the caller's shell exports the real daemon's address (SW-264, SW-426).
|
|
250
|
-
WERKMEISTER_HOST: opts.daemon ??
|
|
274
|
+
WERKMEISTER_HOST: opts.daemon ?? closedPortUrl(),
|
|
275
|
+
// A refused daemon is retried for a restart gap (15 s default): each fixture step would wait it out (SW-708).
|
|
276
|
+
WERKMEISTER_DAEMON_RETRY_MS: process.env["WERKMEISTER_DAEMON_RETRY_MS"] || "500",
|
|
251
277
|
},
|
|
252
278
|
};
|
|
253
279
|
}
|
|
280
|
+
// A port just bound and closed, so a call is refused (ECONNREFUSED) like a stopped daemon: fetch
|
|
281
|
+
// rejects port 1 as a "bad port" before connecting (SW-708). Sync, since seedFixture is.
|
|
282
|
+
// shortcut: another process can take the port between close and use; hold a socket if that flakes.
|
|
283
|
+
function closedPortUrl() {
|
|
284
|
+
const port = execFileSync(process.execPath, [
|
|
285
|
+
"-e",
|
|
286
|
+
"const s=require('net').createServer().listen(0,'127.0.0.1',()=>{process.stdout.write(String(s.address().port));s.close()})",
|
|
287
|
+
]).toString();
|
|
288
|
+
return `http://127.0.0.1:${port}`;
|
|
289
|
+
}
|
|
254
290
|
const SCRIPT = `#!/bin/sh
|
|
255
291
|
# Generated by \`werkmeister workspace init\` (SW-292); rerun it to regenerate.
|
|
256
292
|
# Runs this workspace's own built werkmeister CLI against a seeded fixture workspace, removed on exit:
|
|
257
293
|
# temp HOME and registry, a local bare origin, logging fakes for gh and docker, dead Docker and daemon.
|
|
258
|
-
# usage: with-fixture-workspace [--no-wait] [--gate] [--bare] [--daemon] [--exec-runs] [--merged] [--behind] [--slots-full] [--issue <ref>] [--pr-field <key>=<value>]... [--workspace <file>] [--config <file>] [--services <file>] [--fragment <file>] [--change <path>] [--change-base <file>] [--change-branch <file>] [--fragment-change <file>] [--print <file>]... <werkmeister args> [--then <werkmeister args>]...
|
|
294
|
+
# usage: with-fixture-workspace [--no-wait] [--gate] [--bare] [--daemon] [--exec-runs] [--merged] [--behind] [--slots-full] [--running <file>] [--queue <feature>[,<feature>]...] [--issue <ref>] [--pr-field <key>=<value>]... [--workspace <file>] [--config <file>] [--services <file>] [--fragment <file>] [--change <path>] [--change-base <file>] [--change-branch <file>] [--fragment-change <file>] [--print <file>]... <werkmeister args> [--then <werkmeister args>]...
|
|
259
295
|
# It only ever runs that CLI, never another command, so one allow rule can cover it (SW-172, SW-231);
|
|
260
296
|
# --exec-runs, given first, also runs the registry's rows on the host, so the workspace asks before it (SW-473).
|
|
261
297
|
ws=$(cd "$(dirname "$0")/../.." && pwd -P) || exit 1
|
|
@@ -262,6 +262,8 @@ function testCommandLine(feature, svc, servicesConfig, archetypes, lint) {
|
|
|
262
262
|
? `- \`${svc}\`: \`${containerTestCommand(feature, svc, lint ? `${cmd} && ${lint}` : cmd)}\``
|
|
263
263
|
: `- \`${svc}\`: no test command registered (add \`test:\` to its registry entry)`;
|
|
264
264
|
}
|
|
265
|
+
/** SW-720: in sw-700 host `node`, a compound line and `docker exec … node <script>` were each denied before this form ran. */
|
|
266
|
+
const PROBE_FORM = (tempHome) => `A one-off probe is a \`node --test\` file, run as \`${tempHome} --no-wait node --test <file>\` (in the service's container, after its \`docker exec -w <dir> <container>\`, when the host has no node_modules); never host \`node <script>\`, a compound shell line or \`docker exec … node <script>\`. That form asks each time and is never pre-approved, since it runs any file (SW-510).`;
|
|
265
267
|
/**
|
|
266
268
|
* Render .werkmeister/werkmeister-context.md — how to validate, then (when they apply)
|
|
267
269
|
* ports, service topology, lifecycle commands, health checks.
|
|
@@ -325,7 +327,13 @@ export function buildSandboxContextMd(feature, slot, portStart, portEnd, localSe
|
|
|
325
327
|
return "—";
|
|
326
328
|
return `\`${wrappedTestCommand(tempHome, r.test, lintOf(r.repo))}\``;
|
|
327
329
|
};
|
|
328
|
-
|
|
330
|
+
// SW-705: the gate tests every service a change reaches, so the table lists the candidates' whole repos.
|
|
331
|
+
// Each service's own `repo:`, not repos.<repo>.services: only registry sync fills that list.
|
|
332
|
+
const repoOf = (s) => (isDict(servicesConfig[s]) ? servicesConfig[s]["repo"] : undefined);
|
|
333
|
+
const repos = new Set(candidates.map(repoOf).filter(Boolean));
|
|
334
|
+
const repoServices = Object.keys(servicesConfig).filter((s) => repos.has(repoOf(s)));
|
|
335
|
+
const rows = validationRows([...candidates, ...repoServices], servicesConfig, archetypes, urlServices);
|
|
336
|
+
const extraRows = rows.some((r) => !candidates.includes(r.service));
|
|
329
337
|
// SW-646: contracts name no repo's toolchain; they send the agent here for the repo's own commands.
|
|
330
338
|
const repoCommands = [...new Set(rows.map((r) => r.repo))]
|
|
331
339
|
.map((repo) => {
|
|
@@ -502,10 +510,12 @@ or visit https://${proxy.host}/__werkmeister and select \`${feature}\` — the s
|
|
|
502
510
|
const onDemand = candidates.filter((s) => !localServices.includes(s)).sort();
|
|
503
511
|
const validateBlock = `## How to validate
|
|
504
512
|
|
|
505
|
-
How to exercise a change to each service in this workspace.${
|
|
513
|
+
How to exercise a change to each service in this workspace.${extraRows
|
|
514
|
+
? " The table also lists the other services in this workspace's repos: the PR gate tests each service a change reaches, the workspace's own or not."
|
|
515
|
+
: ""}${onDemand.length
|
|
506
516
|
? ` A plain \`werkmeister feature up\` skips the on-demand ones, ${onDemand.map((s) => `\`${s}\``).join(", ")}: start one with \`werkmeister feature up --service <name>\`.`
|
|
507
517
|
: ""}${tempHome
|
|
508
|
-
? ` Each test command runs through \`.werkmeister/bin/with-temp-home\`, which gives it a fresh temporary HOME and deletes it on exit: never hand-roll \`HOME=…\`. Start every exercise command with the script itself, never with env assignments or a \`cd\`, so one permission rule matches it: \`${tempHome} <test command>\`. A command that needs an env var takes it after the script (\`${tempHome} env WERKMEISTER_ROOT=… <cmd>\`); no rule pre-approves that form, so it asks. Put \`--no-wait\` first (\`${tempHome} --no-wait <cmd>\`) to skip its host-load and free-memory wait; the allow rules below cover that form too. That wait lasts up to 90 s; if load or memory is still over its limit then, the script exits 75 without running the command (retry later). It prints only on stderr, so a foreground call shows nothing until it ends and its only child is \`werkmeister internal wait-load\`: that is the wait, not a hang. The allow rule that covers them is \`Bash(${tempHome} <test command>:*)\` for each test command below: run those for a test without a prompt. A test command of more than one command (an \`&&\` chain, a \`{ …; }\` group, \`||\`, \`;\` or a pipe) is shown as \`${tempHome} sh -c '…'\`, so every part runs under the temp HOME, and its rule allows that exact line: run it as shown, with no extra arguments.
|
|
518
|
+
? ` Each test command runs through \`.werkmeister/bin/with-temp-home\`, which gives it a fresh temporary HOME and deletes it on exit: never hand-roll \`HOME=…\`. Start every exercise command with the script itself, never with env assignments or a \`cd\`, so one permission rule matches it: \`${tempHome} <test command>\`. A command that needs an env var takes it after the script (\`${tempHome} env WERKMEISTER_ROOT=… <cmd>\`); no rule pre-approves that form, so it asks. Put \`--no-wait\` first (\`${tempHome} --no-wait <cmd>\`) to skip its host-load and free-memory wait; the allow rules below cover that form too. That wait lasts up to 90 s; if load or memory is still over its limit then, the script exits 75 without running the command (retry later). It prints only on stderr, so a foreground call shows nothing until it ends and its only child is \`werkmeister internal wait-load\`: that is the wait, not a hang. The allow rule that covers them is \`Bash(${tempHome} <test command>:*)\` for each test command below: run those for a test without a prompt. A test command of more than one command (an \`&&\` chain, a \`{ …; }\` group, \`||\`, \`;\` or a pipe) is shown as \`${tempHome} sh -c '…'\`, so every part runs under the temp HOME, and its rule allows that exact line: run it as shown, with no extra arguments. ${PROBE_FORM(tempHome)} The script alone is never allowed either, since it runs any command. The temp HOME only keeps a run from writing to the real one by accident; it is not an isolation boundary. A pre-approved test command or built CLI still runs whatever the worktree holds, a test written in this run included, and that code can reach absolute paths, the caller's env, the network, docker and gh (SW-522).`
|
|
509
519
|
: ""}${linted
|
|
510
520
|
? " A test command ending in `&& <lint>` also runs the repo's lint, the same command the PR gate's lint row runs, so a format error fails here and not first at `werkmeister pr open`."
|
|
511
521
|
: ""}
|
|
@@ -529,6 +529,12 @@ export function workspaceAskRules(workspaceRoot) {
|
|
|
529
529
|
const nodeTest = [
|
|
530
530
|
`Bash(${tempHome} env WERKMEISTER_ROOT=* node --test:*)`,
|
|
531
531
|
`Bash(${tempHome} --no-wait env WERKMEISTER_ROOT=* node --test:*)`,
|
|
532
|
+
// SW-720: the probe form werkmeister-context.md names; an ask, so auto mode prompts instead of denying it.
|
|
533
|
+
`Bash(${tempHome} node --test*)`,
|
|
534
|
+
`Bash(${tempHome} --no-wait node --test*)`,
|
|
535
|
+
// The same form in the service's container, where a host without node_modules runs it.
|
|
536
|
+
`Bash(docker exec * ${tempHome} node --test*)`,
|
|
537
|
+
`Bash(docker exec * ${tempHome} --no-wait node --test*)`,
|
|
532
538
|
];
|
|
533
539
|
const builtClis = builtCliWrappers(workspaceRoot);
|
|
534
540
|
if (!builtClis.length)
|
|
@@ -18,6 +18,8 @@ const HOSTNAME_RULE = "If `werkmeister feature up` warns that a routed hostname
|
|
|
18
18
|
// SW-143: a library or CLI has nothing to restart. How to exercise one is the service's (or its archetype's)
|
|
19
19
|
// `validate:` text, so app-specific steps stay out of the generic templates.
|
|
20
20
|
const NO_SERVICE_RULE = "A library or CLI has no service to restart: build it, then exercise the built artifact exactly as its Validation text in `werkmeister-context.md` § How to validate says.";
|
|
21
|
+
// SW-720: sw-700 had host `node`, a compound line and `docker exec … node <script>` each denied before a probe ran.
|
|
22
|
+
const PROBE_RULE = "A one-off probe is a `node --test` file run through `.werkmeister/bin/with-temp-home --no-wait node --test <file>`, in the service's container when the host has no node_modules, as `werkmeister-context.md` § How to validate says; never host `node <script>`, a compound shell line or `docker exec … node <script>`.";
|
|
21
23
|
// SW-691: sw-681's replay filtered out the very lines that showed its bug, and recorded nothing.
|
|
22
24
|
const EXERCISE_WORKAROUND = "A filter, workaround or special case the exercise needs before the change passes is a finding: write it into `exercise.md` as a `FAIL` row until the code is fixed, or until the row says why it reflects real use rather than a defect.";
|
|
23
25
|
const IMPLEMENT_STEPS = [
|
|
@@ -255,7 +257,7 @@ const feature = [
|
|
|
255
257
|
implementReview(v),
|
|
256
258
|
GATE_STEP,
|
|
257
259
|
REVIEW_DELTA,
|
|
258
|
-
`Reload the running code: ${v.restart}. ${RELOAD_RULE} ${HOSTNAME_RULE} Then exercise the change as the How-to-validate section of \`werkmeister-context.md\` describes for each service touched, and capture the output. ${NO_SERVICE_RULE} ${EXERCISE_WORKAROUND}`,
|
|
260
|
+
`Reload the running code: ${v.restart}. ${RELOAD_RULE} ${HOSTNAME_RULE} Then exercise the change as the How-to-validate section of \`werkmeister-context.md\` describes for each service touched, and capture the output. ${NO_SERVICE_RULE} ${PROBE_RULE} ${EXERCISE_WORKAROUND}`,
|
|
259
261
|
`Write \`output/exercise.md\`: \`git diff --stat\` for each repo you touched, the host and \`pr gate --tests\` exit codes and summary lines, ${SKIPPED}, any deviation from \`spec.md\` with its reason, and the exercise checks as ${exerciseFormat("evidence")}.`,
|
|
260
262
|
MANUAL_STEP,
|
|
261
263
|
],
|
|
@@ -290,7 +292,7 @@ const bugfix = [
|
|
|
290
292
|
doNotLoad: "`_shared/standards.md` (nothing is written here), other stages' contracts, `.werkmeister/*.yml`.",
|
|
291
293
|
process: [
|
|
292
294
|
// SW-392: a grep for a line the reporter never prints read "0/25 failures" for a flake nobody reproduced.
|
|
293
|
-
|
|
295
|
+
`Reproduce the failure against the running service or with a test. Record the exact command and its output. Judge each run by its exit code, or by a check you have shown fails on a known-bad run — never by grepping the output for a line that may not be printed. ${PROBE_RULE}`,
|
|
294
296
|
"Write the smallest failing test that captures it, in the style of the nearest existing test. Do not commit it yet.",
|
|
295
297
|
"Trace to the root cause: the first place the code does something other than intended. A symptom site is not a root cause.",
|
|
296
298
|
// SW-543: sw-520 grepped one call shape and missed the calls through other helpers; review caught them a round later.
|
|
@@ -357,7 +359,7 @@ const bugfix = [
|
|
|
357
359
|
],
|
|
358
360
|
doNotLoad: "`BRIEF.md` (`repro.md` carries the settled scope), `.werkmeister/*.yml`.",
|
|
359
361
|
process: [
|
|
360
|
-
`Reload the running code: ${v.restart}. ${RELOAD_RULE} ${HOSTNAME_RULE} ${NO_SERVICE_RULE}`,
|
|
362
|
+
`Reload the running code: ${v.restart}. ${RELOAD_RULE} ${HOSTNAME_RULE} ${NO_SERVICE_RULE} ${PROBE_RULE}`,
|
|
361
363
|
"Rerun the reproduction steps from `repro.md` exactly. Capture the output.",
|
|
362
364
|
`Exercise one neighbouring path through each caller \`repro.md\` listed. Capture the output. ${EXERCISE_WORKAROUND}`,
|
|
363
365
|
`Write \`output/exercise.md\`: steps 2–3 as ${exerciseFormat("detail")}.`,
|
|
@@ -429,7 +431,7 @@ const refactor = [
|
|
|
429
431
|
implementReview(v),
|
|
430
432
|
GATE_STEP,
|
|
431
433
|
REVIEW_DELTA,
|
|
432
|
-
`After the last step, reload and exercise the service: ${v.restart}. ${RELOAD_RULE} ${HOSTNAME_RULE} ${NO_SERVICE_RULE} ${EXERCISE_WORKAROUND}`,
|
|
434
|
+
`After the last step, reload and exercise the service: ${v.restart}. ${RELOAD_RULE} ${HOSTNAME_RULE} ${NO_SERVICE_RULE} ${PROBE_RULE} ${EXERCISE_WORKAROUND}`,
|
|
433
435
|
`Write \`output/exercise.md\`: \`git diff --stat\` per repo, the test result after each step, the \`pr gate --tests\` exit code, ${SKIPPED}, and the final exercise checks as ${exerciseFormat("evidence")}.`,
|
|
434
436
|
MANUAL_STEP,
|
|
435
437
|
],
|
package/package.json
CHANGED