speckeeper 0.11.1 → 0.13.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/dist/cli.js CHANGED
@@ -39,7 +39,9 @@ var init_agents = __esm({
39
39
  can_execute_tools: [
40
40
  "speckeeper-cli"
41
41
  ],
42
- can_invoke_agents: [],
42
+ can_invoke_agents: [
43
+ "spec-quality-reviewer"
44
+ ],
43
45
  can_return_handoffs: [
44
46
  "requirement-audit-result",
45
47
  "trace-link-result",
@@ -449,9 +451,14 @@ var init_workflows = __esm({
449
451
  type: "delegate",
450
452
  task: "audit-requirement-quality",
451
453
  from_agent: "spec-quality-reviewer",
452
- description: "",
454
+ description: "Execute LLM-based requirement audit. Retries once on adapter error (exit 12).",
453
455
  optional: false,
454
- max_retries: 0
456
+ max_retries: 1
457
+ },
458
+ {
459
+ type: "gate",
460
+ gate_kind: "requirement-audit-result",
461
+ description: "Block if RequirementAuditResult fails schema validation or no specs were found in configuration (stop_and_report)."
455
462
  }
456
463
  ]
457
464
  };
@@ -467,9 +474,14 @@ var init_workflows = __esm({
467
474
  type: "delegate",
468
475
  task: "propose-trace-links",
469
476
  from_agent: "spec-quality-reviewer",
470
- description: "",
477
+ description: "Execute LLM-based trace link analysis. Retries once on adapter error (exit 12).",
471
478
  optional: false,
472
- max_retries: 0
479
+ max_retries: 1
480
+ },
481
+ {
482
+ type: "gate",
483
+ gate_kind: "trace-link-result",
484
+ description: "Block if TraceLinkResult fails schema validation or no specs were found in configuration (stop_and_report)."
473
485
  }
474
486
  ]
475
487
  };
@@ -485,9 +497,14 @@ var init_workflows = __esm({
485
497
  type: "delegate",
486
498
  task: "explain-impact-result",
487
499
  from_agent: "spec-quality-reviewer",
488
- description: "",
500
+ description: "Execute LLM-based impact explanation. Retries once on adapter error (exit 12).",
489
501
  optional: false,
490
- max_retries: 0
502
+ max_retries: 1
503
+ },
504
+ {
505
+ type: "gate",
506
+ gate_kind: "impact-explain-result",
507
+ description: "Block if ImpactExplainResult fails schema validation or stdin was empty/invalid (stop_and_report)."
491
508
  }
492
509
  ]
493
510
  };
@@ -503,9 +520,14 @@ var init_workflows = __esm({
503
520
  type: "delegate",
504
521
  task: "propose-acceptance-criteria",
505
522
  from_agent: "spec-quality-reviewer",
506
- description: "",
523
+ description: "Execute LLM-based acceptance criteria proposal. Retries once on adapter error (exit 12).",
507
524
  optional: false,
508
- max_retries: 0
525
+ max_retries: 1
526
+ },
527
+ {
528
+ type: "gate",
529
+ gate_kind: "acceptance-criteria-result",
530
+ description: "Block if AcceptanceCriteriaResult fails schema validation or no specs were found in configuration (stop_and_report)."
509
531
  }
510
532
  ]
511
533
  };
@@ -570,9 +592,9 @@ function derivePolicy(input) {
570
592
  const riskLevels = [];
571
593
  let executionMode;
572
594
  let explicitConfirmation;
573
- if (input.commandEffects) {
574
- const ce = input.commandEffects;
575
- riskLevels.push(ce.riskLevel ?? "low");
595
+ if (input.command_effects) {
596
+ const ce = input.command_effects;
597
+ riskLevels.push(ce.risk_level ?? "low");
576
598
  if (ce.writes) {
577
599
  sideEffects.add("file_write");
578
600
  for (const w of ce.writes) {
@@ -583,9 +605,9 @@ function derivePolicy(input) {
583
605
  overwrite: w.overwrite,
584
606
  destructive: w.destructive,
585
607
  ...w.idempotent !== void 0 ? { idempotent: w.idempotent } : {},
586
- ...w.idempotencyKey ? { idempotencyKey: w.idempotencyKey } : {},
587
- ...w.idempotentNote ? { idempotentNote: w.idempotentNote } : {},
588
- source: `command:${input.commandId}`
608
+ ...w.idempotency_key ? { idempotency_key: w.idempotency_key } : {},
609
+ ...w.idempotent_note ? { idempotent_note: w.idempotent_note } : {},
610
+ source: `command:${input.command_id}`
589
611
  });
590
612
  }
591
613
  }
@@ -595,7 +617,7 @@ function derivePolicy(input) {
595
617
  kind: "semantic",
596
618
  target: r.target,
597
619
  description: r.description,
598
- source: `command:${input.commandId}`
620
+ source: `command:${input.command_id}`
599
621
  });
600
622
  }
