@llm-dev-ops/agentics-cli 2.5.4 → 2.6.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.
Files changed (37) hide show
  1. package/dist/cli/index.js +80 -13
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/agents.d.ts +7 -0
  4. package/dist/commands/agents.d.ts.map +1 -1
  5. package/dist/commands/agents.js +130 -23
  6. package/dist/commands/agents.js.map +1 -1
  7. package/dist/errors/transient.d.ts +67 -0
  8. package/dist/errors/transient.d.ts.map +1 -0
  9. package/dist/errors/transient.js +260 -0
  10. package/dist/errors/transient.js.map +1 -0
  11. package/dist/observability/degradations.d.ts +58 -0
  12. package/dist/observability/degradations.d.ts.map +1 -0
  13. package/dist/observability/degradations.js +74 -0
  14. package/dist/observability/degradations.js.map +1 -0
  15. package/dist/pipeline/phase1-verdict.d.ts +55 -0
  16. package/dist/pipeline/phase1-verdict.d.ts.map +1 -0
  17. package/dist/pipeline/phase1-verdict.js +186 -0
  18. package/dist/pipeline/phase1-verdict.js.map +1 -0
  19. package/dist/pipeline/phase2-preflight.d.ts +44 -0
  20. package/dist/pipeline/phase2-preflight.d.ts.map +1 -0
  21. package/dist/pipeline/phase2-preflight.js +120 -0
  22. package/dist/pipeline/phase2-preflight.js.map +1 -0
  23. package/dist/pipeline/swarm-orchestrator.d.ts.map +1 -1
  24. package/dist/pipeline/swarm-orchestrator.js +67 -5
  25. package/dist/pipeline/swarm-orchestrator.js.map +1 -1
  26. package/dist/synthesis/financial-claim-extractor.d.ts +11 -0
  27. package/dist/synthesis/financial-claim-extractor.d.ts.map +1 -1
  28. package/dist/synthesis/financial-claim-extractor.js +24 -0
  29. package/dist/synthesis/financial-claim-extractor.js.map +1 -1
  30. package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
  31. package/dist/synthesis/simulation-artifact-generator.js +28 -3
  32. package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
  33. package/dist/synthesis/simulation-renderers.d.ts +1 -1
  34. package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
  35. package/dist/synthesis/simulation-renderers.js +39 -13
  36. package/dist/synthesis/simulation-renderers.js.map +1 -1
  37. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -1842,29 +1842,53 @@ async function main() {
1842
1842
  // Auto-chain Phases 2-6: each phase builds on the previous phase's output
1843
1843
  let chainResult = null;
1844
1844
  if (routeResult.kind === 'multi') {
1845
- // Only auto-chain if the ruvector simulation actually succeeded (not just dispatched).
1846
- // Check invocations for a successful simulator/enterprise result — if it errored
1847
- // (e.g. ruvector-service unreachable), Phases 2-6 would build on empty artifacts.
1848
- const simSucceeded = routeResult.result.invocations.some((i) => i.intent.domain === 'simulator' && i.intent.agent === 'enterprise' && !('error' in i.result));
1845
+ // ADR-PIPELINE-089 §3: gate auto-chain on the Phase 1 Health
1846
+ // Gate verdict, not just whether the simulator intent returned
1847
+ // without an error field. The verdict classifier looks at the
1848
+ // simulator outcome AND agent error ratio AND artifact presence
1849
+ // AND degradation sink entries (tag-survival, consensus, sector,
1850
+ // local fallbacks), so we catch "it technically succeeded but
1851
+ // produced nothing useful" — the user's actual symptom.
1852
+ const verdict = routeResult.result.phase1Verdict;
1853
+ const verdictKind = verdict?.verdict ?? 'healthy'; // default healthy if older caller path
1849
1854
  const hasSimIntent = routeResult.result.intents.some((i) => i.domain === 'simulator' && i.agent === 'enterprise');
1850
- if (!simSucceeded && hasSimIntent) {
1851
- // Simulation was dispatched but failed — surface the error prominently
1852
- const simError = routeResult.result.invocations.find((i) => i.intent.domain === 'simulator' && i.intent.agent === 'enterprise');
1853
- const errDetail = simError ? simError.result.error ?? 'unknown error' : 'not dispatched';
1855
+ if (verdictKind === 'failed' && hasSimIntent) {
1854
1856
  console.error('');
1855
1857
  console.error('='.repeat(72));
1856
- console.error(' RUVECTOR SIMULATION FAILED — Phases 2-6 skipped');
1858
+ console.error(' PHASE 1 FAILED — Phases 2-6 skipped');
1857
1859
  console.error('='.repeat(72));
1858
- console.error(` Error: ${errDetail}`);
1860
+ console.error(` Reason: ${verdict?.reason ?? 'unknown failure'}`);
1861
+ if (verdict && verdict.degradations.length > 0) {
1862
+ console.error('');
1863
+ console.error(' Degradations:');
1864
+ for (const d of verdict.degradations) {
1865
+ console.error(` · [${d.code}] ${d.message}`);
1866
+ }
1867
+ }
1859
1868
  console.error('');
1860
- console.error(' The enterprise simulation via ruvector-service did not complete.');
1861
- console.error(' Phases 2-6 require simulation artifacts to build on.');
1869
+ console.error(' Phases 2-6 require a healthy Phase 1 to build on.');
1862
1870
  console.error('');
1863
1871
  console.error(' To retry:');
1864
1872
  console.error(` agentics ask "${nlQuery}"`);
1865
1873
  console.error('');
1866
1874
  }
1867
- if (simSucceeded) {
1875
+ if (verdictKind === 'degraded') {
1876
+ // Auto-chain still proceeds on degraded — the user may want
1877
+ // partial output — but we surface the specific degradations
1878
+ // prominently so they can judge whether to re-run instead.
1879
+ console.error('');
1880
+ console.error('='.repeat(72));
1881
+ console.error(' PHASE 1 DEGRADED — proceeding to Phases 2-6 with caveats');
1882
+ console.error('='.repeat(72));
1883
+ console.error(` ${verdict?.reason ?? 'partial success'}`);
1884
+ if (verdict && verdict.degradations.length > 0) {
1885
+ for (const d of verdict.degradations) {
1886
+ console.error(` · [${d.code}] ${d.message}`);
1887
+ }
1888
+ }
1889
+ console.error('');
1890
+ }
1891
+ if (verdictKind !== 'failed') {
1868
1892
  // ADR-PIPELINE-088: under MCP mode, detach the auto-chain into a
1869
1893
  // background subprocess so the tool call returns within Claude
1870
1894
  // Code's MCP client-side timeout. Auto-chain phases can take
@@ -1901,6 +1925,10 @@ async function main() {
1901
1925
  fsMod.closeSync(logFd);
1902
1926
  // Write an initial status record so `agentics status <id>`
1903
1927
  // has something to read before the child updates it.
1928
+ // ADR-PIPELINE-089 §6: seed Phase 1 verdict fields so the
1929
+ // status tool can surface HEALTHY / DEGRADED / FAILED plus
1930
+ // the specific degradation list on the very first poll.
1931
+ const phase1V = routeResult.result.phase1Verdict;
1904
1932
  const initialStatus = {
1905
1933
  traceId,
1906
1934
  pid: child.pid ?? null,
@@ -1912,6 +1940,10 @@ async function main() {
1912
1940
  logPath,
1913
1941
  plansDir,
1914
1942
  artifacts: {},
1943
+ phase1_verdict: phase1V?.verdict ?? null,
1944
+ phase1_reason: phase1V?.reason ?? null,
1945
+ phase1_degradations: phase1V?.degradations ?? [],
1946
+ phase1_stats: phase1V?.stats ?? null,
1915
1947
  };
1916
1948
  fsMod.writeFileSync(statusPath, JSON.stringify(initialStatus, null, 2), { encoding: 'utf-8', mode: 0o600 });
1917
1949
  // Emit structured markers so the MCP tool handler (and
@@ -1924,6 +1956,15 @@ async function main() {
1924
1956
  console.log(`AGENTICS_AUTOCHAIN_LOG=${logPath}`);
1925
1957
  console.log(`AGENTICS_AUTOCHAIN_STATUS_FILE=${statusPath}`);
1926
1958
  console.log(`AGENTICS_PLANS_DIR=${plansDir}`);
1959
+ // ADR-PIPELINE-089 §2: surface Phase 1 verdict as a
1960
+ // structured marker so the MCP tool wrapper (and any
1961
+ // log-grepping relay) can read it without parsing the
1962
+ // status file. Count only — the full degradation list is
1963
+ // in status.json.
1964
+ if (phase1V) {
1965
+ console.log(`AGENTICS_PHASE1_VERDICT=${phase1V.verdict}`);
1966
+ console.log(`AGENTICS_PHASE1_DEGRADATIONS=${phase1V.degradations.length}`);
1967
+ }
1927
1968
  console.log('');
1928
1969
  console.log('Phases 2-6 are running in the background. Poll with:');
1929
1970
  console.log(` agentics status ${traceId}`);
@@ -2148,6 +2189,13 @@ async function main() {
2148
2189
  logPath: status['logPath'] ?? null,
2149
2190
  plansDir,
2150
2191
  artifacts: artifactSummary,
2192
+ // ADR-PIPELINE-089 §6: pass Phase 1 verdict + Phase 2 preflight
2193
+ // through verbatim. Null-safe so runs predating 089 still report.
2194
+ phase1_verdict: status['phase1_verdict'] ?? null,
2195
+ phase1_reason: status['phase1_reason'] ?? null,
2196
+ phase1_degradations: status['phase1_degradations'] ?? [],
2197
+ phase1_stats: status['phase1_stats'] ?? null,
2198
+ phase2_preflight: status['phase2_preflight'] ?? null,
2151
2199
  };
2152
2200
  if (options.format === 'json') {
2153
2201
  console.log(JSON.stringify(report, null, parsed.flags['pretty'] ? 2 : 0));
@@ -2168,6 +2216,25 @@ async function main() {
2168
2216
  console.log(`Error: ${report.error}`);
2169
2217
  console.log(`Logs: ${report.logPath ?? '(none)'}`);
2170
2218
  console.log(`Plans dir: ${report.plansDir}`);
2219
+ // ADR-PIPELINE-089 §6: verdict + preflight in the text report.
2220
+ if (report.phase1_verdict) {
2221
+ const v = String(report.phase1_verdict).toUpperCase();
2222
+ console.log(`Phase 1: ${v}${report.phase1_reason ? ' — ' + report.phase1_reason : ''}`);
2223
+ const degs = report.phase1_degradations;
2224
+ for (const d of degs) {
2225
+ console.log(` · [${d.code}] ${d.message}`);
2226
+ }
2227
+ }
2228
+ const pf = report.phase2_preflight;
2229
+ if (pf) {
2230
+ console.log(`Phase 2 pre: ${pf.healthy.length}/${pf.probed} backends healthy (${pf.verdict})`);
2231
+ if (pf.unhealthy.length > 0) {
2232
+ console.log(` unhealthy: ${pf.unhealthy.join(', ')}`);
2233
+ }
2234
+ if (pf.skipped.length > 0) {
2235
+ console.log(` skipped: ${pf.skipped.join(', ')}`);
2236
+ }
2237
+ }
2171
2238
  console.log('Artifacts:');
2172
2239
  for (const [k, n] of Object.entries(artifactSummary)) {
2173
2240
  console.log(` ${k.padEnd(8)} ${n} files`);