@turri-dev/cli 0.1.3-next.f74e98a → 0.1.4-next.172be6f
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/README.md +22 -1
- package/dist/ask.js +34 -15
- package/dist/cli-options.js +12 -6
- package/dist/config-edit.js +1 -0
- package/dist/config.js +5 -2
- package/dist/extension.js +86 -25
- package/dist/genome.js +1 -1
- package/dist/init-config.js +5 -0
- package/dist/loop-cli.js +13 -1
- package/dist/loop-tools.js +31 -12
- package/dist/pi-launch.js +5 -0
- package/dist/pi.js +48 -19
- package/dist/question-dialog.js +9 -3
- package/dist/questioning.js +1 -1
- package/dist/regenerate/activity.js +14 -0
- package/dist/regenerate/conform.js +5 -5
- package/dist/regenerate/conformance-agents.js +28 -8
- package/dist/regenerate/conformance.js +24 -10
- package/dist/regenerate/list-arguments.js +121 -0
- package/dist/regenerate/loop.js +137 -18
- package/dist/regenerate/notes.js +66 -17
- package/dist/regenerate/prompt.js +3 -1
- package/dist/regenerate/regenerate.js +16 -10
- package/dist/regenerate/regression.js +2 -1
- package/dist/regenerate/requires.js +55 -2
- package/dist/regenerate/self-check.js +13 -6
- package/dist/regenerate/test-scripts.js +54 -10
- package/dist/regenerate/unit-review.js +12 -1
- package/dist/regenerate-cli.js +11 -5
- package/dist/release-tools.js +1 -1
- package/dist/resume-line.js +4 -0
- package/dist/review/live.js +2 -1
- package/dist/run-report.js +34 -1
- package/dist/spec-tools.js +10 -45
- package/docs/authoring-plain.md +9 -6
- package/docs/config.md +3 -2
- package/docs/headless.md +30 -3
- package/docs/installation.md +3 -0
- package/docs/regenerating.md +69 -20
- package/docs/skills-and-gates.md +5 -3
- package/docs/using.md +20 -9
- package/genome/skills/bud/SKILL.md +67 -36
- package/genome/skills/bud/references/intent.md +4 -0
- package/genome/skills/refactor-module/SKILL.md +24 -2
- package/package.json +3 -3
- package/genome/skills/bud/references/checklist.md +0 -44
|
@@ -21,7 +21,7 @@ import { keepingTestsUnchanged, listFiles } from "./testing.js";
|
|
|
21
21
|
* job ends on it: tests that pass on their own are not done until the whole suite passes with them.
|
|
22
22
|
*/
|
|
23
23
|
/** On top of the file tools, which are fenced to the build directory by `confine.ts`. */
|
|
24
|
-
const FIX_TOOLS = ["run_unit_tests", "run_conformance_tests", "update_notes"];
|
|
24
|
+
const FIX_TOOLS = ["run_unit_tests", "run_conformance_tests", "update_notes", "report_spec_gap"];
|
|
25
25
|
const DEFAULT_MAX_REGRESSION_ROUNDS = ATTEMPTS.regression;
|
|
26
26
|
/** The module's conformance tests, when there are any: the chain's, copied up, and its own. */
|
|
27
27
|
function conformanceDirs(conformanceRoot, moduleName) {
|
|
@@ -39,6 +39,7 @@ async function repairRegression(input) {
|
|
|
39
39
|
cwd: input.buildDir,
|
|
40
40
|
customTools: [
|
|
41
41
|
notes.tool,
|
|
42
|
+
notes.gapTool,
|
|
42
43
|
...createWebTools(),
|
|
43
44
|
...fence.tools,
|
|
44
45
|
createScriptTool({ kind: "unit", script: input.scripts.unit, run: () => runUnitScript(input.buildDir, input.scripts.unit), runs }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { copyFileSync, existsSync, mkdirSync, readdirSync, rmSync } from "node:fs";
|
|
1
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync } from "node:fs";
|
|
2
2
|
import { basename, dirname, join, resolve } from "node:path";
|
|
3
|
-
import { PLAIN_SOURCE_FILE_EXTENSION, plainFileParser, withParseCache } from "../plain/parser.js";
|
|
3
|
+
import { IMPORT_DIRECTIVE, PLAIN_SOURCE_FILE_EXTENSION, plainFileParser, readPlainSourceMetadata, withParseCache } from "../plain/parser.js";
|
|
4
4
|
import { getFrids, getInheritedFunctionalSpecs } from "../plain/spec.js";
|
|
5
5
|
import { buildDirUnder, modulesRoot, projectDirOf } from "./paths.js";
|
|
6
6
|
import { notesPath } from "./notes.js";
|
|
@@ -54,6 +54,59 @@ options = {}) {
|
|
|
54
54
|
visit(resolve(plainFile), []);
|
|
55
55
|
return chain;
|
|
56
56
|
}
|
|
57
|
+
/** The .plain files that import `plainFile` - read from beside it, and, kept in a `template/` folder, from the folder it is in. */
|
|
58
|
+
function importersOf(plainFile) {
|
|
59
|
+
const file = resolve(plainFile);
|
|
60
|
+
const dir = dirname(file);
|
|
61
|
+
const name = basename(file, PLAIN_SOURCE_FILE_EXTENSION);
|
|
62
|
+
const dirs = [dir, ...(basename(dir) === "template" ? [dirname(dir)] : [])];
|
|
63
|
+
return dirs.flatMap((at) => {
|
|
64
|
+
let names;
|
|
65
|
+
try {
|
|
66
|
+
names = readdirSync(at).filter((entry) => entry.endsWith(PLAIN_SOURCE_FILE_EXTENSION));
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return names
|
|
72
|
+
.map((entry) => join(at, entry))
|
|
73
|
+
.filter((path) => {
|
|
74
|
+
if (path === file || !resolveTemplateDirs(path).includes(dir))
|
|
75
|
+
return false;
|
|
76
|
+
try {
|
|
77
|
+
return (readPlainSourceMetadata(readFileSync(path, "utf8")).metadata[IMPORT_DIRECTIVE] ?? []).includes(name);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Whether a .plain file is an import module - one a .plain file imports, or one kept in a `template/` folder - rather than
|
|
87
|
+
* a module of its own. It is no codebase: its reqs and definitions are built in the modules that import it.
|
|
88
|
+
*/
|
|
89
|
+
export function isImportModule(plainFile) {
|
|
90
|
+
return basename(dirname(resolve(plainFile))) === "template" || importersOf(plainFile).length > 0;
|
|
91
|
+
}
|
|
92
|
+
/** The modules of their own that import an import module, through any import modules between. */
|
|
93
|
+
export function importingModules(plainFile) {
|
|
94
|
+
const found = new Set();
|
|
95
|
+
const seen = new Set();
|
|
96
|
+
const walk = (file) => {
|
|
97
|
+
if (seen.has(file))
|
|
98
|
+
return;
|
|
99
|
+
seen.add(file);
|
|
100
|
+
for (const importer of importersOf(file)) {
|
|
101
|
+
if (isImportModule(importer))
|
|
102
|
+
walk(importer);
|
|
103
|
+
else
|
|
104
|
+
found.add(importer);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
walk(resolve(plainFile));
|
|
108
|
+
return [...found];
|
|
109
|
+
}
|
|
57
110
|
/**
|
|
58
111
|
* The codebase a change to `plainFile`'s module lands in: the furthest-built module whose
|
|
59
112
|
* requires chain includes it, with that chain.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { readFileSync
|
|
2
|
-
import {
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { relative, resolve, sep } from "node:path";
|
|
3
3
|
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { Type } from "typebox";
|
|
5
5
|
import { workDiff } from "./lineage.js";
|
|
6
|
-
import { lastPassingMs, runOnCode } from "./test-scripts.js";
|
|
6
|
+
import { lastPassingMs, runOnCode, scriptsRunInPlace } from "./test-scripts.js";
|
|
7
7
|
/**
|
|
8
8
|
* Tools an agent checks its own work with, before the harness and the reviewer do: the diff the reviewer is shown, and
|
|
9
9
|
* whether a test catches a change to the code. Neither decides anything - the testing scripts, run by the harness, still do.
|
|
@@ -43,16 +43,23 @@ export function canItFailLimitMs(buildDir, script) {
|
|
|
43
43
|
*/
|
|
44
44
|
export function createCanItFailTool(options) {
|
|
45
45
|
let left = options.runs ?? CAN_IT_FAIL_RUNS;
|
|
46
|
+
// In place, the change is made to the code itself for the run, and undone after it: the scripts run on the code there.
|
|
47
|
+
const inPlace = scriptsRunInPlace(options.buildDir);
|
|
46
48
|
return defineTool({
|
|
47
49
|
name: "can_it_fail",
|
|
48
50
|
label: "Can it fail",
|
|
49
51
|
description: "Check that the unit tests catch a bug: give one change to the code that breaks a behaviour the specification " +
|
|
50
52
|
"states - a value or a status changed, a check taken out, a condition turned round where it cannot make a loop run for " +
|
|
51
53
|
"ever - and the unit testing script " +
|
|
52
|
-
|
|
54
|
+
(inPlace
|
|
55
|
+
? "runs with that change made to the code, which is put back as it was once the run ends, whatever its result. "
|
|
56
|
+
: "runs on a copy of the code with that change. The code itself is never touched. ") +
|
|
57
|
+
"The tests should fail; if they all " +
|
|
53
58
|
"pass, no test catches that bug. Make a change that still builds and runs: a failure only because it no longer " +
|
|
54
59
|
`compiles or imports says nothing about the tests. ${options.runs ?? CAN_IT_FAIL_RUNS} runs at most.`,
|
|
55
|
-
promptSnippet: "can_it_fail: whether the unit tests catch a bug you put in
|
|
60
|
+
promptSnippet: "can_it_fail: whether the unit tests catch a bug you put in the code for one run",
|
|
61
|
+
// Never beside another call: in place, an edit made while the bug is in would be undone with it.
|
|
62
|
+
executionMode: "sequential",
|
|
56
63
|
parameters: Type.Object({
|
|
57
64
|
file: Type.String({ description: "The code file to change, relative to the code folder" }),
|
|
58
65
|
find: Type.String({ description: "Text that is in the file exactly once - the code to change" }),
|
|
@@ -83,7 +90,7 @@ export function createCanItFailTool(options) {
|
|
|
83
90
|
left -= 1;
|
|
84
91
|
let run;
|
|
85
92
|
try {
|
|
86
|
-
run = await runOnCode(options.buildDir, options.script, "unit testing script, with the change",
|
|
93
|
+
run = await runOnCode(options.buildDir, options.script, "unit testing script, with the change", { file: relative(options.buildDir, path), text: text.slice(0, at) + replace + text.slice(at + find.length) }, canItFailLimitMs(options.buildDir, options.script));
|
|
87
94
|
}
|
|
88
95
|
catch (error) {
|
|
89
96
|
return say(error instanceof Error ? error.message : String(error));
|
|
@@ -297,6 +297,10 @@ export function setScriptTimeoutForTests(ms) {
|
|
|
297
297
|
* own paths start - and whether they run on the code in place (the default), rather than on a fresh copy
|
|
298
298
|
* (`testing-scripts-run-on: copy`).
|
|
299
299
|
*/
|
|
300
|
+
/** Whether the testing scripts run on the code in `buildDir` itself, not on a copy of it. */
|
|
301
|
+
export function scriptsRunInPlace(buildDir) {
|
|
302
|
+
return projectOfBuild(buildDir).inPlace;
|
|
303
|
+
}
|
|
300
304
|
function projectOfBuild(buildDir) {
|
|
301
305
|
const parts = resolve(buildDir).split(sep);
|
|
302
306
|
const index = parts.lastIndexOf("plain_modules");
|
|
@@ -401,30 +405,70 @@ const lastPassing = new Map();
|
|
|
401
405
|
export function lastPassingMs(buildDir, script) {
|
|
402
406
|
return lastPassing.get(`${resolve(buildDir)}\n${script}`);
|
|
403
407
|
}
|
|
408
|
+
/** Files changed in place for a run under way, and what each held: put back however the run ends - the process exiting too. */
|
|
409
|
+
const changedInPlace = new Map();
|
|
410
|
+
let restoreOnExit = false;
|
|
411
|
+
function putBack(path) {
|
|
412
|
+
const original = changedInPlace.get(path);
|
|
413
|
+
if (original === undefined)
|
|
414
|
+
return;
|
|
415
|
+
writeFileSync(path, original);
|
|
416
|
+
changedInPlace.delete(path);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* `run` with `change` made to the code itself, and undone once it ends - passed, failed, timed out, thrown, or the process
|
|
420
|
+
* exiting. Killed outright, the change is left: the next unit of work starts from the last commit (lineage.ts startWork).
|
|
421
|
+
*/
|
|
422
|
+
async function withChangeInPlace(buildDir, change, run) {
|
|
423
|
+
const path = resolve(buildDir, change.file);
|
|
424
|
+
if (changedInPlace.has(path))
|
|
425
|
+
throw new Error(`${change.file} is being changed for another run already.`);
|
|
426
|
+
if (!restoreOnExit) {
|
|
427
|
+
restoreOnExit = true;
|
|
428
|
+
process.once("exit", () => {
|
|
429
|
+
for (const changed of [...changedInPlace.keys()])
|
|
430
|
+
putBack(changed);
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
changedInPlace.set(path, readFileSync(path));
|
|
434
|
+
try {
|
|
435
|
+
writeFileSync(path, change.text);
|
|
436
|
+
return await run();
|
|
437
|
+
}
|
|
438
|
+
finally {
|
|
439
|
+
putBack(path);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
404
442
|
/**
|
|
405
|
-
* A script that takes the code folder - the unit testing script - run where the testing scripts
|
|
406
|
-
*
|
|
443
|
+
* A script that takes the code folder - the unit testing script - run where the testing scripts run. `change`: one file
|
|
444
|
+
* as it is for this run - made to the fresh copy, or, in place, to the code itself and undone once the run ends.
|
|
407
445
|
*/
|
|
408
446
|
export async function runOnCode(buildDir, script, what, change,
|
|
409
447
|
/** A time limit of its own, in place of a test run's. */
|
|
410
448
|
limitMs) {
|
|
411
449
|
const project = projectOfBuild(buildDir);
|
|
450
|
+
const passed = (run, started) => {
|
|
451
|
+
if (change === undefined && run.exitCode === 0)
|
|
452
|
+
lastPassing.set(`${resolve(buildDir)}\n${script}`, Date.now() - started);
|
|
453
|
+
return run;
|
|
454
|
+
};
|
|
412
455
|
if (project.inPlace) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
456
|
+
const inPlace = () => runScript(project.root, script, [resolve(buildDir)], buildDir, limitMs !== undefined ? { limitMs } : {});
|
|
457
|
+
const started = Date.now();
|
|
458
|
+
if (change === undefined)
|
|
459
|
+
return passed(await inPlace(), started);
|
|
460
|
+
reportActivity(` changing ${change.file} in place for the ${what} - put back once it has run`);
|
|
461
|
+
return withChangeInPlace(buildDir, change, inPlace);
|
|
416
462
|
}
|
|
417
463
|
const staging = stagingFor(buildDir);
|
|
418
464
|
rmSync(staging.root, { recursive: true, force: true });
|
|
419
465
|
ensureInModulesScratch(buildDir, staging.root);
|
|
420
466
|
try {
|
|
421
467
|
reportActivity(` copying ${stageBuild(buildDir, staging.build)} files of the code for the ${what}`);
|
|
422
|
-
change
|
|
468
|
+
if (change !== undefined)
|
|
469
|
+
writeFileSync(join(staging.build, change.file), change.text);
|
|
423
470
|
const started = Date.now();
|
|
424
|
-
|
|
425
|
-
if (change === undefined && run.exitCode === 0)
|
|
426
|
-
lastPassing.set(`${resolve(buildDir)}\n${script}`, Date.now() - started);
|
|
427
|
-
return run;
|
|
471
|
+
return passed(await runOnCopy(staging.root, script, [staging.build], buildDir, limitMs), started);
|
|
428
472
|
}
|
|
429
473
|
finally {
|
|
430
474
|
rmSync(staging.root, { recursive: true, force: true });
|
|
@@ -63,6 +63,17 @@ export function unitReviewTask(options) {
|
|
|
63
63
|
options.spec.trim(),
|
|
64
64
|
"</specification>",
|
|
65
65
|
"",
|
|
66
|
+
...(options.testingScript !== undefined
|
|
67
|
+
? [
|
|
68
|
+
"The harness runs the unit tests with this script, and it decides whether they pass. Read it for which tests it",
|
|
69
|
+
"runs and how: a test it never reaches - a file it does not pick up, a folder it does not look in - is not run, and",
|
|
70
|
+
"checks nothing.",
|
|
71
|
+
`<unit testing script path="${options.testingScript.path}">`,
|
|
72
|
+
options.testingScript.content.trimEnd(),
|
|
73
|
+
"</unit testing script>",
|
|
74
|
+
"",
|
|
75
|
+
]
|
|
76
|
+
: []),
|
|
66
77
|
...(options.cases !== undefined ? [...codeReviewCasesBlock(options.cases), ""] : []),
|
|
67
78
|
// A job that touches no functional spec is held only to that: the checks of behaviour are not its.
|
|
68
79
|
...(mechanical ? [] : ["Check that the code does what the specification states for this work:"]),
|
|
@@ -85,7 +96,7 @@ export function unitReviewTask(options) {
|
|
|
85
96
|
" assertion so loose any answer passes, an expected value computed the way the code computes it.",
|
|
86
97
|
...(options.canItFail === true
|
|
87
98
|
? [
|
|
88
|
-
"- A test you doubt can fail, check: can_it_fail puts a bug in
|
|
99
|
+
"- A test you doubt can fail, check: can_it_fail puts a bug in the code for one run - a condition turned round, a",
|
|
89
100
|
" value changed - and runs the unit tests on it. A test that still passes cannot fail: raise it as bad, with the",
|
|
90
101
|
` bug it missed. ${REVIEWER_CAN_IT_FAIL_RUNS} runs a session: spend them on the tests the work rests on.`,
|
|
91
102
|
]
|
package/dist/regenerate-cli.js
CHANGED
|
@@ -19,10 +19,15 @@ its conformance tests too when they are on.
|
|
|
19
19
|
--start-over start over, without asking, a codebase regenerated without a module it now requires -
|
|
20
20
|
with no terminal to ask and without it, the run stops there
|
|
21
21
|
--from-scratch delete the module's code and conformance tests (its lineage keeps them) and regenerate all of it
|
|
22
|
+
--from-scratch-chain the same for every module of its requires chain, built again from the bottom - after
|
|
23
|
+
modules were split or moved
|
|
22
24
|
--harness-model <p/id> config.turri.yaml's harness-model for this run: the planner and the conformance chooser
|
|
23
25
|
--coding-model <p/id> its coding-model, --model too: the agents that build; p/id:level for how hard a model thinks
|
|
24
26
|
--judge-model <p/id> its judge-model: the judge and the test review
|
|
25
27
|
--review <true|false> its review: whether the code and its tests are reviewed once they pass
|
|
28
|
+
--mutation-testing <true|false>
|
|
29
|
+
its mutation-testing: whether the coding agent and the reviewer can put a bug in the code
|
|
30
|
+
for one test run (can_it_fail), to see that a test catches it
|
|
26
31
|
--conformance-tests <all|chosen|module|false>
|
|
27
32
|
its conformance-tests: which conformance tests are written and run
|
|
28
33
|
--build-dir <dir> as the run ends, however it ends, export the code there: the furthest-built codebase's
|
|
@@ -31,7 +36,7 @@ its conformance tests too when they are on.
|
|
|
31
36
|
as it starts, as each pulse ends and as it exits (docs/headless.md)
|
|
32
37
|
|
|
33
38
|
PLAIN_TEMPLATE_DIRS colon-separated template directories`;
|
|
34
|
-
const { positional, options } = parseArgs(process.argv.slice(2), ["--dry-run", "--start-over", "--from-scratch"], USAGE, ["--build-dir", "--report", "--conformance-tests", "--harness-model", "--judge-model", "--review"]);
|
|
39
|
+
const { positional, options } = parseArgs(process.argv.slice(2), ["--dry-run", "--start-over", "--from-scratch", "--from-scratch-chain"], USAGE, ["--build-dir", "--report", "--conformance-tests", "--harness-model", "--judge-model", "--review", "--mutation-testing"]);
|
|
35
40
|
const { report, buildDir } = headlessOptions(options, true);
|
|
36
41
|
const named = positional[0] ?? readProjectConfig(process.cwd()).module;
|
|
37
42
|
// Functional specs named after the file: regenerated again though their spec did not change.
|
|
@@ -40,9 +45,10 @@ if (!named) {
|
|
|
40
45
|
console.error(`${USAGE}\n\nNo file given, and ${CONFIG_FILE} names no module.`);
|
|
41
46
|
process.exit(1);
|
|
42
47
|
}
|
|
48
|
+
const scratch = options["from-scratch-chain"] !== undefined ? "chain" : options["from-scratch"] !== undefined ? "module" : undefined;
|
|
43
49
|
// A dry run starts nothing, and from scratch deletes before it plans: the two do not go together.
|
|
44
|
-
if (
|
|
45
|
-
console.error(
|
|
50
|
+
if (scratch !== undefined && options["dry-run"] !== undefined) {
|
|
51
|
+
console.error(`--from-scratch${scratch === "chain" ? "-chain" : ""} deletes the code before anything is planned: it cannot be a dry run.`);
|
|
46
52
|
process.exit(1);
|
|
47
53
|
}
|
|
48
54
|
runLoop({
|
|
@@ -54,8 +60,8 @@ runLoop({
|
|
|
54
60
|
startOver: options["start-over"] !== undefined,
|
|
55
61
|
ask: (loop) => again.length > 0
|
|
56
62
|
? loop.regenerateAgain(named, again)
|
|
57
|
-
:
|
|
58
|
-
? loop.fromScratch(named)
|
|
63
|
+
: scratch !== undefined
|
|
64
|
+
? loop.fromScratch(named, { chain: scratch === "chain" })
|
|
59
65
|
: loop.bringUp(named),
|
|
60
66
|
}).catch((error) => {
|
|
61
67
|
console.error(error instanceof Error ? error.message : error);
|
package/dist/release-tools.js
CHANGED
|
@@ -142,7 +142,7 @@ export function createDeployTools(options) {
|
|
|
142
142
|
},
|
|
143
143
|
});
|
|
144
144
|
// The one halt: with the pulses in the conversation, and without them for the release agent.
|
|
145
|
-
const stopTool = haltTool(options.jobs !== undefined ? { jobs: options.jobs } : {});
|
|
145
|
+
const stopTool = haltTool(options.jobs !== undefined ? { jobs: options.jobs, ...(options.workLoop !== undefined ? { workLoop: options.workLoop } : {}) } : {});
|
|
146
146
|
return [deploy, startTool, stopTool];
|
|
147
147
|
}
|
|
148
148
|
export const DEPLOY_TOOLS = ["release", "activate", "halt"];
|
package/dist/review/live.js
CHANGED
|
@@ -79,7 +79,8 @@ export function createLiveReviewer(opts) {
|
|
|
79
79
|
pending.push(finding);
|
|
80
80
|
all.push(finding);
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
// No verdict - its turn stopped before it gave one - clears nothing: the scope is looked at again next pass.
|
|
83
|
+
if (captured !== undefined && violations.length === 0) {
|
|
83
84
|
cleared.push(scope);
|
|
84
85
|
}
|
|
85
86
|
else if (captured?.question) {
|
package/dist/run-report.js
CHANGED
|
@@ -22,6 +22,8 @@ const emptyTotals = () => ({
|
|
|
22
22
|
llm_calls: 0,
|
|
23
23
|
agent_turns: 0,
|
|
24
24
|
compactions: 0,
|
|
25
|
+
provider_retries: 0,
|
|
26
|
+
turns_stopped: 0,
|
|
25
27
|
model_seconds: 0,
|
|
26
28
|
});
|
|
27
29
|
function addUsage(totals, usage) {
|
|
@@ -43,8 +45,12 @@ function addEvent(totals, event, tokens) {
|
|
|
43
45
|
}
|
|
44
46
|
else if (event.kind === "turn")
|
|
45
47
|
totals.agent_turns += 1;
|
|
46
|
-
else
|
|
48
|
+
else if (event.kind === "compaction")
|
|
47
49
|
totals.compactions += 1;
|
|
50
|
+
else if (event.kind === "provider_retry")
|
|
51
|
+
totals.provider_retries += 1;
|
|
52
|
+
else
|
|
53
|
+
totals.turns_stopped += 1;
|
|
48
54
|
}
|
|
49
55
|
function sumTotals(a, b) {
|
|
50
56
|
const sum = emptyTotals();
|
|
@@ -181,6 +187,30 @@ export function startRunReport(options) {
|
|
|
181
187
|
list,
|
|
182
188
|
};
|
|
183
189
|
};
|
|
190
|
+
/** The spec gaps the pulses' agents met, in the order the pulses started: questions a person would want to decide. */
|
|
191
|
+
const specGapsOf = (jobs) => jobs.flatMap((job) => {
|
|
192
|
+
const details = job.details;
|
|
193
|
+
return (details?.specGaps ?? []).map((gap) => ({
|
|
194
|
+
module: job.module ?? null,
|
|
195
|
+
pulse: job.pulse ?? null,
|
|
196
|
+
pulse_id: job.id,
|
|
197
|
+
landed: job.status === "succeeded" && details?.landed === true,
|
|
198
|
+
question: gap.question,
|
|
199
|
+
assumption: gap.assumption,
|
|
200
|
+
}));
|
|
201
|
+
});
|
|
202
|
+
/** Each turn the provider failed and turri waited out, and each turn turri ended itself: why, and where. */
|
|
203
|
+
const turnIncidentsOf = () => events
|
|
204
|
+
.filter((event) => event.kind === "provider_retry" || event.kind === "stopped")
|
|
205
|
+
.map((event) => ({
|
|
206
|
+
kind: event.kind,
|
|
207
|
+
pulse_id: event.job ?? null,
|
|
208
|
+
role: event.role ?? null,
|
|
209
|
+
model: event.model ?? null,
|
|
210
|
+
...(event.kind === "stopped"
|
|
211
|
+
? { reason: event.reason ?? null }
|
|
212
|
+
: { error: event.error ?? null, attempt: event.attempt ?? null, of: event.of ?? null, wait_seconds: Math.round((event.waitMs ?? 0) / 100) / 10 }),
|
|
213
|
+
}));
|
|
184
214
|
const functionalitiesOf = (counts) => {
|
|
185
215
|
if (counts === undefined)
|
|
186
216
|
return null;
|
|
@@ -228,6 +258,7 @@ export function startRunReport(options) {
|
|
|
228
258
|
build_dir: options.buildDir !== undefined ? resolve(options.buildDir) : null,
|
|
229
259
|
conformance_tests: options.conformanceTests,
|
|
230
260
|
review: options.review ?? null,
|
|
261
|
+
mutation_testing: options.mutationTesting ?? null,
|
|
231
262
|
models: {
|
|
232
263
|
...Object.fromEntries(Object.entries(options.models).map(([role, choice]) => [role, { model: choice.model ?? null, thinking: choice.thinking ?? null }])),
|
|
233
264
|
observed: Object.fromEntries([...new Set(events.map((event) => event.role ?? "unknown"))].sort().map((role) => [role, [...new Set(events.filter((event) => (event.role ?? "unknown") === role).map((event) => event.model ?? "unknown"))].sort()])),
|
|
@@ -245,6 +276,8 @@ export function startRunReport(options) {
|
|
|
245
276
|
usage: usageOf(jobs),
|
|
246
277
|
pulses: pulsesOf(jobs, now),
|
|
247
278
|
functionalities: functionalitiesOf(attempt(sources.completion)),
|
|
279
|
+
spec_gaps: specGapsOf(jobs),
|
|
280
|
+
turn_incidents: turnIncidentsOf(),
|
|
248
281
|
...(exitParts ?? {}),
|
|
249
282
|
logs: {
|
|
250
283
|
jobs_dir: fromProject(join(projectRoot, ".turri", "jobs")),
|
package/dist/spec-tools.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
1
|
+
import { basename, relative, resolve } from "node:path";
|
|
3
2
|
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
4
3
|
import { Type } from "typebox";
|
|
5
|
-
import {
|
|
4
|
+
import { plainFileParser } from "./plain/parser.js";
|
|
5
|
+
import { importingModules, isImportModule } from "./regenerate/requires.js";
|
|
6
6
|
import { resolveTemplateDirs } from "./regenerate/paths.js";
|
|
7
7
|
import { applySpecDiff, plainFilesOf, revertSpecDiff } from "./regenerate/regenerate.js";
|
|
8
8
|
import { MissingFunctionalitiesError } from "./plain/errors.js";
|
|
@@ -62,24 +62,12 @@ export function createSpecDiffTools(options) {
|
|
|
62
62
|
// file that cannot be parsed. A module with no functional specs yet is not broken. An import
|
|
63
63
|
// module - definitions only, say - is not a module of its own: it is parsed as the modules
|
|
64
64
|
// that import it read it, the one the change is built for among them.
|
|
65
|
-
const importers = (file) => {
|
|
66
|
-
const name = basename(file, ".plain");
|
|
67
|
-
const dir = dirname(resolve(cwd, file));
|
|
68
|
-
return readdirSync(dir)
|
|
69
|
-
.filter((entry) => entry.endsWith(".plain"))
|
|
70
|
-
.map((entry) => join(dir, entry))
|
|
71
|
-
.filter((path) => {
|
|
72
|
-
try {
|
|
73
|
-
return (readPlainSourceMetadata(readFileSync(path, "utf8")).metadata[IMPORT_DIRECTIVE] ?? []).includes(name);
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
const imported = importedNames(resolveTemplateDirs(resolve(cwd, params.plain_file)));
|
|
81
65
|
const toParse = [
|
|
82
|
-
...new Set([params.plain_file, ...touched].flatMap((file) =>
|
|
66
|
+
...new Set([params.plain_file, ...touched].flatMap((file) => {
|
|
67
|
+
const path = resolve(cwd, file);
|
|
68
|
+
const importing = isImportModule(path) ? importingModules(path) : [];
|
|
69
|
+
return importing.length > 0 ? importing : [path];
|
|
70
|
+
})),
|
|
83
71
|
];
|
|
84
72
|
for (const path of toParse) {
|
|
85
73
|
const file = relative(cwd, path);
|
|
@@ -100,7 +88,8 @@ export function createSpecDiffTools(options) {
|
|
|
100
88
|
owed = false;
|
|
101
89
|
liveReview?.notice(`${params.plain_file}, after the change to ${touched.join(", ")}`);
|
|
102
90
|
// In the files, the change is work: the loop works out what is left to build and plans it.
|
|
103
|
-
|
|
91
|
+
// A spec change, not a request: a module the person halted stays halted.
|
|
92
|
+
const statuses = await loop.bringUp(params.plain_file, { specChange: true, ...(params.guidance !== undefined ? { guidance: params.guidance } : {}) });
|
|
104
93
|
const lines = [
|
|
105
94
|
result === "applied" ? `Applied the change to ${touched.join(", ")}.` : `The change to ${touched.join(", ")} was already applied.`,
|
|
106
95
|
`Building in the background:\n${describeModules(statuses)}\n`,
|
|
@@ -129,27 +118,3 @@ export function createSpecDiffTools(options) {
|
|
|
129
118
|
},
|
|
130
119
|
};
|
|
131
120
|
}
|
|
132
|
-
/** The module names some .plain file in these folders imports: import modules, not codebases. */
|
|
133
|
-
export function importedNames(dirs) {
|
|
134
|
-
const names = new Set();
|
|
135
|
-
for (const dir of dirs) {
|
|
136
|
-
let entries;
|
|
137
|
-
try {
|
|
138
|
-
entries = readdirSync(dir).filter((name) => name.endsWith(PLAIN_SOURCE_FILE_EXTENSION));
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
for (const entry of entries) {
|
|
144
|
-
try {
|
|
145
|
-
const imports = readPlainSourceMetadata(readFileSync(join(dir, entry), "utf8")).metadata[IMPORT_DIRECTIVE];
|
|
146
|
-
for (const name of imports ?? [])
|
|
147
|
-
names.add(name);
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
// A file that does not read imports nothing.
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return names;
|
|
155
|
-
}
|
package/docs/authoring-plain.md
CHANGED
|
@@ -196,18 +196,21 @@ the reading that fits the rest of the spec, and marks each such decision in its
|
|
|
196
196
|
code, environment and turri problems to the builds, and stops when a functionality keeps
|
|
197
197
|
struggling after the spec was clarified, when two cycles change nothing, or after twenty.
|
|
198
198
|
|
|
199
|
-
For an existing project, `bud` works the same way, scoped to one feature: intent → scope →
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
For an existing project, `bud` works the same way, scoped to one feature: intent → scope → product.
|
|
200
|
+
It first asks how many questions the product phase may ask - light, medium, thorough or best
|
|
201
|
+
judgement, as `brood` does - then a short feature-intent interview, then product questions - a
|
|
202
|
+
trigger and its outcome, an edge case, a rule - and every answer is a spec change, a git diff
|
|
203
|
+
written with `write_spec_diff` and built the moment it is written, before the next question. What
|
|
204
|
+
the questions leave open it decides itself, a spec change each. A change to something already
|
|
203
205
|
specified, built or still to build, is put to the user first and is a spec diff too: what is left to
|
|
204
|
-
build is worked out again from the spec.
|
|
206
|
+
build is worked out again from the spec. It ends on the person's confirmation of a short summary of
|
|
207
|
+
the feature's changes.
|
|
205
208
|
|
|
206
209
|
What keeps the interview honest is the harness, not the interviewer:
|
|
207
210
|
|
|
208
211
|
- **Every question offers choices** (`ask_user` refuses a question without them), and each
|
|
209
212
|
answer maps to one spec change.
|
|
210
|
-
- **Every answer is written before the next question.** In `brood`
|
|
213
|
+
- **Every answer is written before the next question.** In the product phase of `brood` and `bud`, `ask_user` refuses
|
|
211
214
|
a new question until the last answer is a spec change - see [skills and gates](skills-and-gates.md).
|
|
212
215
|
- **Each phase ends on the person's confirmation** of a short summary, not on the interviewer's word.
|
|
213
216
|
|
package/docs/config.md
CHANGED
|
@@ -84,7 +84,7 @@ runs:
|
|
|
84
84
|
| --- | --- |
|
|
85
85
|
| now | `harness-model` and `models.chat` - the conversation switches to it; `parallel-jobs` - a pulse waiting for a slot starts if there is one now; `allow-to-stop-jobs` |
|
|
86
86
|
| your next message | `rules-off` - for the conversation; a skill's agents from the next skill run |
|
|
87
|
-
| the next pulse - one running keeps what it started with | `coding-model`, `judge-model`, every other `models.<role>`, `review`, `turn-limit`, `compact-at`, `agent-env`, `toolchains` |
|
|
87
|
+
| the next pulse - one running keeps what it started with | `coding-model`, `judge-model`, every other `models.<role>`, `review`, `mutation-testing`, `turn-limit`, `compact-at`, `agent-env`, `toolchains` |
|
|
88
88
|
| the next time the work is planned | `conformance-tests`, `conformance-budget`, `max-specs-per-pulse`, `max-lines-per-pulse` |
|
|
89
89
|
| the next test run - the running pulse's too | the testing scripts, `testing-scripts-run-on` |
|
|
90
90
|
| the next pulse that lands - the running one too | `release-after-pulse` |
|
|
@@ -128,6 +128,7 @@ models: # each agent role's model, thinking and tur
|
|
|
128
128
|
| `conformance-tests` | `all` (or `true`): conformance tests for every functional spec of every module with test reqs, written once each module's code is built, before anything is built on it. `chosen`: for the functional specs chosen - every one with acceptance tests, and those the chooser picks as each code pulse ends, from what that pulse regenerated. `module`: the same, but the chooser is asked once, when the whole module is regenerated, and plans the conformance pulses too. Under both, the choice is made inside the pulse, before anything is built on the module, and the pulse's report says what was chosen and why; those the person asks for with `conform` are written too; once chosen, a functional spec keeps them, and they are rewritten when it changes - see [who chooses, and when](regenerating.md#conformance-tests-in-the-work-loop). `false`: none written, and none of the existing ones run - until the conversation asks with `conform` | `false` |
|
|
129
129
|
| `conformance-budget` | under `conformance-tests: chosen` or `module`: how many of a module's functional specs may be chosen for conformance tests, beside those with acceptance tests - a count (`2`) or a share of its functional specs (`30%`, rounded up, at least one). Every choice for the module counts, whenever it was made; the chooser is told what is left, and can choose no more. Your own `conform` is not limited. A stack's `config.turri.<stack>.yaml` can set its own | no limit |
|
|
130
130
|
| `review` | `true` or `false`: whether the code and its unit tests - and the conformance tests - are reviewed once they pass: two reviews at most, the second weighed by the arbiter; off, a job lands once its tests pass - see [regenerating the code](regenerating.md#the-code-and-its-unit-tests-are-reviewed) | `false` |
|
|
131
|
+
| `mutation-testing` | `true` or `false`: whether the coding agent and the reviewer have `can_it_fail` - one change put in the code for one run of the unit testing script, to see that a test catches it; on a copy of the code, or in place and put back after the run (see [regenerating the code](regenerating.md#checking-its-own-work)). `turri regenerate --mutation-testing false` for one run | `true` |
|
|
131
132
|
| `rules-off` | a list of rule names - `integrations`, `concise-specs`, the files of `genome/rules/` without `.md` - left out of the conversation's prompt and every spec-writing agent's: a rule this project's own skills or AGENTS.md replace, such as one that says to probe a live API before any spec is written. The project's alone | none |
|
|
132
133
|
| `allow-to-stop-jobs` | `true` or `false`: whether turri stops a running job the spec has moved on from - a functional spec it regenerates changed, or a file one links was edited - rolls it back and regenerates the spec as it now is. `false`: the job runs to its end and lands, and what changed since is regenerated on top of it by the next job - see [regenerating the code](regenerating.md). Your own `halt` stops a job either way | `true` |
|
|
133
134
|
| `release-after-pulse` | `true` or `false`: whether every pulse that lands code releases it, in the chat, as its last stage - before the module's next pulse starts, whatever the chat is doing: an agent on the coding model looks for the project's release guidance as the chat does (what was passed to `release` this conversation, AGENTS.md, the project's skills) and, when it says to release after a build, does what it says - see [deploy](deploy.md#after-every-pulse). One release a pulse that lands; a release that fails is said in the pulse's report, and what it landed stays | `false` |
|
|
@@ -142,7 +143,7 @@ models: # each agent role's model, thinking and tur
|
|
|
142
143
|
| `toolchains` | folders of this machine an agent's commands may read beside the system's, the `PATH`'s and those the toolchain variables point at - a toolchain installed somewhere unusual (`[/srv/zig]`). A stack's add to the project's. See [the OS sandbox](sandbox.md#the-os-sandbox) | none |
|
|
143
144
|
| `turn-limit` | seconds each turn of an agent a job starts has, for every role without its own (`models:`); `0` for none. The config is the only place it is set. A turn past it ends at its next request to the model - see [regenerating the code](regenerating.md) | 120 |
|
|
144
145
|
| `models` | each agent role's own model, thinking and turn limit - see [models per role](#models-per-role) | every role on `coding-model`, the conversation's side on `harness-model` |
|
|
145
|
-
| `testing-scripts-run-on` | what the testing scripts run on - always on this machine, in your environment. `in-place`: the real build and tests folders, the script at its own path, from the project - so a script that finds a host codebase from its own path finds it. `copy`: a fresh copy of the code, staged in `plain_modules/.turri/scripts/`, with the script copied beside it
|
|
146
|
+
| `testing-scripts-run-on` | what the testing scripts run on - always on this machine, in your environment. `in-place`: the real build and tests folders, the script at its own path, from the project - so a script that finds a host codebase from its own path finds it. `copy`: a fresh copy of the code, staged in `plain_modules/.turri/scripts/`, with the script copied beside it. `can_it_fail` works on either: on a copy it changes the copy, in place the code itself for the one run, put back after it (see [the testing scripts](regenerating.md#the-testing-scripts)) | `in-place` |
|
|
146
147
|
|
|
147
148
|
Keys are written with dashes; underscores are read the same (`conformance_tests`). A key turri
|
|
148
149
|
does not know is ignored - another tool's `config.yaml`, read while it is the old file, may carry several - and so is a value of the
|
package/docs/headless.md
CHANGED
|
@@ -86,7 +86,10 @@ Useful options - `turri regenerate --help` lists all of them:
|
|
|
86
86
|
| `--judge-model <provider/id>` | `judge-model`: the judge and the test review; not given, the coding model |
|
|
87
87
|
| `--conformance-tests <all\|chosen\|module\|false>` | `conformance-tests`, with its values (`true` is `all`) |
|
|
88
88
|
| `--review <true\|false>` | `review`: whether the code and its tests are reviewed once they pass |
|
|
89
|
+
| `--mutation-testing <true\|false>` | `mutation-testing`: whether the coding agent and the reviewer have `can_it_fail` |
|
|
89
90
|
| `--stack <name>` | build with the stack's `config.turri.<name>.yaml` over `config.turri.yaml`; default, `TURRI_STACK`, else none |
|
|
91
|
+
| `--from-scratch` | delete the module's code and conformance tests (its lineage keeps them) and regenerate all of it |
|
|
92
|
+
| `--from-scratch-chain` | the same for every module of its requires chain, the base's included, built again from the bottom |
|
|
90
93
|
| `--start-over` | start over, unasked, a codebase built without a module it now requires - without a terminal, a run that needs it and lacks it stops |
|
|
91
94
|
| `--build-dir <dir>` | as the run ends, export the code there - see below |
|
|
92
95
|
| `--report <file.json>` | write [the run report](#the-run-report) there |
|
|
@@ -104,7 +107,8 @@ Conformance tests follow `conformance-tests:` in `config.turri.yaml`, or `--conf
|
|
|
104
107
|
The command exits `0` only when every module is complete: its code regenerated from the spec as it is
|
|
105
108
|
now, and its conformance tests written for what is built when they are on - no pulse failed, nothing
|
|
106
109
|
halted, nothing waiting for a start over. Anything else exits `1`, and the last lines say which
|
|
107
|
-
module is not complete, and why.
|
|
110
|
+
module is not complete, and why. A behaviour the spec leaves open that an agent had to decide is printed
|
|
111
|
+
as a `spec gap` under its pulse, with what was decided meanwhile. The log says, per functionality, what was built and whether its
|
|
108
112
|
tests passed.
|
|
109
113
|
|
|
110
114
|
| | |
|
|
@@ -150,6 +154,7 @@ changes meaning or goes; new fields may appear in the same version. Paths in `pu
|
|
|
150
154
|
"spec_file": "/work/app.plain", "project_dir": "/work", "build_dir": "/work/out", // build_dir: null without one
|
|
151
155
|
"conformance_tests": "all", // all | chosen | module | false
|
|
152
156
|
"review": false,
|
|
157
|
+
"mutation_testing": true,
|
|
153
158
|
"models": {
|
|
154
159
|
"harness": { "model": "…", "thinking": "medium" }, // the planner, the chooser
|
|
155
160
|
"coding": { "model": "…", "thinking": "low" },
|
|
@@ -165,7 +170,7 @@ changes meaning or goes; new fields may appear in the same version. Paths in `pu
|
|
|
165
170
|
"usage": {
|
|
166
171
|
"total": {
|
|
167
172
|
"input_tokens": 0, "output_tokens": 0, "cache_read_tokens": 0, "cache_write_tokens": 0, "cost_usd": 0,
|
|
168
|
-
"llm_calls": 0, "agent_turns": 0, "compactions": 0, "model_seconds": 0
|
|
173
|
+
"llm_calls": 0, "agent_turns": 0, "compactions": 0, "provider_retries": 0, "turns_stopped": 0, "model_seconds": 0
|
|
169
174
|
},
|
|
170
175
|
"in_pulses": { }, // the pulses' usage added up - the same fields
|
|
171
176
|
"outside_pulses": { }, // the planner, the conformance chooser, a failed pulse's diagnosis
|
|
@@ -191,6 +196,15 @@ changes meaning or goes; new fields may appear in the same version. Paths in `pu
|
|
|
191
196
|
],
|
|
192
197
|
"codebases": ["plain_modules/app/code"]
|
|
193
198
|
},
|
|
199
|
+
"spec_gaps": [{ // [] when no agent met one
|
|
200
|
+
"module": "app", "pulse": 3, "pulse_id": "2a058729", "landed": true,
|
|
201
|
+
"question": "What happens to a contact archived in HubSpot after it was synced?",
|
|
202
|
+
"assumption": "An archived contact is left as synced - asserted in sync.test.ts, archived contacts"
|
|
203
|
+
}],
|
|
204
|
+
"turn_incidents": [ // [] when none
|
|
205
|
+
{ "kind": "provider_retry", "pulse_id": "2a058729", "role": "coding", "model": "…", "error": "…: 529 overloaded", "attempt": 1, "of": 6, "wait_seconds": 15.3 },
|
|
206
|
+
{ "kind": "stopped", "pulse_id": "5c1e0b2f", "role": "conformance explorer", "model": "…", "reason": "10 submit_exploration calls failed in a row" }
|
|
207
|
+
],
|
|
194
208
|
"build_dir_export": { "exported": true, "dir": "/work/out", "module": "app", "commit": "8036b3b", "files": 23 },
|
|
195
209
|
"logs": { "jobs_dir": ".turri/jobs", "debug_dir": ".turri/debug", "sessions_dir": ".turri/sessions" }
|
|
196
210
|
}
|
|
@@ -209,6 +223,19 @@ calls; a role or model turri could not tell is `unknown`.
|
|
|
209
223
|
stopped, or did not pass - and everything it wrote was undone. A pulse that failed is tried once more
|
|
210
224
|
before it counts as failed; both tries are the one pulse.
|
|
211
225
|
|
|
226
|
+
**Spec gaps.** A behaviour the spec leaves open that an agent met and decided on its own - reported with
|
|
227
|
+
`report_spec_gap` (see [regenerating](regenerating.md)). In the chat they are put to you as the pulse ends; a
|
|
228
|
+
headless run has no one to ask, so they are listed here, in the order the pulses started, and printed under the
|
|
229
|
+
pulse that met them. `assumption` is what the agent decided meanwhile, also in the codebase's notes'
|
|
230
|
+
assumptions while its pulse is `landed`; a pulse rolled back takes it out of the notes, but the question still
|
|
231
|
+
stands. Settle the ones you care about in the spec and run again.
|
|
232
|
+
|
|
233
|
+
**Turn incidents.** Each time the model provider failed for a moment and turri waited it out before trying the
|
|
234
|
+
turn again, and each turn turri stopped itself - an agent going round in a circle, its calls failing again and again,
|
|
235
|
+
its time up - after which the run carried on. Both are printed as they happen, in yellow, under the pulse, and
|
|
236
|
+
counted in the usage as `provider_retries` and `turns_stopped`. Many of either point at the model, not the spec: a
|
|
237
|
+
provider at its limits, or a model too small for the role it was given.
|
|
238
|
+
|
|
212
239
|
**Completed functional specs** - the pass rate, the figure to compare runs by.
|
|
213
240
|
A functional spec is completed when the code record of the codebase the run delivers - the
|
|
214
241
|
furthest-built of the chain, the one `--build-dir` exports - as last committed, holds it as the spec has
|
|
@@ -227,7 +254,7 @@ and modules that are complete are skipped, so it picks up where it stopped - aft
|
|
|
227
254
|
provider outage, or a machine that went to sleep anyway. Whatever the stopped run left
|
|
228
255
|
half-written is undone first: each step starts from the module's last commit. A functionality whose spec has changed
|
|
229
256
|
since counts as not built, so editing the spec and re-running rebuilds what changed. `--from-scratch`
|
|
230
|
-
rebuilds
|
|
257
|
+
rebuilds the module; `--from-scratch-chain` rebuilds every module of its chain.
|
|
231
258
|
|
|
232
259
|
## Rebuilding one functionality
|
|
233
260
|
|