werkmeister-core 0.91.3 → 0.91.5
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
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# sandbox-core
|
|
2
2
|
|
|
3
|
+
## 0.91.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4ea7192: SW-789: the feature pipeline's research contract (step 3) now tells a gate-, test- or build-speed ticket to sample the container cgroup `cpu.stat` `usage_usec` every 5 s across a cold run and report cores in use per phase before naming a critical path or lever. If the run holds all its CPUs, only a CPU cut shortens it, and the decision says so.
|
|
8
|
+
|
|
9
|
+
## 0.91.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2a3fff3: SW-636: the test commands `werkmeister-context.md` prints, and the allow rules that match them, now run the repo's `lint:` before the test command (`<lint> && <test>`), not after it. A format error now fails within seconds instead of after the full test run: in the werkmeister repo, about 7 s rather than turbo's ~6 minutes. A repo with no `lint:` gets the same lines as before.
|
|
14
|
+
|
|
3
15
|
## 0.91.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/archetypes.d.ts
CHANGED
|
@@ -47,8 +47,8 @@ export declare function containerTestCommand(feature: string, svc: string, cmd:
|
|
|
47
47
|
/** True when *cmd* is simple commands joined only by `&&`: no group, pipe, `||`, `;`, `&`, newline or substitution. */
|
|
48
48
|
export declare function isPlainChain(cmd: string): boolean;
|
|
49
49
|
/**
|
|
50
|
-
* The test command (
|
|
51
|
-
* matches it. One simple command is prefixed with *tempHome*; anything more goes through `sh -c`,
|
|
50
|
+
* The test command (after the repo's lint) as werkmeister-context.md prints it and its allow rule
|
|
51
|
+
* matches it. Lint goes first so a format error fails in seconds, not after turbo's minutes (SW-636). One simple command is prefixed with *tempHome*; anything more goes through `sh -c`,
|
|
52
52
|
* so every part runs under the temp HOME (`with-temp-home a && b` wraps only `a`) and a `{ …; }`
|
|
53
53
|
* group is not a syntax error (SW-660).
|
|
54
54
|
*/
|
package/dist/archetypes.js
CHANGED
|
@@ -88,13 +88,13 @@ export function isPlainChain(cmd) {
|
|
|
88
88
|
return !/[|;&{}()`\n]|\$\(/.test(cmd.split("&&").join(""));
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
* The test command (
|
|
92
|
-
* matches it. One simple command is prefixed with *tempHome*; anything more goes through `sh -c`,
|
|
91
|
+
* The test command (after the repo's lint) as werkmeister-context.md prints it and its allow rule
|
|
92
|
+
* matches it. Lint goes first so a format error fails in seconds, not after turbo's minutes (SW-636). One simple command is prefixed with *tempHome*; anything more goes through `sh -c`,
|
|
93
93
|
* so every part runs under the temp HOME (`with-temp-home a && b` wraps only `a`) and a `{ …; }`
|
|
94
94
|
* group is not a syntax error (SW-660).
|
|
95
95
|
*/
|
|
96
96
|
export function wrappedTestCommand(tempHome, test, lint) {
|
|
97
|
-
const full = lint ? `${
|
|
97
|
+
const full = lint ? `${lint} && ${test}` : test;
|
|
98
98
|
if (!tempHome)
|
|
99
99
|
return full;
|
|
100
100
|
if (isPlainChain(full) && !full.includes("&&"))
|
|
@@ -259,7 +259,7 @@ function testCommandLine(feature, svc, servicesConfig, archetypes, lint) {
|
|
|
259
259
|
if (noTests)
|
|
260
260
|
return `- \`${svc}\`: no tests (registry: ${noTests})`;
|
|
261
261
|
return cmd
|
|
262
|
-
? `- \`${svc}\`: \`${containerTestCommand(feature, svc, lint ? `${
|
|
262
|
+
? `- \`${svc}\`: \`${containerTestCommand(feature, svc, lint ? `${lint} && ${cmd}` : cmd)}\``
|
|
263
263
|
: `- \`${svc}\`: no test command registered (add \`test:\` to its registry entry)`;
|
|
264
264
|
}
|
|
265
265
|
/** SW-720: in sw-700 host `node`, a compound line and `docker exec … node <script>` were each denied before this form ran. */
|
|
@@ -445,7 +445,7 @@ docker compose restart ${sampleSvc}
|
|
|
445
445
|
### Test commands
|
|
446
446
|
|
|
447
447
|
The registry's \`test:\` for each service (or its archetype's), run in its container — the worktree is mounted at \`/app\` with its \`node_modules\`; the host checkout has none. The pre-PR gate runs these (\`werkmeister pr gate\`).${svcLint.some(Boolean)
|
|
448
|
-
? " A line
|
|
448
|
+
? " A line starting with `<lint> &&` first runs the repo's lint, the PR gate's lint row, so a `docs:check` or format failure shows here, before the tests, and not first at the gate."
|
|
449
449
|
: ""}
|
|
450
450
|
|
|
451
451
|
${svcs.map((s, i) => testCommandLine(feature, s, servicesConfig, archetypes ?? loadArchetypes(), svcLint[i])).join("\n")}
|
|
@@ -517,7 +517,7 @@ How to exercise a change to each service in this workspace.${extraRows
|
|
|
517
517
|
: ""}${tempHome
|
|
518
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).`
|
|
519
519
|
: ""}${linted
|
|
520
|
-
? " A test command
|
|
520
|
+
? " A test command starting with `<lint> &&` first runs the repo's lint, the same command the PR gate's lint row runs, so a format error fails here, before the tests, and not first at `werkmeister pr open`."
|
|
521
521
|
: ""}
|
|
522
522
|
|
|
523
523
|
${validationTable}${repoCommands}
|
|
@@ -98,6 +98,9 @@ const reviewStep = (rerun, group) => "Review the diff: for each code worktree yo
|
|
|
98
98
|
const implementReview = (v) => reviewStep("rerun the host test step above", v.group);
|
|
99
99
|
// SW-687: sw-634 decided a blocklist for a pre-approved wrapper's input; one key it let through sent auth to any host.
|
|
100
100
|
const PREAPPROVED_INPUT = "When the change adds or widens an input to a pre-approved command (an allow rule, or a wrapper an allow rule covers), the decision defaults to an allowlist of accepted values and lists what each accepted value can reach: files, env vars, network addresses, processes. A blocklist needs a stated reason.";
|
|
101
|
+
// SW-789: sw-751 named the build chain as the critical path from task start/end times; the row held all 3 CPUs for ~170 s, so only a CPU cut shortens it.
|
|
102
|
+
const CPU_PROFILE = "When the ticket is about gate, test or build speed, sample the container cgroup `cpu.stat` `usage_usec` every 5 s across a cold run and report the cores in use per phase before naming a critical path or any lever. " +
|
|
103
|
+
"Task start and end times alone do not show whether a path matters. If the run holds all its CPUs, only a CPU cut shortens it, and the decision says so.";
|
|
101
104
|
// SW-106 decision 7 renamed a legacy alias that `git log -S` would have shown was meant to be removed.
|
|
102
105
|
const NAME_HISTORY_STEP = "For each decision that renames, keeps or removes a name, a fallback or an alias, record its definition site (file and line) and the commit that introduced it (`git log -S <name>`, in the repo that defines it). " +
|
|
103
106
|
'When that commit marks it as a transition or legacy alias, list "remove" as an option beside rename and keep.';
|
|
@@ -117,7 +120,7 @@ export const SELF_CHECK = "Review `output/` once against `../../BRIEF.md` and th
|
|
|
117
120
|
// ends at an approved PR file is "propose".
|
|
118
121
|
// The gate reads every `result` column and rejects any other cell text (SW-247, SW-286).
|
|
119
122
|
const exerciseFormat = (col) => `a \`| check | result | ${col} |\` table whose result cell is exactly \`PASS\` or \`FAIL\` — nothing else in the cell — with the captured output in the ${col} column. The rule holds for every table in \`exercise.md\`; describe a superseded run in prose, not as a \`FAIL\` row`;
|
|
120
|
-
const LINT = "the repo's lint command (the
|
|
123
|
+
const LINT = "the repo's lint command (the `<lint> &&` head of the test command in `werkmeister-context.md`, when it has one, which the PR gate's lint row runs) and fix what it fails, release entry included.";
|
|
121
124
|
const propose = {
|
|
122
125
|
name: "propose",
|
|
123
126
|
job: "acceptance walk and PR files",
|
|
@@ -192,7 +195,9 @@ const feature = [
|
|
|
192
195
|
"When a decision rests on how an external tool behaves (a CLI command or flag, a plugin API, an event name), check it against the installed tool, not only its docs: record `<bin> --version`, and confirm each fact with `<bin> <cmd> --help` or a real run or plugin load. `decisions.md` names the version and, beside each fact, the command that confirmed it; a fact only the docs support is marked `unverified: docs only`, and no decision rests on it. If the tool cannot be installed, say so and mark every such fact `unverified`. " +
|
|
193
196
|
// SW-605: sw-583 recommended a GitHub API call as `unverified` only in the file; the person approved it and a read-only call later returned 403.
|
|
194
197
|
"A recommended answer that rests on an external API, permission or platform behaviour (a token scope, a hosted API's response, a cloud permission) is checked live, read-only (a list, get, `--help` or dry run, never a write), before it goes into `decisions.md`, with the command and its result beside it. When it cannot be checked read-only, write `unverified` in the option text itself, so the question the person is asked carries the word, not only the file. " +
|
|
195
|
-
PREAPPROVED_INPUT
|
|
198
|
+
PREAPPROVED_INPUT +
|
|
199
|
+
" " +
|
|
200
|
+
CPU_PROFILE,
|
|
196
201
|
"Write `output/inventory.md`: steps 1–3.",
|
|
197
202
|
NAME_HISTORY_STEP,
|
|
198
203
|
`Write \`output/decisions.md\`: every open question in \`BRIEF.md\`, each as a heading with \`status: proposed\`, your recommended answer, and the evidence from steps 1–3 and 5. Leave the answer blank when only a person can give it (a ticket key, a preference). ${CRITERION_REACH}`,
|
package/package.json
CHANGED