601
623
  }
@@ -606,17 +628,17 @@ function derivePolicy(input) {
606
628
  ...ce.network.description ? { description: ce.network.description } : {},
607
629
  ...ce.network.domains ? { domains: ce.network.domains } : {},
608
630
  ...ce.network.idempotent !== void 0 ? { idempotent: ce.network.idempotent } : {},
609
- ...ce.network.idempotencyKey ? { idempotencyKey: ce.network.idempotencyKey } : {},
610
- ...ce.network.idempotentNote ? { idempotentNote: ce.network.idempotentNote } : {},
611
- source: `command:${input.commandId}`
631
+ ...ce.network.idempotency_key ? { idempotency_key: ce.network.idempotency_key } : {},
632
+ ...ce.network.idempotent_note ? { idempotent_note: ce.network.idempotent_note } : {},
633
+ source: `command:${input.command_id}`
612
634
  });
613
635
  }
614
636
  }
615
- if (ce.executionMode) {
616
- executionMode = ce.executionMode;
637
+ if (ce.execution_mode) {
638
+ executionMode = ce.execution_mode;
617
639
  }
618
- if (ce.requiresConfirmation !== void 0) {
619
- explicitConfirmation = ce.requiresConfirmation;
640
+ if (ce.requires_confirmation !== void 0) {
641
+ explicitConfirmation = ce.requires_confirmation;
620
642
  }
621
643
  }
622
644
  for (const [optName, optInput] of Object.entries(input.options)) {
@@ -647,7 +669,7 @@ function derivePolicy(input) {
647
669
  }
648
670
  if (definition.effects) {
649
671
  const eff = definition.effects;
650
- riskLevels.push(eff.riskLevel ?? "low");
672
+ riskLevels.push(eff.risk_level ?? "low");
651
673
  if (eff.writes) {
652
674
  sideEffects.add("file_write");
653
675
  for (const w of eff.writes) {
@@ -658,8 +680,8 @@ function derivePolicy(input) {
658
680
  overwrite: w.overwrite,
659
681
  destructive: w.destructive,
660
682
  ...w.idempotent !== void 0 ? { idempotent: w.idempotent } : {},
661
- ...w.idempotencyKey ? { idempotencyKey: w.idempotencyKey } : {},
662
- ...w.idempotentNote ? { idempotentNote: w.idempotentNote } : {},
683
+ ...w.idempotency_key ? { idempotency_key: w.idempotency_key } : {},
684
+ ...w.idempotent_note ? { idempotent_note: w.idempotent_note } : {},
663
685
  source: `option:${optName}`
664
686
  });
665
687
  }
@@ -681,17 +703,17 @@ function derivePolicy(input) {
681
703
  ...eff.network.description ? { description: eff.network.description } : {},
682
704
  ...eff.network.domains ? { domains: eff.network.domains } : {},
683
705
  ...eff.network.idempotent !== void 0 ? { idempotent: eff.network.idempotent } : {},
684
- ...eff.network.idempotencyKey ? { idempotencyKey: eff.network.idempotencyKey } : {},
685
- ...eff.network.idempotentNote ? { idempotentNote: eff.network.idempotentNote } : {},
706
+ ...eff.network.idempotency_key ? { idempotency_key: eff.network.idempotency_key } : {},
707
+ ...eff.network.idempotent_note ? { idempotent_note: eff.network.idempotent_note } : {},
686
708
  source: `option:${optName}`
687
709
  });
688
710
  }
689
711
  }
690
- if (eff.executionMode && !executionMode) {
691
- executionMode = eff.executionMode;
712
+ if (eff.execution_mode && !executionMode) {
713
+ executionMode = eff.execution_mode;
692
714
  }
693
- if (eff.requiresConfirmation !== void 0 && explicitConfirmation === void 0) {
694
- explicitConfirmation = eff.requiresConfirmation;
715
+ if (eff.requires_confirmation !== void 0 && explicitConfirmation === void 0) {
716
+ explicitConfirmation = eff.requires_confirmation;
695
717
  }
696
718
  }
697
719
  }
@@ -712,15 +734,15 @@ function derivePolicy(input) {
712
734
  const semanticWrites = writes.filter((w) => w.kind === "semantic");
713
735
  const idempotent = semanticWrites.every((w) => w.idempotent === true) && networkEffects.every((n) => n.idempotent === true);
714
736
  return {
715
- riskLevel: finalRiskLevel,
716
- requiresConfirmation,
737
+ risk_level: finalRiskLevel,
738
+ requires_confirmation: requiresConfirmation,
717
739
  idempotent,
718
- sideEffects: [...sideEffects],
740
+ side_effects: [...sideEffects],
719
741
  reads,
720
742
  writes,
721
743
  ...networkEffects.length > 0 ? { network: networkEffects } : {},
722
- ...executionMode ? { executionMode } : {},
723
- ...requiresSecrets ? { requiresSecrets } : {}
744
+ ...executionMode ? { execution_mode: executionMode } : {},
745
+ ...requiresSecrets ? { requires_secrets: requiresSecrets } : {}
724
746
  };
725
747
  }
