plumbbob 0.9.2 → 0.9.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/.claude-plugin/plugin.json +1 -1
- package/README.md +15 -13
- package/dist/cli-core.js +298 -24
- package/dist/lib/check.js +46 -13
- package/dist/lib/intent.js +1 -1
- package/dist/lib/latch.js +3 -3
- package/dist/lib/reentry.js +70 -0
- package/dist/verbs/agent.js +5 -4
- package/dist/verbs/check.js +6 -2
- package/dist/verbs/doctor.js +4 -4
- package/dist/verbs/finish.js +1 -1
- package/dist/verbs/recover.js +297 -0
- package/dist/verbs/revert.js +2 -2
- package/dist/verbs/spike.js +8 -2
- package/hooks/post-edit.sh +4 -4
- package/hooks/pre-bash-commit.sh +3 -3
- package/node_modules/checkride/.claude-plugin/plugin.json +11 -0
- package/node_modules/checkride/CHANGELOG.md +1003 -0
- package/node_modules/checkride/LICENSE +201 -21
- package/node_modules/checkride/README.md +171 -30
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.d.ts +15 -0
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.d.ts.map +1 -0
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.js +17 -0
- package/node_modules/checkride/dist/__tests__/fixtures/released-stanzas.js.map +1 -0
- package/node_modules/checkride/dist/adapters.d.ts +18 -6
- package/node_modules/checkride/dist/adapters.d.ts.map +1 -1
- package/node_modules/checkride/dist/adapters.js +42 -23
- package/node_modules/checkride/dist/adapters.js.map +1 -1
- package/node_modules/checkride/dist/agent-setup/claude.d.ts +88 -0
- package/node_modules/checkride/dist/agent-setup/claude.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/claude.js +305 -0
- package/node_modules/checkride/dist/agent-setup/claude.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/command.d.ts +43 -0
- package/node_modules/checkride/dist/agent-setup/command.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/command.js +77 -0
- package/node_modules/checkride/dist/agent-setup/command.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/cursor.d.ts +61 -0
- package/node_modules/checkride/dist/agent-setup/cursor.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/cursor.js +189 -0
- package/node_modules/checkride/dist/agent-setup/cursor.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/files.d.ts +50 -0
- package/node_modules/checkride/dist/agent-setup/files.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/files.js +80 -0
- package/node_modules/checkride/dist/agent-setup/files.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/harness.d.ts +101 -0
- package/node_modules/checkride/dist/agent-setup/harness.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/harness.js +84 -0
- package/node_modules/checkride/dist/agent-setup/harness.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/hook.d.ts +45 -52
- package/node_modules/checkride/dist/agent-setup/hook.d.ts.map +1 -1
- package/node_modules/checkride/dist/agent-setup/hook.js +64 -95
- package/node_modules/checkride/dist/agent-setup/hook.js.map +1 -1
- package/node_modules/checkride/dist/agent-setup/index.d.ts +10 -4
- package/node_modules/checkride/dist/agent-setup/index.d.ts.map +1 -1
- package/node_modules/checkride/dist/agent-setup/index.js +9 -4
- package/node_modules/checkride/dist/agent-setup/index.js.map +1 -1
- package/node_modules/checkride/dist/agent-setup/scripts.d.ts +58 -0
- package/node_modules/checkride/dist/agent-setup/scripts.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/scripts.js +299 -0
- package/node_modules/checkride/dist/agent-setup/scripts.js.map +1 -0
- package/node_modules/checkride/dist/agent-setup/skills.d.ts +31 -0
- package/node_modules/checkride/dist/agent-setup/skills.d.ts.map +1 -0
- package/node_modules/checkride/dist/agent-setup/skills.js +56 -0
- package/node_modules/checkride/dist/agent-setup/skills.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/configured.d.ts +30 -0
- package/node_modules/checkride/dist/artifacts/configured.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/configured.js +45 -0
- package/node_modules/checkride/dist/artifacts/configured.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/format.d.ts +33 -0
- package/node_modules/checkride/dist/artifacts/format.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/format.js +56 -0
- package/node_modules/checkride/dist/artifacts/format.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/freshness.d.ts +32 -0
- package/node_modules/checkride/dist/artifacts/freshness.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/freshness.js +37 -0
- package/node_modules/checkride/dist/artifacts/freshness.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/index.d.ts +22 -0
- package/node_modules/checkride/dist/artifacts/index.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/index.js +19 -0
- package/node_modules/checkride/dist/artifacts/index.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/json.d.ts +31 -0
- package/node_modules/checkride/dist/artifacts/json.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/json.js +47 -0
- package/node_modules/checkride/dist/artifacts/json.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/raw.d.ts +60 -0
- package/node_modules/checkride/dist/artifacts/raw.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/raw.js +91 -0
- package/node_modules/checkride/dist/artifacts/raw.js.map +1 -0
- package/node_modules/checkride/dist/artifacts/summary.d.ts +69 -0
- package/node_modules/checkride/dist/artifacts/summary.d.ts.map +1 -0
- package/node_modules/checkride/dist/artifacts/summary.js +108 -0
- package/node_modules/checkride/dist/artifacts/summary.js.map +1 -0
- package/node_modules/checkride/dist/atomic.d.ts +16 -1
- package/node_modules/checkride/dist/atomic.d.ts.map +1 -1
- package/node_modules/checkride/dist/atomic.js +25 -3
- package/node_modules/checkride/dist/atomic.js.map +1 -1
- package/node_modules/checkride/dist/baseline/fallow.d.ts +9 -5
- package/node_modules/checkride/dist/baseline/fallow.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/fallow.js +161 -58
- package/node_modules/checkride/dist/baseline/fallow.js.map +1 -1
- package/node_modules/checkride/dist/baseline/fingerprint.d.ts +7 -7
- package/node_modules/checkride/dist/baseline/fingerprint.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/fingerprint.js +16 -19
- package/node_modules/checkride/dist/baseline/fingerprint.js.map +1 -1
- package/node_modules/checkride/dist/baseline/index.d.ts +4 -4
- package/node_modules/checkride/dist/baseline/index.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/index.js +4 -4
- package/node_modules/checkride/dist/baseline/index.js.map +1 -1
- package/node_modules/checkride/dist/baseline/store.d.ts +12 -4
- package/node_modules/checkride/dist/baseline/store.d.ts.map +1 -1
- package/node_modules/checkride/dist/baseline/store.js +16 -9
- package/node_modules/checkride/dist/baseline/store.js.map +1 -1
- package/node_modules/checkride/dist/baseline-command.d.ts +5 -5
- package/node_modules/checkride/dist/baseline-command.js +7 -7
- package/node_modules/checkride/dist/baseline-command.js.map +1 -1
- package/node_modules/checkride/dist/cli.d.ts +17 -4
- package/node_modules/checkride/dist/cli.d.ts.map +1 -1
- package/node_modules/checkride/dist/cli.js +259 -18
- package/node_modules/checkride/dist/cli.js.map +1 -1
- package/node_modules/checkride/dist/config.d.ts +84 -8
- package/node_modules/checkride/dist/config.d.ts.map +1 -1
- package/node_modules/checkride/dist/config.js +122 -18
- package/node_modules/checkride/dist/config.js.map +1 -1
- package/node_modules/checkride/dist/digest/digest.d.ts +5 -5
- package/node_modules/checkride/dist/digest/digest.js +5 -5
- package/node_modules/checkride/dist/digest/index.d.ts +2 -2
- package/node_modules/checkride/dist/digest/index.js +2 -2
- package/node_modules/checkride/dist/doctor.d.ts +25 -6
- package/node_modules/checkride/dist/doctor.d.ts.map +1 -1
- package/node_modules/checkride/dist/doctor.js +193 -27
- package/node_modules/checkride/dist/doctor.js.map +1 -1
- package/node_modules/checkride/dist/gate.d.ts +135 -0
- package/node_modules/checkride/dist/gate.d.ts.map +1 -0
- package/node_modules/checkride/dist/gate.js +490 -0
- package/node_modules/checkride/dist/gate.js.map +1 -0
- package/node_modules/checkride/dist/init.d.ts +72 -12
- package/node_modules/checkride/dist/init.d.ts.map +1 -1
- package/node_modules/checkride/dist/init.js +324 -81
- package/node_modules/checkride/dist/init.js.map +1 -1
- package/node_modules/checkride/dist/json.d.ts +21 -0
- package/node_modules/checkride/dist/json.d.ts.map +1 -0
- package/node_modules/checkride/dist/json.js +21 -0
- package/node_modules/checkride/dist/json.js.map +1 -0
- package/node_modules/checkride/dist/links.d.ts +31 -5
- package/node_modules/checkride/dist/links.d.ts.map +1 -1
- package/node_modules/checkride/dist/links.js +141 -32
- package/node_modules/checkride/dist/links.js.map +1 -1
- package/node_modules/checkride/dist/node-pin.d.ts +129 -0
- package/node_modules/checkride/dist/node-pin.d.ts.map +1 -0
- package/node_modules/checkride/dist/node-pin.js +211 -0
- package/node_modules/checkride/dist/node-pin.js.map +1 -0
- package/node_modules/checkride/dist/orchestrator.d.ts +40 -10
- package/node_modules/checkride/dist/orchestrator.d.ts.map +1 -1
- package/node_modules/checkride/dist/orchestrator.js +196 -102
- package/node_modules/checkride/dist/orchestrator.js.map +1 -1
- package/node_modules/checkride/dist/pack.d.ts +8 -9
- package/node_modules/checkride/dist/pack.d.ts.map +1 -1
- package/node_modules/checkride/dist/pack.js +53 -17
- package/node_modules/checkride/dist/pack.js.map +1 -1
- package/node_modules/checkride/dist/pm/detect.d.ts +6 -1
- package/node_modules/checkride/dist/pm/detect.d.ts.map +1 -1
- package/node_modules/checkride/dist/pm/detect.js +6 -1
- package/node_modules/checkride/dist/pm/detect.js.map +1 -1
- package/node_modules/checkride/dist/pm/index.d.ts +6 -2
- package/node_modules/checkride/dist/pm/index.d.ts.map +1 -1
- package/node_modules/checkride/dist/pm/index.js +6 -2
- package/node_modules/checkride/dist/pm/index.js.map +1 -1
- package/node_modules/checkride/dist/pm/launch.d.ts +51 -0
- package/node_modules/checkride/dist/pm/launch.d.ts.map +1 -0
- package/node_modules/checkride/dist/pm/launch.js +92 -0
- package/node_modules/checkride/dist/pm/launch.js.map +1 -0
- package/node_modules/checkride/dist/pm/tools.d.ts +73 -0
- package/node_modules/checkride/dist/pm/tools.d.ts.map +1 -0
- package/node_modules/checkride/dist/pm/tools.js +124 -0
- package/node_modules/checkride/dist/pm/tools.js.map +1 -0
- package/node_modules/checkride/dist/pm/translate.d.ts +35 -9
- package/node_modules/checkride/dist/pm/translate.d.ts.map +1 -1
- package/node_modules/checkride/dist/pm/translate.js +78 -18
- package/node_modules/checkride/dist/pm/translate.js.map +1 -1
- package/node_modules/checkride/dist/proc.d.ts +30 -0
- package/node_modules/checkride/dist/proc.d.ts.map +1 -0
- package/node_modules/checkride/dist/proc.js +42 -0
- package/node_modules/checkride/dist/proc.js.map +1 -0
- package/node_modules/checkride/dist/qa/cli.d.ts +20 -0
- package/node_modules/checkride/dist/qa/cli.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/cli.js +24 -0
- package/node_modules/checkride/dist/qa/cli.js.map +1 -0
- package/node_modules/checkride/dist/qa/dead.d.ts +39 -0
- package/node_modules/checkride/dist/qa/dead.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/dead.js +88 -0
- package/node_modules/checkride/dist/qa/dead.js.map +1 -0
- package/node_modules/checkride/dist/qa/dupes.d.ts +45 -0
- package/node_modules/checkride/dist/qa/dupes.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/dupes.js +62 -0
- package/node_modules/checkride/dist/qa/dupes.js.map +1 -0
- package/node_modules/checkride/dist/qa/health.d.ts +85 -0
- package/node_modules/checkride/dist/qa/health.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/health.js +109 -0
- package/node_modules/checkride/dist/qa/health.js.map +1 -0
- package/node_modules/checkride/dist/qa/index.d.ts +23 -0
- package/node_modules/checkride/dist/qa/index.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/index.js +22 -0
- package/node_modules/checkride/dist/qa/index.js.map +1 -0
- package/node_modules/checkride/dist/qa/mutation.d.ts +80 -0
- package/node_modules/checkride/dist/qa/mutation.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/mutation.js +195 -0
- package/node_modules/checkride/dist/qa/mutation.js.map +1 -0
- package/node_modules/checkride/dist/qa/qa.d.ts +71 -0
- package/node_modules/checkride/dist/qa/qa.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/qa.js +158 -0
- package/node_modules/checkride/dist/qa/qa.js.map +1 -0
- package/node_modules/checkride/dist/qa/read.d.ts +40 -0
- package/node_modules/checkride/dist/qa/read.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/read.js +47 -0
- package/node_modules/checkride/dist/qa/read.js.map +1 -0
- package/node_modules/checkride/dist/qa/render.d.ts +26 -0
- package/node_modules/checkride/dist/qa/render.d.ts.map +1 -0
- package/node_modules/checkride/dist/qa/render.js +310 -0
- package/node_modules/checkride/dist/qa/render.js.map +1 -0
- package/node_modules/checkride/dist/security.d.ts +45 -0
- package/node_modules/checkride/dist/security.d.ts.map +1 -0
- package/node_modules/checkride/dist/security.js +86 -0
- package/node_modules/checkride/dist/security.js.map +1 -0
- package/node_modules/checkride/dist/smoke.d.ts +5 -5
- package/node_modules/checkride/dist/smoke.js +5 -5
- package/node_modules/checkride/dist/snippets.d.ts +26 -29
- package/node_modules/checkride/dist/snippets.d.ts.map +1 -1
- package/node_modules/checkride/dist/snippets.js +26 -30
- package/node_modules/checkride/dist/snippets.js.map +1 -1
- package/node_modules/checkride/dist/tool-json.d.ts +33 -0
- package/node_modules/checkride/dist/tool-json.d.ts.map +1 -0
- package/node_modules/checkride/dist/tool-json.js +58 -0
- package/node_modules/checkride/dist/tool-json.js.map +1 -0
- package/node_modules/checkride/dist/triage/cli.d.ts +21 -0
- package/node_modules/checkride/dist/triage/cli.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/cli.js +26 -0
- package/node_modules/checkride/dist/triage/cli.js.map +1 -0
- package/node_modules/checkride/dist/triage/doctor-fold.d.ts +51 -0
- package/node_modules/checkride/dist/triage/doctor-fold.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/doctor-fold.js +88 -0
- package/node_modules/checkride/dist/triage/doctor-fold.js.map +1 -0
- package/node_modules/checkride/dist/triage/env.d.ts +54 -0
- package/node_modules/checkride/dist/triage/env.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/env.js +81 -0
- package/node_modules/checkride/dist/triage/env.js.map +1 -0
- package/node_modules/checkride/dist/triage/gate.d.ts +61 -0
- package/node_modules/checkride/dist/triage/gate.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/gate.js +121 -0
- package/node_modules/checkride/dist/triage/gate.js.map +1 -0
- package/node_modules/checkride/dist/triage/index.d.ts +22 -0
- package/node_modules/checkride/dist/triage/index.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/index.js +20 -0
- package/node_modules/checkride/dist/triage/index.js.map +1 -0
- package/node_modules/checkride/dist/triage/render.d.ts +19 -0
- package/node_modules/checkride/dist/triage/render.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/render.js +419 -0
- package/node_modules/checkride/dist/triage/render.js.map +1 -0
- package/node_modules/checkride/dist/triage/triage.d.ts +83 -0
- package/node_modules/checkride/dist/triage/triage.d.ts.map +1 -0
- package/node_modules/checkride/dist/triage/triage.js +131 -0
- package/node_modules/checkride/dist/triage/triage.js.map +1 -0
- package/node_modules/checkride/package.json +17 -15
- package/node_modules/checkride/schema/checkride.config.schema.json +62 -5
- package/node_modules/checkride/schema/checkride.summary.schema.json +1 -1
- package/node_modules/checkride/skills/check/SKILL.md +257 -0
- package/node_modules/checkride/skills/qa/SKILL.md +231 -0
- package/node_modules/checkride/templates/shared/cspell.json +1 -0
- package/node_modules/checkride/templates/shared/oxlintrc.json +1 -1
- package/package.json +2 -2
- package/skills/build/SKILL.md +23 -19
- package/skills/finish/SKILL.md +3 -1
- package/skills/harvest/SKILL.md +2 -1
- package/skills/plan/SKILL.md +8 -7
- package/skills/recover/SKILL.md +28 -0
- package/skills/refine/SKILL.md +5 -4
- package/skills/spike/SKILL.md +1 -1
- package/skills/step/SKILL.md +4 -4
- package/skills/verify/SKILL.md +19 -14
- package/templates/intent.md +8 -7
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering a {@link TriageReport} as Markdown — what the skill actually reads.
|
|
3
|
+
*
|
|
4
|
+
* The output is an *index with a verdict*, never an excerpt of tool output. It
|
|
5
|
+
* opens with provenance (what ran, how it ended, whether the summary on disk
|
|
6
|
+
* belongs to that run, and what it covered) because every wrong triage answer
|
|
7
|
+
* this reader exists to prevent comes from skipping straight to the findings.
|
|
8
|
+
* Slot rows carry sizes and paths; the bytes stay on disk. The only raw text
|
|
9
|
+
* that ever appears is a capped tail of the gate's own output, and only on the
|
|
10
|
+
* two branches where no slot can explain the failure: the harness broke, or the
|
|
11
|
+
* gate went red before checkride ran at all.
|
|
12
|
+
*
|
|
13
|
+
* Sections that have nothing to say render empty and drop out, so a clean run
|
|
14
|
+
* is short and a pathological one is still bounded.
|
|
15
|
+
*/
|
|
16
|
+
import { formatBytes, formatDuration, tail } from '../artifacts/index.js';
|
|
17
|
+
/** Cap per captured stream: enough to see the crash, never a log dump. */
|
|
18
|
+
const GATE_TAIL_LINES = 25;
|
|
19
|
+
/** Half the single-stream budget, so rendering both streams costs no more. */
|
|
20
|
+
const GATE_TAIL_BYTES = 2000;
|
|
21
|
+
const NOT_READ_NOTE = 'Not read: the contents of any `.check/` artifact. This reader reports sizes and ' +
|
|
22
|
+
'locations only — open a listed file when its slot is the one you are working on.';
|
|
23
|
+
function heading(title, body) {
|
|
24
|
+
return `## ${title}\n\n${body}\n`;
|
|
25
|
+
}
|
|
26
|
+
function bullets(items) {
|
|
27
|
+
return items.map((item) => `- ${item}`).join('\n');
|
|
28
|
+
}
|
|
29
|
+
/** `fresh`, `stale 4.1d`, or `?` when the run's timestamp could not be parsed. */
|
|
30
|
+
function ageCell(freshness) {
|
|
31
|
+
if (freshness.state === 'stale')
|
|
32
|
+
return `stale ${formatDuration(freshness.ageMs ?? 0)}`;
|
|
33
|
+
return freshness.state === 'fresh' ? 'fresh' : '?';
|
|
34
|
+
}
|
|
35
|
+
function exitClause(gate) {
|
|
36
|
+
if (gate.spawnError !== null)
|
|
37
|
+
return `could not start (${gate.spawnError})`;
|
|
38
|
+
if (gate.exitCode !== null)
|
|
39
|
+
return `exit ${gate.exitCode}`;
|
|
40
|
+
return gate.signal === null ? 'ended with no exit code' : `killed by ${gate.signal}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* How the summary on disk relates to the run just made — the provenance clause.
|
|
44
|
+
* Named by its repo-relative path, which is how an agent would open it; the
|
|
45
|
+
* absolute path is in the report model for anyone who needs it.
|
|
46
|
+
*/
|
|
47
|
+
function provenance(report) {
|
|
48
|
+
const { summary, fromThisRun } = report;
|
|
49
|
+
const at = '`.check/summary.json`';
|
|
50
|
+
if (summary.state === 'missing')
|
|
51
|
+
return `${at} — absent; this run wrote no summary`;
|
|
52
|
+
if (summary.state === 'unreadable')
|
|
53
|
+
return `${at} — unreadable (${summary.detail})`;
|
|
54
|
+
if (summary.state === 'foreign') {
|
|
55
|
+
return `${at} — no \`schema_version\` field, so it was NOT written by checkride; this repo's gate is something else`;
|
|
56
|
+
}
|
|
57
|
+
if (summary.state === 'schema-mismatch') {
|
|
58
|
+
return `${at} — \`schema_version\` is ${JSON.stringify(summary.found)}, not 1; STOP`;
|
|
59
|
+
}
|
|
60
|
+
const written = fromThisRun === false ? 'left by an EARLIER run' : 'written by this run';
|
|
61
|
+
return `${at} — \`schema_version\` 1, ${written}, ${formatDuration(summary.summary.total_duration_ms)}`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether the slot table below came from a summary this reader actually parsed.
|
|
65
|
+
* Everything downstream that counts slots has to ask: with no parse, `rows` is
|
|
66
|
+
* empty because nothing was *read*, and rendering `0` from it would report a
|
|
67
|
+
* measurement that was never taken.
|
|
68
|
+
*/
|
|
69
|
+
function summaryParsed(report) {
|
|
70
|
+
return report.summary.state === 'ok';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What the run verified — or, with no parseable summary, an explicit `unknown`.
|
|
74
|
+
* Zero is a measurement; the difference between "no slot was skipped" and "we
|
|
75
|
+
* cannot say whether any slot was skipped" is the whole point of this line.
|
|
76
|
+
*/
|
|
77
|
+
function coveredLine(report) {
|
|
78
|
+
if (!summaryParsed(report)) {
|
|
79
|
+
return 'covered: unknown — no summary this reader could parse, so ran, skipped and baselined counts are all unknown, NOT zero';
|
|
80
|
+
}
|
|
81
|
+
const { coverage } = report;
|
|
82
|
+
return `covered: ${coverage.ran.length} slot(s) ran, ${coverage.skipped.length} skipped`;
|
|
83
|
+
}
|
|
84
|
+
function renderHeader(report) {
|
|
85
|
+
const { gate } = report;
|
|
86
|
+
const lines = [
|
|
87
|
+
`gate: \`${gate.command}\` → ${exitClause(gate)}${gate.verdict === 'not-run' ? '' : ` (${formatDuration(gate.durationMs)})`}`,
|
|
88
|
+
gate.script === null ? 'script: none — this repo has no `check` script' : `script: \`${gate.script}\``,
|
|
89
|
+
`summary: ${provenance(report)}`,
|
|
90
|
+
coveredLine(report),
|
|
91
|
+
];
|
|
92
|
+
return `${bullets(lines)}\n`;
|
|
93
|
+
}
|
|
94
|
+
/** The verdict sentence, keyed by how the gate ended. */
|
|
95
|
+
const VERDICTS = {
|
|
96
|
+
green: greenVerdict,
|
|
97
|
+
red: redVerdict,
|
|
98
|
+
'could-not-start': (r) => `**the gate could not start** — ${r.gate.refusal ?? 'the package manager refused to run the script'}. ` +
|
|
99
|
+
'The exit code is 1, the same code a red pipeline uses, but **no check ran and no artifact was ' +
|
|
100
|
+
'written**: everything under `.check/` belongs to an earlier run and nothing below describes this ' +
|
|
101
|
+
'one. This is an environment finding, not a code one — no edit will clear it. The most common cause ' +
|
|
102
|
+
'is Node: an agent harness runs hooks in a non-login shell, so a hook gets the machine’s default ' +
|
|
103
|
+
'interpreter rather than the one your terminal has, and a repo pinning `engines.node` then refuses ' +
|
|
104
|
+
'to run anything at all. See the `doctor` fold above for what this process is running.',
|
|
105
|
+
'harness-broken': () => '**harness broken** — the gate exited 2, which checkride reserves for "the harness broke or was ' +
|
|
106
|
+
'misused". No check result from this run is evidence of anything; fix the harness first.',
|
|
107
|
+
'off-contract': (r) => `**off-contract exit** — the gate ${exitClause(r.gate)}, which is not one of checkride's promised ` +
|
|
108
|
+
'0/1/2. Something in the `check` script failed before or around checkride itself.',
|
|
109
|
+
'not-run': () => '**gate not run** — this repo has no `check` script, so there is nothing that defines done here. ' +
|
|
110
|
+
'Run `checkride init` to add one; everything below is from whatever last wrote `.check/`.',
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* A red gate whose summary names no failing check. The usual cause is a
|
|
114
|
+
* compound `check` script — `tsc --build && node dist/cli.js`, the shape
|
|
115
|
+
* `checkride init` writes — short-circuiting before checkride runs: the gate
|
|
116
|
+
* exits 1, no summary is written, and whatever table follows belongs to an
|
|
117
|
+
* earlier run. On this branch the gate's own output is the only evidence there
|
|
118
|
+
* is, which is why it renders (see {@link renderGateOutput}).
|
|
119
|
+
*/
|
|
120
|
+
function unexplainedRed(report) {
|
|
121
|
+
return report.gate.verdict === 'red' && report.failing.length === 0;
|
|
122
|
+
}
|
|
123
|
+
/** Where to look when no slot accounts for the failure. Shared by both branches. */
|
|
124
|
+
function gateEvidenceClause(report) {
|
|
125
|
+
return `${report.gate.stdout}${report.gate.stderr}`.trim() === ''
|
|
126
|
+
? 'The gate printed nothing on either stream — re-run the `check` script by hand and read what it prints.'
|
|
127
|
+
: 'The `gate output` tail below is the only evidence there is; read it first.';
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Why an empty slot table is the *summary's* fault rather than the run's, or
|
|
131
|
+
* `null` when it is not.
|
|
132
|
+
*
|
|
133
|
+
* The distinction this draws is the one a reader gets wrong for free. A summary
|
|
134
|
+
* that is **absent** is the compound-script short-circuit in
|
|
135
|
+
* {@link redVerdict}'s last branch: checkride never ran, so it wrote nothing.
|
|
136
|
+
* But a summary that *exists* and cannot be parsed says nothing whatsoever
|
|
137
|
+
* about what ran — and telling an agent "checkride never ran, a compound script
|
|
138
|
+
* short-circuited" on that evidence is a specific, confident, and usually false
|
|
139
|
+
* diagnosis. The file is right there; what is missing is this reader's ability
|
|
140
|
+
* to read it.
|
|
141
|
+
*/
|
|
142
|
+
function unparsedSummaryClause(report) {
|
|
143
|
+
const { summary } = report;
|
|
144
|
+
if (summary.state === 'foreign') {
|
|
145
|
+
return ('a `.check/summary.json` exists but carries no `schema_version`, so it was not written by checkride — ' +
|
|
146
|
+
"this repo's gate is a different tool, and its artifacts follow no contract this reader can index");
|
|
147
|
+
}
|
|
148
|
+
if (summary.state === 'schema-mismatch') {
|
|
149
|
+
return (`\`.check/summary.json\` is \`schema_version\` ${JSON.stringify(summary.found)}, which this reader is not ` +
|
|
150
|
+
'pinned to — the additive-only guarantee holds within a version and promises nothing across one');
|
|
151
|
+
}
|
|
152
|
+
if (summary.state === 'unreadable')
|
|
153
|
+
return `\`.check/summary.json\` could not be parsed (${summary.detail})`;
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
function redVerdict(report) {
|
|
157
|
+
if (!unexplainedRed(report)) {
|
|
158
|
+
return `**red** — ${report.failing.length} of ${report.coverage.ran.length} executed check(s) failed.`;
|
|
159
|
+
}
|
|
160
|
+
const unparsed = unparsedSummaryClause(report);
|
|
161
|
+
if (unparsed !== null) {
|
|
162
|
+
return (`**red, and the summary cannot be read** — the gate exited 1, and ${unparsed}. There is no slot table below ` +
|
|
163
|
+
'because nothing was parsed, NOT because nothing failed: which slots ran, which failed, what was baselined ' +
|
|
164
|
+
`and what was skipped are all unknown. ${gateEvidenceClause(report)}`);
|
|
165
|
+
}
|
|
166
|
+
return ('**red, but no slot explains it** — the gate exited 1 and no check in the summary failed. Something in the ' +
|
|
167
|
+
'`check` script failed before checkride ran (a compound script like `tsc --build && node dist/cli.js` ' +
|
|
168
|
+
`short-circuits), so nothing in the table below describes this failure. ${gateEvidenceClause(report)}`);
|
|
169
|
+
}
|
|
170
|
+
function greenVerdict(report) {
|
|
171
|
+
// Same trap as the red branch: with no parse, `coverage` is empty because
|
|
172
|
+
// nothing was read, and the narrow-green sentence would report a subset that
|
|
173
|
+
// was never measured. The pass itself is real — the repo's own gate exited 0
|
|
174
|
+
// — but this reader cannot say what it covered, and should not imply it can.
|
|
175
|
+
if (!summaryParsed(report)) {
|
|
176
|
+
return ("**green, with no index** — the gate exited 0, so the repo's own definition of done was met, but no summary " +
|
|
177
|
+
'this reader can parse says what that covered. Report the pass; do not attach a slot count to it. See the ' +
|
|
178
|
+
'header for why the summary could not be read.');
|
|
179
|
+
}
|
|
180
|
+
if (report.vacuous) {
|
|
181
|
+
return ('**vacuous green** — the gate exited 0 but `checks_run` is 0: nothing was verified. This is a ' +
|
|
182
|
+
'failure wearing a pass. Find out why no check was selected before believing anything else here.');
|
|
183
|
+
}
|
|
184
|
+
if (report.gate.narrowingFlags.length > 0 || report.coverage.uncovered.length > 0) {
|
|
185
|
+
return (`**green, but narrow** — ${report.coverage.ran.length} check(s) passed and that is all this run ` +
|
|
186
|
+
'verified. See coverage below before calling the work done.');
|
|
187
|
+
}
|
|
188
|
+
return `**green** — ${report.coverage.ran.length} check(s) passed.`;
|
|
189
|
+
}
|
|
190
|
+
function renderVerdict(report) {
|
|
191
|
+
return heading('verdict', VERDICTS[report.gate.verdict](report));
|
|
192
|
+
}
|
|
193
|
+
function renderDoctorFold(fold) {
|
|
194
|
+
if (fold.state !== 'ran')
|
|
195
|
+
return `\`checkride doctor\` could not be consulted: ${fold.reason}.`;
|
|
196
|
+
if (fold.findings.length === 0) {
|
|
197
|
+
return `\`checkride doctor\` exited ${fold.exitCode ?? '?'} and found no broken requirement — the ` +
|
|
198
|
+
'break is in the `check` script or in checkride itself, not in the environment.';
|
|
199
|
+
}
|
|
200
|
+
return `\`checkride doctor\` exited ${fold.exitCode ?? '?'} — ${fold.findings.length} required check(s) not ok:\n\n${bullets(fold.findings.map(findingLine))}`;
|
|
201
|
+
}
|
|
202
|
+
function findingLine(finding) {
|
|
203
|
+
const found = finding.found ?? 'not found';
|
|
204
|
+
const expected = finding.expected === null ? '' : `, expected ${finding.expected}`;
|
|
205
|
+
const hint = finding.hint === null ? '' : ` — ${finding.hint}`;
|
|
206
|
+
return `**${finding.name}** (${finding.status}): ${found}${expected}${hint}`;
|
|
207
|
+
}
|
|
208
|
+
/** A bounded tail of one captured stream, or `''` when it caught nothing. */
|
|
209
|
+
function streamExcerpt(label, stream) {
|
|
210
|
+
const { text, omittedLines, totalBytes } = tail(stream, GATE_TAIL_LINES, GATE_TAIL_BYTES);
|
|
211
|
+
if (text === '')
|
|
212
|
+
return '';
|
|
213
|
+
const kept = text.split('\n').length;
|
|
214
|
+
const omitted = omittedLines > 0 ? ` — last ${kept} of ${omittedLines + kept} lines` : '';
|
|
215
|
+
return `**${label}** — ${formatBytes(totalBytes)} captured${omitted}\n\n\`\`\`\n${text}\n\`\`\``;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The gate's own output — the only raw text this reader ever prints, and only
|
|
219
|
+
* where no slot can account for the failure: the harness broke (exit 2 or
|
|
220
|
+
* off-contract, where `doctor` is folded in beside it) or the gate went red
|
|
221
|
+
* with nothing failing in the summary. On any other branch the raw file named
|
|
222
|
+
* in the table is the evidence, and printing the gate's output would spend the
|
|
223
|
+
* context this reader exists to save.
|
|
224
|
+
*
|
|
225
|
+
* Both streams render, because which one carries the diagnosis is the tool's
|
|
226
|
+
* choice and not knowable here. checkride's own discipline puts diagnostics on
|
|
227
|
+
* stderr, but the compound script this branch usually catches fails in `tsc`,
|
|
228
|
+
* which reports on *stdout* — measured on this repo, where a type error leaves
|
|
229
|
+
* `error TS2322` on stdout and nothing but pnpm's command echo on stderr. This
|
|
230
|
+
* is the render-side twin of the judgment `../artifacts/raw.ts` declines to
|
|
231
|
+
* make: show both rather than guess which stream a stranger's tool used.
|
|
232
|
+
*/
|
|
233
|
+
function renderGateOutput(report) {
|
|
234
|
+
if (report.doctor === null && !unexplainedRed(report))
|
|
235
|
+
return '';
|
|
236
|
+
const streams = [
|
|
237
|
+
streamExcerpt('stderr', report.gate.stderr),
|
|
238
|
+
streamExcerpt('stdout', report.gate.stdout),
|
|
239
|
+
].filter((excerpt) => excerpt !== '');
|
|
240
|
+
return streams.length === 0 ? '' : heading('gate output', streams.join('\n\n'));
|
|
241
|
+
}
|
|
242
|
+
/** The broken-harness diagnosis, folded in on the branch that has one. */
|
|
243
|
+
function renderDoctor(report) {
|
|
244
|
+
return report.doctor === null ? '' : heading('doctor', renderDoctorFold(report.doctor));
|
|
245
|
+
}
|
|
246
|
+
function renderCoverage(report) {
|
|
247
|
+
const { coverage, gate } = report;
|
|
248
|
+
const lines = [];
|
|
249
|
+
if (gate.narrowingFlags.length > 0) {
|
|
250
|
+
lines.push(`The \`check\` script narrows the run on purpose (${gate.narrowingFlags.join(', ')}). A green here is green *for those slots*.`);
|
|
251
|
+
}
|
|
252
|
+
if (!summaryParsed(report)) {
|
|
253
|
+
lines.push('What this run covered is unknown — there is no parseable summary to read it from.');
|
|
254
|
+
}
|
|
255
|
+
else if (coverage.configured === null) {
|
|
256
|
+
lines.push('This repo has no `checkride.config.json`, so the slots below are simply what the run selected — this reader will not guess at the default catalogue.');
|
|
257
|
+
}
|
|
258
|
+
else if (coverage.uncovered.length > 0) {
|
|
259
|
+
lines.push(`\`checkride.config.json\` names ${coverage.configured.length} slot(s); ${coverage.uncovered.length} had no entry in this run: ${coverage.uncovered.join(', ')}.`);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
lines.push(`Every slot named in \`checkride.config.json\` (${coverage.configured.length}) has an entry in this run.`);
|
|
263
|
+
}
|
|
264
|
+
return heading('coverage', lines.join('\n\n'));
|
|
265
|
+
}
|
|
266
|
+
const TABLE_HEAD = '| slot | adapter | result | exit | ms | raw output | size | age |\n| --- | --- | --- | --- | --- | --- | --- | --- |';
|
|
267
|
+
function rawCells(row) {
|
|
268
|
+
if (row.raw === null)
|
|
269
|
+
return '— | — | —';
|
|
270
|
+
const { chosen } = row.raw;
|
|
271
|
+
const extra = row.raw.candidates.length > 1 ? ` (+${row.raw.candidates.length - 1})` : '';
|
|
272
|
+
return `\`.check/${chosen.file}\`${extra} | ${formatBytes(chosen.bytes)} | ${ageCell(chosen.freshness)}`;
|
|
273
|
+
}
|
|
274
|
+
function tableRow(row) {
|
|
275
|
+
const baselined = row.baselined === null ? '' : ` (${row.baselined} baselined)`;
|
|
276
|
+
return `| ${row.slot} | ${row.adapter ?? '—'} | ${row.status}${baselined} | ${row.exitCode ?? '—'} | ${Math.round(row.durationMs)} | ${rawCells(row)} |`;
|
|
277
|
+
}
|
|
278
|
+
function renderChecks(report) {
|
|
279
|
+
if (report.rows.length === 0)
|
|
280
|
+
return '';
|
|
281
|
+
return heading('checks', [TABLE_HEAD, ...report.rows.map(tableRow)].join('\n'));
|
|
282
|
+
}
|
|
283
|
+
/** Rows past this are counted rather than listed — bounded, but never silently. */
|
|
284
|
+
const CHECK_DIR_LIMIT = 40;
|
|
285
|
+
const CHECK_DIR_HEAD = '| file | size | age |\n| --- | --- | --- |';
|
|
286
|
+
/**
|
|
287
|
+
* Everything in `.check/`, measured — rendered only when the summary could not
|
|
288
|
+
* be parsed, because then it is the only inventory there is. Without it the
|
|
289
|
+
* report's answer to "what is even in there?" is silence, and an agent's next
|
|
290
|
+
* move is an unbounded `ls` plus a guess at which files belong to this run.
|
|
291
|
+
*
|
|
292
|
+
* Ages here are measured against the *gate's own start*, not the summary's
|
|
293
|
+
* window: this reader ran the gate and knows when, which is a firmer anchor
|
|
294
|
+
* than a timestamp inside a file it could not read.
|
|
295
|
+
*/
|
|
296
|
+
function renderCheckDir(report) {
|
|
297
|
+
const files = report.checkDir;
|
|
298
|
+
if (files === null || files.length === 0)
|
|
299
|
+
return '';
|
|
300
|
+
const shown = files.slice(0, CHECK_DIR_LIMIT);
|
|
301
|
+
const rows = shown.map((f) => `| \`.check/${f.file}\` | ${formatBytes(f.bytes)} | ${ageCell(f.freshness)} |`);
|
|
302
|
+
const omitted = files.length - shown.length;
|
|
303
|
+
const note = omitted === 0 ? '' : `\n\n${omitted} further file(s) present and not listed.`;
|
|
304
|
+
const body = 'No parseable summary, so this listing is the index. `fresh` means the file was written after this run\'s ' +
|
|
305
|
+
'gate started; `stale` means it is a leftover from something earlier and describes no part of this run.\n\n' +
|
|
306
|
+
`${[CHECK_DIR_HEAD, ...rows].join('\n')}${note}`;
|
|
307
|
+
return heading('.check/ contents', body);
|
|
308
|
+
}
|
|
309
|
+
/** One alternate, named and sized — a stale one carries its age, never dropped. */
|
|
310
|
+
function alternate(file) {
|
|
311
|
+
const stale = file.freshness.state === 'stale' ? `, stale ${formatDuration(file.freshness.ageMs ?? 0)}` : '';
|
|
312
|
+
return `\`.check/${file.file}\` (${formatBytes(file.bytes)}${stale})`;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* The candidates the chosen file was picked over, named rather than counted.
|
|
316
|
+
* The table's `(+N)` is a width compromise; here there is room, and a bare
|
|
317
|
+
* count is not actionable — a reader told the chosen file gives a count but not
|
|
318
|
+
* a location has to guess which sibling holds the location.
|
|
319
|
+
*/
|
|
320
|
+
function alternatesClause(raw) {
|
|
321
|
+
const others = raw.candidates.filter((file) => file.file !== raw.chosen.file);
|
|
322
|
+
return others.length === 0 ? '' : `; also: ${others.map(alternate).join(', ')}`;
|
|
323
|
+
}
|
|
324
|
+
function failingLine(row, index) {
|
|
325
|
+
const where = row.raw === null
|
|
326
|
+
? 'no output file found under `.check/` — the tool wrote nothing this reader can locate'
|
|
327
|
+
: `read \`.check/${row.raw.chosen.file}\` (${formatBytes(row.raw.chosen.bytes)})${alternatesClause(row.raw)}`;
|
|
328
|
+
return `${index + 1}. **${row.slot}** (${row.adapter ?? 'no adapter'}) — exit ${row.exitCode ?? '—'} — ${where}`;
|
|
329
|
+
}
|
|
330
|
+
function renderFailing(report) {
|
|
331
|
+
if (report.failing.length === 0)
|
|
332
|
+
return '';
|
|
333
|
+
const body = report.failing.map(failingLine).join('\n') +
|
|
334
|
+
'\n\nListed in pipeline order (the summary\'s deterministic order), not by importance — ' +
|
|
335
|
+
'a failure early in the pipeline is often the cause of the ones after it.';
|
|
336
|
+
return heading('failing slots', body);
|
|
337
|
+
}
|
|
338
|
+
function renderDigest(report) {
|
|
339
|
+
const { digest } = report;
|
|
340
|
+
if (digest === null) {
|
|
341
|
+
// Only a run this reader can index supports the `--digest` explanation;
|
|
342
|
+
// a gate it could not parse may have no such flag to pass.
|
|
343
|
+
const why = summaryParsed(report) ? 'this run passed no `--digest`, so there is' : 'there is';
|
|
344
|
+
return heading('digest', `No \`.check/digest.md\`: ${why} no pre-built excerpt. Read the raw files above.`);
|
|
345
|
+
}
|
|
346
|
+
if (digest.freshness.state === 'stale') {
|
|
347
|
+
return heading('digest', `\`.check/digest.md\` (${formatBytes(digest.bytes)}) is from an EARLIER run — ${formatDuration(digest.freshness.ageMs ?? 0)} before this one started. Do not read it as this run's failures.`);
|
|
348
|
+
}
|
|
349
|
+
return heading('digest', `\`.check/digest.md\` (${formatBytes(digest.bytes)}) — checkride's own bounded excerpt of this run's failing slots. Read it before any raw file.`);
|
|
350
|
+
}
|
|
351
|
+
function baselineCaveats(rows) {
|
|
352
|
+
return rows
|
|
353
|
+
.filter((r) => r.baselined !== null)
|
|
354
|
+
.map((r) => `\`${r.slot}\` reports \`baselined: ${r.baselined}\` — that many current findings are grandfathered by \`checkride.baseline.json\`. Passing here does not mean clean.`);
|
|
355
|
+
}
|
|
356
|
+
function skipCaveats(rows) {
|
|
357
|
+
return rows
|
|
358
|
+
.filter((r) => r.status === 'skipped')
|
|
359
|
+
.map((r) => `\`${r.slot}\` skipped: ${r.reason ?? 'no reason given'}. It verified nothing this run.`);
|
|
360
|
+
}
|
|
361
|
+
function staleCaveats(stale) {
|
|
362
|
+
return stale.map((f) => `\`.check/${f.file}\` is ${formatDuration(f.freshness.ageMs ?? 0)} older than this run's start — a leftover, not this run's output.`);
|
|
363
|
+
}
|
|
364
|
+
function spawnFailureCaveats(rows) {
|
|
365
|
+
return rows
|
|
366
|
+
.filter((r) => r.exitCode === -1)
|
|
367
|
+
.map((r) => `\`${r.slot}\` has \`exit_code: -1\` — it failed to spawn or timed out. That is a harness problem, not a finding.`);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* What the summary's own state costs everything below it.
|
|
371
|
+
*
|
|
372
|
+
* The unparsed case earns a caveat of its own because the absence of findings
|
|
373
|
+
* reads as their absence in the repo. `baselined` and `skipped` are the sharp
|
|
374
|
+
* edges: both are silent by construction — a baselined slot *passes* and a
|
|
375
|
+
* skipped one reports nothing — so with no summary to name them, "no caveats
|
|
376
|
+
* were raised" and "no caveats could be raised" look identical on the page.
|
|
377
|
+
*/
|
|
378
|
+
function summaryCaveats(report) {
|
|
379
|
+
if (report.summary.state !== 'ok') {
|
|
380
|
+
return [
|
|
381
|
+
'`.check/summary.json` could not be parsed, so there is no slot table: `baselined` and `skipped` counts are ' +
|
|
382
|
+
'**unknown**, not zero, and no slot in this repo can be reported as passing on this run\'s evidence.',
|
|
383
|
+
];
|
|
384
|
+
}
|
|
385
|
+
if (report.fromThisRun !== false)
|
|
386
|
+
return [];
|
|
387
|
+
return ['`.check/summary.json` predates the run just made, so the table above describes an earlier run. Everything in it is suspect.'];
|
|
388
|
+
}
|
|
389
|
+
function renderCaveats(report) {
|
|
390
|
+
const items = [
|
|
391
|
+
...summaryCaveats(report),
|
|
392
|
+
...baselineCaveats(report.rows),
|
|
393
|
+
...spawnFailureCaveats(report.rows),
|
|
394
|
+
...skipCaveats(report.rows),
|
|
395
|
+
...staleCaveats(report.stale),
|
|
396
|
+
NOT_READ_NOTE,
|
|
397
|
+
];
|
|
398
|
+
return heading('caveats', bullets(items));
|
|
399
|
+
}
|
|
400
|
+
const SECTIONS = [
|
|
401
|
+
renderHeader,
|
|
402
|
+
renderVerdict,
|
|
403
|
+
renderGateOutput,
|
|
404
|
+
renderDoctor,
|
|
405
|
+
renderCoverage,
|
|
406
|
+
renderChecks,
|
|
407
|
+
renderCheckDir,
|
|
408
|
+
renderFailing,
|
|
409
|
+
renderDigest,
|
|
410
|
+
renderCaveats,
|
|
411
|
+
];
|
|
412
|
+
/** Render the whole report. Deterministic: same report in, same bytes out. */
|
|
413
|
+
export function renderTriage(report) {
|
|
414
|
+
const body = SECTIONS.map((section) => section(report))
|
|
415
|
+
.filter((text) => text !== '')
|
|
416
|
+
.join('\n');
|
|
417
|
+
return `# checkride triage\n\n${body}`;
|
|
418
|
+
}
|
|
419
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/triage/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAM1E,0EAA0E;AAC1E,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,8EAA8E;AAC9E,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,MAAM,aAAa,GACjB,kFAAkF;IAClF,kFAAkF,CAAC;AAErF,SAAS,OAAO,CAAC,KAAa,EAAE,IAAY;IAC1C,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI,CAAC;AACpC,CAAC;AAED,SAAS,OAAO,CAAC,KAAwB;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,kFAAkF;AAClF,SAAS,OAAO,CAAC,SAAoB;IACnC,IAAI,SAAS,CAAC,KAAK,KAAK,OAAO;QAAE,OAAO,SAAS,cAAc,CAAC,SAAS,CAAC,KA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8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,MAAoB;IAC/C,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SACpD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;SAC7B,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,yBAAyB,IAAI,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assembling the triage report — everything the skill reasons over, and nothing
|
|
3
|
+
* it would have to open a file to learn.
|
|
4
|
+
*
|
|
5
|
+
* The shape is deliberately a *model*, not text: the run's provenance, one row
|
|
6
|
+
* per slot with its raw output located and sized, what the run did and did not
|
|
7
|
+
* cover, and the traps (vacuous green, narrow green, baselined findings, stale
|
|
8
|
+
* artifacts) each surfaced as its own field. Rendering is `./render.ts`'s job.
|
|
9
|
+
*
|
|
10
|
+
* Two facts drive almost all of it. First, the summary is an index, not
|
|
11
|
+
* evidence: it is overwritten by every run, so triage runs the gate itself and
|
|
12
|
+
* then checks that the summary on disk is the one that run wrote. Second, sizes
|
|
13
|
+
* are the product: `mutation.json` is 2.3 MB in this repo, and a reader that
|
|
14
|
+
* reports contents instead of bytes has spent the context it exists to save.
|
|
15
|
+
*/
|
|
16
|
+
import type { ArtifactFile, RawOutput, SummaryRead } from '../artifacts/index.js';
|
|
17
|
+
import type { DoctorFold } from './doctor-fold.js';
|
|
18
|
+
import type { TriageEnv } from './env.js';
|
|
19
|
+
import type { GateOutcome } from './gate.js';
|
|
20
|
+
export type SlotStatus = 'pass' | 'fail' | 'skipped';
|
|
21
|
+
/** One slot as the report presents it: outcome, plus where its bytes are. */
|
|
22
|
+
export type SlotRow = {
|
|
23
|
+
slot: string;
|
|
24
|
+
adapter: string | null;
|
|
25
|
+
status: SlotStatus;
|
|
26
|
+
exitCode: number | null;
|
|
27
|
+
durationMs: number;
|
|
28
|
+
/** Findings a committed baseline grandfathered; `null` when none were masked. */
|
|
29
|
+
baselined: number | null;
|
|
30
|
+
/** Why a skipped slot sat out. */
|
|
31
|
+
reason: string | null;
|
|
32
|
+
raw: RawOutput | null;
|
|
33
|
+
};
|
|
34
|
+
/** What the run actually verified — and, where knowable, what it did not. */
|
|
35
|
+
export type Coverage = {
|
|
36
|
+
ran: string[];
|
|
37
|
+
skipped: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Slots named in `checkride.config.json` and not disabled, or `null` when the
|
|
40
|
+
* repo has no config file (the default catalogue applies and this reader will
|
|
41
|
+
* not guess at it).
|
|
42
|
+
*/
|
|
43
|
+
configured: string[] | null;
|
|
44
|
+
/** Configured slots with no entry in this run's summary at all. */
|
|
45
|
+
uncovered: string[];
|
|
46
|
+
};
|
|
47
|
+
export type TriageReport = {
|
|
48
|
+
cwd: string;
|
|
49
|
+
gate: GateOutcome;
|
|
50
|
+
/** Present only on the broken-harness branch, where it is the diagnosis. */
|
|
51
|
+
doctor: DoctorFold | null;
|
|
52
|
+
summary: SummaryRead;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the summary on disk was written by the run just made. `null` when
|
|
55
|
+
* there is no readable summary, or no run to compare it against.
|
|
56
|
+
*/
|
|
57
|
+
fromThisRun: boolean | null;
|
|
58
|
+
windowStart: number | null;
|
|
59
|
+
rows: SlotRow[];
|
|
60
|
+
failing: SlotRow[];
|
|
61
|
+
coverage: Coverage;
|
|
62
|
+
/** `ok: true` with `checks_run: 0` — nothing was verified. */
|
|
63
|
+
vacuous: boolean;
|
|
64
|
+
/** `.check/digest.md`; its existence means the run that wrote it had failures. */
|
|
65
|
+
digest: ArtifactFile | null;
|
|
66
|
+
/** Every measured file older than this run's start, deduped by path. */
|
|
67
|
+
stale: ArtifactFile[];
|
|
68
|
+
/**
|
|
69
|
+
* Every file in `.check/`, measured — populated only when the summary could
|
|
70
|
+
* not be parsed, because there {@link rows} is empty for want of an index
|
|
71
|
+
* rather than for want of artifacts, and this listing is the only inventory
|
|
72
|
+
* left. `null` whenever the summary *was* parsed: the rows are the index then,
|
|
73
|
+
* and repeating the directory beside them would be noise.
|
|
74
|
+
*/
|
|
75
|
+
checkDir: ArtifactFile[] | null;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Run the gate, then read what it wrote. On the broken-harness branch `doctor`
|
|
79
|
+
* is folded in first, because there the environment is the finding and the
|
|
80
|
+
* slot table is not evidence of anything.
|
|
81
|
+
*/
|
|
82
|
+
export declare function triage(cwd: string, env: TriageEnv): Promise<TriageReport>;
|
|
83
|
+
//# sourceMappingURL=triage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../../src/triage/triage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIlF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAErD,6EAA6E;AAC7E,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kCAAkC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,EAAE,SAA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