strikethroo 3.14.3 → 3.16.0
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 +52 -31
- package/dist/__tests__/fixtures/review-gate.d.ts +59 -0
- package/dist/__tests__/fixtures/review-gate.d.ts.map +1 -0
- package/dist/__tests__/fixtures/review-gate.js +150 -0
- package/dist/__tests__/fixtures/review-gate.js.map +1 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +1 -1
- package/dist/export-profile.d.ts +50 -0
- package/dist/export-profile.d.ts.map +1 -0
- package/dist/export-profile.js +321 -0
- package/dist/export-profile.js.map +1 -0
- package/dist/harnesses/registry.d.ts +4 -2
- package/dist/harnesses/registry.d.ts.map +1 -1
- package/dist/harnesses/registry.js +4 -2
- package/dist/harnesses/registry.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -3
- package/dist/index.js.map +1 -1
- package/dist/profiles.d.ts +163 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +561 -0
- package/dist/profiles.js.map +1 -0
- package/dist/types.d.ts +37 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -1
- package/dist/types.js.map +1 -1
- package/dist-web/assets/{arc-CsLKjSmD.js → arc-DMHUv2NY.js} +1 -1
- package/dist-web/assets/{architectureDiagram-3BPJPVTR-CUdI2ZME.js → architectureDiagram-3BPJPVTR-CeAAqVS4.js} +1 -1
- package/dist-web/assets/{blockDiagram-GPEHLZMM-BzGl3sJ5.js → blockDiagram-GPEHLZMM-Hns_u_jz.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-B9BcD268.js → c4Diagram-AAUBKEIU-BH3RLVAi.js} +1 -1
- package/dist-web/assets/channel-Dk0dEQIT.js +1 -0
- package/dist-web/assets/{chunk-2J33WTMH-jrfdvIhS.js → chunk-2J33WTMH-h6Ws9VXu.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-BppnV9t3.js → chunk-4BX2VUAB-BSBeNNnS.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-Dgig1qV7.js → chunk-55IACEB6-BmUY060b.js} +1 -1
- package/dist-web/assets/{chunk-727SXJPM-CssKzpPg.js → chunk-727SXJPM-CmemMVvQ.js} +1 -1
- package/dist-web/assets/{chunk-AQP2D5EJ-DWYbdfaL.js → chunk-AQP2D5EJ-LQpUb_FL.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-Cbt7Dqxf.js → chunk-FMBD7UC4-wk7OYcdf.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-2W-YdHxx.js → chunk-ND2GUHAM-O3K3rkHW.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-BSLdTa36.js → chunk-QZHKN3VN-CvppUbp9.js} +1 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-gqDJqcDV.js +1 -0
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-gqDJqcDV.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-D0_MX2M6.js → cose-bilkent-S5V4N54A-Cf1nQ4V_.js} +1 -1
- package/dist-web/assets/{dagre-BM42HDAG-DGXkicI6.js → dagre-BM42HDAG-YyP7mwPP.js} +1 -1
- package/dist-web/assets/{diagram-2AECGRRQ-DMfWZxh-.js → diagram-2AECGRRQ-BmAtTKkQ.js} +1 -1
- package/dist-web/assets/{diagram-5GNKFQAL-IChrzosS.js → diagram-5GNKFQAL-Bem8_DUK.js} +1 -1
- package/dist-web/assets/{diagram-KO2AKTUF-C7IVA_Py.js → diagram-KO2AKTUF-0gNyY9-f.js} +1 -1
- package/dist-web/assets/{diagram-LMA3HP47-UQXc1x2n.js → diagram-LMA3HP47-CJJh_IUU.js} +1 -1
- package/dist-web/assets/{diagram-OG6HWLK6-Z69O_NXy.js → diagram-OG6HWLK6-DJcCho7F.js} +1 -1
- package/dist-web/assets/{erDiagram-TEJ5UH35-xrgfPZU-.js → erDiagram-TEJ5UH35-D-TI_EbX.js} +1 -1
- package/dist-web/assets/{flowDiagram-I6XJVG4X-Co-y5e2I.js → flowDiagram-I6XJVG4X-BUrB4EYN.js} +1 -1
- package/dist-web/assets/{ganttDiagram-6RSMTGT7-C9TOh3M1.js → ganttDiagram-6RSMTGT7-C9_ItheP.js} +1 -1
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-iBpK83U-.js → gitGraphDiagram-PVQCEYII-DYQEmll0.js} +1 -1
- package/dist-web/assets/{index-DaaOiRou.js → index-DULKNhw0.js} +4 -4
- package/dist-web/assets/{index-6RY653Ds.js → index-X-a-o-AT.js} +1 -1
- package/dist-web/assets/{index-D4y2EDE-.js → index-mEUl0sqe.js} +1 -1
- package/dist-web/assets/{infoDiagram-5YYISTIA-C-_CUdyF.js → infoDiagram-5YYISTIA-B06Tp7cb.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-zPkWZ6FX.js → ishikawaDiagram-YF4QCWOH-DY9iP3P6.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-CsTWcFHo.js → journeyDiagram-JHISSGLW-Bk4MV49m.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-CCsrhCu2.js → kanban-definition-UN3LZRKU-B9-wsNt9.js} +1 -1
- package/dist-web/assets/{linear-DlkSJnhW.js → linear-DEY9HwQB.js} +1 -1
- package/dist-web/assets/{mermaid.core-BM7nlTu6.js → mermaid.core-Cn0e4l6V.js} +4 -4
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-C5tQ7zJH.js → mindmap-definition-RKZ34NQL-pN4Q2WNG.js} +1 -1
- package/dist-web/assets/{pieDiagram-4H26LBE5-CsK9eMOa.js → pieDiagram-4H26LBE5-DTkPv6S2.js} +1 -1
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CsUwvpcD.js → quadrantDiagram-W4KKPZXB-BS9LhTv0.js} +1 -1
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-CzQDuhAP.js → requirementDiagram-4Y6WPE33-BlSOLsQe.js} +1 -1
- package/dist-web/assets/{sankeyDiagram-5OEKKPKP-BTa3-BBs.js → sankeyDiagram-5OEKKPKP-B1xl-B1U.js} +1 -1
- package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CPPduAn5.js → sequenceDiagram-3UESZ5HK-BoiYrW_0.js} +1 -1
- package/dist-web/assets/{stateDiagram-AJRCARHV-T5j3NpOr.js → stateDiagram-AJRCARHV-BxvfZYDK.js} +1 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-XGZY1tGg.js +1 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-BG2gG3_T.js → timeline-definition-PNZ67QCA-CUEbrRkc.js} +1 -1
- package/dist-web/assets/{vennDiagram-CIIHVFJN-B3LyjiD_.js → vennDiagram-CIIHVFJN-CgQiBucH.js} +1 -1
- package/dist-web/assets/{wardley-L42UT6IY-CTsJTFG9.js → wardley-L42UT6IY-BsGW6T55.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-cmPISkrt.js → wardleyDiagram-YWT4CUSO-Cq3RMp6B.js} +1 -1
- package/dist-web/assets/{xychartDiagram-2RQKCTM6-BWy_dUgl.js → xychartDiagram-2RQKCTM6-WaoV-V3f.js} +1 -1
- package/dist-web/index.html +1 -1
- package/package.json +3 -3
- package/templates/harness/skills/st-code-review/SKILL.md +309 -0
- package/templates/harness/skills/st-code-review/scripts/code-review.cjs +1539 -0
- package/templates/harness/skills/st-code-review/scripts/find-strikethroo-root.cjs +116 -0
- package/templates/harness/skills/st-code-review/scripts/validate-plan-blueprint.cjs +429 -0
- package/templates/harness/skills/st-execute-blueprint/SKILL.md +48 -1
- package/templates/harness/skills/st-execute-blueprint/scripts/capture-base-commit.cjs +325 -0
- package/templates/harness/skills/st-execute-blueprint/scripts/dispatch-task-execution.cjs +46 -26
- package/templates/harness/skills/st-execute-task/scripts/dispatch-task-execution.cjs +46 -26
- package/templates/harness/skills/st-full-workflow/SKILL.md +48 -1
- package/templates/harness/skills/st-full-workflow/scripts/capture-base-commit.cjs +325 -0
- package/templates/harness/skills/st-full-workflow/scripts/dispatch-task-execution.cjs +46 -26
- package/templates/strikethroo/config/hooks/CODE_REVIEW.md +60 -0
- package/templates/strikethroo/config/schemas/self-review-v2.xsd +437 -0
- package/dist-web/assets/channel-CN9J8c_F.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-DHR8VHf9.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DHR8VHf9.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-CXpXsXHt.js +0 -1
|
@@ -417,6 +417,8 @@ If `taskCount` is 0 or `blueprintExists` is `no`:
|
|
|
417
417
|
|
|
418
418
|
Run `scripts/create-feature-branch.cjs <plan-id>` once before phase execution. Branch creation is best-effort: when the script reports that it skipped creation (for example, not on `main`/`master`), continue on the current branch and do not retry or create a branch manually. Uncommitted or untracked changes are permitted only when every change is inside the repository-root `.ai/strikethroo` subtree, so a newly generated plan and tasks can remain uncommitted before execution. When the script exits with an error—including changes anywhere outside that subtree or an inability to inspect Git status on `main`/`master`—halt and report the error. Do not treat a skipped branch as a failure or spend effort working around a skip.
|
|
419
419
|
|
|
420
|
+
After the branch step, run `scripts/capture-base-commit.cjs <plan-id>` once. It records the commit the review gate diffs against. A `skipped` result is not a failure — continue execution and note that the review gate will skip. Only an `error` result halts.
|
|
421
|
+
|
|
420
422
|
#### 4. Load execution blueprint
|
|
421
423
|
|
|
422
424
|
Read these files in order:
|
|
@@ -505,6 +507,51 @@ Read `<root>/config/hooks/POST_EXECUTION.md` and execute its instructions. If va
|
|
|
505
507
|
|
|
506
508
|
Before declaring execution complete, apply the evidence gate in `<root>/config/shared/verification-gate.md` to the plan's Success Criteria and Self Validation steps.
|
|
507
509
|
|
|
510
|
+
##### Run the code review gate
|
|
511
|
+
|
|
512
|
+
After `POST_EXECUTION.md` reports green and before appending the execution summary, follow the `st-code-review` skill and run one review round with its bundled mechanism:
|
|
513
|
+
|
|
514
|
+
```text
|
|
515
|
+
code-review.cjs <plan-id> <current-harness> <round>
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
`code-review.cjs` ships with the `st-code-review` skill and lives in that skill's own `scripts` directory, a sibling of this one. Resolve it there; it is not bundled with this skill. If the `st-code-review` skill is not installed on this harness, record that as the review outcome in the execution summary and continue to the summary and archival.
|
|
519
|
+
|
|
520
|
+
`<current-harness>` is the exact supported harness identifier running this skill. `<round>` is `1` on the first invocation, and thereafter the exact `decision.nextRound` the previous round returned. The command emits exactly one JSON line on stdout. Read its `kind`, then — when `kind` is `reviewed` — its `decision.kind`, and do exactly what the matching row states.
|
|
521
|
+
|
|
522
|
+
| Result | What you do |
|
|
523
|
+
| --- | --- |
|
|
524
|
+
| `skipped` | The gate is disabled or unconfigured. Record `reason` and `detail` verbatim in the execution summary, then continue to the summary and archival. A skip is never a failure. |
|
|
525
|
+
| `reviewed`, `decision.kind` = `gate-passed` | The gate passed. Record `findingsGate.recorded` and `findingsGate.aboveFloorWithoutSuggestion` — real findings deliberately not applied — then continue to the summary and archival. |
|
|
526
|
+
| `reviewed`, `decision.kind` = `fix-and-continue` | Apply the `actionable` set from `<plan-dir>/review/round-<n>/findings.json` on the implementer route. Re-run `POST_EXECUTION.md` in full. Then run the gate again with `<round>` set to `decision.nextRound`. |
|
|
527
|
+
| `reviewed`, `decision.kind` = `budget-exhausted` | Halt exactly as any mechanical gate failure. Leave the plan in `plans/`, do not append a completion summary, do not archive, and report the outstanding findings with actionable next steps. |
|
|
528
|
+
| `reviewed`, `decision.kind` = `round-failed` | The round was not certified — the findings document was absent or invalid, or no validator was available. Halt and report `decision.detail`. Never report an uncertified round as clean. |
|
|
529
|
+
| `budget-exhausted` | A round past the enforced budget was requested and no reviewer was dispatched. Halt exactly as `decision.kind` = `budget-exhausted` above. |
|
|
530
|
+
| `launched-failure` | The reviewer harness exited non-zero. Halt and report `detail`. |
|
|
531
|
+
| `fallback` | The reviewer never ran — the harness was unavailable or authentication failed. Record `reason` and `detail` verbatim in the execution summary, then continue to the summary and archival. |
|
|
532
|
+
| `infrastructure-failure` | A real error. Halt and report `detail`. Do not retry on a different route. |
|
|
533
|
+
|
|
534
|
+
<details>
|
|
535
|
+
<summary>Applying an actionable finding</summary>
|
|
536
|
+
|
|
537
|
+
`<plan-dir>/review/round-<n>/findings.json` holds that round's partition. Its `actionable` array is the only set you apply. Its `recorded` array is inspection material and is never applied.
|
|
538
|
+
|
|
539
|
+
Each actionable entry names a file, a location, and a suggestion whose `original-code` was copied verbatim from that file. Apply it as an exact text replacement of `original-code` by `proposed-code`, and change nothing else. When `original-code` no longer matches the file, record the finding as not applied and move to the next one. Do not reconstruct the fix, widen it, or refactor around it.
|
|
540
|
+
|
|
541
|
+
Dispatch every fix on the implementer route. Earlier rounds' rulings are carried into the next round by the mechanism itself, which reads the partitions it already wrote; do not pass them back on the command line.
|
|
542
|
+
|
|
543
|
+
</details>
|
|
544
|
+
|
|
545
|
+
Hard rules:
|
|
546
|
+
|
|
547
|
+
- The gate creates no task files.
|
|
548
|
+
- The gate never mutates the Execution Blueprint.
|
|
549
|
+
- The gate is terminal only — never per phase, never per task.
|
|
550
|
+
- The reviewer never fixes its own findings. Detection runs on the reviewer route, fixes run on the implementer route.
|
|
551
|
+
- Any applied fix invalidates the green build that preceded it. Re-run `POST_EXECUTION.md` in full — lint, tests, and Self Validation — before the gate runs again. Never re-verify against the prior green build.
|
|
552
|
+
- Whether another round runs is `decision.kind`'s to state and yours to obey. Do not count rounds, reason about the budget, or invoke a round the mechanism did not name.
|
|
553
|
+
- A green gate is not a correctness guarantee. It reduces the exposure a human PR approval reduces, and it leaves the same exposure behind.
|
|
554
|
+
|
|
508
555
|
#### 7. Append execution summary
|
|
509
556
|
|
|
510
557
|
Append an execution summary section to the plan document using the format described in `<root>/config/templates/EXECUTION_SUMMARY_TEMPLATE.md`. Populate:
|
|
@@ -512,7 +559,7 @@ Append an execution summary section to the plan document using the format descri
|
|
|
512
559
|
- **Status**: Completed Successfully
|
|
513
560
|
- **Completed Date**: current date
|
|
514
561
|
- **Results**: brief summary of deliverables
|
|
515
|
-
- **Noteworthy Events**: all decisions, issues, and outcomes encountered during execution. If
|
|
562
|
+
- **Noteworthy Events**: all decisions, issues, and outcomes encountered during execution. Always record the review gate's outcome here: the reviewer harness, the number of rounds run, and the counts of findings recorded versus applied — or, when the gate did not run, its `reason` and `detail` verbatim. If nothing else occurred, state "No significant issues encountered." after the review outcome.
|
|
516
563
|
- **Necessary follow-ups**: any follow-up actions or optimizations
|
|
517
564
|
|
|
518
565
|
#### 8. Archive the plan
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/skill-scripts/capture-base-commit.ts
|
|
31
|
+
var capture_base_commit_exports = {};
|
|
32
|
+
__export(capture_base_commit_exports, {
|
|
33
|
+
_isGitRepo: () => _isGitRepo,
|
|
34
|
+
_isValidSha: () => _isValidSha,
|
|
35
|
+
_readExistingBaseCommit: () => _readExistingBaseCommit,
|
|
36
|
+
main: () => main
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(capture_base_commit_exports);
|
|
39
|
+
var fs4 = __toESM(require("fs"));
|
|
40
|
+
var path4 = __toESM(require("path"));
|
|
41
|
+
|
|
42
|
+
// src/skill-scripts/shared/git-utils.ts
|
|
43
|
+
var import_child_process = require("child_process");
|
|
44
|
+
var execGit = (command) => {
|
|
45
|
+
try {
|
|
46
|
+
return (0, import_child_process.execSync)(command, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
47
|
+
} catch (_error) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// src/skill-scripts/shared/plan-resolve.ts
|
|
53
|
+
var fs3 = __toESM(require("fs"));
|
|
54
|
+
var path3 = __toESM(require("path"));
|
|
55
|
+
|
|
56
|
+
// src/skill-scripts/shared/root.ts
|
|
57
|
+
var fs = __toESM(require("fs"));
|
|
58
|
+
var path = __toESM(require("path"));
|
|
59
|
+
var EXPECTED_SCHEMA = true ? 4 : 4;
|
|
60
|
+
var isValidStrikethrooRoot = (strikethrooPath) => {
|
|
61
|
+
try {
|
|
62
|
+
if (!fs.existsSync(strikethrooPath)) return false;
|
|
63
|
+
if (!fs.lstatSync(strikethrooPath).isDirectory()) return false;
|
|
64
|
+
const metadataPath = path.join(strikethrooPath, ".init-metadata.json");
|
|
65
|
+
if (!fs.existsSync(metadataPath)) return false;
|
|
66
|
+
const metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
|
|
67
|
+
return metadata && typeof metadata === "object" && "version" in metadata;
|
|
68
|
+
} catch (_err) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var getStrikethrooAt = (directory) => {
|
|
73
|
+
const strikethrooPath = path.join(directory, ".ai", "strikethroo");
|
|
74
|
+
return isValidStrikethrooRoot(strikethrooPath) ? strikethrooPath : null;
|
|
75
|
+
};
|
|
76
|
+
var getParentPaths = (currentPath, acc = []) => {
|
|
77
|
+
const absolutePath = path.resolve(currentPath);
|
|
78
|
+
const nextAcc = [...acc, absolutePath];
|
|
79
|
+
const parentPath = path.dirname(absolutePath);
|
|
80
|
+
if (parentPath === absolutePath) return nextAcc;
|
|
81
|
+
return getParentPaths(parentPath, nextAcc);
|
|
82
|
+
};
|
|
83
|
+
var checkWorkspaceSchema = (metadataPath) => {
|
|
84
|
+
let metadata;
|
|
85
|
+
try {
|
|
86
|
+
metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
|
|
87
|
+
} catch {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const actual = typeof metadata.workspaceSchemaVersion === "number" ? metadata.workspaceSchemaVersion : 1;
|
|
91
|
+
if (actual === EXPECTED_SCHEMA) return;
|
|
92
|
+
if (actual < EXPECTED_SCHEMA) {
|
|
93
|
+
process.stderr.write(
|
|
94
|
+
`Workspace schema v${actual} is older than this skill requires (v${EXPECTED_SCHEMA}). Re-run \`npx strikethroo init\` with the latest CLI to update.
|
|
95
|
+
`
|
|
96
|
+
);
|
|
97
|
+
} else {
|
|
98
|
+
process.stderr.write(
|
|
99
|
+
`This skill (built for workspace schema v${EXPECTED_SCHEMA}) is older than the workspace (v${actual}). Re-run \`npx skills add e0ipso/strikethroo\` to update skills.
|
|
100
|
+
`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
process.exit(1);
|
|
104
|
+
};
|
|
105
|
+
var findStrikethrooRoot = (startPath = process.cwd()) => {
|
|
106
|
+
const paths = getParentPaths(startPath);
|
|
107
|
+
const found = paths.find((p) => getStrikethrooAt(p));
|
|
108
|
+
if (!found) return null;
|
|
109
|
+
const root = getStrikethrooAt(found);
|
|
110
|
+
if (root) checkWorkspaceSchema(path.join(root, ".init-metadata.json"));
|
|
111
|
+
return root;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/skill-scripts/shared/plan-scan.ts
|
|
115
|
+
var fs2 = __toESM(require("fs"));
|
|
116
|
+
var path2 = __toESM(require("path"));
|
|
117
|
+
|
|
118
|
+
// src/skill-scripts/shared/frontmatter.ts
|
|
119
|
+
var ID_PATTERNS = [
|
|
120
|
+
/^\s*["']?id["']?\s*:\s*["']?([+-]?\d+)["']?\s*(?:#.*)?$/im,
|
|
121
|
+
/^\s*id\s*:\s*([+-]?\d+)\s*(?:#.*)?$/im,
|
|
122
|
+
/^\s*["']?id["']?\s*:\s*"([+-]?\d+)"\s*(?:#.*)?$/im,
|
|
123
|
+
/^\s*["']?id["']?\s*:\s*'([+-]?\d+)'\s*(?:#.*)?$/im,
|
|
124
|
+
/^\s*["']id["']\s*:\s*([+-]?\d+)\s*(?:#.*)?$/im,
|
|
125
|
+
/^\s*id\s*:\s*[|>]\s*([+-]?\d+)\s*$/im
|
|
126
|
+
];
|
|
127
|
+
var validateId = (rawId) => {
|
|
128
|
+
const id = parseInt(rawId, 10);
|
|
129
|
+
if (Number.isNaN(id) || id < 0 || id > Number.MAX_SAFE_INTEGER) return null;
|
|
130
|
+
return id;
|
|
131
|
+
};
|
|
132
|
+
var extractIdFromMarkdown = (content) => {
|
|
133
|
+
const frontmatterMatch = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---/);
|
|
134
|
+
if (!frontmatterMatch || !frontmatterMatch[1]) return null;
|
|
135
|
+
const block = frontmatterMatch[1];
|
|
136
|
+
for (const pattern of ID_PATTERNS) {
|
|
137
|
+
const match = block.match(pattern);
|
|
138
|
+
if (match && match[1]) {
|
|
139
|
+
const id = validateId(match[1]);
|
|
140
|
+
if (id !== null) return id;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
};
|
|
145
|
+
var extractPlanId = (content, _filePath) => {
|
|
146
|
+
return extractIdFromMarkdown(content);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// src/skill-scripts/shared/plan-scan.ts
|
|
150
|
+
var PLAN_EXTENSIONS = [".md"];
|
|
151
|
+
var scanPlanDir = (planDirPath, dirName, isArchive) => {
|
|
152
|
+
let entries;
|
|
153
|
+
try {
|
|
154
|
+
entries = fs2.readdirSync(planDirPath, { withFileTypes: true });
|
|
155
|
+
} catch (_err) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
return entries.filter((e) => e.isFile() && PLAN_EXTENSIONS.some((ext) => e.name.endsWith(ext))).flatMap((e) => {
|
|
159
|
+
const filePath = path2.join(planDirPath, e.name);
|
|
160
|
+
try {
|
|
161
|
+
const content = fs2.readFileSync(filePath, "utf8");
|
|
162
|
+
const id = extractPlanId(content, filePath);
|
|
163
|
+
if (id === null) return [];
|
|
164
|
+
return [{ id, file: filePath, dir: planDirPath, isArchive, name: dirName }];
|
|
165
|
+
} catch (_err) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
var getAllPlans = (taskManagerRoot) => {
|
|
171
|
+
const sources = [
|
|
172
|
+
{ dir: path2.join(taskManagerRoot, "plans"), isArchive: false },
|
|
173
|
+
{ dir: path2.join(taskManagerRoot, "archive"), isArchive: true }
|
|
174
|
+
];
|
|
175
|
+
return sources.flatMap(({ dir, isArchive }) => {
|
|
176
|
+
if (!fs2.existsSync(dir)) return [];
|
|
177
|
+
let entries;
|
|
178
|
+
try {
|
|
179
|
+
entries = fs2.readdirSync(dir, { withFileTypes: true });
|
|
180
|
+
} catch (_err) {
|
|
181
|
+
return [];
|
|
182
|
+
}
|
|
183
|
+
return entries.filter((e) => e.isDirectory()).flatMap((e) => scanPlanDir(path2.join(dir, e.name), e.name, isArchive));
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/skill-scripts/shared/plan-resolve.ts
|
|
188
|
+
var isValidRootDir = (strikethrooPath) => {
|
|
189
|
+
try {
|
|
190
|
+
if (!fs3.existsSync(strikethrooPath)) return false;
|
|
191
|
+
if (!fs3.lstatSync(strikethrooPath).isDirectory()) return false;
|
|
192
|
+
const metadataPath = path3.join(strikethrooPath, ".init-metadata.json");
|
|
193
|
+
if (!fs3.existsSync(metadataPath)) return false;
|
|
194
|
+
const metadata = JSON.parse(fs3.readFileSync(metadataPath, "utf8"));
|
|
195
|
+
return metadata && typeof metadata === "object" && "version" in metadata;
|
|
196
|
+
} catch (_err) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
var checkStandardRootShortcut = (filePath) => {
|
|
201
|
+
const planDir = path3.dirname(filePath);
|
|
202
|
+
const parentDir = path3.dirname(planDir);
|
|
203
|
+
const possibleRoot = path3.dirname(parentDir);
|
|
204
|
+
const parentBase = path3.basename(parentDir);
|
|
205
|
+
if (parentBase !== "plans" && parentBase !== "archive") return null;
|
|
206
|
+
if (path3.basename(possibleRoot) !== "strikethroo") return null;
|
|
207
|
+
const dotAiDir = path3.dirname(possibleRoot);
|
|
208
|
+
if (path3.basename(dotAiDir) !== ".ai") return null;
|
|
209
|
+
return isValidRootDir(possibleRoot) ? possibleRoot : null;
|
|
210
|
+
};
|
|
211
|
+
var resolveByPath = (absolutePath) => {
|
|
212
|
+
let content;
|
|
213
|
+
try {
|
|
214
|
+
content = fs3.readFileSync(absolutePath, "utf8");
|
|
215
|
+
} catch (_err) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
const planId = extractPlanId(content, absolutePath);
|
|
219
|
+
if (planId === null) return null;
|
|
220
|
+
const tmRoot = checkStandardRootShortcut(absolutePath) || findStrikethrooRoot(path3.dirname(absolutePath));
|
|
221
|
+
if (!tmRoot) return null;
|
|
222
|
+
return {
|
|
223
|
+
planFile: absolutePath,
|
|
224
|
+
planDir: path3.dirname(absolutePath),
|
|
225
|
+
strikethrooRoot: tmRoot,
|
|
226
|
+
planId
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
var resolveByIdInAncestry = (planId, startPath, searched = /* @__PURE__ */ new Set()) => {
|
|
230
|
+
const tmRoot = findStrikethrooRoot(startPath);
|
|
231
|
+
if (!tmRoot) return null;
|
|
232
|
+
const normalized = path3.normalize(tmRoot);
|
|
233
|
+
if (searched.has(normalized)) return null;
|
|
234
|
+
searched.add(normalized);
|
|
235
|
+
const plans = getAllPlans(tmRoot);
|
|
236
|
+
const match = plans.find((p) => p.id === planId);
|
|
237
|
+
if (match) {
|
|
238
|
+
return {
|
|
239
|
+
planFile: match.file,
|
|
240
|
+
planDir: match.dir,
|
|
241
|
+
strikethrooRoot: tmRoot,
|
|
242
|
+
planId
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const parentOfRoot = path3.dirname(path3.dirname(tmRoot));
|
|
246
|
+
if (parentOfRoot === tmRoot) return null;
|
|
247
|
+
return resolveByIdInAncestry(planId, parentOfRoot, searched);
|
|
248
|
+
};
|
|
249
|
+
var resolvePlan = (input, startPath = process.cwd()) => {
|
|
250
|
+
if (input === null || input === void 0 || input === "") return null;
|
|
251
|
+
const inputStr = String(input);
|
|
252
|
+
if (inputStr.startsWith("/")) {
|
|
253
|
+
return resolveByPath(inputStr);
|
|
254
|
+
}
|
|
255
|
+
const planId = parseInt(inputStr, 10);
|
|
256
|
+
if (Number.isNaN(planId)) return null;
|
|
257
|
+
return resolveByIdInAncestry(planId, startPath);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/skill-scripts/capture-base-commit.ts
|
|
261
|
+
var SHA_RE = /^[0-9a-f]{40}$/i;
|
|
262
|
+
var emit = (result, exitCode) => {
|
|
263
|
+
process.stdout.write(`${JSON.stringify(result)}
|
|
264
|
+
`);
|
|
265
|
+
process.exit(exitCode);
|
|
266
|
+
};
|
|
267
|
+
var _isGitRepo = () => execGit("git rev-parse --is-inside-work-tree") === "true";
|
|
268
|
+
var _isValidSha = (value) => typeof value === "string" && SHA_RE.test(value);
|
|
269
|
+
var _readExistingBaseCommit = (filePath) => {
|
|
270
|
+
let raw;
|
|
271
|
+
try {
|
|
272
|
+
raw = fs4.readFileSync(filePath, "utf8");
|
|
273
|
+
} catch {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
try {
|
|
277
|
+
const parsed = JSON.parse(raw);
|
|
278
|
+
if (parsed && typeof parsed === "object" && _isValidSha(parsed.baseCommit)) {
|
|
279
|
+
return parsed.baseCommit;
|
|
280
|
+
}
|
|
281
|
+
} catch {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
};
|
|
286
|
+
var main = (startPath = process.cwd()) => {
|
|
287
|
+
if (!_isGitRepo()) {
|
|
288
|
+
emit({ kind: "skipped", reason: "not-a-git-repository" }, 0);
|
|
289
|
+
}
|
|
290
|
+
const head = execGit("git rev-parse HEAD");
|
|
291
|
+
if (!_isValidSha(head)) {
|
|
292
|
+
emit({ kind: "skipped", reason: "no-commits" }, 0);
|
|
293
|
+
}
|
|
294
|
+
const inputId = process.argv[2] ?? "";
|
|
295
|
+
const resolved = resolvePlan(inputId, startPath);
|
|
296
|
+
if (!resolved) {
|
|
297
|
+
emit({ kind: "error", detail: `Plan "${inputId}" not found or invalid` }, 2);
|
|
298
|
+
}
|
|
299
|
+
const { planDir } = resolved;
|
|
300
|
+
const reviewDir = path4.join(planDir, "review");
|
|
301
|
+
const filePath = path4.join(reviewDir, "base-commit.json");
|
|
302
|
+
const existing = _readExistingBaseCommit(filePath);
|
|
303
|
+
if (existing) {
|
|
304
|
+
emit({ kind: "already-captured", baseCommit: existing, file: filePath }, 0);
|
|
305
|
+
}
|
|
306
|
+
fs4.mkdirSync(reviewDir, { recursive: true });
|
|
307
|
+
const record = {
|
|
308
|
+
version: 1,
|
|
309
|
+
baseCommit: head,
|
|
310
|
+
capturedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
311
|
+
};
|
|
312
|
+
fs4.writeFileSync(filePath, `${JSON.stringify(record)}
|
|
313
|
+
`, "utf8");
|
|
314
|
+
emit({ kind: "captured", baseCommit: head, file: filePath }, 0);
|
|
315
|
+
};
|
|
316
|
+
if (require.main === module) {
|
|
317
|
+
main();
|
|
318
|
+
}
|
|
319
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
320
|
+
0 && (module.exports = {
|
|
321
|
+
_isGitRepo,
|
|
322
|
+
_isValidSha,
|
|
323
|
+
_readExistingBaseCommit,
|
|
324
|
+
main
|
|
325
|
+
});
|
|
@@ -3654,8 +3654,9 @@ var command = (executable, argv, request) => ({
|
|
|
3654
3654
|
executable,
|
|
3655
3655
|
argv,
|
|
3656
3656
|
cwd: request.workspace,
|
|
3657
|
-
stdin:
|
|
3657
|
+
stdin: request.prompt
|
|
3658
3658
|
});
|
|
3659
|
+
var modelArgv = (model) => model === void 0 ? [] : ["--model", model];
|
|
3659
3660
|
var EXTERNAL_HARNESS_ADAPTERS = {
|
|
3660
3661
|
claude: {
|
|
3661
3662
|
executable: "claude",
|
|
@@ -3663,8 +3664,7 @@ var EXTERNAL_HARNESS_ADAPTERS = {
|
|
|
3663
3664
|
"claude",
|
|
3664
3665
|
[
|
|
3665
3666
|
"-p",
|
|
3666
|
-
|
|
3667
|
-
request.model,
|
|
3667
|
+
...modelArgv(request.model),
|
|
3668
3668
|
...request.reasoningEffort === void 0 ? [] : ["--effort", request.reasoningEffort]
|
|
3669
3669
|
],
|
|
3670
3670
|
request
|
|
@@ -3677,8 +3677,7 @@ var EXTERNAL_HARNESS_ADAPTERS = {
|
|
|
3677
3677
|
"codex",
|
|
3678
3678
|
[
|
|
3679
3679
|
"exec",
|
|
3680
|
-
|
|
3681
|
-
request.model,
|
|
3680
|
+
...modelArgv(request.model),
|
|
3682
3681
|
...request.reasoningEffort === void 0 ? [] : ["--config", `model_reasoning_effort=${request.reasoningEffort}`],
|
|
3683
3682
|
"-"
|
|
3684
3683
|
],
|
|
@@ -3688,17 +3687,19 @@ var EXTERNAL_HARNESS_ADAPTERS = {
|
|
|
3688
3687
|
},
|
|
3689
3688
|
cursor: {
|
|
3690
3689
|
executable: "cursor-agent",
|
|
3691
|
-
buildCommand: (request) => command("cursor-agent", ["--print",
|
|
3690
|
+
buildCommand: (request) => command("cursor-agent", ["--print", ...modelArgv(request.model)], request),
|
|
3692
3691
|
authenticationArgv: () => ["status"]
|
|
3693
3692
|
},
|
|
3694
3693
|
gemini: {
|
|
3695
3694
|
executable: "gemini",
|
|
3696
|
-
|
|
3695
|
+
// The empty positional prompt is the existing contract — content travels on
|
|
3696
|
+
// stdin. It stays even when the model pair is dropped.
|
|
3697
|
+
buildCommand: (request) => command("gemini", ["--prompt", "", ...modelArgv(request.model)], request),
|
|
3697
3698
|
authenticationArgv: () => ["auth", "status"]
|
|
3698
3699
|
},
|
|
3699
3700
|
copilot: {
|
|
3700
3701
|
executable: "copilot",
|
|
3701
|
-
buildCommand: (request) => command("copilot", ["-p", "",
|
|
3702
|
+
buildCommand: (request) => command("copilot", ["-p", "", ...modelArgv(request.model)], request),
|
|
3702
3703
|
authenticationArgv: () => ["auth", "status"]
|
|
3703
3704
|
},
|
|
3704
3705
|
opencode: {
|
|
@@ -3707,8 +3708,7 @@ var EXTERNAL_HARNESS_ADAPTERS = {
|
|
|
3707
3708
|
"opencode",
|
|
3708
3709
|
[
|
|
3709
3710
|
"run",
|
|
3710
|
-
|
|
3711
|
-
request.model,
|
|
3711
|
+
...modelArgv(request.model),
|
|
3712
3712
|
...request.reasoningEffort === void 0 ? [] : ["--variant", request.reasoningEffort],
|
|
3713
3713
|
"-"
|
|
3714
3714
|
],
|
|
@@ -3722,6 +3722,12 @@ var harnessKeys = [...SUPPORTED_HARNESSES].sort();
|
|
|
3722
3722
|
if (adapterKeys.join("\0") !== harnessKeys.join("\0")) {
|
|
3723
3723
|
throw new Error("External harness adapter registry does not cover SUPPORTED_HARNESSES exactly.");
|
|
3724
3724
|
}
|
|
3725
|
+
var taskCommandRequest = (request) => ({
|
|
3726
|
+
model: request.model,
|
|
3727
|
+
reasoningEffort: request.reasoningEffort,
|
|
3728
|
+
workspace: request.workspace,
|
|
3729
|
+
prompt: taskPrompt(request)
|
|
3730
|
+
});
|
|
3725
3731
|
var executableOnPath = (executable) => (process.env.PATH ?? "").split(path2.delimiter).some((directory) => {
|
|
3726
3732
|
if (!directory) return false;
|
|
3727
3733
|
const candidate = path2.join(directory, executable);
|
|
@@ -3782,23 +3788,17 @@ var dependencies = {
|
|
|
3782
3788
|
launch: (commandSpec) => runProcess(commandSpec.executable, commandSpec.argv, commandSpec.cwd, commandSpec.stdin, true)
|
|
3783
3789
|
};
|
|
3784
3790
|
var errorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
3785
|
-
var
|
|
3786
|
-
const adapter = EXTERNAL_HARNESS_ADAPTERS[
|
|
3791
|
+
var prepareLaunch = async (harness, input, active, guard) => {
|
|
3792
|
+
const adapter = EXTERNAL_HARNESS_ADAPTERS[harness];
|
|
3787
3793
|
if (!adapter) {
|
|
3788
3794
|
return {
|
|
3789
3795
|
kind: "fallback",
|
|
3790
3796
|
reason: "adapter-unavailable",
|
|
3791
|
-
detail: `No adapter is registered for ${
|
|
3792
|
-
};
|
|
3793
|
-
}
|
|
3794
|
-
const active = { ...dependencies, ...overrides };
|
|
3795
|
-
if (request.reasoningEffort !== void 0 && (request.harness === "cursor" || request.harness === "gemini" || request.harness === "copilot")) {
|
|
3796
|
-
return {
|
|
3797
|
-
kind: "fallback",
|
|
3798
|
-
reason: "unsupported-reasoning-effort",
|
|
3799
|
-
detail: `${request.harness} does not support a generic reasoning_effort override.`
|
|
3797
|
+
detail: `No adapter is registered for ${harness}.`
|
|
3800
3798
|
};
|
|
3801
3799
|
}
|
|
3800
|
+
const blocked = guard?.();
|
|
3801
|
+
if (blocked) return blocked;
|
|
3802
3802
|
if (!active.executableExists(adapter.executable)) {
|
|
3803
3803
|
return {
|
|
3804
3804
|
kind: "fallback",
|
|
@@ -3806,7 +3806,7 @@ var dispatchExternalTask = async (request, overrides = {}) => {
|
|
|
3806
3806
|
detail: `${adapter.executable} is unavailable.`
|
|
3807
3807
|
};
|
|
3808
3808
|
}
|
|
3809
|
-
const commandSpec = adapter.buildCommand(
|
|
3809
|
+
const commandSpec = adapter.buildCommand(input);
|
|
3810
3810
|
const authentication = await active.authenticate(commandSpec, adapter);
|
|
3811
3811
|
if (!authentication.ok) {
|
|
3812
3812
|
return {
|
|
@@ -3815,16 +3815,35 @@ var dispatchExternalTask = async (request, overrides = {}) => {
|
|
|
3815
3815
|
detail: authentication.detail ?? `${adapter.executable} authentication check failed.`
|
|
3816
3816
|
};
|
|
3817
3817
|
}
|
|
3818
|
+
return { kind: "ready", command: commandSpec };
|
|
3819
|
+
};
|
|
3820
|
+
var launchPrepared = async (prepared, active, label) => {
|
|
3821
|
+
if (prepared.kind === "fallback") return prepared;
|
|
3818
3822
|
try {
|
|
3819
|
-
const launched = await active.launch(
|
|
3823
|
+
const launched = await active.launch(prepared.command);
|
|
3820
3824
|
return launched.exitCode === 0 ? { kind: "launched-success", exitCode: 0 } : { kind: "launched-failure", exitCode: launched.exitCode };
|
|
3821
3825
|
} catch (error) {
|
|
3822
3826
|
return {
|
|
3823
3827
|
kind: "infrastructure-failure",
|
|
3824
|
-
detail: `External
|
|
3828
|
+
detail: `External ${label} process failed: ${errorMessage(error)}`
|
|
3825
3829
|
};
|
|
3826
3830
|
}
|
|
3827
3831
|
};
|
|
3832
|
+
var unsupportedReasoningEffort = (request) => request.reasoningEffort !== void 0 && (request.harness === "cursor" || request.harness === "gemini" || request.harness === "copilot") ? {
|
|
3833
|
+
kind: "fallback",
|
|
3834
|
+
reason: "unsupported-reasoning-effort",
|
|
3835
|
+
detail: `${request.harness} does not support a generic reasoning_effort override.`
|
|
3836
|
+
} : void 0;
|
|
3837
|
+
var dispatchExternalTask = async (request, overrides = {}) => {
|
|
3838
|
+
const active = { ...dependencies, ...overrides };
|
|
3839
|
+
const prepared = await prepareLaunch(
|
|
3840
|
+
request.harness,
|
|
3841
|
+
taskCommandRequest(request),
|
|
3842
|
+
active,
|
|
3843
|
+
() => unsupportedReasoningEffort(request)
|
|
3844
|
+
);
|
|
3845
|
+
return launchPrepared(prepared, active, "task");
|
|
3846
|
+
};
|
|
3828
3847
|
|
|
3829
3848
|
// src/skill-scripts/shared/harness-availability.ts
|
|
3830
3849
|
var fs2 = __toESM(require("fs"));
|
|
@@ -6509,7 +6528,7 @@ var main = async () => {
|
|
|
6509
6528
|
);
|
|
6510
6529
|
}
|
|
6511
6530
|
const handoff = decodeHandoff(handoffArg);
|
|
6512
|
-
const
|
|
6531
|
+
const routed = {
|
|
6513
6532
|
harness: handoff.harness,
|
|
6514
6533
|
model: handoff.model,
|
|
6515
6534
|
...handoff.reasoningEffort === void 0 ? {} : { reasoningEffort: handoff.reasoningEffort },
|
|
@@ -6518,7 +6537,8 @@ var main = async () => {
|
|
|
6518
6537
|
taskId: validTaskId,
|
|
6519
6538
|
taskFile: taskPath,
|
|
6520
6539
|
taskMarkdown
|
|
6521
|
-
}
|
|
6540
|
+
};
|
|
6541
|
+
const result = await dispatchExternalTask(routed);
|
|
6522
6542
|
emit(
|
|
6523
6543
|
result,
|
|
6524
6544
|
result.kind === "infrastructure-failure" ? 2 : result.kind === "launched-failure" ? 1 : 0
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# CODE_REVIEW Hook
|
|
2
|
+
|
|
3
|
+
## Automated Code Review Gate
|
|
4
|
+
|
|
5
|
+
This hook governs an unattended review loop that runs at the end of blueprint execution, after mechanical gates (lint, tests, Self Validation) report success. A reviewer on a discovered external harness critiques the plan's cumulative diff and emits findings; findings at or above the severity and confidence floors trigger automatic remediation, followed by a full re-run of the mechanical gates and re-verification.
|
|
6
|
+
|
|
7
|
+
The gate terminates on exhausted round budget or when no findings above threshold remain.
|
|
8
|
+
|
|
9
|
+
## Mandate: Conformance and Defects Only
|
|
10
|
+
|
|
11
|
+
The reviewer checks the diff against the **plan's stated requirements** and for **demonstrable defects**. It does **not** raise general code-quality opinions, style notes, design critiques, or taste judgments — the linter owns style. Every finding must cite concrete evidence and trace to:
|
|
12
|
+
|
|
13
|
+
- An explicit requirement stated in the plan, **or**
|
|
14
|
+
- A demonstrable defect in the code as written
|
|
15
|
+
|
|
16
|
+
Anything else is out of scope and must not be included in findings.
|
|
17
|
+
|
|
18
|
+
## Finding Categories In Scope
|
|
19
|
+
|
|
20
|
+
- **Requirement conformance** — the code does not implement what the plan explicitly asked for
|
|
21
|
+
- **Demonstrable defects** — the code fails at runtime, produces wrong behaviour, violates a contract it declares, has a security hole, causes data loss, or breaks something else in the plan
|
|
22
|
+
|
|
23
|
+
## Severity Floor: `major`
|
|
24
|
+
|
|
25
|
+
Findings below `major` are recorded in the review output but never auto-applied. The severity levels, ordered from most to least consequential:
|
|
26
|
+
|
|
27
|
+
- `critical` — causes data loss, security hole, crash, or corruption on a path real usage reaches
|
|
28
|
+
- `major` — produces wrong behaviour or breaks a documented contract; nothing destroyed
|
|
29
|
+
- `minor` — real but bounded (mishandled edge case, missing test, maintenance hazard); behaviour correct today
|
|
30
|
+
- `info` — no defect (style, naming, question for author, recorded context)
|
|
31
|
+
|
|
32
|
+
If a finding omits the severity attribute, it falls below the floor and is never auto-applied.
|
|
33
|
+
|
|
34
|
+
## Confidence Floor: `high`
|
|
35
|
+
|
|
36
|
+
Findings below `high` are recorded but never auto-applied. The confidence levels, ordered from most to least sure:
|
|
37
|
+
|
|
38
|
+
- `high` — evidence is in the code that was read; failure can be traced from the diff alone, no assumptions needed
|
|
39
|
+
- `medium` — likely real, but rests on one assumption not verified (how a caller behaves, what a dependency guarantees, what a requirement was)
|
|
40
|
+
- `low` — speculative (failure scenario imagined, not traced; constraint invented; intent could not be inferred)
|
|
41
|
+
|
|
42
|
+
If a finding omits the confidence attribute, it falls below the floor and is never auto-applied.
|
|
43
|
+
|
|
44
|
+
This attribute has no schema default on purpose. Findings that omit confidence are treated as falling below any floor. An automated consumer relies on confidence being lowered honestly; LLM reviewers systematically overstate certainty.
|
|
45
|
+
|
|
46
|
+
## Round Budget: 3
|
|
47
|
+
|
|
48
|
+
The gate runs up to three detect-and-fix cycles:
|
|
49
|
+
|
|
50
|
+
1. Reviewer critiques the cumulative diff → findings
|
|
51
|
+
2. If findings above floor exist: implement fixes, re-run mechanical gates, verify
|
|
52
|
+
3. Reviewer re-checks → repeat until no new findings above floor or budget exhausted
|
|
53
|
+
|
|
54
|
+
This value expressed here is advisory prose only. **Termination is enforced in code and cannot be bypassed by editing this file.** If the round budget is exhausted, the gate halts exactly as any mechanical gate failure does: the plan stays in `plans/`, findings are recorded, and the failure is documented.
|
|
55
|
+
|
|
56
|
+
## Disable the Gate
|
|
57
|
+
|
|
58
|
+
**Emptying this file, or deleting it, disables the review gate cleanly.** The gate skips with no error and records the skip in the execution summary. This is the documented sentinel for "do not review this plan"; there is no undefined behaviour and no error.
|
|
59
|
+
|
|
60
|
+
Users who already have a code review step in their workflow disable this feature by editing or emptying the hook, matching the pattern of `PRE_TASK_EXECUTION` which ships an overridable default discipline.
|