@agentic-coding-framework/orchestrator-core 0.1.2 → 0.3.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/dispatch.js CHANGED
@@ -6,10 +6,13 @@
6
6
  * to drive the micro-waterfall pipeline. All decisions are deterministic —
7
7
  * zero LLM tokens.
8
8
  *
9
- * Main entry point: dispatch(projectRoot)
9
+ * Main entry points:
10
+ * dispatch(projectRoot) — dispatch next step (mutates STATE)
11
+ * peek(projectRoot) — [FIX P1] read-only dispatch preview (no mutation)
10
12
  */
11
13
  Object.defineProperty(exports, "__esModule", { value: true });
12
14
  exports.dispatch = dispatch;
15
+ exports.peek = peek;
13
16
  exports.buildPrompt = buildPrompt;
14
17
  exports.parseHandoff = parseHandoff;
15
18
  exports.applyHandoff = applyHandoff;
@@ -37,6 +40,22 @@ const rules_1 = require("./rules");
37
40
  * steps, etc.).
38
41
  */
39
42
  function dispatch(projectRoot) {
43
+ return _dispatch(projectRoot, false);
44
+ }
45
+ /**
46
+ * [FIX P1] Read-only dispatch preview — returns the same DispatchResult
47
+ * as dispatch() but never writes to STATE.json.
48
+ *
49
+ * Use cases:
50
+ * - dispatch-claude-code.sh: check if dispatch would succeed before committing
51
+ * - Monitoring / debugging without state contamination
52
+ * - OpenClaw dry-run checks
53
+ */
54
+ function peek(projectRoot) {
55
+ return _dispatch(projectRoot, true);
56
+ }
57
+ /** Internal dispatch implementation with optional dry-run mode */
58
+ function _dispatch(projectRoot, dryRun) {
40
59
  const state = (0, state_1.readState)(projectRoot);
41
60
  // ── Story complete ──
42
61
  if (state.step === "done") {
@@ -50,9 +69,11 @@ function dispatch(projectRoot) {
50
69
  // ── Timeout check ──
51
70
  if (state.status === "running") {
52
71
  if ((0, state_1.isTimedOut)(state)) {
53
- state.status = "timeout";
54
- state.completed_at = new Date().toISOString();
55
- (0, state_1.writeState)(projectRoot, state);
72
+ if (!dryRun) {
73
+ state.status = "timeout";
74
+ state.completed_at = new Date().toISOString();
75
+ (0, state_1.writeState)(projectRoot, state);
76
+ }
56
77
  const elapsed = elapsedMinutes(state.dispatched_at);
57
78
  return {
58
79
  type: "timeout",
@@ -69,7 +90,7 @@ function dispatch(projectRoot) {
69
90
  }
70
91
  // ── Requires human (review checkpoint) ──
71
92
  if (rule.requires_human && state.status !== "pass") {
72
- if (state.status !== "needs_human") {
93
+ if (state.status !== "needs_human" && !dryRun) {
73
94
  state.status = "needs_human";
74
95
  (0, state_1.writeState)(projectRoot, state);
75
96
  }
@@ -92,7 +113,8 @@ function dispatch(projectRoot) {
92
113
  state.files_changed = [];
93
114
  // Check if we just reached "done"
94
115
  if (state.step === "done") {
95
- (0, state_1.writeState)(projectRoot, state);
116
+ if (!dryRun)
117
+ (0, state_1.writeState)(projectRoot, state);
96
118
  return {
97
119
  type: "done",
98
120
  story: state.story ?? "(no story)",
@@ -103,7 +125,8 @@ function dispatch(projectRoot) {
103
125
  const newRule = (0, rules_1.getRule)(state.step);
104
126
  if (newRule.requires_human) {
105
127
  state.status = "needs_human";
106
- (0, state_1.writeState)(projectRoot, state);
128
+ if (!dryRun)
129
+ (0, state_1.writeState)(projectRoot, state);
107
130
  return {
108
131
  type: "needs_human",
109
132
  step: state.step,
@@ -118,12 +141,15 @@ function dispatch(projectRoot) {
118
141
  if (state.status === "failing") {
119
142
  if ((0, state_1.isMaxedOut)(state)) {
120
143
  state.status = "needs_human";
121
- (0, state_1.writeState)(projectRoot, state);
144
+ if (!dryRun)
145
+ (0, state_1.writeState)(projectRoot, state);
122
146
  return {
123
147
  type: "blocked",
124
148
  step: state.step,
125
149
  reason: `Max attempts (${state.max_attempts}) exhausted at step "${state.step}". ` +
126
- (state.reason ? `Last reason: ${state.reason}` : "No specific reason."),
150
+ (state.reason
151
+ ? `Last reason: ${state.reason}`
152
+ : "No specific reason."),
127
153
  };
128
154
  }
129
155
  const target = (0, rules_1.getFailTarget)(state.step, state.reason);
@@ -144,14 +170,16 @@ function dispatch(projectRoot) {
144
170
  // ── Dispatch executor ──
145
171
  const currentRule = (0, rules_1.getRule)(state.step);
146
172
  const prompt = buildPrompt(state, currentRule);
147
- const running = (0, state_1.markRunning)(state);
148
- (0, state_1.writeState)(projectRoot, running);
173
+ if (!dryRun) {
174
+ const running = (0, state_1.markRunning)(state);
175
+ (0, state_1.writeState)(projectRoot, running);
176
+ }
149
177
  // Detect framework adoption level so caller knows the context richness
150
178
  const framework = detectFramework(projectRoot);
151
179
  return {
152
180
  type: "dispatched",
153
- step: running.step,
154
- attempt: running.attempt,
181
+ step: state.step,
182
+ attempt: state.attempt,
155
183
  prompt,
156
184
  fw_lv: framework.level,
157
185
  };
@@ -212,18 +240,24 @@ function buildPrompt(state, rule) {
212
240
  lines.push("===================");
213
241
  lines.push("");
214
242
  }
215
- // Step instruction
243
+ // === PRIMARY TASK (this is the actual work CC must do) ===
244
+ lines.push("=== YOUR PRIMARY TASK ===");
216
245
  lines.push(rule.step_instruction);
217
246
  lines.push("");
218
- // Output rules (always appended)
219
- lines.push("Output rules:");
247
+ lines.push("Focus on completing the task above FIRST. Modify source files, create");
248
+ lines.push("tests, update documents — whatever the task requires. Do NOT stop after");
249
+ lines.push("just updating .ai/HANDOFF.md — that is only the final bookkeeping step.");
250
+ lines.push("=========================");
251
+ lines.push("");
252
+ // === POST-TASK BOOKKEEPING (only after the real work is done) ===
253
+ lines.push("After you have completed ALL the work above, do this final bookkeeping:");
220
254
  lines.push("- Only modify affected files and paragraphs, don't rewrite unrelated content");
221
- lines.push("- After completion, update .ai/HANDOFF.md:");
255
+ lines.push("- Update .ai/HANDOFF.md as a summary of what you did:");
222
256
  lines.push(" - YAML front matter: fill in story, step, attempt, status, reason, files_changed, tests values");
223
257
  lines.push(" - Markdown body: record what was done, what's unresolved, what next session should note");
224
- lines.push("- If requirements unclear, fill reason field with needs_clarification");
225
- lines.push("- If Constitution violation found, fill reason field with constitution_violation");
226
- lines.push("- If touching Non-Goals scope, fill reason field with scope_warning");
258
+ lines.push("- If requirements unclear, set status: failing and reason: needs_clarification");
259
+ lines.push("- If Constitution violation found, set status: failing and reason: constitution_violation");
260
+ lines.push("- If touching Non-Goals scope, set status: failing and reason: scope_warning");
227
261
  return lines.join("\n");
228
262
  }
229
263
  /**
@@ -255,11 +289,17 @@ function parseYamlFrontMatter(content) {
255
289
  step: yaml["step"] ?? null,
256
290
  attempt: yaml["attempt"] ? parseInt(yaml["attempt"], 10) : null,
257
291
  status: yaml["status"] ?? null,
258
- reason: (yaml["reason"] || null),
292
+ reason: yaml["reason"] || null,
259
293
  files_changed: parseYamlList(yaml["files_changed"]),
260
- tests_pass: yaml["tests_pass"] ? parseInt(yaml["tests_pass"], 10) : null,
261
- tests_fail: yaml["tests_fail"] ? parseInt(yaml["tests_fail"], 10) : null,
262
- tests_skip: yaml["tests_skip"] ? parseInt(yaml["tests_skip"], 10) : null,
294
+ tests_pass: yaml["tests_pass"]
295
+ ? parseInt(yaml["tests_pass"], 10)
296
+ : null,
297
+ tests_fail: yaml["tests_fail"]
298
+ ? parseInt(yaml["tests_fail"], 10)
299
+ : null,
300
+ tests_skip: yaml["tests_skip"]
301
+ ? parseInt(yaml["tests_skip"], 10)
302
+ : null,
263
303
  body,
264
304
  };
265
305
  }
@@ -294,6 +334,11 @@ function parseFallback(content) {
294
334
  * Minimal YAML parser for flat key: value pairs.
295
335
  * Handles simple scalars and inline lists. NOT a full YAML parser —
296
336
  * just enough for HANDOFF.md front matter.
337
+ *
338
+ * [FIX P2] Improved to handle:
339
+ * - Inline bracket lists: `files: [a.go, b.ts]`
340
+ * - Values containing colons: `reason: needs_clarification: details here`
341
+ * (only first colon splits key/value, rest is part of the value)
297
342
  */
298
343
  function parseSimpleYaml(block) {
299
344
  const result = {};
@@ -313,16 +358,25 @@ function parseSimpleYaml(block) {
313
358
  result[currentKey] = JSON.stringify(listValues);
314
359
  listValues = [];
315
360
  }
316
- // Key: value pair
361
+ // Key: value pair — use FIRST colon only, rest is value
317
362
  const colonIdx = trimmed.indexOf(":");
318
363
  if (colonIdx > 0) {
319
364
  const key = trimmed.slice(0, colonIdx).trim();
320
365
  const value = trimmed.slice(colonIdx + 1).trim();
321
366
  currentKey = key;
322
367
  if (value) {
323
- // "null" empty
324
- result[key] = value === "null" ? "" : value;
325
- currentKey = null; // not expecting list items
368
+ // [FIX P2] Handle inline bracket lists: `files: [a.go, b.ts]`
369
+ if (value.startsWith("[") && value.endsWith("]")) {
370
+ const inner = value.slice(1, -1);
371
+ const items = inner.split(",").map((s) => s.trim()).filter(Boolean);
372
+ result[key] = JSON.stringify(items);
373
+ currentKey = null;
374
+ }
375
+ else {
376
+ // "null" → empty
377
+ result[key] = value === "null" ? "" : value;
378
+ currentKey = null; // not expecting list items
379
+ }
326
380
  }
327
381
  // else: value on next lines (list)
328
382
  }
@@ -450,9 +504,6 @@ function rejectReview(projectRoot, reason, humanNote) {
450
504
  * Ensure STATE.json exists. If not, auto-initialize it.
451
505
  * This allows startStory() and startCustom() to work on ANY project,
452
506
  * even if the Agentic Coding Framework hasn't been set up yet.
453
- *
454
- * Project name is inferred from: package.json name → go.mod module →
455
- * directory name (in that order).
456
507
  */
457
508
  function ensureState(projectRoot) {
458
509
  const path = (0, path_1.join)(projectRoot, ".ai", "STATE.json");
@@ -468,19 +519,25 @@ function ensureState(projectRoot) {
468
519
  if (pkg.name)
469
520
  projectName = pkg.name;
470
521
  }
471
- catch { /* ignore */ }
522
+ catch {
523
+ /* ignore */
524
+ }
472
525
  }
473
526
  const goModPath = (0, path_1.join)(projectRoot, "go.mod");
474
527
  if ((0, fs_1.existsSync)(goModPath)) {
475
528
  try {
476
529
  const goMod = (0, fs_1.readFileSync)(goModPath, "utf-8");
477
- const moduleLine = goMod.split("\n").find((l) => l.startsWith("module "));
530
+ const moduleLine = goMod
531
+ .split("\n")
532
+ .find((l) => l.startsWith("module "));
478
533
  if (moduleLine) {
479
534
  const parts = moduleLine.replace("module ", "").trim().split("/");
480
535
  projectName = parts[parts.length - 1] ?? projectName;
481
536
  }
482
537
  }
483
- catch { /* ignore */ }
538
+ catch {
539
+ /* ignore */
540
+ }
484
541
  }
485
542
  const { state } = (0, state_1.initState)(projectRoot, projectName);
486
543
  return state;
@@ -525,7 +582,13 @@ function detectFramework(projectRoot) {
525
582
  const has_sdd = check("docs/sdd.md");
526
583
  const has_handoff = check(".ai/HANDOFF.md");
527
584
  const has_history = check(".ai/history.md");
528
- const core = [has_state, has_memory, has_context, has_constitution, has_sdd];
585
+ const core = [
586
+ has_state,
587
+ has_memory,
588
+ has_context,
589
+ has_constitution,
590
+ has_sdd,
591
+ ];
529
592
  const coreCount = core.filter(Boolean).length;
530
593
  let level = 0;
531
594
  if (coreCount === core.length)
@@ -533,16 +596,18 @@ function detectFramework(projectRoot) {
533
596
  else if (coreCount > 0)
534
597
  level = 1;
535
598
  return {
536
- has_state, has_memory, has_context, has_constitution,
537
- has_sdd, has_handoff, has_history, level,
599
+ has_state,
600
+ has_memory,
601
+ has_context,
602
+ has_constitution,
603
+ has_sdd,
604
+ has_handoff,
605
+ has_history,
606
+ level,
538
607
  };
539
608
  }
540
609
  /**
541
610
  * Get comprehensive project status for OpenClaw to summarize to the user.
542
- * Works for ANY project — with or without the Agentic Coding Framework.
543
- *
544
- * - Framework project (has STATE.json): returns full state + memory summary
545
- * - Non-framework project: returns framework detection + whatever files exist
546
611
  */
547
612
  function queryProjectStatus(projectRoot) {
548
613
  const framework = detectFramework(projectRoot);
@@ -556,9 +621,7 @@ function queryProjectStatus(projectRoot) {
556
621
  memory_summary = nextMatch[0].trim().slice(0, 500);
557
622
  }
558
623
  }
559
- // If no STATE.json, return a minimal status with framework detection
560
624
  if (!framework.has_state) {
561
- // Try to infer project name from package.json or directory name
562
625
  let project = "(not initialized)";
563
626
  const pkgPath = (0, path_1.join)(projectRoot, "package.json");
564
627
  if ((0, fs_1.existsSync)(pkgPath)) {
@@ -566,7 +629,9 @@ function queryProjectStatus(projectRoot) {
566
629
  const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, "utf-8"));
567
630
  project = pkg.name ?? project;
568
631
  }
569
- catch { /* ignore */ }
632
+ catch {
633
+ /* ignore */
634
+ }
570
635
  }
571
636
  return {
572
637
  project,
@@ -586,7 +651,6 @@ function queryProjectStatus(projectRoot) {
586
651
  has_framework: framework,
587
652
  };
588
653
  }
589
- // Framework project: read full state
590
654
  const state = (0, state_1.readState)(projectRoot);
591
655
  return {
592
656
  project: state.project,
@@ -607,16 +671,7 @@ function queryProjectStatus(projectRoot) {
607
671
  };
608
672
  }
609
673
  /**
610
- * Scan a workspace directory for all projects — both framework and non-framework.
611
- * OpenClaw calls this when the user asks "list my projects" or "switch project".
612
- *
613
- * A directory is considered a "project" if it contains any of:
614
- * - .ai/STATE.json (framework project)
615
- * - package.json (Node.js project)
616
- * - go.mod (Go project)
617
- * - Cargo.toml (Rust project)
618
- * - pyproject.toml or setup.py (Python project)
619
- * - .git/ (any git repo)
674
+ * Scan a workspace directory for all projects.
620
675
  */
621
676
  function listProjects(workspaceRoot) {
622
677
  const { readdirSync, statSync } = require("fs");
@@ -638,21 +693,18 @@ function listProjects(workspaceRoot) {
638
693
  return results;
639
694
  }
640
695
  for (const entry of entries) {
641
- // Skip hidden directories (except .git check is internal)
642
696
  if (entry.startsWith("."))
643
697
  continue;
644
698
  const dir = (0, path_1.join)(workspaceRoot, entry);
645
699
  try {
646
700
  if (!statSync(dir).isDirectory())
647
701
  continue;
648
- // Check if this directory is a project
649
702
  const isProject = PROJECT_MARKERS.some((marker) => (0, fs_1.existsSync)((0, path_1.join)(dir, marker)));
650
703
  if (!isProject)
651
704
  continue;
652
705
  const stateFile = (0, path_1.join)(dir, ".ai", "STATE.json");
653
706
  const hasFramework = (0, fs_1.existsSync)(stateFile);
654
707
  if (hasFramework) {
655
- // Framework project: read state
656
708
  const state = JSON.parse((0, fs_1.readFileSync)(stateFile, "utf-8"));
657
709
  results.push({
658
710
  name: state.project,
@@ -664,7 +716,6 @@ function listProjects(workspaceRoot) {
664
716
  });
665
717
  }
666
718
  else {
667
- // Non-framework project: infer name from package.json or dir name
668
719
  let name = entry;
669
720
  const pkgPath = (0, path_1.join)(dir, "package.json");
670
721
  if ((0, fs_1.existsSync)(pkgPath)) {
@@ -672,7 +723,9 @@ function listProjects(workspaceRoot) {
672
723
  const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, "utf-8"));
673
724
  name = pkg.name ?? entry;
674
725
  }
675
- catch { /* ignore */ }
726
+ catch {
727
+ /* ignore */
728
+ }
676
729
  }
677
730
  results.push({
678
731
  name,
@@ -697,10 +750,6 @@ function listProjects(workspaceRoot) {
697
750
  * micro-waterfall pipeline.
698
751
  *
699
752
  * Pipeline: custom → update-memory → done
700
- * Auto-initializes STATE.json if the project hasn't adopted the framework yet.
701
- *
702
- * Use cases: refactoring, code review, bug fix, DevOps, documentation,
703
- * testing, migration, performance optimization, security, cleanup, etc.
704
753
  */
705
754
  function startCustom(projectRoot, instruction, options = {}) {
706
755
  const state = ensureState(projectRoot);
@@ -729,12 +778,21 @@ function startCustom(projectRoot, instruction, options = {}) {
729
778
  function elapsedMinutes(isoTimestamp) {
730
779
  return Math.round((Date.now() - new Date(isoTimestamp).getTime()) / 60_000);
731
780
  }
781
+ /**
782
+ * [FIX P2] Use resolvePaths() for review request paths to stay consistent
783
+ * with the path resolution logic (prevents stale paths if format changes).
784
+ */
732
785
  function formatReviewRequest(state) {
733
786
  const storyId = state.story ?? "(no story)";
787
+ const paths = (0, rules_1.resolvePaths)([
788
+ "docs/bdd/US-{story}.md",
789
+ "docs/deltas/US-{story}.md",
790
+ ], storyId);
734
791
  return (`Story ${storyId} is ready for review.\n` +
735
792
  `Please check:\n` +
736
- `- docs/bdd/${storyId}.md (BDD scenarios)\n` +
737
- `- docs/deltas/${storyId}.md (Delta Spec)\n` +
793
+ `- ${paths[0]} (BDD scenarios)\n` +
794
+ `- ${paths[1]} (Delta Spec)\n` +
738
795
  `- docs/api/openapi.yaml (contract changes)\n\n` +
739
796
  `Reply "approved" to continue, or provide feedback.`);
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G,IAAA,oBAAY,EACxB;QACE,wBAAwB;QACxB,2BAA2B;KAC5B,EACD,OAAO,CACR,CAAC;IAEF,OAAO,CACL,SAAS,OAAO,yBAAyB;QACzC,iBAAiB;QACjB,KAAK,KAAK,CAAC,CAAC,CAAC,oBAAoB;QACjC,KAAK,KAAK,CAAC,CAAC,CAAC,iBAAiB;QAC9B,gDAAgD;QAChD,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,12 @@
6
6
  * rules.ts → Step transition rules table (pure data)
7
7
  * dispatch.ts → State machine + prompt builder + handoff parser
8
8
  */
9
- export { type State, type Step, type Status, type Reason, type TaskType, type TestResult, createInitialState, readState, writeState, initState, validate, isTimedOut, isMaxedOut, markRunning, markCompleted, } from "./state";
10
- export { type StepRule, type FailRouting, type TeamRole, type TeamRoles, type DispatchMode, STEP_RULES, BOOTSTRAP_RULE, DEFAULT_TEAM_ROLES, DISPATCH_MODES, getRule, resolvePaths, getDispatchMode, getFailTarget, getStepSequence, } from "./rules";
11
- export { type DispatchResult, type HandoffResult, dispatch, buildPrompt, parseHandoff, applyHandoff, runPostCheck, approveReview, rejectReview, startStory, startCustom, type ProjectStatus, type FrameworkDetection, type ProjectEntry, detectFramework, queryProjectStatus, listProjects, } from "./dispatch";
9
+ export { createInitialState, readState, writeState, initState, validate, isTimedOut, isMaxedOut, markRunning, markCompleted, generateClaudeMd, writeClaudeMd, } from "./state";
10
+ export type { State, TestResults } from "./state";
11
+ export { STEP_RULES, BOOTSTRAP_RULE, DEFAULT_TEAM_ROLES, DISPATCH_MODES, getRule, resolvePaths, getDispatchMode, getFailTarget, getStepSequence, } from "./rules";
12
+ export type { StepRule } from "./rules";
13
+ export { auto, classify } from "./auto";
14
+ export { dispatch, peek, // [FIX P1] New: read-only dispatch preview
15
+ buildPrompt, parseHandoff, applyHandoff, runPostCheck, approveReview, rejectReview, startStory, startCustom, detectFramework, queryProjectStatus, listProjects, } from "./dispatch";
16
+ export type { DispatchResult, HandoffData } from "./dispatch";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGlD,OAAO,EACL,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,YAAY,EACZ,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EACL,QAAQ,EACR,IAAI,EAAE,2CAA2C;AACjD,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * dispatch.ts → State machine + prompt builder + handoff parser
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.listProjects = exports.queryProjectStatus = exports.detectFramework = exports.startCustom = exports.startStory = exports.rejectReview = exports.approveReview = exports.runPostCheck = exports.applyHandoff = exports.parseHandoff = exports.buildPrompt = exports.dispatch = exports.getStepSequence = exports.getFailTarget = exports.getDispatchMode = exports.resolvePaths = exports.getRule = exports.DISPATCH_MODES = exports.DEFAULT_TEAM_ROLES = exports.BOOTSTRAP_RULE = exports.STEP_RULES = exports.markCompleted = exports.markRunning = exports.isMaxedOut = exports.isTimedOut = exports.validate = exports.initState = exports.writeState = exports.readState = exports.createInitialState = void 0;
11
+ exports.listProjects = exports.queryProjectStatus = exports.detectFramework = exports.startCustom = exports.startStory = exports.rejectReview = exports.approveReview = exports.runPostCheck = exports.applyHandoff = exports.parseHandoff = exports.buildPrompt = exports.peek = exports.dispatch = exports.classify = exports.auto = exports.getStepSequence = exports.getFailTarget = exports.getDispatchMode = exports.resolvePaths = exports.getRule = exports.DISPATCH_MODES = exports.DEFAULT_TEAM_ROLES = exports.BOOTSTRAP_RULE = exports.STEP_RULES = exports.writeClaudeMd = exports.generateClaudeMd = exports.markCompleted = exports.markRunning = exports.isMaxedOut = exports.isTimedOut = exports.validate = exports.initState = exports.writeState = exports.readState = exports.createInitialState = void 0;
12
12
  // State
13
13
  var state_1 = require("./state");
14
14
  Object.defineProperty(exports, "createInitialState", { enumerable: true, get: function () { return state_1.createInitialState; } });
@@ -20,6 +20,8 @@ Object.defineProperty(exports, "isTimedOut", { enumerable: true, get: function (
20
20
  Object.defineProperty(exports, "isMaxedOut", { enumerable: true, get: function () { return state_1.isMaxedOut; } });
21
21
  Object.defineProperty(exports, "markRunning", { enumerable: true, get: function () { return state_1.markRunning; } });
22
22
  Object.defineProperty(exports, "markCompleted", { enumerable: true, get: function () { return state_1.markCompleted; } });
23
+ Object.defineProperty(exports, "generateClaudeMd", { enumerable: true, get: function () { return state_1.generateClaudeMd; } });
24
+ Object.defineProperty(exports, "writeClaudeMd", { enumerable: true, get: function () { return state_1.writeClaudeMd; } });
23
25
  // Rules
24
26
  var rules_1 = require("./rules");
25
27
  Object.defineProperty(exports, "STEP_RULES", { enumerable: true, get: function () { return rules_1.STEP_RULES; } });
@@ -31,9 +33,14 @@ Object.defineProperty(exports, "resolvePaths", { enumerable: true, get: function
31
33
  Object.defineProperty(exports, "getDispatchMode", { enumerable: true, get: function () { return rules_1.getDispatchMode; } });
32
34
  Object.defineProperty(exports, "getFailTarget", { enumerable: true, get: function () { return rules_1.getFailTarget; } });
33
35
  Object.defineProperty(exports, "getStepSequence", { enumerable: true, get: function () { return rules_1.getStepSequence; } });
36
+ // Auto (unified entry point)
37
+ var auto_1 = require("./auto");
38
+ Object.defineProperty(exports, "auto", { enumerable: true, get: function () { return auto_1.auto; } });
39
+ Object.defineProperty(exports, "classify", { enumerable: true, get: function () { return auto_1.classify; } });
34
40
  // Dispatch
35
41
  var dispatch_1 = require("./dispatch");
36
42
  Object.defineProperty(exports, "dispatch", { enumerable: true, get: function () { return dispatch_1.dispatch; } });
43
+ Object.defineProperty(exports, "peek", { enumerable: true, get: function () { return dispatch_1.peek; } });
37
44
  Object.defineProperty(exports, "buildPrompt", { enumerable: true, get: function () { return dispatch_1.buildPrompt; } });
38
45
  Object.defineProperty(exports, "parseHandoff", { enumerable: true, get: function () { return dispatch_1.parseHandoff; } });
39
46
  Object.defineProperty(exports, "applyHandoff", { enumerable: true, get: function () { return dispatch_1.applyHandoff; } });
@@ -45,3 +52,4 @@ Object.defineProperty(exports, "startCustom", { enumerable: true, get: function
45
52
  Object.defineProperty(exports, "detectFramework", { enumerable: true, get: function () { return dispatch_1.detectFramework; } });
46
53
  Object.defineProperty(exports, "queryProjectStatus", { enumerable: true, get: function () { return dispatch_1.queryProjectStatus; } });
47
54
  Object.defineProperty(exports, "listProjects", { enumerable: true, get: function () { return dispatch_1.listProjects; } });
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,QAAQ;AACR,iCAYiB;AAXf,2GAAA,kBAAkB,OAAA;AAClB,kGAAA,SAAS,OAAA;AACT,mGAAA,UAAU,OAAA;AACV,kGAAA,SAAS,OAAA;AACT,iGAAA,QAAQ,OAAA;AACR,mGAAA,UAAU,OAAA;AACV,mGAAA,UAAU,OAAA;AACV,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,yGAAA,gBAAgB,OAAA;AAChB,sGAAA,aAAa,OAAA;AAIf,QAAQ;AACR,iCAUiB;AATf,mGAAA,UAAU,OAAA;AACV,uGAAA,cAAc,OAAA;AACd,2GAAA,kBAAkB,OAAA;AAClB,uGAAA,cAAc,OAAA;AACd,gGAAA,OAAO,OAAA;AACP,qGAAA,YAAY,OAAA;AACZ,wGAAA,eAAe,OAAA;AACf,sGAAA,aAAa,OAAA;AACb,wGAAA,eAAe,OAAA;AAIjB,6BAA6B;AAC7B,+BAAwC;AAA/B,4FAAA,IAAI,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAEvB,WAAW;AACX,uCAcoB;AAblB,oGAAA,QAAQ,OAAA;AACR,gGAAA,IAAI,OAAA;AACJ,uGAAA,WAAW,OAAA;AACX,wGAAA,YAAY,OAAA;AACZ,wGAAA,YAAY,OAAA;AACZ,wGAAA,YAAY,OAAA;AACZ,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AACZ,sGAAA,UAAU,OAAA;AACV,uGAAA,WAAW,OAAA;AACX,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA"}
package/dist/rules.d.ts CHANGED
@@ -8,58 +8,41 @@
8
8
  *
9
9
  * Projects can override defaults via `.ai/step-rules.yaml` (future).
10
10
  */
11
- import type { Step, Reason } from "./state";
12
- /** Reason-based routing: maps failure reason → target step */
13
- export type FailRouting = {
14
- /** Fallback when reason is null or unrecognized */
15
- default: Step;
16
- } & Partial<Record<Reason, Step>>;
17
- /** Complete rule definition for a single step */
18
11
  export interface StepRule {
19
- /** Display name for dispatch prompt */
20
12
  display_name: string;
21
- /** Step to advance to on success */
22
- next_on_pass: Step;
23
- /** Reason-based routing on failure */
24
- on_fail: FailRouting;
25
- /** Maximum attempts before marking as blocked */
13
+ next_on_pass: string;
14
+ on_fail: Record<string, string>;
26
15
  max_attempts: number;
27
- /** Timeout in minutes for executor session */
28
16
  timeout_min: number;
29
- /** Whether this step requires human input (pauses pipeline) */
30
17
  requires_human: boolean;
31
- /** Files executor should read at this step.
32
- * Supports {story} placeholder for current Story ID. */
33
18
  claude_reads: string[];
34
- /** Files/patterns executor may write at this step */
35
19
  claude_writes: string[];
36
- /** Shell command to run after executor exits (null = none).
37
- * Deterministic check, zero LLM tokens. */
38
20
  post_check: string | null;
39
- /** Fixed instruction for the dispatch prompt */
40
21
  step_instruction: string;
41
22
  }
42
- /** Role definition for multi-executor team dispatch */
43
- export interface TeamRole {
44
- claude_reads: string[];
45
- claude_writes: string[];
46
- }
47
- /** Optional team_roles extension for multi-executor steps */
48
- export type TeamRoles = Record<string, TeamRole>;
49
- /** Dispatch mode based on story complexity */
50
- export type DispatchMode = "single" | "auto" | "team";
51
23
  /** Complexity-to-dispatch-mode mapping */
52
- export declare const DISPATCH_MODES: Record<string, DispatchMode>;
53
- export declare const STEP_RULES: Record<Exclude<Step, "bootstrap" | "done">, StepRule>;
24
+ export declare const DISPATCH_MODES: Record<string, string>;
25
+ export declare const STEP_RULES: Record<string, StepRule>;
54
26
  export declare const BOOTSTRAP_RULE: StepRule;
55
- export declare const DEFAULT_TEAM_ROLES: Record<string, TeamRoles>;
27
+ export declare const DEFAULT_TEAM_ROLES: Record<string, Record<string, {
28
+ claude_reads: string[];
29
+ claude_writes: string[];
30
+ }>>;
56
31
  /** Get the rule for a given step */
57
- export declare function getRule(step: Step): StepRule;
58
- /** Resolve {story} placeholders in file paths */
32
+ export declare function getRule(step: string): StepRule;
33
+ /**
34
+ * Resolve {story} placeholders in file paths.
35
+ *
36
+ * [FIX P0] Handles double-prefix prevention:
37
+ * Templates use "US-{story}" but storyId may already be "US-013".
38
+ * If template has "US-{story}" and storyId starts with "US-",
39
+ * replace "US-{story}" as a whole unit → "US-013" (not "US-US-013").
40
+ */
59
41
  export declare function resolvePaths(paths: string[], storyId: string): string[];
60
42
  /** Determine dispatch mode from complexity marker */
61
- export declare function getDispatchMode(complexity: string, parallelCount?: number): DispatchMode;
43
+ export declare function getDispatchMode(complexity: string, parallelCount?: number): string;
62
44
  /** Get the next step after a failure, using reason-based routing */
63
- export declare function getFailTarget(step: Step, reason: Reason | null): Step;
45
+ export declare function getFailTarget(step: string, reason: string | null): string;
64
46
  /** Get ordered step sequence for the micro-waterfall loop */
65
- export declare function getStepSequence(): Step[];
47
+ export declare function getStepSequence(): string[];
48
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,0CAA0C;AAC1C,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIjD,CAAC;AAIF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAyL/C,CAAC;AAIF,eAAO,MAAM,cAAc,EAAE,QAsB5B,CAAC;AAIF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE;IAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiCpE,CAAC;AAIF,oCAAoC;AACpC,wBA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