726
748
 
@@ -728,7 +750,7 @@ function derivePolicy(input) {
728
750
  var commandDefinitions = {
729
751
  "init": {
730
752
  "effects": {
731
- "riskLevel": "medium",
753
+ "risk_level": "medium",
732
754
  "writes": [
733
755
  {
734
756
  "target": "speckeeper.config.ts, design/ directory",
@@ -745,7 +767,7 @@ var commandDefinitions = {
745
767
  "default": false
746
768
  },
747
769
  "effects": {
748
- "riskLevel": "high",
770
+ "risk_level": "high",
749
771
  "writes": [
750
772
  {
751
773
  "target": "existing project files",
@@ -785,7 +807,7 @@ var commandDefinitions = {
785
807
  },
786
808
  "build": {
787
809
  "effects": {
788
- "riskLevel": "low",
810
+ "risk_level": "low",
789
811
  "writes": [
790
812
  {
791
813
  "target": "docs/ directory",
@@ -832,9 +854,7 @@ var commandDefinitions = {
832
854
  "type": "boolean",
833
855
  "default": false
834
856
  },
835
- "effects": {
836
- "executionMode": "watch"
837
- }
857
+ "effects": {}
838
858
  },
839
859
  {
840
860
  "name": "verbose",
@@ -1033,7 +1053,7 @@ var commandDefinitions = {
1033
1053
  },
1034
1054
  "new": {
1035
1055
  "effects": {
1036
- "riskLevel": "low",
1056
+ "risk_level": "low",
1037
1057
  "writes": [
1038
1058
  {
1039
1059
  "target": "design/ directory",
@@ -1158,7 +1178,7 @@ var commandDefinitions = {
1158
1178
  },
1159
1179
  "scaffold": {
1160
1180
  "effects": {
1161
- "riskLevel": "low",
1181
+ "risk_level": "low",
1162
1182
  "writes": [
1163
1183
  {
1164
1184
  "target": "design/ directory",
@@ -1193,7 +1213,7 @@ var commandDefinitions = {
1193
1213
  "default": false
1194
1214
  },
1195
1215
  "effects": {
1196
- "riskLevel": "medium",
1216
+ "risk_level": "medium",
1197
1217
  "writes": [
1198
1218
  {
1199
1219
  "target": "existing model and spec files",
@@ -1239,7 +1259,7 @@ var commandDefinitions = {
1239
1259
  },
1240
1260
  "convert": {
1241
1261
  "effects": {
1242
- "riskLevel": "low",
1262
+ "risk_level": "low",
1243
1263
  "writes": [
1244
1264
  {
1245
1265
  "target": ".yaml output file",
@@ -1680,27 +1700,27 @@ var commandDefinitions = {
1680
1700
  }
1681
1701
  }
1682
1702
  };
1683
- function deriveCommandPolicy(commandId, optionValues) {
1684
- const def = commandDefinitions[commandId];
1685
- if (!def) throw new Error(`Unknown command: ${commandId}`);
1703
+ function deriveCommandPolicy(command_id, optionValues) {
1704
+ const def = commandDefinitions[command_id];
1705
+ if (!def) throw new Error(`Unknown command: ${command_id}`);
1686
1706
  const cmdDef = def;
1687
1707
  const options = {};
1688
- const activeOptions = [];
1708
+ const active_options = [];
1689
1709
  for (const optDef of cmdDef.options ?? []) {
1690
1710
  const value = optionValues[optDef.name];
1691
1711
  const specified = optDef.name in optionValues && value !== void 0;
1692
1712
  options[optDef.name] = { value, specified, definition: optDef };
1693
1713
  if (isOptionActive(optDef, value, specified)) {
1694
- activeOptions.push(optDef.name);
1714
+ active_options.push(optDef.name);
1695
1715
  }
1696
1716
  }
1697
1717
  const policy = derivePolicy({
1698
- commandId,
1699
- commandEffects: cmdDef.effects,
1718
+ command_id,
1719
+ command_effects: cmdDef.effects,
1700
1720
  options,
1701
1721
  env: cmdDef.env
1702
1722
  });
1703
- return { command: commandId, activeOptions, policy };
1723
+ return { command: command_id, active_options, policy };
1704
1724
  }
1705
1725
 
1706
1726
  // src/generated/program.ts