@outerlayer/cli 0.38.0-next.20261110133110 → 0.38.0-next.20261110212358
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/dist/build-info.json +1 -1
- package/dist/{chunk-QNHBJU74.js → chunk-KGHYNTF6.js} +2 -2
- package/dist/{chunk-2KGYMIVS.js → chunk-S56J4BMQ.js} +5 -5
- package/dist/{cli-VQNE6M77.js → cli-PS6GSOAE.js} +16 -6
- package/dist/{demo-voice-cmd-PGM5JPCQ.js → demo-voice-cmd-TQP3PZE2.js} +1 -1
- package/dist/{emit-demo-cmd-NOSQTOES.js → emit-demo-cmd-R3TIGMFX.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{work-proofs-cmd-27IPS3EY.js → work-proofs-cmd-7HSLB52S.js} +1 -1
- package/dist/{work-proofs-record-2RDDJ6CK.js → work-proofs-record-BE6UMZPH.js} +96 -16
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/SKILL.md +13 -4
- package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +10 -8
- package/skill-pack/maintained/outerlayer-build/references/evidence.md +33 -23
- package/skill-pack/maintained/outerlayer-build/references/release.md +2 -2
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"2026-11-
|
|
1
|
+
{"id":"2026-11-10T21:30:48.557Z","root":"/home/runner/work/outerlayer/outerlayer","pkg":"outerlayer"}
|
|
@@ -14,7 +14,7 @@ import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
|
|
|
14
14
|
import { ARTIFACT_MAX_BYTES, ARTIFACT_MAX_CAPTION_LENGTH, DEMO_RECORD_MEDIA_TYPE, ARTIFACT_MAX_REPLACES_TARGETS, DEMO_MANIFEST_LATEST_VERSION, DemoManifestSchema, ARTIFACT_KINDS } from './chunk-FXVHF6RX.js';
|
|
15
15
|
import { __commonJS, __require, __toESM } from './chunk-Z5GEFMRW.js';
|
|
16
16
|
import { createHash } from 'crypto';
|
|
17
|
-
import { mkdtempSync, writeFileSync, statSync,
|
|
17
|
+
import { readFileSync, mkdtempSync, writeFileSync, statSync, rmSync, mkdirSync, existsSync, copyFileSync, accessSync, constants, realpathSync, createReadStream, createWriteStream } from 'fs';
|
|
18
18
|
import { tmpdir } from 'os';
|
|
19
19
|
import { resolve, dirname, join, relative, sep, isAbsolute, delimiter, normalize } from 'path';
|
|
20
20
|
import { execFileSync, spawn } from 'child_process';
|
|
@@ -3706,4 +3706,4 @@ async function renderOnly(params) {
|
|
|
3706
3706
|
}
|
|
3707
3707
|
}
|
|
3708
3708
|
|
|
3709
|
-
export { EmitDemoError, realSpeaker, runEmitDemo };
|
|
3709
|
+
export { EmitDemoError, chapterPassed, planScreenshots, readStill, realSpeaker, runEmitDemo };
|
|
@@ -301,7 +301,7 @@ function classifyProofsAt(data, heads, listing = {}) {
|
|
|
301
301
|
return entries;
|
|
302
302
|
}
|
|
303
303
|
var STATE_LABEL = { current: "current", "out-of-date": "out of date", missing: "missing" };
|
|
304
|
-
function
|
|
304
|
+
function renderProofRow(e) {
|
|
305
305
|
const id = sanitizeTerminal(e.id);
|
|
306
306
|
if (e.state === "failed") {
|
|
307
307
|
return `${id} none failed ${sanitizeTerminal(e.commit)} The judge failed it: ${sanitizeTerminal(e.reason)} No test file has changed since. Add or change a test that proves ${id}.`;
|
|
@@ -314,7 +314,7 @@ function renderEntry(e) {
|
|
|
314
314
|
function render(entries, notes, json, tests) {
|
|
315
315
|
if (json) return JSON.stringify(entries);
|
|
316
316
|
const none = tests ? "No criterion declares a proof." : "No criterion declares a proof other than test.";
|
|
317
|
-
const lines = entries.length === 0 ? [none] : entries.map(
|
|
317
|
+
const lines = entries.length === 0 ? [none] : entries.map(renderProofRow);
|
|
318
318
|
if (notes.length > 0) lines.push(`The command could not check the judge's results: ${notes.map(sanitizeTerminal).join("; ")}.`);
|
|
319
319
|
return lines.join("\n");
|
|
320
320
|
}
|
|
@@ -371,8 +371,8 @@ async function runWorkProofs(opts) {
|
|
|
371
371
|
}
|
|
372
372
|
async function runWorkProofsCommand(opts) {
|
|
373
373
|
try {
|
|
374
|
-
if (opts.record) {
|
|
375
|
-
const { runWorkProofsRecord } = await import('./work-proofs-record-
|
|
374
|
+
if (opts.record || opts.check) {
|
|
375
|
+
const { runWorkProofsRecord } = await import('./work-proofs-record-BE6UMZPH.js');
|
|
376
376
|
const result2 = await runWorkProofsRecord(opts);
|
|
377
377
|
process.exitCode = result2.exitCode;
|
|
378
378
|
return;
|
|
@@ -390,4 +390,4 @@ async function runWorkProofsCommand(opts) {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
export { classifyProofs, classifyProofsAt, freshXmlFiles, joinResults, kindProblem, otherPullRequestHeads, ownPullRequest, proofsCommentBody, proofsCommentId, resolveProofsItem, runWorkProofs, runWorkProofsCommand, testFilesOf, testProofMode, testSelectors };
|
|
393
|
+
export { classifyProofs, classifyProofsAt, freshXmlFiles, joinResults, kindProblem, otherPullRequestHeads, ownPullRequest, proofsCommentBody, proofsCommentId, renderProofRow, resolveProofsItem, runWorkProofs, runWorkProofsCommand, testFilesOf, testProofMode, testSelectors };
|
|
@@ -4424,7 +4424,7 @@ its criterion, and the new record retires the old record. The id must be the ite
|
|
|
4424
4424
|
as \`work demo --item <n> --json\` prints it.
|
|
4425
4425
|
`
|
|
4426
4426
|
).action(async (manifest, opts) => {
|
|
4427
|
-
const { runEmitDemo, EmitDemoError } = await import('./emit-demo-cmd-
|
|
4427
|
+
const { runEmitDemo, EmitDemoError } = await import('./emit-demo-cmd-R3TIGMFX.js');
|
|
4428
4428
|
let item;
|
|
4429
4429
|
if (opts.item !== void 0) {
|
|
4430
4430
|
item = parseTrackerNumber(opts.item);
|
|
@@ -4467,7 +4467,7 @@ as \`work demo --item <n> --json\` prints it.
|
|
|
4467
4467
|
}
|
|
4468
4468
|
});
|
|
4469
4469
|
program2.command("demo-voice", { hidden: true }).description("Speak demo lines for a recorder: JSON lines in on stdin, out on stdout").action(async () => {
|
|
4470
|
-
const { runDemoVoice } = await import('./demo-voice-cmd-
|
|
4470
|
+
const { runDemoVoice } = await import('./demo-voice-cmd-TQP3PZE2.js');
|
|
4471
4471
|
await runDemoVoice();
|
|
4472
4472
|
});
|
|
4473
4473
|
const demoCmd = program2.command("demo").description("Record demos with the recorder this CLI carries");
|
|
@@ -5097,12 +5097,13 @@ live addition remains on it.
|
|
|
5097
5097
|
throw err;
|
|
5098
5098
|
}
|
|
5099
5099
|
});
|
|
5100
|
-
workCmd.command("proofs").description("List each proof
|
|
5100
|
+
workCmd.command("proofs").description("List each proof's state; --record records them, --check only runs their tests").option("--item <number>", "the item's number inside this factory (default: OUTERLAYER_WORK)").option("--json", "machine-readable JSON output").option("--record", "rerun the tests that name each stale proof and emit their output").option("--check", "run the same tests as --record and report each proof as passed or failed").option("--comment", "with --record, comment on the general thread with each proof not current").option("--pr <number>", "the item's own pull request, when it links several in this repository").option("--url <url>", "cloud base URL (or OUTERLAYER_URL / config)").addOption(apiKeyOption()).option("--app-id <id>", "factory id the key is bound to (or OUTERLAYER_APP_ID / config)").addHelpText(
|
|
5101
5101
|
"after",
|
|
5102
5102
|
`
|
|
5103
5103
|
${cliInvocation()} work proofs --item 7
|
|
5104
5104
|
${cliInvocation()} work proofs --json
|
|
5105
5105
|
${cliInvocation()} work proofs --record --comment
|
|
5106
|
+
${cliInvocation()} work proofs --check
|
|
5106
5107
|
|
|
5107
5108
|
A proof is current when it was recorded at this checkout's HEAD, or at the head of a
|
|
5108
5109
|
linked pull request that is open or merged. Run \`outerlayer sync\` first, so the
|
|
@@ -5119,14 +5120,23 @@ its files, then teardown. A test writes <criterion id>.<ext> under $OUTERLAYER_P
|
|
|
5119
5120
|
--record emits it at HEAD. For a test proof it runs the test files its newest results named,
|
|
5120
5121
|
and emits the JUnit XML the run wrote, bound to the same tests. It lists the proofs last. It
|
|
5121
5122
|
stops at once if a tracked file differs from HEAD.
|
|
5123
|
+
|
|
5124
|
+
--check runs the same setup, tests and teardown as --record. It reports each proof as passed or
|
|
5125
|
+
failed, and the rows the judge failed. It emits, syncs and posts nothing. A runner build uses it,
|
|
5126
|
+
because the host records the proofs at the pushed head. Exits 0 when every proof passed and, in
|
|
5127
|
+
a runner build, no row is failed.
|
|
5122
5128
|
`
|
|
5123
5129
|
).action(async (opts) => {
|
|
5130
|
+
if (opts.check && opts.record) {
|
|
5131
|
+
fail("--check and --record cannot be used together.");
|
|
5132
|
+
return;
|
|
5133
|
+
}
|
|
5124
5134
|
if (opts.comment && !opts.record) {
|
|
5125
5135
|
fail("--comment needs --record.");
|
|
5126
5136
|
return;
|
|
5127
5137
|
}
|
|
5128
|
-
if (opts.pr !== void 0 && !opts.record) {
|
|
5129
|
-
fail("--pr needs --record.");
|
|
5138
|
+
if (opts.pr !== void 0 && !opts.record && !opts.check) {
|
|
5139
|
+
fail("--pr needs --record or --check.");
|
|
5130
5140
|
return;
|
|
5131
5141
|
}
|
|
5132
5142
|
const pr = opts.pr === void 0 ? void 0 : parseTrackerNumber(opts.pr);
|
|
@@ -5134,7 +5144,7 @@ stops at once if a tracked file differs from HEAD.
|
|
|
5134
5144
|
fail(trackerNumberError("--pr", opts.pr));
|
|
5135
5145
|
return;
|
|
5136
5146
|
}
|
|
5137
|
-
const { runWorkProofsCommand } = await import('./work-proofs-cmd-
|
|
5147
|
+
const { runWorkProofsCommand } = await import('./work-proofs-cmd-7HSLB52S.js');
|
|
5138
5148
|
await runWorkProofsCommand({ ...opts, ...pr === void 0 ? {} : { pr } });
|
|
5139
5149
|
});
|
|
5140
5150
|
workCmd.command("list").description("List live work items for this factory").option("--stage <spec|build|review>", "filter by stage").option("--section <attention|waiting|flowing>", "filter by Queue section").option("--repo <owner/name>", "repository (default: the current checkout's remote)").option("--unclaimed", "only items with no live lease").option("--claimed", "only items with a live lease, held by a host or a local session").option("--startable", "only items a host can start: a build request, no open PR, no live lease").option("--needs <amend>", "only items with a thread waiting on an agent").option("--json", "machine-readable JSON output").option("--url <url>", "cloud base URL (or OUTERLAYER_URL / config)").addOption(apiKeyOption()).option("--app-id <id>", "factory id the key is bound to (or OUTERLAYER_APP_ID / config)").action(async (opts) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { realSpeaker } from './chunk-
|
|
3
|
+
import { realSpeaker } from './chunk-KGHYNTF6.js';
|
|
4
4
|
import './chunk-ER6KQCVJ.js';
|
|
5
5
|
import './chunk-VU5PPWIQ.js';
|
|
6
6
|
import './chunk-2PGI6RDE.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { EmitDemoError, realSpeaker, runEmitDemo } from './chunk-
|
|
3
|
+
export { EmitDemoError, realSpeaker, runEmitDemo } from './chunk-KGHYNTF6.js';
|
|
4
4
|
import './chunk-ER6KQCVJ.js';
|
|
5
5
|
import './chunk-VU5PPWIQ.js';
|
|
6
6
|
import './chunk-2PGI6RDE.js';
|
package/dist/index.js
CHANGED
|
@@ -25,5 +25,5 @@ var { runSubcommand } = await import('./agent-subcommand-5PNHUNZZ.js');
|
|
|
25
25
|
var launcherCode = await runSubcommand(argv);
|
|
26
26
|
if (launcherCode !== void 0) process.exit(launcherCode);
|
|
27
27
|
(await import('./hook-fast-ECQBMESE.js')).recordLinkExitFailure(argv);
|
|
28
|
-
var { runCli } = await import('./cli-
|
|
28
|
+
var { runCli } = await import('./cli-PS6GSOAE.js');
|
|
29
29
|
await runCli(process.argv);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { classifyProofs, classifyProofsAt, otherPullRequestHeads, resolveProofsItem, runWorkProofs, runWorkProofsCommand } from './chunk-
|
|
3
|
+
export { classifyProofs, classifyProofsAt, otherPullRequestHeads, renderProofRow, resolveProofsItem, runWorkProofs, runWorkProofsCommand } from './chunk-S56J4BMQ.js';
|
|
4
4
|
import './chunk-BCQFMAGM.js';
|
|
5
5
|
import './chunk-B4U5XI4F.js';
|
|
6
6
|
import './chunk-SBPMDO47.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { runWorkComment } from './chunk-YOAJLD2D.js';
|
|
4
|
-
import { resolveProofsItem, ownPullRequest, otherPullRequestHeads, testProofMode, classifyProofsAt, runWorkProofs, proofsCommentId, testFilesOf, freshXmlFiles, joinResults, testSelectors, kindProblem, proofsCommentBody } from './chunk-
|
|
5
|
-
import { runEmitDemo } from './chunk-
|
|
4
|
+
import { resolveProofsItem, ownPullRequest, otherPullRequestHeads, testProofMode, classifyProofsAt, runWorkProofs, proofsCommentId, testFilesOf, freshXmlFiles, joinResults, testSelectors, kindProblem, renderProofRow, proofsCommentBody } from './chunk-S56J4BMQ.js';
|
|
5
|
+
import { runEmitDemo, planScreenshots, chapterPassed, readStill } from './chunk-KGHYNTF6.js';
|
|
6
6
|
import { readNewestDemo } from './chunk-ER6KQCVJ.js';
|
|
7
7
|
import { runEmitArtifact } from './chunk-VU5PPWIQ.js';
|
|
8
8
|
import { runnerMatcher } from './chunk-BCQFMAGM.js';
|
|
@@ -46,18 +46,18 @@ import './chunk-ATEMEVFF.js';
|
|
|
46
46
|
import './chunk-RA3O54FC.js';
|
|
47
47
|
import './chunk-352DHUTP.js';
|
|
48
48
|
import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
|
|
49
|
-
import { ARTIFACT_MAX_CAPTION_LENGTH } from './chunk-FXVHF6RX.js';
|
|
49
|
+
import { ARTIFACT_MAX_CAPTION_LENGTH, DemoManifestSchema, ARTIFACT_MAX_BYTES } from './chunk-FXVHF6RX.js';
|
|
50
50
|
import './chunk-Z5GEFMRW.js';
|
|
51
51
|
import { spawnSync, spawn } from 'child_process';
|
|
52
|
-
import { mkdtempSync, writeFileSync, rmSync, openSync, closeSync, readdirSync
|
|
52
|
+
import { mkdtempSync, writeFileSync, rmSync, readFileSync, openSync, closeSync, readdirSync } from 'fs';
|
|
53
53
|
import { tmpdir } from 'os';
|
|
54
|
-
import { join } from 'path';
|
|
54
|
+
import { join, dirname, relative, resolve, sep, isAbsolute } from 'path';
|
|
55
55
|
|
|
56
56
|
createRequire(import.meta.url);
|
|
57
57
|
var runShell = (command, params) => {
|
|
58
58
|
const logPath = join(params.logDir, `${params.groups.length}-${Date.now()}.log`);
|
|
59
59
|
const fd = openSync(logPath, "w");
|
|
60
|
-
return new Promise((
|
|
60
|
+
return new Promise((resolve2) => {
|
|
61
61
|
const child = spawn("sh", ["-c", command], { cwd: params.cwd, env: params.env, detached: true, stdio: ["ignore", fd, fd] });
|
|
62
62
|
closeSync(fd);
|
|
63
63
|
if (child.pid !== void 0) params.groups.push(child.pid);
|
|
@@ -76,7 +76,7 @@ var runShell = (command, params) => {
|
|
|
76
76
|
text = readFileSync(logPath, "utf8");
|
|
77
77
|
} catch {
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
resolve2({ status, timedOut, tail: text.trimEnd().split("\n").slice(-8).join("\n") });
|
|
80
80
|
};
|
|
81
81
|
child.on("error", () => finish(null));
|
|
82
82
|
child.on("exit", (status) => finish(status));
|
|
@@ -141,6 +141,8 @@ var CONFIG_FILE = ".outerlayer-proofs.yaml";
|
|
|
141
141
|
var DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
142
142
|
var DEMO_PROOFS = /* @__PURE__ */ new Set(["screenshot", "video"]);
|
|
143
143
|
var NO_TEST = "no test at HEAD names this criterion";
|
|
144
|
+
var DemoRefused = class extends Error {
|
|
145
|
+
};
|
|
144
146
|
function changedTrackedFiles(root) {
|
|
145
147
|
const status = spawnSync("git", ["status", "--porcelain=v1", "-z", "--untracked-files=no"], { cwd: root, encoding: "utf8", maxBuffer: 16 * 1024 * 1024 });
|
|
146
148
|
if (status.error !== void 0 || status.status !== 0) {
|
|
@@ -219,7 +221,7 @@ async function runWorkProofsRecord(opts) {
|
|
|
219
221
|
const changed = changedTrackedFiles(root);
|
|
220
222
|
if (changed.length > 0) {
|
|
221
223
|
throw new WorkCommandError(
|
|
222
|
-
`the working copy differs from HEAD in ${changed.join(", ")}. Only the committed files run, so nothing was recorded. Commit or discard the change, then record again.`
|
|
224
|
+
opts.check ? `the working copy differs from HEAD in ${changed.join(", ")}. Only the committed files run, so nothing was checked. Commit or discard the change, then check again.` : `the working copy differs from HEAD in ${changed.join(", ")}. Only the committed files run, so nothing was recorded. Commit or discard the change, then record again.`
|
|
223
225
|
);
|
|
224
226
|
}
|
|
225
227
|
const fetchImpl = opts.fetchImpl ?? defaultFetch;
|
|
@@ -251,8 +253,9 @@ async function runWorkProofsRecord(opts) {
|
|
|
251
253
|
if (todo.length === 0) {
|
|
252
254
|
const closing2 = await runWorkProofs({ ...opts, item, env, quiet: true, checkoutHead: head, fetchImpl });
|
|
253
255
|
if (!opts.quiet) process.stdout.write(closing2.output + "\n");
|
|
254
|
-
return { exitCode: closing2.exitCode, output: closing2.output, emitted: [], notCurrent: [] };
|
|
256
|
+
return { exitCode: closing2.exitCode, output: closing2.output, emitted: [], notCurrent: [], passed: [] };
|
|
255
257
|
}
|
|
258
|
+
const check = opts.check === true;
|
|
256
259
|
const configText = showAtHead(root, CONFIG_FILE);
|
|
257
260
|
const parsed = configText === void 0 ? void 0 : parseProofsConfig(configText);
|
|
258
261
|
if (parsed === void 0 || !parsed.ok) {
|
|
@@ -268,6 +271,7 @@ async function runWorkProofsRecord(opts) {
|
|
|
268
271
|
const proofOf = (id) => declared.get(id).proof;
|
|
269
272
|
const reasons = /* @__PURE__ */ new Map();
|
|
270
273
|
const emitted = /* @__PURE__ */ new Map();
|
|
274
|
+
const passed = /* @__PURE__ */ new Set();
|
|
271
275
|
const testIds = todo.filter((id) => proofOf(id) === "test");
|
|
272
276
|
const testsOf = /* @__PURE__ */ new Map();
|
|
273
277
|
const matchesRunner = runnerMatcher(config.runners);
|
|
@@ -384,7 +388,7 @@ async function runWorkProofsRecord(opts) {
|
|
|
384
388
|
} catch {
|
|
385
389
|
}
|
|
386
390
|
if (left.length > 0) {
|
|
387
|
-
say(`The run changed tracked files: ${left.join(", ")}. The next --record records nothing until they match HEAD. Make setup, the tests and teardown leave them unchanged.`);
|
|
391
|
+
say(`The run changed tracked files: ${left.join(", ")}. The next ${check ? "--check checks" : "--record records"} nothing until they match HEAD. Make setup, the tests and teardown leave them unchanged.`);
|
|
388
392
|
}
|
|
389
393
|
}
|
|
390
394
|
await emitProofs();
|
|
@@ -396,24 +400,30 @@ async function runWorkProofsRecord(opts) {
|
|
|
396
400
|
const manifests = runs.flatMap((run) => findManifests(run.proofOut));
|
|
397
401
|
const chapters = /* @__PURE__ */ new Set();
|
|
398
402
|
if (manifests.length > 1) {
|
|
399
|
-
say(
|
|
403
|
+
say(`${check ? "Failed" : "Not recorded"}, the demo: the runners left ${manifests.length} demo manifests, so it is unclear which to store`);
|
|
400
404
|
} else if (manifests.length === 1) {
|
|
401
405
|
for (const id of chapterCriteria(manifests[0])) chapters.add(id);
|
|
402
|
-
|
|
406
|
+
if (check) checkDemoOrRefuse(manifests[0]);
|
|
407
|
+
else await recordDemo(manifests[0], chapters);
|
|
403
408
|
}
|
|
404
409
|
for (const [id, tests] of testsOf) {
|
|
405
410
|
const ran = runs.filter((run) => run.criteria.includes(id));
|
|
406
411
|
if (ran.length === 0) continue;
|
|
407
412
|
const fail = (reason) => {
|
|
408
413
|
reasons.set(id, reason);
|
|
409
|
-
say(`Not recorded, ${id}: ${reason}`);
|
|
414
|
+
if (!check) say(`Not recorded, ${id}: ${reason}`);
|
|
410
415
|
};
|
|
411
416
|
const joined = joinResults([...new Set(ran.flatMap((run) => run.results))], new Set(tests.items.map((test) => test.name)), root);
|
|
417
|
+
const failed = ran.find((run) => run.failure !== void 0)?.failure;
|
|
412
418
|
if (!joined.ok) {
|
|
413
|
-
const failed = ran.find((run) => run.failure !== void 0)?.failure;
|
|
414
419
|
fail(failed === void 0 ? joined.reason : `${failed}, and ${joined.reason}`);
|
|
415
420
|
continue;
|
|
416
421
|
}
|
|
422
|
+
if (check) {
|
|
423
|
+
if (failed === void 0) passed.add(id);
|
|
424
|
+
else reasons.set(id, failed);
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
417
427
|
const resultsFile = join(logDir, `${id}.xml`);
|
|
418
428
|
writeFileSync(resultsFile, joined.xml);
|
|
419
429
|
try {
|
|
@@ -453,7 +463,7 @@ async function runWorkProofsRecord(opts) {
|
|
|
453
463
|
if (emitted.has(id)) continue;
|
|
454
464
|
const fail = (reason) => {
|
|
455
465
|
reasons.set(id, reason);
|
|
456
|
-
say(`Not recorded, ${id}: ${reason}`);
|
|
466
|
+
if (!check) say(`Not recorded, ${id}: ${reason}`);
|
|
457
467
|
};
|
|
458
468
|
if (run.failure !== void 0) {
|
|
459
469
|
fail(`${run.failure}, so its files are not recorded`);
|
|
@@ -464,6 +474,10 @@ async function runWorkProofsRecord(opts) {
|
|
|
464
474
|
fail(problem);
|
|
465
475
|
continue;
|
|
466
476
|
}
|
|
477
|
+
if (check) {
|
|
478
|
+
passed.add(id);
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
467
481
|
try {
|
|
468
482
|
const caption = (declared.get(id).text ?? `Proof for ${id}`).slice(0, ARTIFACT_MAX_CAPTION_LENGTH);
|
|
469
483
|
const before = spooledCount;
|
|
@@ -487,6 +501,56 @@ async function runWorkProofsRecord(opts) {
|
|
|
487
501
|
}
|
|
488
502
|
}
|
|
489
503
|
}
|
|
504
|
+
function checkDemo(manifest) {
|
|
505
|
+
const demoCriteria = todo.filter((id) => DEMO_PROOFS.has(proofOf(id)));
|
|
506
|
+
let raw;
|
|
507
|
+
try {
|
|
508
|
+
raw = JSON.parse(readFileSync(manifest, "utf8"));
|
|
509
|
+
} catch {
|
|
510
|
+
raw = void 0;
|
|
511
|
+
}
|
|
512
|
+
const parsed2 = DemoManifestSchema.safeParse(raw);
|
|
513
|
+
if (!parsed2.success) {
|
|
514
|
+
const reason = "the demo manifest is not valid";
|
|
515
|
+
for (const id of demoCriteria) reasons.set(id, reason);
|
|
516
|
+
say(`Failed, the demo: ${reason}`);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
const manifestDir = dirname(manifest);
|
|
520
|
+
const frames = planScreenshots({ manifest: parsed2.data, proofs: new Map([...declared].map(([id, c]) => [id, c.proof])) });
|
|
521
|
+
const problems = parsed2.data.chapters.map((chapter, index) => {
|
|
522
|
+
if (!chapterPassed(chapter.checks)) return chapter.checks.length === 0 ? "its demo chapter ran no check" : "its demo chapter has a failed check";
|
|
523
|
+
const decision = frames[index];
|
|
524
|
+
if (chapter.criterionId === null || declared.get(chapter.criterionId)?.proof !== "screenshot" || decision === void 0) return void 0;
|
|
525
|
+
if ("skip" in decision) return `its demo chapter ${decision.skip}`;
|
|
526
|
+
const inside = relative(manifestDir, resolve(manifestDir, decision.bind.file));
|
|
527
|
+
if (inside === ".." || inside.startsWith(`..${sep}`) || isAbsolute(inside)) throw new DemoRefused(`the frame "${decision.bind.file}" is outside the manifest's folder`);
|
|
528
|
+
let bytes;
|
|
529
|
+
try {
|
|
530
|
+
bytes = readStill(manifestDir, decision.bind.file, decision.bind.sha256, "frame");
|
|
531
|
+
} catch (err) {
|
|
532
|
+
throw new DemoRefused(err instanceof Error ? err.message : String(err));
|
|
533
|
+
}
|
|
534
|
+
if (bytes.length > ARTIFACT_MAX_BYTES) return `its screenshot frame is over the ${ARTIFACT_MAX_BYTES / (1024 * 1024)} MiB limit`;
|
|
535
|
+
return void 0;
|
|
536
|
+
});
|
|
537
|
+
for (const id of demoCriteria) {
|
|
538
|
+
const indexes = parsed2.data.chapters.flatMap((chapter, index) => chapter.criterionId === id ? [index] : []);
|
|
539
|
+
if (indexes.length === 0) continue;
|
|
540
|
+
if (indexes.some((index) => problems[index] === void 0)) passed.add(id);
|
|
541
|
+
else reasons.set(id, problems[indexes[0]]);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
function checkDemoOrRefuse(manifest) {
|
|
545
|
+
try {
|
|
546
|
+
checkDemo(manifest);
|
|
547
|
+
} catch (err) {
|
|
548
|
+
if (!(err instanceof DemoRefused)) throw err;
|
|
549
|
+
const reason = `the demo would not be stored: ${err.message}`;
|
|
550
|
+
for (const id of todo.filter((id2) => DEMO_PROOFS.has(proofOf(id2)))) reasons.set(id, reason);
|
|
551
|
+
say(`Failed, the demo: ${err.message}`);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
490
554
|
async function recordDemo(manifest, chapters) {
|
|
491
555
|
const demoCriteria = todo.filter((id) => DEMO_PROOFS.has(proofOf(id)));
|
|
492
556
|
let replaces;
|
|
@@ -524,6 +588,21 @@ async function runWorkProofsRecord(opts) {
|
|
|
524
588
|
}
|
|
525
589
|
for (const failure of result.failures) say(`Demo check failed: ${oneLine(failure)}`);
|
|
526
590
|
}
|
|
591
|
+
if (check) return finishCheck();
|
|
592
|
+
async function finishCheck() {
|
|
593
|
+
const failedProofs = todo.filter((id) => !passed.has(id)).map((id) => ({ id, proof: proofOf(id), reason: reasons.get(id) ?? "it was not checked in this run" }));
|
|
594
|
+
for (const id of todo) {
|
|
595
|
+
if (passed.has(id)) say(`Passed ${id} (${proofOf(id)})`);
|
|
596
|
+
}
|
|
597
|
+
for (const proof of failedProofs) say(`Failed ${proof.id} (${proof.proof}): ${proof.reason}`);
|
|
598
|
+
const closing2 = await runWorkProofs({ ...opts, item, env, quiet: true, checkoutHead: head, fetchImpl });
|
|
599
|
+
const judged = closing2.entries.filter((entry) => entry.state === "failed");
|
|
600
|
+
const inRunnerBuild = env.OUTERLAYER_JOB_DIR !== void 0;
|
|
601
|
+
const output2 = [...lines, ...judged.map(renderProofRow)].join("\n");
|
|
602
|
+
if (!opts.quiet) process.stdout.write(output2 + "\n");
|
|
603
|
+
const ok = failedProofs.length === 0 && !(inRunnerBuild && judged.length > 0);
|
|
604
|
+
return { exitCode: ok ? 0 : 1, output: output2, emitted: [], notCurrent: failedProofs, passed: [...passed] };
|
|
605
|
+
}
|
|
527
606
|
if (spooledCount > 0) {
|
|
528
607
|
try {
|
|
529
608
|
const synced = await (opts.sync ?? (() => runSync({ ...common })))();
|
|
@@ -565,7 +644,8 @@ async function runWorkProofsRecord(opts) {
|
|
|
565
644
|
exitCode: closing.exitCode,
|
|
566
645
|
output,
|
|
567
646
|
emitted: [...emitted].map(([criterion, artifactId]) => ({ criterion, artifactId })),
|
|
568
|
-
notCurrent
|
|
647
|
+
notCurrent,
|
|
648
|
+
passed: []
|
|
569
649
|
};
|
|
570
650
|
}
|
|
571
651
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outerlayer/cli",
|
|
3
|
-
"version": "0.38.0-next.
|
|
3
|
+
"version": "0.38.0-next.20261110212358",
|
|
4
4
|
"description": "OuterLayer CLI — commands: init, claude, opencode, connect, doctor, login, logout, sync, daemon (alias: watch), emit, demo, findings, work, run, spec, runner, hooks, mcp, context. Capture and sync coding-agent sessions, and record proof of factory work.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Magu Studios, Inc.",
|
|
@@ -422,9 +422,11 @@ Run them in order.
|
|
|
422
422
|
then apply the team's changes for this phase. Read [references/evidence.md](references/evidence.md)
|
|
423
423
|
when the pull request opens, and run it. Write and commit the demo test and the
|
|
424
424
|
file-proof tests. Each test uses the id of the criterion it records a proof for. When the
|
|
425
|
-
repository has no `.outerlayer-proofs.yaml`, write and commit one.
|
|
426
|
-
|
|
427
|
-
|
|
425
|
+
repository has no `.outerlayer-proofs.yaml`, write and commit one. In a
|
|
426
|
+
runner build, check each proof with `outerlayer work proofs --check`, and
|
|
427
|
+
record none: the host records them at the pushed head. In a local session,
|
|
428
|
+
record each proof with `outerlayer work proofs --record` after the last
|
|
429
|
+
push. Check the proofs with `outerlayer work proofs`, as that file says.
|
|
428
430
|
|
|
429
431
|
Optional steps a team may turn off: the manual test and screenshots in the
|
|
430
432
|
Evidence phase, for a repository with no user interface.
|
|
@@ -441,7 +443,14 @@ is "The tests need STRIPE_KEY. Add it as a build variable." Keep it under 200
|
|
|
441
443
|
characters. The Work page and the Activity tab show your sentence as the reason
|
|
442
444
|
the item needs attention. Skip it when the build opens a pull request.
|
|
443
445
|
|
|
444
|
-
|
|
446
|
+
In a runner build, end the run only when `outerlayer work proofs --check`
|
|
447
|
+
exits 0 at the last commit, or when `build-reports/evidence.md` names each
|
|
448
|
+
proof that failed and the reason. Do not run `--record`: the host records each
|
|
449
|
+
proof at the pushed head. A row marked `failed` fails the check, and no reason
|
|
450
|
+
excuses it: add or change a test that proves the criterion, commit, and check
|
|
451
|
+
again.
|
|
452
|
+
|
|
453
|
+
In a local session, run the release command below last, after the pull request is open and the
|
|
445
454
|
evidence is emitted, and run no other tool call after it. Before it, run `outerlayer sync` and then
|
|
446
455
|
`outerlayer work proofs --item "$OUTERLAYER_WORK"`. End the run only when it
|
|
447
456
|
exits 0, or when `build-reports/evidence.md` names each proof it still lists
|
|
@@ -338,17 +338,19 @@ each proof that is not current, and runs them.
|
|
|
338
338
|
- A proof that no test can make stays without a test. Give the reason in
|
|
339
339
|
`build-reports/evidence.md`.
|
|
340
340
|
|
|
341
|
-
Commit the setup file and every test.
|
|
342
|
-
`outerlayer work proofs --
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
Commit the setup file and every test. In a runner build (`OUTERLAYER_JOB_DIR`
|
|
342
|
+
is set), run `outerlayer work proofs --check` from the committed checkout. In a
|
|
343
|
+
local session, run `outerlayer work proofs --record`. Each stops when a
|
|
344
|
+
tracked file differs from HEAD, and runs only what is committed at HEAD. Each
|
|
345
|
+
skips a proof that is current. `--record` emits each proof at HEAD. `--check`
|
|
346
|
+
emits nothing, because the host records each proof at the pushed head. Never emit by hand
|
|
345
347
|
a proof that a test can make, except a `test` proof the first time, as above. Always pass `--pr <number>` when the item links
|
|
346
348
|
more than one pull request in the repository.
|
|
347
349
|
|
|
348
|
-
The output names each proof that is still not current, with the
|
|
349
|
-
that test, commit it and
|
|
350
|
-
head moved. Each run starts the app again. The
|
|
351
|
-
the run's last head.
|
|
350
|
+
The output names each proof that failed or is still not current, with the
|
|
351
|
+
reason. Fix that test, commit it and run the same command again. Do not run it
|
|
352
|
+
again only because the head moved. Each run starts the app again. The
|
|
353
|
+
orchestrator runs it once more, at the run's last head.
|
|
352
354
|
|
|
353
355
|
Run `outerlayer sync`, then `outerlayer work proofs --item "$OUTERLAYER_WORK"`.
|
|
354
356
|
|
|
@@ -36,36 +36,46 @@ changed since: a row marked `failed`. The row gives the judge's reason. Add or
|
|
|
36
36
|
change a test that proves the criterion, and commit. The judge finds a
|
|
37
37
|
criterion's tests itself, so a test needs no comment that names the criterion.
|
|
38
38
|
|
|
39
|
-
A commit makes every proof out of date, and each
|
|
40
|
-
again. So
|
|
41
|
-
still needs, such as a fix or a merge of the base branch.
|
|
42
|
-
commit, then run `outerlayer work proofs --record` once. It records each
|
|
43
|
-
proof that is not current and skips the rest. If a commit lands after that,
|
|
44
|
-
record once more after it. The final report names that head and the proofs
|
|
45
|
-
recorded there.
|
|
39
|
+
A commit makes every proof out of date, and each run of the proof tests starts
|
|
40
|
+
the app again. So run them only at the run's last head. First make every
|
|
41
|
+
commit the run still needs, such as a fix or a merge of the base branch.
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
In a runner build (`OUTERLAYER_JOB_DIR` is set), do not record a proof. Run
|
|
44
|
+
`outerlayer work proofs --check` once, at the last commit. It runs the same
|
|
45
|
+
setup, tests and teardown as `--record`. It reports each proof as passed or
|
|
46
|
+
failed, and emits nothing. After the run ends, the host records each proof
|
|
47
|
+
once, at the pushed head. A proof that fails the check fails there too. Fix
|
|
48
|
+
its test, commit, and check again. The run ends when the check exits 0, or
|
|
49
|
+
when `build-reports/evidence.md` names each proof that failed and the reason.
|
|
50
|
+
|
|
51
|
+
In a local session, push the last commit, then run
|
|
52
|
+
`outerlayer work proofs --record` once. It records each proof that is not
|
|
53
|
+
current and skips the rest. If a commit lands after that, record once more
|
|
54
|
+
after it. The final report names that head and the proofs recorded there.
|
|
55
|
+
|
|
56
|
+
Run `--check` and `--record` in the foreground with the longest timeout. Never
|
|
57
|
+
cut their output with `| tail`. The lines before the list say why a proof
|
|
58
|
+
failed or was not recorded.
|
|
53
59
|
|
|
54
60
|
A criterion that declares `proof: test` is recorded the first time as the
|
|
55
61
|
Evidence brief in [agent-briefs.md](agent-briefs.md) says, unless the policy
|
|
56
62
|
file sets `criteria.test_proof: ci`. After that, `--record` runs the same tests
|
|
57
|
-
again and records their results, as the host does at the final commit.
|
|
58
|
-
do so only when the results name each
|
|
59
|
-
`.outerlayer-proofs.yaml` matches that file. A
|
|
60
|
-
JUnit reporter names the file by default.
|
|
61
|
-
`addFileAttribute` option. Otherwise, give
|
|
62
|
-
`--test "<test name>=<path>"`. The list command names a proof
|
|
63
|
+
again and records their results, as the host does at the final commit.
|
|
64
|
+
`--check` runs the same tests. Both can do so only when the results name each
|
|
65
|
+
test's file, and a runner in `.outerlayer-proofs.yaml` matches that file. A
|
|
66
|
+
line is not needed. Vitest's JUnit reporter names the file by default.
|
|
67
|
+
jest-junit names it only with its `addFileAttribute` option. Otherwise, give
|
|
68
|
+
the file with `--test "<test name>=<path>"`. The list command names a proof
|
|
63
69
|
the host cannot record again, and why. Fix the proofs file before the run
|
|
64
|
-
ends.
|
|
70
|
+
ends. In a local session, the final report names each test proof with its
|
|
71
|
+
artifact. In a runner build, it names each test proof that passed the check.
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
as out of date or missing goes in
|
|
68
|
-
|
|
73
|
+
In a local session, run the list command once more before the run ends. A
|
|
74
|
+
criterion still listed as out of date or missing goes in
|
|
75
|
+
`build-reports/evidence.md` with the reason. In a runner build, the list shows
|
|
76
|
+
each proof as out of date or missing until the host records it. There, a
|
|
77
|
+
proof that fails `--check` goes in `build-reports/evidence.md` with the
|
|
78
|
+
reason. A written reason never excuses a `failed` row. Fix it first. Never
|
|
69
79
|
drive the browser yourself.
|
|
70
80
|
|
|
71
81
|
Re-read the pull request's evidence comment. Resolve or escalate every row that
|
|
@@ -80,8 +80,8 @@ Then run `outerlayer sync`. List every unsatisfied criterion in the final
|
|
|
80
80
|
report. A criterion that declares a proof form such as a screenshot or video is
|
|
81
81
|
proven only by an artifact bound to it on the pull request. The judge cannot
|
|
82
82
|
see that. Run `outerlayer work proofs --item "$OUTERLAYER_WORK"`, as the
|
|
83
|
-
evidence phase says,
|
|
84
|
-
missing.
|
|
83
|
+
evidence phase says. In a local session, record again any proof it lists as
|
|
84
|
+
out of date or missing. In a runner build, the host records them.
|
|
85
85
|
|
|
86
86
|
## The criteria verdict
|
|
87
87
|
|