@rpamis/comet 0.4.0-beta.4 → 0.4.0-beta.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/LICENSE +21 -21
- package/README.md +5 -1
- package/assets/manifest.json +1 -1
- package/assets/skills/comet/SKILL.md +30 -28
- package/assets/skills/comet/reference/auto-transition.md +1 -1
- package/assets/skills/comet/reference/comet-yaml-fields.md +6 -4
- package/assets/skills/comet/reference/context-recovery.md +2 -2
- package/assets/skills/comet/reference/decision-point.md +11 -0
- package/assets/skills/comet/reference/subagent-dispatch.md +6 -5
- package/assets/skills/comet/rules/comet-phase-guard.en.md +23 -28
- package/assets/skills/comet/rules/comet-phase-guard.md +22 -28
- package/assets/skills/comet/scripts/comet-runtime.mjs +185 -56
- package/assets/skills/comet-any/SKILL.md +1 -1
- package/assets/skills/comet-any/reference/authored-zone-example.md +10 -5
- package/assets/skills/comet-any/reference/subagents/pause-points-author.md +14 -11
- package/assets/skills/comet-any/reference/subagents/skill-reviewer.md +2 -0
- package/assets/skills/comet-any/reference/subagents/workflow-entry-author.md +5 -4
- package/assets/skills/comet-archive/SKILL.md +34 -13
- package/assets/skills/comet-build/SKILL.md +23 -21
- package/assets/skills/comet-design/SKILL.md +23 -22
- package/assets/skills/comet-hotfix/SKILL.md +35 -34
- package/assets/skills/comet-open/SKILL.md +97 -58
- package/assets/skills/comet-tweak/SKILL.md +21 -18
- package/assets/skills/comet-verify/SKILL.md +35 -59
- package/assets/skills-zh/comet/SKILL.md +30 -28
- package/assets/skills-zh/comet/reference/auto-transition.md +1 -1
- package/assets/skills-zh/comet/reference/comet-yaml-fields.md +6 -4
- package/assets/skills-zh/comet/reference/context-recovery.md +2 -2
- package/assets/skills-zh/comet/reference/decision-point.md +11 -0
- package/assets/skills-zh/comet/reference/subagent-dispatch.md +6 -5
- package/assets/skills-zh/comet-any/SKILL.md +1 -1
- package/assets/skills-zh/comet-any/reference/authored-zone-example.md +10 -5
- package/assets/skills-zh/comet-any/reference/subagents/pause-points-author.md +14 -12
- package/assets/skills-zh/comet-any/reference/subagents/skill-reviewer.md +2 -0
- package/assets/skills-zh/comet-any/reference/subagents/workflow-entry-author.md +5 -4
- package/assets/skills-zh/comet-archive/SKILL.md +34 -13
- package/assets/skills-zh/comet-build/SKILL.md +23 -21
- package/assets/skills-zh/comet-design/SKILL.md +23 -22
- package/assets/skills-zh/comet-hotfix/SKILL.md +34 -33
- package/assets/skills-zh/comet-open/SKILL.md +96 -57
- package/assets/skills-zh/comet-tweak/SKILL.md +20 -17
- package/assets/skills-zh/comet-verify/SKILL.md +35 -59
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +62 -15
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/init.d.ts +1 -1
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +58 -14
- package/dist/app/commands/init.js.map +1 -1
- package/dist/app/commands/uninstall.d.ts +3 -0
- package/dist/app/commands/uninstall.d.ts.map +1 -1
- package/dist/app/commands/uninstall.js +70 -36
- package/dist/app/commands/uninstall.js.map +1 -1
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +213 -34
- package/dist/app/commands/update.js.map +1 -1
- package/dist/domains/bundle/bundle-platform.d.ts +1 -0
- package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
- package/dist/domains/bundle/bundle-platform.js +6 -2
- package/dist/domains/bundle/bundle-platform.js.map +1 -1
- package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-guard.js +15 -11
- package/dist/domains/comet-classic/classic-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.js +113 -19
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-resolver.js +1 -1
- package/dist/domains/comet-classic/classic-resolver.js.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.js +22 -13
- package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-state.d.ts +3 -2
- package/dist/domains/comet-classic/classic-state.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-state.js +13 -1
- package/dist/domains/comet-classic/classic-state.js.map +1 -1
- package/dist/domains/comet-classic/classic-transitions.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-transitions.js +16 -2
- package/dist/domains/comet-classic/classic-transitions.js.map +1 -1
- package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-validate-command.js +7 -1
- package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
- package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/domains/dashboard/web/assets/arc-TGVUG2WN.js +1 -0
- package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-ASHmiHoP.js +36 -0
- package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-CwASxBKe.js +132 -0
- package/dist/domains/dashboard/web/assets/c4Diagram-AAUBKEIU-BU8z_WNk.js +10 -0
- package/dist/domains/dashboard/web/assets/channel-kp6Ng2JJ.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-2J33WTMH-CBGlUx4_.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-4BX2VUAB-CS-iGcFz.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-55IACEB6-BUtCVJat.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-727SXJPM-C94tj_pf.js +206 -0
- package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-BFOKcpdG.js +231 -0
- package/dist/domains/dashboard/web/assets/chunk-FMBD7UC4-Dmx8B-st.js +15 -0
- package/dist/domains/dashboard/web/assets/chunk-ND2GUHAM-DYV00CNn.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-QZHKN3VN-DMJJyQnw.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-yBDjgMY_.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-yBDjgMY_.js +1 -0
- package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-P4nE2rea.js +1 -0
- package/dist/domains/dashboard/web/assets/cynefin-VYW2F7L2-C-R1HXDv.js +166 -0
- package/dist/domains/dashboard/web/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
- package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-BH8d-C9z.js +4 -0
- package/dist/domains/dashboard/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-DpXTgQIH.js +43 -0
- package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-DSiFJzSw.js +10 -0
- package/dist/domains/dashboard/web/assets/diagram-KO2AKTUF-DULMkben.js +3 -0
- package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-Pi8m_NO9.js +24 -0
- package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-BSe6bCWm.js +24 -0
- package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-zb-FEcbq.js +85 -0
- package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-Dr-Gk0z2.js +162 -0
- package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-qs6Zb2A6.js +292 -0
- package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-BQ314orT.js +106 -0
- package/dist/domains/dashboard/web/assets/graph--OzhPTMs.js +1 -0
- package/dist/domains/dashboard/web/assets/index-BLAfkNTu.css +1 -0
- package/dist/domains/dashboard/web/assets/index-DlSYK56b.js +139 -0
- package/dist/domains/dashboard/web/assets/index-DtLUOcAW.js +24 -0
- package/dist/domains/dashboard/web/assets/index-QO0z6F4w.js +10 -0
- package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-O0bQp98A.js +2 -0
- package/dist/domains/dashboard/web/assets/init-Gi6I4Gst.js +1 -0
- package/dist/domains/dashboard/web/assets/ishikawaDiagram-YF4QCWOH-BPC7wbKh.js +70 -0
- package/dist/domains/dashboard/web/assets/journeyDiagram-JHISSGLW-ohViOd4b.js +139 -0
- package/dist/domains/dashboard/web/assets/kanban-definition-UN3LZRKU-CHleNdbG.js +89 -0
- package/dist/domains/dashboard/web/assets/katex-HP8lGamR.js +257 -0
- package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +1 -0
- package/dist/domains/dashboard/web/assets/linear-CyqiW--Q.js +1 -0
- package/dist/domains/dashboard/web/assets/marked.esm-DECB3bxB.js +64 -0
- package/dist/domains/dashboard/web/assets/mermaid.core-qS9XvtaK.js +301 -0
- package/dist/domains/dashboard/web/assets/mindmap-definition-RKZ34NQL-oaGkqO9l.js +96 -0
- package/dist/domains/dashboard/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-CPcB-AFh.js +30 -0
- package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +3 -0
- package/dist/domains/dashboard/web/assets/quadrantDiagram-W4KKPZXB-LFy52Qtj.js +7 -0
- package/dist/domains/dashboard/web/assets/requirementDiagram-4Y6WPE33-BdjeaYP_.js +84 -0
- package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-DDJ4styL.js +40 -0
- package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-BL5bFNoz.js +162 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-BNUfikui.js +1 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-DGrsmWts.js +1 -0
- package/dist/domains/dashboard/web/assets/timeline-definition-PNZ67QCA--ps2uu6L.js +120 -0
- package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-C2q8q26c.js +34 -0
- package/dist/domains/dashboard/web/assets/wardleyDiagram-YWT4CUSO-BUH9gXqd.js +78 -0
- package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-B-DielEy.js +7 -0
- package/dist/domains/dashboard/web/index.html +16 -16
- package/dist/domains/factory/package.d.ts.map +1 -1
- package/dist/domains/factory/package.js +20 -6
- package/dist/domains/factory/package.js.map +1 -1
- package/dist/domains/integrations/openspec.d.ts +4 -1
- package/dist/domains/integrations/openspec.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.js +56 -4
- package/dist/domains/integrations/openspec.js.map +1 -1
- package/dist/domains/skill/json-object.d.ts +13 -0
- package/dist/domains/skill/json-object.d.ts.map +1 -0
- package/dist/domains/skill/json-object.js +24 -0
- package/dist/domains/skill/json-object.js.map +1 -0
- package/dist/domains/skill/platform-inspect.d.ts +9 -0
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -0
- package/dist/domains/skill/platform-inspect.js +149 -0
- package/dist/domains/skill/platform-inspect.js.map +1 -0
- package/dist/domains/skill/platform-install.d.ts +16 -6
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +277 -144
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/skill/uninstall.d.ts.map +1 -1
- package/dist/domains/skill/uninstall.js +204 -141
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/platform/fs/file-system.d.ts +3 -3
- package/dist/platform/fs/file-system.d.ts.map +1 -1
- package/dist/platform/fs/file-system.js +21 -11
- package/dist/platform/fs/file-system.js.map +1 -1
- package/dist/platform/install/platforms.d.ts +4 -0
- package/dist/platform/install/platforms.d.ts.map +1 -1
- package/dist/platform/install/platforms.js +2 -0
- package/dist/platform/install/platforms.js.map +1 -1
- package/dist/platform/install/project-registry.d.ts +1 -0
- package/dist/platform/install/project-registry.d.ts.map +1 -1
- package/dist/platform/install/project-registry.js +9 -1
- package/dist/platform/install/project-registry.js.map +1 -1
- package/dist/platform/install/skill-root-owner.d.ts +15 -0
- package/dist/platform/install/skill-root-owner.d.ts.map +1 -0
- package/dist/platform/install/skill-root-owner.js +68 -0
- package/dist/platform/install/skill-root-owner.js.map +1 -0
- package/package.json +6 -1
- package/dist/domains/dashboard/web/assets/index-CIvN-PL8.js +0 -22
- package/dist/domains/dashboard/web/assets/index-DcyRPBnT.css +0 -1
- package/eval/.env +0 -28
|
@@ -7739,7 +7739,7 @@ function fullBuildConfigured(classic) {
|
|
|
7739
7739
|
}
|
|
7740
7740
|
function presetBuildConfigured(classic) {
|
|
7741
7741
|
return Boolean(
|
|
7742
|
-
classic.buildMode === "direct" && classic.tddMode === "direct" && classic.isolation
|
|
7742
|
+
classic.buildMode === "direct" && classic.tddMode === "direct" && classic.isolation !== null && classic.verifyMode === "light"
|
|
7743
7743
|
);
|
|
7744
7744
|
}
|
|
7745
7745
|
function resolveBuild(profile, classic, evidence) {
|
|
@@ -7808,7 +7808,7 @@ var BUILD_PAUSES = ["plan-ready"];
|
|
|
7808
7808
|
var SUBAGENT_DISPATCH = ["confirmed"];
|
|
7809
7809
|
var TDD_MODES = ["tdd", "direct"];
|
|
7810
7810
|
var REVIEW_MODES = ["off", "standard", "thorough"];
|
|
7811
|
-
var ISOLATIONS = ["branch", "worktree"];
|
|
7811
|
+
var ISOLATIONS = ["current", "branch", "worktree"];
|
|
7812
7812
|
var VERIFY_MODES = ["light", "full"];
|
|
7813
7813
|
var VERIFY_RESULTS = ["pending", "pass", "fail"];
|
|
7814
7814
|
var BRANCH_STATUSES = ["pending", "handled"];
|
|
@@ -7830,6 +7830,7 @@ var CLASSIC_WIRE_KEYS = [
|
|
|
7830
7830
|
"design_doc",
|
|
7831
7831
|
"plan",
|
|
7832
7832
|
"verify_result",
|
|
7833
|
+
"verify_failures",
|
|
7833
7834
|
"verification_report",
|
|
7834
7835
|
"branch_status",
|
|
7835
7836
|
"created_at",
|
|
@@ -7891,6 +7892,14 @@ function booleanValue(doc, key, nullable = true) {
|
|
|
7891
7892
|
}
|
|
7892
7893
|
return value;
|
|
7893
7894
|
}
|
|
7895
|
+
function nonNegativeInteger(doc, key, fallback = 0) {
|
|
7896
|
+
const value = doc[key];
|
|
7897
|
+
if (value === null || value === void 0 || value === "") return fallback;
|
|
7898
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
|
|
7899
|
+
throw new Error(`Invalid Classic state: ${key} must be a non-negative integer`);
|
|
7900
|
+
}
|
|
7901
|
+
return value;
|
|
7902
|
+
}
|
|
7894
7903
|
function relativePath(doc, key) {
|
|
7895
7904
|
const value = nullableString(doc, key);
|
|
7896
7905
|
if (value === null) return null;
|
|
@@ -7939,6 +7948,7 @@ function classicStateFromDocument(doc) {
|
|
|
7939
7948
|
designDoc: relativePath(doc, "design_doc"),
|
|
7940
7949
|
plan: relativePath(doc, "plan"),
|
|
7941
7950
|
verifyResult: enumValue(doc, "verify_result", VERIFY_RESULTS, false),
|
|
7951
|
+
verifyFailures: nonNegativeInteger(doc, "verify_failures"),
|
|
7942
7952
|
verificationReport: relativePath(doc, "verification_report"),
|
|
7943
7953
|
branchStatus: enumValue(doc, "branch_status", BRANCH_STATUSES),
|
|
7944
7954
|
createdAt: nullableString(doc, "created_at"),
|
|
@@ -8003,6 +8013,7 @@ function classicStateToDocument(state) {
|
|
|
8003
8013
|
design_doc: state.designDoc,
|
|
8004
8014
|
plan: state.plan,
|
|
8005
8015
|
verify_result: state.verifyResult,
|
|
8016
|
+
verify_failures: state.verifyFailures,
|
|
8006
8017
|
verification_report: state.verificationReport,
|
|
8007
8018
|
branch_status: state.branchStatus,
|
|
8008
8019
|
created_at: state.createdAt,
|
|
@@ -9390,7 +9401,7 @@ var CLASSIC_TRANSITION_TABLE = {
|
|
|
9390
9401
|
"verify-pass": {
|
|
9391
9402
|
event: "verify-pass",
|
|
9392
9403
|
from: "verify",
|
|
9393
|
-
guardRefs: ["verification-report-present"
|
|
9404
|
+
guardRefs: ["verification-report-present"]
|
|
9394
9405
|
},
|
|
9395
9406
|
"verify-fail": {
|
|
9396
9407
|
event: "verify-fail",
|
|
@@ -9450,18 +9461,22 @@ function applyClassicTransition(current, event, options = {}) {
|
|
|
9450
9461
|
const preserveEvidence = classic.verifyResult === "fail";
|
|
9451
9462
|
setField(classic, effects, "phase", "verify");
|
|
9452
9463
|
setField(classic, effects, "verifyResult", "pending");
|
|
9464
|
+
setField(classic, effects, "branchStatus", "pending");
|
|
9453
9465
|
if (!preserveEvidence) {
|
|
9454
9466
|
setField(classic, effects, "verificationReport", null);
|
|
9455
|
-
setField(classic, effects, "branchStatus", "pending");
|
|
9456
9467
|
}
|
|
9457
9468
|
} else if (event === "verify-pass") {
|
|
9458
9469
|
setField(classic, effects, "verifyResult", "pass");
|
|
9470
|
+
setField(classic, effects, "verifyFailures", 0);
|
|
9459
9471
|
setField(classic, effects, "phase", "archive");
|
|
9460
9472
|
setField(classic, effects, "verifiedAt", dateOnly(now));
|
|
9461
9473
|
setField(classic, effects, "archiveConfirmation", "pending");
|
|
9474
|
+
setField(classic, effects, "branchStatus", "pending");
|
|
9462
9475
|
} else if (event === "verify-fail") {
|
|
9463
9476
|
setField(classic, effects, "verifyResult", "fail");
|
|
9477
|
+
setField(classic, effects, "verifyFailures", classic.verifyFailures + 1);
|
|
9464
9478
|
setField(classic, effects, "phase", "build");
|
|
9479
|
+
setField(classic, effects, "branchStatus", "pending");
|
|
9465
9480
|
} else if (event === "preset-escalate") {
|
|
9466
9481
|
if (classic.workflow !== "hotfix" && classic.workflow !== "tweak") {
|
|
9467
9482
|
throw new Error(
|
|
@@ -9472,6 +9487,14 @@ function applyClassicTransition(current, event, options = {}) {
|
|
|
9472
9487
|
setField(classic, effects, "classicProfile", "full");
|
|
9473
9488
|
setField(classic, effects, "phase", "design");
|
|
9474
9489
|
setField(classic, effects, "designDoc", null);
|
|
9490
|
+
setField(classic, effects, "buildPause", null);
|
|
9491
|
+
setField(classic, effects, "buildMode", null);
|
|
9492
|
+
setField(classic, effects, "subagentDispatch", null);
|
|
9493
|
+
setField(classic, effects, "tddMode", null);
|
|
9494
|
+
setField(classic, effects, "reviewMode", null);
|
|
9495
|
+
setField(classic, effects, "isolation", null);
|
|
9496
|
+
setField(classic, effects, "verifyMode", null);
|
|
9497
|
+
setField(classic, effects, "directOverride", null);
|
|
9475
9498
|
} else if (event === "archive-confirm") {
|
|
9476
9499
|
if (classic.verifyResult !== "pass") {
|
|
9477
9500
|
throw new Error(`Cannot apply ${event}: verifyResult must be pass`);
|
|
@@ -9481,9 +9504,11 @@ function applyClassicTransition(current, event, options = {}) {
|
|
|
9481
9504
|
} else if (event === "archive-reopen") {
|
|
9482
9505
|
if (classic.archived) throw new Error(`Cannot apply ${event}: already archived`);
|
|
9483
9506
|
setField(classic, effects, "verifyResult", "pending");
|
|
9507
|
+
setField(classic, effects, "verifyFailures", 0);
|
|
9484
9508
|
setField(classic, effects, "phase", "verify");
|
|
9485
9509
|
setField(classic, effects, "verifiedAt", null);
|
|
9486
9510
|
setField(classic, effects, "archiveConfirmation", null);
|
|
9511
|
+
setField(classic, effects, "branchStatus", "pending");
|
|
9487
9512
|
} else {
|
|
9488
9513
|
if (classic.verifyResult !== "pass") {
|
|
9489
9514
|
throw new Error(`Cannot apply ${event}: verifyResult must be pass`);
|
|
@@ -10095,7 +10120,7 @@ var ENUMS = {
|
|
|
10095
10120
|
subagent_dispatch: ["confirmed"],
|
|
10096
10121
|
tdd_mode: ["tdd", "direct"],
|
|
10097
10122
|
review_mode: ["off", "standard", "thorough"],
|
|
10098
|
-
isolation: ["branch", "worktree"],
|
|
10123
|
+
isolation: ["current", "branch", "worktree"],
|
|
10099
10124
|
verify_mode: ["light", "full"],
|
|
10100
10125
|
auto_transition: ["true", "false"],
|
|
10101
10126
|
verify_result: ["pending", "pass", "fail"],
|
|
@@ -10188,6 +10213,12 @@ var classicValidateCommand = async (args) => {
|
|
|
10188
10213
|
fail3(`${field2}='${value}' is not valid. Expected: ${values.join(" ")}`);
|
|
10189
10214
|
}
|
|
10190
10215
|
}
|
|
10216
|
+
if (Object.prototype.hasOwnProperty.call(record, "verify_failures")) {
|
|
10217
|
+
const value = record.verify_failures;
|
|
10218
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
|
|
10219
|
+
fail3(`verify_failures='${text(value)}' is not a non-negative integer`);
|
|
10220
|
+
}
|
|
10221
|
+
}
|
|
10191
10222
|
for (const field2 of ["design_doc", "plan", "handoff_context"]) {
|
|
10192
10223
|
const value = text(record[field2]);
|
|
10193
10224
|
if (value && !await exists3(path14.resolve(value))) {
|
|
@@ -10224,8 +10255,9 @@ async function fileExists3(filePath) {
|
|
|
10224
10255
|
try {
|
|
10225
10256
|
await fs13.access(filePath);
|
|
10226
10257
|
return true;
|
|
10227
|
-
} catch {
|
|
10228
|
-
return false;
|
|
10258
|
+
} catch (error) {
|
|
10259
|
+
if (isNotFoundError(error)) return false;
|
|
10260
|
+
throw error;
|
|
10229
10261
|
}
|
|
10230
10262
|
}
|
|
10231
10263
|
async function readDir(dirPath) {
|
|
@@ -10239,6 +10271,9 @@ async function readDir(dirPath) {
|
|
|
10239
10271
|
throw error;
|
|
10240
10272
|
}
|
|
10241
10273
|
}
|
|
10274
|
+
function isNotFoundError(error) {
|
|
10275
|
+
return error?.code === "ENOENT";
|
|
10276
|
+
}
|
|
10242
10277
|
|
|
10243
10278
|
// domains/comet-classic/classic-project-config.ts
|
|
10244
10279
|
function configCandidates(options = {}) {
|
|
@@ -10644,11 +10679,14 @@ Next: check off corresponding completed plan tasks, then commit the plan update.
|
|
|
10644
10679
|
}
|
|
10645
10680
|
async function isolationSelected(changeDir, change) {
|
|
10646
10681
|
const isolation = await readField(changeDir, "isolation");
|
|
10682
|
+
const workflow = await readField(changeDir, "workflow");
|
|
10647
10683
|
if (isolation === "branch" || isolation === "worktree") return pass();
|
|
10684
|
+
if (isolation === "current" && (workflow === "hotfix" || workflow === "tweak")) return pass();
|
|
10685
|
+
const allowedValues = workflow === "full" ? "<branch|worktree>" : "<current|branch|worktree>";
|
|
10648
10686
|
return fail(
|
|
10649
|
-
`isolation must be branch or worktree, got '${isolation || "null"}'
|
|
10650
|
-
Next:
|
|
10651
|
-
|
|
10687
|
+
`isolation must be ${workflow === "full" ? "branch or worktree" : "current, branch, or worktree"}, got '${isolation || "null"}'
|
|
10688
|
+
Next: choose a valid workspace mode, prepare it when needed, then run:
|
|
10689
|
+
comet state set ${change} isolation ${allowedValues}`
|
|
10652
10690
|
);
|
|
10653
10691
|
}
|
|
10654
10692
|
async function buildModeSelected(changeDir, change) {
|
|
@@ -10658,7 +10696,7 @@ async function buildModeSelected(changeDir, change) {
|
|
|
10658
10696
|
return fail(
|
|
10659
10697
|
`build_mode must be selected before leaving build, got '${buildMode || "null"}'
|
|
10660
10698
|
Next: ask the user to choose an execution mode, then run:
|
|
10661
|
-
|
|
10699
|
+
comet state set ${change} build_mode <subagent-driven-development|executing-plans>`
|
|
10662
10700
|
);
|
|
10663
10701
|
}
|
|
10664
10702
|
async function buildModeAllowedForWorkflow(changeDir) {
|
|
@@ -10680,9 +10718,9 @@ async function subagentDispatchConfirmed(changeDir, change) {
|
|
|
10680
10718
|
return fail(
|
|
10681
10719
|
`subagent_dispatch must be confirmed before using build_mode=subagent-driven-development
|
|
10682
10720
|
Next: confirm the current platform has a real background subagent/Task/multi-agent dispatcher, then run:
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10721
|
+
comet state set ${change} subagent_dispatch confirmed
|
|
10722
|
+
If dispatch is unavailable, return to /comet-build Step 2 with subagent-driven-development removed. When executing-plans is the only valid mode, run:
|
|
10723
|
+
comet state set ${change} build_mode executing-plans`
|
|
10686
10724
|
);
|
|
10687
10725
|
}
|
|
10688
10726
|
async function tddModeSelected(changeDir, change) {
|
|
@@ -10693,7 +10731,7 @@ async function tddModeSelected(changeDir, change) {
|
|
|
10693
10731
|
return fail(
|
|
10694
10732
|
`tdd_mode must be tdd or direct for full workflow, got '${tddMode || "null"}'
|
|
10695
10733
|
Next: ask the user to choose TDD enforcement level, then run:
|
|
10696
|
-
|
|
10734
|
+
comet state set ${change} tdd_mode <tdd|direct>`
|
|
10697
10735
|
);
|
|
10698
10736
|
}
|
|
10699
10737
|
async function reviewModeSelected(changeDir, change) {
|
|
@@ -10706,7 +10744,7 @@ async function reviewModeSelected(changeDir, change) {
|
|
|
10706
10744
|
return fail(
|
|
10707
10745
|
`review_mode must be off, standard, or thorough before leaving build, got '${reviewMode || "null"}'
|
|
10708
10746
|
Next: ask the user to choose review strength, then run:
|
|
10709
|
-
|
|
10747
|
+
comet state set ${change} review_mode <off|standard|thorough>`
|
|
10710
10748
|
);
|
|
10711
10749
|
}
|
|
10712
10750
|
async function verificationReportExists(changeDir) {
|
|
@@ -10737,7 +10775,7 @@ async function designDocRecorded(changeDir, change) {
|
|
|
10737
10775
|
if (designDoc && designDoc !== "null" && existsSync(designDoc)) return pass();
|
|
10738
10776
|
return fail(
|
|
10739
10777
|
`design_doc must point to an existing Superpowers Design Doc for full workflow before leaving design.
|
|
10740
|
-
Next: create the Design Doc and run:
|
|
10778
|
+
Next: create the Design Doc and run: comet state set ${change} design_doc <path>`
|
|
10741
10779
|
);
|
|
10742
10780
|
}
|
|
10743
10781
|
async function designHandoffContextValid(changeDir, change) {
|
|
@@ -10752,13 +10790,13 @@ Next: run node "$COMET_HANDOFF" ${change} design --write before invoking Superpo
|
|
|
10752
10790
|
if (!await nonempty(context)) {
|
|
10753
10791
|
return fail(
|
|
10754
10792
|
`handoff_context does not point to a non-empty file: ${context}
|
|
10755
|
-
Next: regenerate the design handoff with comet
|
|
10793
|
+
Next: regenerate the design handoff with comet handoff ${change} design --write.`
|
|
10756
10794
|
);
|
|
10757
10795
|
}
|
|
10758
10796
|
if (!/^[a-f0-9]{64}$/u.test(recordedHash)) {
|
|
10759
10797
|
return fail(
|
|
10760
10798
|
`handoff_hash is missing or invalid: ${recordedHash || "null"}
|
|
10761
|
-
Next: regenerate the design handoff with comet
|
|
10799
|
+
Next: regenerate the design handoff with comet handoff ${change} design --write.`
|
|
10762
10800
|
);
|
|
10763
10801
|
}
|
|
10764
10802
|
const actualHash = await computeHandoffHash(changeDir);
|
|
@@ -10767,14 +10805,14 @@ Next: regenerate the design handoff with comet-handoff.mjs.`
|
|
|
10767
10805
|
`OpenSpec artifacts changed after handoff was generated.
|
|
10768
10806
|
Expected handoff_hash: ${recordedHash}
|
|
10769
10807
|
Actual handoff_hash: ${actualHash}
|
|
10770
|
-
Next:
|
|
10808
|
+
Next: run comet handoff ${change} design --write so Superpowers receives the current OpenSpec context.`
|
|
10771
10809
|
);
|
|
10772
10810
|
}
|
|
10773
10811
|
const markdown = `${context.replace(/\.json$/u, "")}.md`;
|
|
10774
10812
|
if (!await nonempty(markdown)) {
|
|
10775
10813
|
return fail(
|
|
10776
10814
|
`design handoff markdown is missing or empty: ${markdown}
|
|
10777
|
-
Next: regenerate the design handoff with comet
|
|
10815
|
+
Next: regenerate the design handoff with comet handoff ${change} design --write.`
|
|
10778
10816
|
);
|
|
10779
10817
|
}
|
|
10780
10818
|
return pass();
|
|
@@ -11007,11 +11045,7 @@ async function guardVerifyChecks(output, changeDir, change, run) {
|
|
|
11007
11045
|
const report = await readField(changeDir, "verification_report");
|
|
11008
11046
|
if (!report || report === "null" || !await exists4(report)) return pass();
|
|
11009
11047
|
return documentLanguageMatchesConfigured(changeDir, report);
|
|
11010
|
-
})
|
|
11011
|
-
check(
|
|
11012
|
-
"branch_status=handled",
|
|
11013
|
-
async () => await branchStatusHandled(changeDir) ? pass() : fail("")
|
|
11014
|
-
)
|
|
11048
|
+
})
|
|
11015
11049
|
]);
|
|
11016
11050
|
}
|
|
11017
11051
|
async function guardArchiveChecks(output, changeDir) {
|
|
@@ -11025,7 +11059,11 @@ async function guardArchiveChecks(output, changeDir) {
|
|
|
11025
11059
|
"design.md exists",
|
|
11026
11060
|
async () => await nonempty(path16.join(changeDir, "design.md")) ? pass() : fail("")
|
|
11027
11061
|
),
|
|
11028
|
-
check("tasks.md all tasks checked", () => tasksAllDone(changeDir))
|
|
11062
|
+
check("tasks.md all tasks checked", () => tasksAllDone(changeDir)),
|
|
11063
|
+
check(
|
|
11064
|
+
"branch_status=handled",
|
|
11065
|
+
async () => await branchStatusHandled(changeDir) ? pass() : fail("")
|
|
11066
|
+
)
|
|
11029
11067
|
]);
|
|
11030
11068
|
}
|
|
11031
11069
|
async function applyStateUpdate(output, change, changeDir, phase, context) {
|
|
@@ -11736,6 +11774,10 @@ function inputTarget() {
|
|
|
11736
11774
|
function normalized(value) {
|
|
11737
11775
|
return value.replaceAll("\\", "/").replace(/\/+/gu, "/");
|
|
11738
11776
|
}
|
|
11777
|
+
function comparisonKey(value) {
|
|
11778
|
+
const normalizedValue = normalized(value);
|
|
11779
|
+
return process.platform === "win32" ? normalizedValue.toLowerCase() : normalizedValue;
|
|
11780
|
+
}
|
|
11739
11781
|
function parseProjectRoot(args) {
|
|
11740
11782
|
const index = args.indexOf("--project-root");
|
|
11741
11783
|
const value = index >= 0 ? args[index + 1] : void 0;
|
|
@@ -11790,12 +11832,17 @@ async function projectRelative(target, projectRoot2) {
|
|
|
11790
11832
|
}
|
|
11791
11833
|
async function loadGoverningChange(changeDir) {
|
|
11792
11834
|
try {
|
|
11793
|
-
const
|
|
11835
|
+
const projection = await readClassicState(changeDir, { migrate: false });
|
|
11836
|
+
const unknownKeys = Array.from(new Set(projection.unknownKeys)).sort();
|
|
11837
|
+
if (unknownKeys.length > 0) {
|
|
11838
|
+
throw new Error(`Invalid Classic state: unknown field(s): ${unknownKeys.join(", ")}`);
|
|
11839
|
+
}
|
|
11840
|
+
if (!projection.classic) throw new Error("Classic state projection is unavailable");
|
|
11794
11841
|
return {
|
|
11795
11842
|
changeDir,
|
|
11796
|
-
phase:
|
|
11797
|
-
classic:
|
|
11798
|
-
archived:
|
|
11843
|
+
phase: projection.classic.phase,
|
|
11844
|
+
classic: projection.classic,
|
|
11845
|
+
archived: projection.classic.archived
|
|
11799
11846
|
};
|
|
11800
11847
|
} catch {
|
|
11801
11848
|
const legacy = await readLegacyState(changeDir);
|
|
@@ -11825,7 +11872,41 @@ async function activeChanges(projectRoot2) {
|
|
|
11825
11872
|
return governingChanges;
|
|
11826
11873
|
}
|
|
11827
11874
|
function isSuperpowersArtifactPath(relativePath2) {
|
|
11828
|
-
return relativePath2.startsWith("docs/superpowers/");
|
|
11875
|
+
return comparisonKey(relativePath2).startsWith("docs/superpowers/");
|
|
11876
|
+
}
|
|
11877
|
+
var SUPERPOWERS_ARTIFACT_SLOTS = [
|
|
11878
|
+
{
|
|
11879
|
+
prefix: "docs/superpowers/specs/",
|
|
11880
|
+
field: "designDoc",
|
|
11881
|
+
wireField: "design_doc",
|
|
11882
|
+
phase: "design"
|
|
11883
|
+
},
|
|
11884
|
+
{
|
|
11885
|
+
prefix: "docs/superpowers/plans/",
|
|
11886
|
+
field: "plan",
|
|
11887
|
+
wireField: "plan",
|
|
11888
|
+
phase: "build"
|
|
11889
|
+
},
|
|
11890
|
+
{
|
|
11891
|
+
prefix: "docs/superpowers/reports/",
|
|
11892
|
+
field: "verificationReport",
|
|
11893
|
+
wireField: "verification_report",
|
|
11894
|
+
phase: "verify"
|
|
11895
|
+
}
|
|
11896
|
+
];
|
|
11897
|
+
function standardSuperpowersArtifactSlot(relativePath2) {
|
|
11898
|
+
const key = comparisonKey(relativePath2);
|
|
11899
|
+
const slot = SUPERPOWERS_ARTIFACT_SLOTS.find((candidate) => key.startsWith(candidate.prefix));
|
|
11900
|
+
if (!slot) return null;
|
|
11901
|
+
const fileName = key.slice(slot.prefix.length);
|
|
11902
|
+
if (!fileName || fileName.includes("/") || !fileName.endsWith(".md")) return null;
|
|
11903
|
+
return slot;
|
|
11904
|
+
}
|
|
11905
|
+
function superpowersArtifactValue(governing, slot) {
|
|
11906
|
+
return governing.classic?.[slot.field] ?? null;
|
|
11907
|
+
}
|
|
11908
|
+
function allowsFirstSuperpowersArtifactWrite(governing, slot) {
|
|
11909
|
+
return governing.classic !== null && governing.phase === slot.phase && !superpowersArtifactValue(governing, slot);
|
|
11829
11910
|
}
|
|
11830
11911
|
function allowsSuperpowersArtifacts(governing) {
|
|
11831
11912
|
return governing.phase === "design" || governing.phase === "build" || governing.phase === "verify";
|
|
@@ -11851,7 +11932,7 @@ function matchesRecordedSuperpowersArtifact(relativePath2, governing) {
|
|
|
11851
11932
|
governing.classic?.verificationReport
|
|
11852
11933
|
];
|
|
11853
11934
|
return artifactPaths.some(
|
|
11854
|
-
(artifactPath) => artifactPath &&
|
|
11935
|
+
(artifactPath) => artifactPath && comparisonKey(artifactPath) === comparisonKey(relativePath2)
|
|
11855
11936
|
);
|
|
11856
11937
|
}
|
|
11857
11938
|
function matchesSuperpowersArtifactName(relativePath2, changeName) {
|
|
@@ -11867,7 +11948,7 @@ async function superpowersArtifactGoverningChange(relativePath2, projectRoot2) {
|
|
|
11867
11948
|
const recorded = active.find(
|
|
11868
11949
|
(governing) => matchesRecordedSuperpowersArtifact(relativePath2, governing)
|
|
11869
11950
|
);
|
|
11870
|
-
if (recorded) return recorded;
|
|
11951
|
+
if (recorded) return { governing: recorded, match: "recorded" };
|
|
11871
11952
|
const eligible = active.filter(allowsSuperpowersArtifacts);
|
|
11872
11953
|
const named = eligible.filter((governing) => {
|
|
11873
11954
|
const name = governingChangeName(governing);
|
|
@@ -11875,7 +11956,7 @@ async function superpowersArtifactGoverningChange(relativePath2, projectRoot2) {
|
|
|
11875
11956
|
}).sort(
|
|
11876
11957
|
(a, b) => (governingChangeName(b)?.length ?? 0) - (governingChangeName(a)?.length ?? 0)
|
|
11877
11958
|
)[0];
|
|
11878
|
-
if (named) return named;
|
|
11959
|
+
if (named) return { governing: named, match: "named" };
|
|
11879
11960
|
return null;
|
|
11880
11961
|
}
|
|
11881
11962
|
async function repoSourceGoverningChange(projectRoot2, relativePath2) {
|
|
@@ -11923,7 +12004,26 @@ async function governingChange(relativePath2, projectRoot2) {
|
|
|
11923
12004
|
}
|
|
11924
12005
|
if (isSuperpowersArtifactPath(relativePath2)) {
|
|
11925
12006
|
const superpowers = await superpowersArtifactGoverningChange(relativePath2, projectRoot2);
|
|
11926
|
-
if (superpowers
|
|
12007
|
+
if (superpowers?.match === "recorded") {
|
|
12008
|
+
return { ...superpowers.governing, superpowersArtifact: "matched" };
|
|
12009
|
+
}
|
|
12010
|
+
const slot = standardSuperpowersArtifactSlot(relativePath2);
|
|
12011
|
+
if (superpowers) {
|
|
12012
|
+
return slot ? {
|
|
12013
|
+
...superpowers.governing,
|
|
12014
|
+
superpowersArtifact: allowsFirstSuperpowersArtifactWrite(superpowers.governing, slot) ? "matched" : "unmatched",
|
|
12015
|
+
superpowersSlot: slot
|
|
12016
|
+
} : { ...superpowers.governing, superpowersArtifact: "matched" };
|
|
12017
|
+
}
|
|
12018
|
+
if (slot) {
|
|
12019
|
+
const candidate = await repoSourceGoverningChange(projectRoot2, relativePath2);
|
|
12020
|
+
if (!candidate || "blockedResult" in candidate) return candidate;
|
|
12021
|
+
return {
|
|
12022
|
+
...candidate,
|
|
12023
|
+
superpowersArtifact: allowsFirstSuperpowersArtifactWrite(candidate, slot) ? "matched" : "unmatched",
|
|
12024
|
+
superpowersSlot: slot
|
|
12025
|
+
};
|
|
12026
|
+
}
|
|
11927
12027
|
const fallback = (await activeChanges(projectRoot2))[0] ?? null;
|
|
11928
12028
|
return fallback ? { ...fallback, superpowersArtifact: "unmatched" } : null;
|
|
11929
12029
|
}
|
|
@@ -11971,7 +12071,7 @@ function blocked(relativePath2, phase) {
|
|
|
11971
12071
|
" BLOCKED: source writes are not allowed during design",
|
|
11972
12072
|
" This phase does not allow source writes",
|
|
11973
12073
|
" ALLOWED: run brainstorming, create the Design Doc, and run guard",
|
|
11974
|
-
" NEXT: finish the Design Doc, then run comet
|
|
12074
|
+
" NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"
|
|
11975
12075
|
] : [
|
|
11976
12076
|
" BLOCKED: source writes are not allowed during archive",
|
|
11977
12077
|
" This phase does not allow source writes",
|
|
@@ -12012,7 +12112,25 @@ function blockedMissingDesignDoc(relativePath2) {
|
|
|
12012
12112
|
].join("\n")
|
|
12013
12113
|
);
|
|
12014
12114
|
}
|
|
12015
|
-
function blockedUnmatchedSuperpowersArtifact(relativePath2,
|
|
12115
|
+
function blockedUnmatchedSuperpowersArtifact(relativePath2, governing) {
|
|
12116
|
+
const slot = governing.superpowersSlot;
|
|
12117
|
+
const recorded = slot ? superpowersArtifactValue(governing, slot) : null;
|
|
12118
|
+
const details = slot ? governing.phase !== slot.phase ? [
|
|
12119
|
+
` BLOCKED: ${slot.wireField} cannot be first-written in phase ${governing.phase}`,
|
|
12120
|
+
` Expected phase: ${slot.phase}`,
|
|
12121
|
+
" NEXT: resume the matching Comet phase or use an already recorded artifact path"
|
|
12122
|
+
] : recorded ? [
|
|
12123
|
+
` BLOCKED: ${slot.wireField} is already recorded for this change`,
|
|
12124
|
+
` Recorded path: ${recorded}`,
|
|
12125
|
+
" NEXT: write the recorded artifact or explicitly correct the state path"
|
|
12126
|
+
] : [
|
|
12127
|
+
" BLOCKED: standard Superpowers artifact state is incomplete",
|
|
12128
|
+
" NEXT: validate the active change state, then retry the matching phase"
|
|
12129
|
+
] : [
|
|
12130
|
+
" BLOCKED: unmatched Superpowers artifact",
|
|
12131
|
+
" This docs/superpowers/ path does not match any active change artifact",
|
|
12132
|
+
" NEXT: use a recorded artifact path or a standard phase artifact directory"
|
|
12133
|
+
];
|
|
12016
12134
|
return result(
|
|
12017
12135
|
2,
|
|
12018
12136
|
[
|
|
@@ -12021,12 +12139,10 @@ function blockedUnmatchedSuperpowersArtifact(relativePath2, phase) {
|
|
|
12021
12139
|
"║ COMET PHASE GUARD — WRITE BLOCKED ║",
|
|
12022
12140
|
"╚══════════════════════════════════════════╝",
|
|
12023
12141
|
"",
|
|
12024
|
-
` Current phase: ${phase}`,
|
|
12142
|
+
` Current phase: ${governing.phase}`,
|
|
12025
12143
|
` Target file: ${relativePath2}`,
|
|
12026
12144
|
"",
|
|
12027
|
-
|
|
12028
|
-
" This docs/superpowers/ path does not match any active change artifact",
|
|
12029
|
-
" NEXT: record the artifact path in .comet.yaml or include the change name in the artifact filename",
|
|
12145
|
+
...details,
|
|
12030
12146
|
""
|
|
12031
12147
|
].join("\n")
|
|
12032
12148
|
);
|
|
@@ -12104,7 +12220,7 @@ var classicHookGuardCommand = async (args) => {
|
|
|
12104
12220
|
return allowed(`${relativePath2} (phase: ${phase}, superpowers)`);
|
|
12105
12221
|
}
|
|
12106
12222
|
if (governing.superpowersArtifact === "unmatched") {
|
|
12107
|
-
return blockedUnmatchedSuperpowersArtifact(relativePath2,
|
|
12223
|
+
return blockedUnmatchedSuperpowersArtifact(relativePath2, governing);
|
|
12108
12224
|
}
|
|
12109
12225
|
}
|
|
12110
12226
|
if (phase === "build" && governing.classic?.workflow === "full" && !governing.classic.designDoc) {
|
|
@@ -12928,6 +13044,7 @@ var EVENTS = CLASSIC_TRANSITION_EVENTS;
|
|
|
12928
13044
|
var MACHINE_OWNED_FIELDS = /* @__PURE__ */ new Set([
|
|
12929
13045
|
...RUN_WIRE_KEYS,
|
|
12930
13046
|
"archive_confirmation",
|
|
13047
|
+
"verify_failures",
|
|
12931
13048
|
"classic_profile",
|
|
12932
13049
|
"classic_migration"
|
|
12933
13050
|
]);
|
|
@@ -12943,7 +13060,7 @@ var FIELD_ENUMS = {
|
|
|
12943
13060
|
subagent_dispatch: ["null", "confirmed"],
|
|
12944
13061
|
tdd_mode: ["tdd", "direct"],
|
|
12945
13062
|
review_mode: ["off", "standard", "thorough"],
|
|
12946
|
-
isolation: ["branch", "worktree"],
|
|
13063
|
+
isolation: ["current", "branch", "worktree"],
|
|
12947
13064
|
verify_mode: ["light", "full"],
|
|
12948
13065
|
auto_transition: ["true", "false"],
|
|
12949
13066
|
verify_result: ["pending", "pass", "fail"],
|
|
@@ -12966,6 +13083,7 @@ var CLASSIC_FIELD_WIRE_NAMES2 = {
|
|
|
12966
13083
|
verifiedAt: "verified_at",
|
|
12967
13084
|
archiveConfirmation: "archive_confirmation",
|
|
12968
13085
|
verifyResult: "verify_result",
|
|
13086
|
+
verifyFailures: "verify_failures",
|
|
12969
13087
|
workflow: "workflow"
|
|
12970
13088
|
};
|
|
12971
13089
|
var CommandFailure = class extends Error {
|
|
@@ -13100,6 +13218,10 @@ function nullableRecordBoolean(record, field2) {
|
|
|
13100
13218
|
if (value === "false") return false;
|
|
13101
13219
|
return null;
|
|
13102
13220
|
}
|
|
13221
|
+
function nonNegativeRecordInteger(record, field2, fallback = 0) {
|
|
13222
|
+
const value = record[field2];
|
|
13223
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : fallback;
|
|
13224
|
+
}
|
|
13103
13225
|
function sparseClassicState(record) {
|
|
13104
13226
|
const workflow = enumRecordValue(record, "workflow", PROFILES, "full");
|
|
13105
13227
|
return {
|
|
@@ -13127,7 +13249,12 @@ function sparseClassicState(record) {
|
|
|
13127
13249
|
["off", "standard", "thorough"],
|
|
13128
13250
|
null
|
|
13129
13251
|
),
|
|
13130
|
-
isolation: enumRecordValue(
|
|
13252
|
+
isolation: enumRecordValue(
|
|
13253
|
+
record,
|
|
13254
|
+
"isolation",
|
|
13255
|
+
["current", "branch", "worktree"],
|
|
13256
|
+
null
|
|
13257
|
+
),
|
|
13131
13258
|
verifyMode: enumRecordValue(record, "verify_mode", ["light", "full"], null),
|
|
13132
13259
|
autoTransition: nullableRecordBoolean(record, "auto_transition"),
|
|
13133
13260
|
baseRef: nullableRecordString(record, "base_ref"),
|
|
@@ -13139,6 +13266,7 @@ function sparseClassicState(record) {
|
|
|
13139
13266
|
["pending", "pass", "fail"],
|
|
13140
13267
|
"pending"
|
|
13141
13268
|
),
|
|
13269
|
+
verifyFailures: nonNegativeRecordInteger(record, "verify_failures"),
|
|
13142
13270
|
verificationReport: nullableRecordString(record, "verification_report"),
|
|
13143
13271
|
branchStatus: enumRecordValue(record, "branch_status", ["pending", "handled"], null),
|
|
13144
13272
|
createdAt: nullableRecordString(record, "created_at"),
|
|
@@ -13315,13 +13443,14 @@ async function init(output, name, workflow) {
|
|
|
13315
13443
|
subagent_dispatch: null,
|
|
13316
13444
|
tdd_mode: preset ? "direct" : null,
|
|
13317
13445
|
review_mode: reviewMode,
|
|
13318
|
-
isolation: preset ? "
|
|
13446
|
+
isolation: preset ? "current" : null,
|
|
13319
13447
|
verify_mode: preset ? "light" : null,
|
|
13320
13448
|
auto_transition: await autoTransition() === "true",
|
|
13321
13449
|
base_ref: gitOutput(["rev-parse", "--verify", "HEAD"]),
|
|
13322
13450
|
design_doc: null,
|
|
13323
13451
|
plan: null,
|
|
13324
13452
|
verify_result: "pending",
|
|
13453
|
+
verify_failures: 0,
|
|
13325
13454
|
verification_report: null,
|
|
13326
13455
|
branch_status: "pending",
|
|
13327
13456
|
created_at: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
@@ -13346,9 +13475,10 @@ async function requireBuildDecisions(name) {
|
|
|
13346
13475
|
const subagentDispatch = await readField3(name, "subagent_dispatch");
|
|
13347
13476
|
const tddMode = await readField3(name, "tdd_mode");
|
|
13348
13477
|
const reviewMode = await readField3(name, "review_mode");
|
|
13349
|
-
|
|
13478
|
+
const allowedIsolation = workflow === "full" ? ["branch", "worktree"] : ["current", "branch", "worktree"];
|
|
13479
|
+
if (!allowedIsolation.includes(isolation)) {
|
|
13350
13480
|
fail2(
|
|
13351
|
-
`ERROR: Cannot transition '${name}': isolation must be branch or worktree, got '${isolation || "null"}'`
|
|
13481
|
+
`ERROR: Cannot transition '${name}': isolation must be ${workflow === "full" ? "branch or worktree" : "current, branch, or worktree"}, got '${isolation || "null"}'`
|
|
13352
13482
|
);
|
|
13353
13483
|
}
|
|
13354
13484
|
if (!["subagent-driven-development", "executing-plans", "direct"].includes(buildMode)) {
|
|
@@ -13469,9 +13599,6 @@ async function transition(output, name, event) {
|
|
|
13469
13599
|
`ERROR: Cannot transition '${name}': verification_report must point to an existing report file`
|
|
13470
13600
|
);
|
|
13471
13601
|
}
|
|
13472
|
-
if (await readField3(name, "branch_status") !== "handled") {
|
|
13473
|
-
fail2(`ERROR: Cannot transition '${name}': branch_status must be handled`);
|
|
13474
|
-
}
|
|
13475
13602
|
} else if (event === "verify-fail") {
|
|
13476
13603
|
await requirePhase(name, "verify");
|
|
13477
13604
|
} else if (event === "archive-confirm") {
|
|
@@ -13731,7 +13858,7 @@ function resolveBuildRecoveryAction(workflow, isolation, buildMode, pause, subag
|
|
|
13731
13858
|
}
|
|
13732
13859
|
if (pause === "plan-ready") {
|
|
13733
13860
|
if (buildMode === "subagent-driven-development" && (pending > 0 || planPending > 0)) {
|
|
13734
|
-
return subagentDispatch === "confirmed" ? "Recovery action: Plan-ready pause is stale because build decisions are already selected. Clear build_pause to null, then inspect the first unchecked task (OpenSpec or plan additions) against recent git history/diff. If implemented, check it off; otherwise dispatch a real background subagent. Do not execute the pending task directly in the main window." : "Recovery action: Plan-ready pause is stale and subagent dispatch is not confirmed. Confirm a real background subagent/Task/multi-agent dispatcher and set subagent_dispatch to confirmed, or set build_mode to executing-plans before continuing.";
|
|
13861
|
+
return subagentDispatch === "confirmed" ? "Recovery action: Plan-ready pause is stale because build decisions are already selected. Clear build_pause to null, then inspect the first unchecked task (OpenSpec or plan additions) against recent git history/diff. If implemented, check it off; otherwise dispatch a real background subagent. Do not execute the pending task directly in the main window." : "Recovery action: Plan-ready pause is stale and subagent dispatch is not confirmed. Return to /comet-build Step 2 capability preflight. Confirm a real background subagent/Task/multi-agent dispatcher and set subagent_dispatch to confirmed, or remove the unavailable mode and set build_mode to executing-plans before continuing.";
|
|
13735
13862
|
}
|
|
13736
13863
|
if (pending > 0 || planPending > 0) {
|
|
13737
13864
|
return "Recovery action: Plan-ready pause is stale because build decisions are already selected. Clear build_pause to null, then continue from the first unchecked task.";
|
|
@@ -13752,13 +13879,13 @@ function resolveBuildRecoveryAction(workflow, isolation, buildMode, pause, subag
|
|
|
13752
13879
|
}
|
|
13753
13880
|
if (pending > 0) {
|
|
13754
13881
|
if (buildMode === "subagent-driven-development") {
|
|
13755
|
-
return subagentDispatch === "confirmed" ? "Recovery action: Read tasks.md and the Superpowers plan (which may include additions beyond OpenSpec), then inspect the first unchecked task against recent git history/diff. If implemented, check it off; otherwise dispatch a real background subagent. Do not execute the pending task directly in the main window." : "Recovery action: Subagent dispatch is not confirmed. Confirm a real background subagent/Task/multi-agent dispatcher and set subagent_dispatch to confirmed, or set build_mode to executing-plans before continuing.";
|
|
13882
|
+
return subagentDispatch === "confirmed" ? "Recovery action: Read tasks.md and the Superpowers plan (which may include additions beyond OpenSpec), then inspect the first unchecked task against recent git history/diff. If implemented, check it off; otherwise dispatch a real background subagent. Do not execute the pending task directly in the main window." : "Recovery action: Subagent dispatch is not confirmed. Return to /comet-build Step 2 capability preflight. Confirm a real background subagent/Task/multi-agent dispatcher and set subagent_dispatch to confirmed, or remove the unavailable mode and set build_mode to executing-plans before continuing.";
|
|
13756
13883
|
}
|
|
13757
13884
|
return "Recovery action: Read tasks.md and continue from first unchecked task.";
|
|
13758
13885
|
}
|
|
13759
13886
|
if (planPending > 0) {
|
|
13760
13887
|
if (buildMode === "subagent-driven-development") {
|
|
13761
|
-
return subagentDispatch === "confirmed" ? "Recovery action: Read the Superpowers plan, then inspect the first unchecked Superpowers plan task against recent git history/diff. If implemented, check it off; otherwise dispatch a real background subagent. Do not execute the pending task directly in the main window." : "Recovery action: Subagent dispatch is not confirmed. Confirm a real background subagent/Task/multi-agent dispatcher and set subagent_dispatch to confirmed, or set build_mode to executing-plans before continuing.";
|
|
13888
|
+
return subagentDispatch === "confirmed" ? "Recovery action: Read the Superpowers plan, then inspect the first unchecked Superpowers plan task against recent git history/diff. If implemented, check it off; otherwise dispatch a real background subagent. Do not execute the pending task directly in the main window." : "Recovery action: Subagent dispatch is not confirmed. Return to /comet-build Step 2 capability preflight. Confirm a real background subagent/Task/multi-agent dispatcher and set subagent_dispatch to confirmed, or remove the unavailable mode and set build_mode to executing-plans before continuing.";
|
|
13762
13889
|
}
|
|
13763
13890
|
return "Recovery action: Read the Superpowers plan and continue from the first unchecked plan task.";
|
|
13764
13891
|
}
|
|
@@ -13766,17 +13893,19 @@ function resolveBuildRecoveryAction(workflow, isolation, buildMode, pause, subag
|
|
|
13766
13893
|
}
|
|
13767
13894
|
async function recoverVerify(output, name) {
|
|
13768
13895
|
const result5 = await readField3(name, "verify_result");
|
|
13896
|
+
const failures = await readField3(name, "verify_failures");
|
|
13769
13897
|
const mode = await readField3(name, "verify_mode");
|
|
13770
13898
|
const report = await readField3(name, "verification_report");
|
|
13771
13899
|
const branch = await readField3(name, "branch_status");
|
|
13772
13900
|
output.stdout.push(
|
|
13773
13901
|
" Verification:",
|
|
13774
13902
|
fieldStatus("verify_result", result5),
|
|
13903
|
+
` - verify_failures: ${failures || "0"}`,
|
|
13775
13904
|
fieldStatus("verify_mode", mode),
|
|
13776
13905
|
fieldStatus("verification_report", report, report),
|
|
13777
|
-
|
|
13906
|
+
branch === "handled" ? " - branch_status: LEGACY (handled before archive; archive still owns final closure)" : " - branch_status: DEFERRED (handled after the archive commit)",
|
|
13778
13907
|
"",
|
|
13779
|
-
result5 === "pass"
|
|
13908
|
+
result5 === "pass" ? "Recovery action: Verification complete. Continue to archive; branch handling happens after archive changes are committed." : result5 === "fail" ? "Recovery action: Verification failed and rolled back to build. Resume from /comet-build." : "Recovery action: Verification not yet started or in progress. Run scale assessment then verify."
|
|
13780
13909
|
);
|
|
13781
13910
|
}
|
|
13782
13911
|
async function recoverArchive(output, name) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: comet-any
|
|
3
|
-
description: "Use when the user wants to customize Comet five-phase
|
|
3
|
+
description: "Use only when explicitly invoked as /comet-any or when the user explicitly wants to customize Comet's five-phase workflow or create/upgrade a workflow Skill managed by Comet Creator. Do not use for general Skill authoring, cleanup, or review."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Comet Any - Skill Creator
|