@llm-dev-ops/agentics-cli 2.7.35 → 2.7.37

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.
Files changed (61) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/agents.d.ts.map +1 -1
  4. package/dist/commands/agents.js +24 -70
  5. package/dist/commands/agents.js.map +1 -1
  6. package/dist/mcp/agent-event-parser.d.ts +1 -11
  7. package/dist/mcp/agent-event-parser.d.ts.map +1 -1
  8. package/dist/mcp/agent-event-parser.js +7 -140
  9. package/dist/mcp/agent-event-parser.js.map +1 -1
  10. package/dist/mcp/mcp-server.js +0 -58
  11. package/dist/mcp/mcp-server.js.map +1 -1
  12. package/dist/pipeline/auto-chain.d.ts.map +1 -1
  13. package/dist/pipeline/auto-chain.js +27 -93
  14. package/dist/pipeline/auto-chain.js.map +1 -1
  15. package/dist/pipeline/local-fallback/phase5a-local-fallback.d.ts +21 -18
  16. package/dist/pipeline/local-fallback/phase5a-local-fallback.d.ts.map +1 -1
  17. package/dist/pipeline/local-fallback/phase5a-local-fallback.js +92 -397
  18. package/dist/pipeline/local-fallback/phase5a-local-fallback.js.map +1 -1
  19. package/dist/pipeline/phase2/phases/adr-generator.d.ts +29 -1
  20. package/dist/pipeline/phase2/phases/adr-generator.d.ts.map +1 -1
  21. package/dist/pipeline/phase2/phases/adr-generator.js +709 -1399
  22. package/dist/pipeline/phase2/phases/adr-generator.js.map +1 -1
  23. package/dist/pipeline/phase2/phases/research-dossier.d.ts.map +1 -1
  24. package/dist/pipeline/phase2/phases/research-dossier.js +2 -33
  25. package/dist/pipeline/phase2/phases/research-dossier.js.map +1 -1
  26. package/dist/pipeline/phase2/types.d.ts +19 -57
  27. package/dist/pipeline/phase2/types.d.ts.map +1 -1
  28. package/dist/pipeline/phase4-adrs/adr-index-extractor.d.ts +75 -0
  29. package/dist/pipeline/phase4-adrs/adr-index-extractor.d.ts.map +1 -0
  30. package/dist/pipeline/phase4-adrs/adr-index-extractor.js +200 -0
  31. package/dist/pipeline/phase4-adrs/adr-index-extractor.js.map +1 -0
  32. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.d.ts.map +1 -1
  33. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js +70 -68
  34. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js.map +1 -1
  35. package/dist/pipeline/phases/adr-ddd-generator.d.ts.map +1 -1
  36. package/dist/pipeline/phases/adr-ddd-generator.js +48 -2
  37. package/dist/pipeline/phases/adr-ddd-generator.js.map +1 -1
  38. package/dist/pipeline/phases/prompt-generator.js +191 -80
  39. package/dist/pipeline/phases/prompt-generator.js.map +1 -1
  40. package/dist/pipeline/ruflo-phase-executor.d.ts.map +1 -1
  41. package/dist/pipeline/ruflo-phase-executor.js +69 -17
  42. package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
  43. package/dist/pipeline/types.d.ts +14 -1
  44. package/dist/pipeline/types.d.ts.map +1 -1
  45. package/dist/synthesis/ask-artifact-writer.d.ts +1 -1
  46. package/dist/synthesis/ask-artifact-writer.d.ts.map +1 -1
  47. package/dist/synthesis/ask-artifact-writer.js +9 -9
  48. package/dist/synthesis/ask-artifact-writer.js.map +1 -1
  49. package/dist/synthesis/simulation-artifact-generator.d.ts +1 -27
  50. package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
  51. package/dist/synthesis/simulation-artifact-generator.js +38 -128
  52. package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
  53. package/package.json +1 -1
  54. package/dist/cli/ui/heartbeat.d.ts +0 -88
  55. package/dist/cli/ui/heartbeat.d.ts.map +0 -1
  56. package/dist/cli/ui/heartbeat.js +0 -158
  57. package/dist/cli/ui/heartbeat.js.map +0 -1
  58. package/dist/synthesis/agent-fleet-decomposer.d.ts +0 -124
  59. package/dist/synthesis/agent-fleet-decomposer.d.ts.map +0 -1
  60. package/dist/synthesis/agent-fleet-decomposer.js +0 -696
  61. package/dist/synthesis/agent-fleet-decomposer.js.map +0 -1
@@ -26,7 +26,6 @@ import { detectExecutionMode, commitScenarioFiles, } from './execution-context.j
26
26
  import { initSwarm, dispatchPhaseAgents, storePhaseArtifacts, reviewPhaseOutput, recordPhaseFailure, shutdownSwarm, invokeRufloCodingSwarm, PHASE_AGENTS, } from './swarm-orchestrator.js';
27
27
  import { executeRufloPhaseSwarm, buildPhase2Tasks, buildPhase3Tasks, buildPhase4Tasks, buildPhase5Tasks, buildPhase6Tasks, collectPhase2Artifacts, collectPhase3Artifacts, collectPhase4Artifacts, collectPhase5Artifacts, collectPhase6Artifacts, extractPhase1AgentCode, runPrimaryPhaseExecution, } from './ruflo-phase-executor.js';
28
28
  import { gatePhaseInputs, determineBlockedPhases, } from './gate/phase-dependency-gate.js';
29
- import { pipelineHeartbeat } from '../cli/ui/heartbeat.js';
30
29
  /** Extract path strings from any manifest artifact array (objects with .path or plain strings). */
31
30
  function extractArtifactPaths(artifacts) {
32
31
  return artifacts.map(a => typeof a === 'string' ? a : a.path);
@@ -2358,7 +2357,7 @@ async function ensureAdrsExist(runDir, traceId, scenarioQuery) {
2358
2357
  console.error('');
2359
2358
  console.error(' [ADR-028] No ADRs found — generating guaranteed set');
2360
2359
  try {
2361
- const { buildPhase2ADRs } = await import('./phase2/phases/adr-generator.js');
2360
+ const { buildLoudFailureADR } = await import('./phase2/phases/adr-generator.js');
2362
2361
  const { buildPhase2DDD } = await import('./phase2/phases/ddd-generator.js');
2363
2362
  // Load SPARC/dossier from any available location, or use empty defaults
2364
2363
  let sparc = { architecture: { services: [] }, specification: { requirements: [], constraints: [] } };
@@ -2383,9 +2382,17 @@ async function ensureAdrsExist(runDir, traceId, scenarioQuery) {
2383
2382
  catch { /* skip */ }
2384
2383
  }
2385
2384
  }
2386
- const adrs = buildPhase2ADRs(sparc, dossier, scenarioQuery, true /* skipLLM */);
2387
- if (adrs.length === 0)
2388
- return;
2385
+ // ADR-PIPELINE-100 §D5: ADR-028 guarantee path emits a loud-failure ADR
2386
+ // directly rather than calling the LLM. By the time we reach this branch
2387
+ // Phase 4 has already run (or been skipped); the LLM pass would either
2388
+ // duplicate Phase 4's work or block the guarantee path on a 30-min cap.
2389
+ const adrs = [buildLoudFailureADR({
2390
+ reason: 'ADR-028 guarantee path: no usable ADRs found anywhere in the run after Phase 4 completed/skipped. This failure ADR is written to satisfy the "always emit something" contract without re-running the LLM.',
2391
+ claudeFailureReason: 'guarantee path skipped LLM call — see Phase 4 logs for the original failure',
2392
+ dossierItemCount: dossier.items?.length ?? 0,
2393
+ sparcStatus: 'unknown',
2394
+ query: scenarioQuery,
2395
+ })];
2389
2396
  // Write to BOTH phase4 and phase2 so downstream consumers find them regardless of which path they check
2390
2397
  for (const targetDir of [path.join(runDir, 'phase4'), path.join(runDir, 'phase2')]) {
2391
2398
  const adrDir = path.join(targetDir, 'adrs');
@@ -2497,16 +2504,11 @@ export async function executeAutoChain(traceId, options = {}) {
2497
2504
  catch {
2498
2505
  // Best-effort
2499
2506
  }
2500
- // ADR-PIPELINE-099 D3 — process-wide heartbeat. Lives until executeAutoChain
2501
- // returns (try/finally below). Replaces the per-call heartbeat in
2502
- // executeNaturalLanguageRoute that died when auto-chain took over.
2503
- pipelineHeartbeat.start('agentics ask');
2504
- pipelineHeartbeat.setPhase('Phase 2 — booting');
2505
2507
  console.error('');
2506
2508
  console.error('='.repeat(72));
2507
2509
  console.error(' ENTERPRISE PROTOTYPE PIPELINE');
2508
2510
  console.error(` Mode: ${mode === 'development' ? 'DEVELOPMENT (sandbox — no repo mutation)' : 'PROJECT (current branch)'}`);
2509
- console.error(' Auto-chaining Phases 2-7 from simulation artifacts');
2511
+ console.error(' Auto-chaining Phases 2-6 from simulation artifacts');
2510
2512
  console.error('='.repeat(72));
2511
2513
  console.error('');
2512
2514
  // ── Check ruflo availability (optional — pipeline works without it) ──
@@ -2547,7 +2549,6 @@ export async function executeAutoChain(traceId, options = {}) {
2547
2549
  console.error('-'.repeat(72));
2548
2550
  console.error(' >> Phase 2: Deep Research');
2549
2551
  console.error('-'.repeat(72));
2550
- pipelineHeartbeat.setPhase('Phase 2 — Deep Research');
2551
2552
  const phase2HasContent = fs.existsSync(phaseDir)
2552
2553
  && fs.existsSync(path.join(phaseDir, 'research-dossier.json'))
2553
2554
  && fs.existsSync(path.join(phaseDir, 'sparc', 'sparc-combined.json'));
@@ -2625,7 +2626,6 @@ export async function executeAutoChain(traceId, options = {}) {
2625
2626
  console.error('');
2626
2627
  console.error('-'.repeat(72));
2627
2628
  console.error(' >> Phase 3: SPARC + London School TDD');
2628
- pipelineHeartbeat.setPhase('Phase 3 — SPARC + London TDD');
2629
2629
  console.error('-'.repeat(72));
2630
2630
  const phase3HasContent = fs.existsSync(phaseDir)
2631
2631
  && fs.existsSync(path.join(phaseDir, 'sparc', 'sparc-combined.json'));
@@ -2743,7 +2743,6 @@ export async function executeAutoChain(traceId, options = {}) {
2743
2743
  console.error('');
2744
2744
  console.error('-'.repeat(72));
2745
2745
  console.error(' >> Phase 4: Architecture Decision Records + Domain-Driven Design');
2746
- pipelineHeartbeat.setPhase('Phase 4 — ADRs + DDDs');
2747
2746
  console.error('-'.repeat(72));
2748
2747
  // Only skip if phase4 has actual ADR + DDD content (not just an empty dir from a failed prior run)
2749
2748
  const phase4HasContent = fs.existsSync(phaseDir)
@@ -2834,7 +2833,7 @@ export async function executeAutoChain(traceId, options = {}) {
2834
2833
  if (!recovered) {
2835
2834
  console.error(' [RECOVER] No Phase 2 ADRs — generating ADRs from SPARC + dossier (no LLM required)');
2836
2835
  try {
2837
- const { buildPhase2ADRs } = await import('../pipeline/phase2/phases/adr-generator.js');
2836
+ const { buildLoudFailureADR } = await import('../pipeline/phase2/phases/adr-generator.js');
2838
2837
  const { buildPhase2DDD } = await import('../pipeline/phase2/phases/ddd-generator.js');
2839
2838
  // Load SPARC and dossier from wherever they exist
2840
2839
  let sparc = null;
@@ -2860,8 +2859,18 @@ export async function executeAutoChain(traceId, options = {}) {
2860
2859
  }
2861
2860
  }
2862
2861
  if (sparc && dossier) {
2863
- // Generate ADRs
2864
- const adrs = buildPhase2ADRs(sparc, dossier, scenarioQuery, true /* skipLLM */);
2862
+ // ADR-PIPELINE-100 §D5: recovery path emits a loud-failure ADR
2863
+ // directly rather than re-running the LLM. The Phase 4 path
2864
+ // has already completed/skipped; we just need a present-but-honest
2865
+ // marker in `phase4/adrs/` so downstream consumers can see that
2866
+ // ADR generation didn't yield real content.
2867
+ const adrs = [buildLoudFailureADR({
2868
+ reason: 'Recovery path: no Phase 2 ADRs found; Phase 4 also did not produce content. This failure ADR is written so downstream phases can see the regression without rerunning the LLM.',
2869
+ claudeFailureReason: 'recovery path skipped LLM call — see Phase 4 logs for the original failure',
2870
+ dossierItemCount: dossier.items?.length ?? 0,
2871
+ sparcStatus: 'present',
2872
+ query: scenarioQuery,
2873
+ })];
2865
2874
  if (adrs.length > 0) {
2866
2875
  const adrDir = path.join(phaseDir, 'adrs');
2867
2876
  fs.mkdirSync(adrDir, { recursive: true });
@@ -2925,11 +2934,10 @@ export async function executeAutoChain(traceId, options = {}) {
2925
2934
  } // close ADR-PIPELINE-093 phase4-adrs-ddd gate-else
2926
2935
  }
2927
2936
  }
2928
- // ── Phase 4.5 (Phase 5a): Generate implementation prompts by reading ADR + DDD files ──
2937
+ // ── Phase 4.5: Generate implementation prompts by reading ADR + DDD files ──
2929
2938
  // Simple approach: gather all ADR/DDD/SPARC files, hand them to ruflo swarm,
2930
2939
  // let the LLM read them and produce coherent implementation prompts.
2931
2940
  {
2932
- pipelineHeartbeat.setPhase('Phase 5a — Implementation Prompts');
2933
2941
  const promptsDir = path.join(runDir, 'prompts');
2934
2942
  // Check if prompts already exist from a prior run
2935
2943
  const promptsExist = fs.existsSync(promptsDir)
@@ -3876,7 +3884,6 @@ services when the pilot validates the approach.
3876
3884
  console.error('');
3877
3885
  console.error('-'.repeat(72));
3878
3886
  console.error(` >> Phase 5: Build (Code Generation + Deployable Service) [${detectedLanguage}]`);
3879
- pipelineHeartbeat.setPhase(`Phase 5 — Build [${detectedLanguage}]`);
3880
3887
  console.error('-'.repeat(72));
3881
3888
  const phase5HasContent = fs.existsSync(phaseDir)
3882
3889
  && fs.existsSync(path.join(phaseDir, 'phase5-manifest.json'));
@@ -3891,38 +3898,6 @@ services when the pilot validates the approach.
3891
3898
  fs.rmSync(phaseDir, { recursive: true, force: true });
3892
3899
  }
3893
3900
  const agentResults = await dispatchPhaseAgents(PHASE_AGENTS[5], traceId, runDir, scenarioQuery);
3894
- // ADR-PIPELINE-099 D3 — surface every implementation prompt so the user
3895
- // sees the work plan instead of staring at a silent terminal. The build
3896
- // itself remains a single Ruflo swarm invocation, but each prompt that
3897
- // feeds it is now visible up front and announced in the heartbeat.
3898
- try {
3899
- const promptsDir = path.join(runDir, 'prompts');
3900
- if (fs.existsSync(promptsDir)) {
3901
- const implFiles = fs.readdirSync(promptsDir)
3902
- .filter(f => /^impl-\d+-.+\.md$/.test(f))
3903
- .sort();
3904
- if (implFiles.length > 0) {
3905
- console.error(` [PROMPTS] Build plan: ${implFiles.length} implementation prompts queued`);
3906
- for (let i = 0; i < implFiles.length; i++) {
3907
- const f = implFiles[i];
3908
- // Read just the title line from frontmatter so the visible
3909
- // line is human-readable, not a slug.
3910
- let title = f;
3911
- try {
3912
- const head = fs.readFileSync(path.join(promptsDir, f), 'utf-8').split('\n').slice(0, 12);
3913
- const titleLine = head.find(l => l.startsWith('title:'));
3914
- if (titleLine)
3915
- title = titleLine.replace(/^title:\s*"?/, '').replace(/"?\s*$/, '');
3916
- }
3917
- catch { /* keep filename */ }
3918
- const titleTrim = title.length > 70 ? title.slice(0, 67) + '…' : title;
3919
- console.error(` ${String(i + 1).padStart(2, ' ')}/${implFiles.length} ${f} ${titleTrim}`);
3920
- }
3921
- pipelineHeartbeat.setActivity(`build: handing ${implFiles.length} prompts to ruflo swarm`);
3922
- }
3923
- }
3924
- }
3925
- catch { /* visibility is best-effort */ }
3926
3901
  // Ruflo swarm: build production-ready application in cooperation with agentics agents
3927
3902
  const rufloP5Dir = path.join(runDir, '.ruflo-cache', 'phase5');
3928
3903
  const rufloResult = executeRufloPhaseSwarm({
@@ -4001,7 +3976,6 @@ services when the pilot validates the approach.
4001
3976
  console.error('');
4002
3977
  console.error('-'.repeat(72));
4003
3978
  console.error(' >> Phase 6: ERP Surface Push + Project Materialization');
4004
- pipelineHeartbeat.setPhase('Phase 6 — ERP Push + Materialization');
4005
3979
  console.error('-'.repeat(72));
4006
3980
  // Only skip if phase6 has actual registration content (not just an empty dir from a failed prior run)
4007
3981
  const phase6HasContent = fs.existsSync(phaseDir)
@@ -4059,7 +4033,6 @@ services when the pilot validates the approach.
4059
4033
  console.error('');
4060
4034
  console.error('-'.repeat(72));
4061
4035
  console.error(' >> Phase 7: Consulting Deliverables (85-document enterprise decision pack)');
4062
- pipelineHeartbeat.setPhase('Phase 7 — Consulting Deliverables');
4063
4036
  console.error('-'.repeat(72));
4064
4037
  try {
4065
4038
  const { executePhase7 } = await import('./phase7/coordinator.js');
@@ -4103,40 +4076,6 @@ services when the pilot validates the approach.
4103
4076
  outputDir: phaseDir,
4104
4077
  ...(errorDetail ? { error: errorDetail } : {}),
4105
4078
  });
4106
- // ADR-PIPELINE-099 D5 (project-co-located deliverables) — the
4107
- // executive deliverables MUST land in the project directory itself,
4108
- // not behind the runDir artifact wall (~/.agentics/runs/...). Copy
4109
- // <runDir>/deliverables/ into:
4110
- // 1. <runDir>/phase6/project/deliverables/ — so the materialized
4111
- // project tree always carries them
4112
- // 2. <options.outputDir>/deliverables/ — when the user asked for
4113
- // a specific output directory
4114
- // 3. <repoRoot>/deliverables/ — when running in 'project' mode,
4115
- // so the deliverables land alongside the just-built code
4116
- const deliverablesSrc = phaseDir; // == <runDir>/deliverables
4117
- if (fs.existsSync(deliverablesSrc)) {
4118
- const targets = [];
4119
- const phase6ProjectDir = path.join(runDir, 'phase6', 'project');
4120
- if (fs.existsSync(phase6ProjectDir)) {
4121
- targets.push(path.join(phase6ProjectDir, 'deliverables'));
4122
- }
4123
- if (options.outputDir) {
4124
- targets.push(path.join(path.resolve(options.outputDir), 'deliverables'));
4125
- }
4126
- if (mode === 'project' && execCtx.repoRoot) {
4127
- targets.push(path.join(execCtx.repoRoot, 'deliverables'));
4128
- }
4129
- for (const target of targets) {
4130
- try {
4131
- const counts = copyDirRecursive(deliverablesSrc, target);
4132
- console.error(` [P7] Co-located deliverables → ${target} (${counts.copied} new, ${counts.skipped} unchanged)`);
4133
- }
4134
- catch (copyErr) {
4135
- const m = copyErr instanceof Error ? copyErr.message : String(copyErr);
4136
- console.error(` [P7] [WARN] failed to copy deliverables to ${target}: ${m}`);
4137
- }
4138
- }
4139
- }
4140
4079
  }
4141
4080
  }
4142
4081
  catch (err) {
@@ -4269,7 +4208,6 @@ services when the pilot validates the approach.
4269
4208
  shutdownSwarm(traceId, false, totalTiming);
4270
4209
  }
4271
4210
  catch { /* best-effort */ }
4272
- pipelineHeartbeat.stop();
4273
4211
  process.exit(1);
4274
4212
  }
4275
4213
  }
@@ -4283,10 +4221,6 @@ services when the pilot validates the approach.
4283
4221
  // ADR-PIPELINE-093 §Rule 3 (c): blocked phases threaded into the
4284
4222
  // result so the final `agentics ask` banner can warn the user.
4285
4223
  gateAcc.blocked.map(b => ({ phase: b.phase, missing: [...b.missing] })));
4286
- // ADR-PIPELINE-099 D3 — clear the heartbeat status line before printing
4287
- // the final summary so the bottom-of-screen frame doesn't overlap the
4288
- // summary banner.
4289
- pipelineHeartbeat.stop();
4290
4224
  printFinalSummary(result);
4291
4225
  return result;
4292
4226
  }