oxe-cc 1.7.0 → 1.8.3

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 (44) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +37 -37
  3. package/bin/lib/oxe-agent-install.cjs +24 -8
  4. package/bin/lib/oxe-manifest.cjs +20 -13
  5. package/bin/lib/oxe-operational.cjs +234 -41
  6. package/bin/lib/oxe-project-health.cjs +219 -52
  7. package/bin/lib/oxe-rationality.cjs +9 -7
  8. package/bin/oxe-cc.js +443 -236
  9. package/lib/runtime/compiler/graph-compiler.js +1 -1
  10. package/lib/runtime/executor/action-tool-map.js +4 -0
  11. package/lib/runtime/executor/built-in-tools.js +27 -0
  12. package/lib/runtime/executor/llm-task-executor.d.ts +4 -1
  13. package/lib/runtime/executor/llm-task-executor.js +41 -5
  14. package/lib/runtime/executor/node-prompt-builder.d.ts +4 -1
  15. package/lib/runtime/executor/node-prompt-builder.js +13 -2
  16. package/lib/runtime/models/failure.d.ts +1 -1
  17. package/lib/runtime/scheduler/scheduler.d.ts +5 -1
  18. package/lib/runtime/scheduler/scheduler.js +82 -14
  19. package/lib/runtime/verification/verification-compiler.js +7 -5
  20. package/lib/sdk/index.cjs +48 -44
  21. package/oxe/templates/PLAN.template.md +23 -9
  22. package/oxe/templates/SPEC.template.md +55 -22
  23. package/oxe/workflows/plan.md +18 -6
  24. package/oxe/workflows/spec.md +31 -9
  25. package/package.json +103 -100
  26. package/packages/runtime/package.json +14 -14
  27. package/packages/runtime/src/compiler/graph-compiler.ts +1 -1
  28. package/packages/runtime/src/evidence/evidence-store.ts +2 -2
  29. package/packages/runtime/src/executor/action-tool-map.ts +4 -0
  30. package/packages/runtime/src/executor/built-in-tools.ts +29 -0
  31. package/packages/runtime/src/executor/llm-task-executor.ts +46 -4
  32. package/packages/runtime/src/executor/node-prompt-builder.ts +18 -1
  33. package/packages/runtime/src/models/failure.ts +2 -0
  34. package/packages/runtime/src/scheduler/scheduler.ts +93 -15
  35. package/packages/runtime/src/verification/verification-compiler.ts +7 -5
  36. package/vscode-extension/package.json +184 -184
  37. package/vscode-extension/oxe-agents-0.9.1.vsix +0 -0
  38. package/vscode-extension/oxe-agents-0.9.2.vsix +0 -0
  39. package/vscode-extension/oxe-agents-1.0.0.vsix +0 -0
  40. package/vscode-extension/oxe-agents-1.4.0.vsix +0 -0
  41. package/vscode-extension/oxe-agents-1.5.0.vsix +0 -0
  42. package/vscode-extension/oxe-agents-1.5.1.vsix +0 -0
  43. package/vscode-extension/oxe-agents-1.6.0.vsix +0 -0
  44. package/vscode-extension/oxe-agents-1.7.0.vsix +0 -0
package/bin/oxe-cc.js CHANGED
@@ -209,8 +209,8 @@ function buildInstallSummary(opts, fullLayout) {
209
209
  if (opts.copilotCli || opts.allAgents || anyGranularAgent(opts)) agentHint.push('CLIs / multi-agente');
210
210
  if (agentHint.length) {
211
211
  nextSteps.push({
212
- desc: `Mapear o código no agente (${agentHint.join(', ')}):`,
213
- cmd: '/oxe-scan',
212
+ desc: `Entrar no fluxo OXE no agente (${agentHint.join(', ')}) e deixar o router indicar o primeiro passo:`,
213
+ cmd: '/oxe',
214
214
  });
215
215
  } else if (opts.oxeOnly) {
216
216
  nextSteps.push({
@@ -220,7 +220,7 @@ function buildInstallSummary(opts, fullLayout) {
220
220
  } else {
221
221
  nextSteps.push({
222
222
  desc: 'Primeiro passo do fluxo no seu editor:',
223
- cmd: '/oxe-scan',
223
+ cmd: '/oxe',
224
224
  });
225
225
  }
226
226
 
@@ -252,6 +252,7 @@ function buildUninstallFooter(u) {
252
252
  const bullets = [];
253
253
  const p = u.dryRun ? '[simulação] ' : '';
254
254
  const rm = u.dryRun ? 'Seriam removidos' : 'Removidos';
255
+ const localIdeArtifacts = shouldAlsoRemoveLocalIdeArtifacts(u);
255
256
  const granularAgents = [
256
257
  u.agentOpenCode ? 'OpenCode' : null,
257
258
  u.agentGemini ? 'Gemini' : null,
@@ -277,9 +278,9 @@ function buildUninstallFooter(u) {
277
278
  } else if (granularAgents.length) {
278
279
  bullets.push(`${p}${rm} apenas as integrações selecionadas: ${granularAgents.join(', ')}.`);
279
280
  }
280
- if (u.ideLocal) {
281
+ if (localIdeArtifacts) {
281
282
  bullets.push(
282
- `${p}${rm} integrações OXE no repositório (.cursor, .github, .claude, .copilot, .opencode, … conforme flags).`
283
+ `${p}${rm} integrações OXE no repositório (.cursor, .github, .claude, .copilot, .opencode, … conforme flags ou artefatos locais detectados).`
283
284
  );
284
285
  }
285
286
  if (u.globalCli) bullets.push(`${p}${rm} também o pacote npm global oxe-cc do PATH.`);
@@ -1527,20 +1528,22 @@ function printOxeHealthDiagnostics(target, c, diagOpts = {}) {
1527
1528
  if (r.eventsSummary) {
1528
1529
  console.log(` ${c ? dim : ''}Tracing:${c ? reset : ''} ${r.eventsSummary.total} evento(s)`);
1529
1530
  }
1530
- if (r.planSelfEvaluation && r.planSelfEvaluation.hasSection) {
1531
- const best = r.planSelfEvaluation.bestPlan || '—';
1532
- const conf =
1533
- typeof r.planSelfEvaluation.confidence === 'number' ? `${r.planSelfEvaluation.confidence}%` : '—';
1534
- console.log(` ${c ? dim : ''}Plano (autoavaliação):${c ? reset : ''} melhor=${best} | confiança=${conf}`);
1535
- }
1536
- if (typeof r.executionRationalityReady === 'boolean') {
1537
- console.log(
1538
- ` ${c ? dim : ''}Prontidão racional:${c ? reset : ''} implementation=${r.implementationPackReady ? 'ok' : 'pendente'} | anchors=${r.referenceAnchorsReady ? 'ok' : 'pendente'} | fixtures=${r.fixturePackReady ? 'ok' : 'pendente'}`
1539
- );
1540
- }
1541
- if (r.contextQuality) {
1542
- console.log(
1543
- ` ${c ? dim : ''}Contexto:${c ? reset : ''} score=${r.contextQuality.primaryScore != null ? r.contextQuality.primaryScore : '—'} | workflow=${r.contextQuality.primaryWorkflow || '—'} | status=${r.contextQuality.primaryStatus || '—'}`
1531
+ if (r.planSelfEvaluation && r.planSelfEvaluation.hasSection) {
1532
+ const best = r.planSelfEvaluation.bestPlan || '—';
1533
+ const conf =
1534
+ typeof r.planSelfEvaluation.confidence === 'number' ? `${r.planSelfEvaluation.confidence}%` : '—';
1535
+ console.log(` ${c ? dim : ''}Plano (autoavaliação):${c ? reset : ''} melhor=${best} | confiança=${conf}`);
1536
+ }
1537
+ if (r.executionRationality && r.executionRationality.applicable === false) {
1538
+ console.log(` ${c ? dim : ''}Prontidão racional:${c ? reset : ''} não aplicável ainda (PLAN.md ausente)`);
1539
+ } else if (typeof r.executionRationalityReady === 'boolean') {
1540
+ console.log(
1541
+ ` ${c ? dim : ''}Prontidão racional:${c ? reset : ''} implementation=${r.implementationPackReady ? 'ok' : 'pendente'} | anchors=${r.referenceAnchorsReady ? 'ok' : 'pendente'} | fixtures=${r.fixturePackReady ? 'ok' : 'pendente'}`
1542
+ );
1543
+ }
1544
+ if (r.contextQuality) {
1545
+ console.log(
1546
+ ` ${c ? dim : ''}Contexto:${c ? reset : ''} score=${r.contextQuality.primaryScore != null ? r.contextQuality.primaryScore : '—'} | workflow=${r.contextQuality.primaryWorkflow || '—'} | status=${r.contextQuality.primaryStatus || '—'}`
1544
1547
  );
1545
1548
  }
1546
1549
  if (r.semanticsDrift) {
@@ -1668,11 +1671,11 @@ function runStatusFull(target) {
1668
1671
  sp = oxeHealth.scopedOxePaths(target, activeSession);
1669
1672
  }
1670
1673
 
1671
- printSection('OXE ▸ status --full');
1672
- console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1673
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
1674
- console.log(` ${c ? green : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1675
- console.log(` ${c ? green : ''}Fase:${c ? reset : ''} ${report.phase || '—'}`);
1674
+ printSection('OXE ▸ status --full');
1675
+ console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1676
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
1677
+ console.log(` ${c ? green : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1678
+ console.log(` ${c ? green : ''}Fase:${c ? reset : ''} ${report.phase || '—'}`);
1676
1679
 
1677
1680
  const healthColor = report.healthStatus === 'healthy' ? green : report.healthStatus === 'warning' ? yellow : red;
1678
1681
  console.log(` ${c ? green : ''}Saúde:${c ? reset : ''} ${c ? healthColor : ''}${report.healthStatus}${c ? reset : ''}`);
@@ -1687,6 +1690,14 @@ function runStatusFull(target) {
1687
1690
  console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1688
1691
  }
1689
1692
  }
1693
+ if (report.codex && (report.codex.detected || report.codex.warnings.length)) {
1694
+ console.log(`\n ${c ? yellow : ''}Codex${c ? reset : ''}`);
1695
+ console.log(` ${c ? dim : ''}Prompts:${c ? reset : ''} ${report.codex.commandsReady ? 'ok' : 'pendente'} · ${displayPathForUser(report.codex.promptsDir)}`);
1696
+ console.log(` ${c ? dim : ''}Skills:${c ? reset : ''} ${report.codex.skillsReady ? 'ok' : 'pendente'} · ${displayPathForUser(report.codex.skillsRoot)}`);
1697
+ for (const warning of report.codexWarn.slice(0, 3)) {
1698
+ console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1699
+ }
1700
+ }
1690
1701
 
1691
1702
  // Coverage matrix
1692
1703
  const specPath = activeSession && sp.spec ? sp.spec : p.spec;
@@ -1702,41 +1713,41 @@ function runStatusFull(target) {
1702
1713
  console.log(` ${coverageCell(codebaseExists, 'codebase scan')} ${coverageCell(specExists, 'SPEC.md')} ${coverageCell(planExists, 'PLAN.md')} ${coverageCell(verifyExists, 'VERIFY.md')} ${coverageCell(lessonsExists, 'LESSONS.md')}`);
1703
1714
 
1704
1715
  // Readiness gate
1705
- const packageMode = report.workspaceMode === 'product_package';
1706
- const ready = packageMode
1707
- ? Boolean(report.releaseReadiness && report.releaseReadiness.ok)
1708
- : specExists
1709
- && planExists
1710
- && report.executionRationalityReady
1711
- && !report.planWarn.length
1712
- && !report.runtimeWarn.length;
1713
- const gateColor = ready ? green : yellow;
1714
- console.log(`\n ${c ? yellow : ''}Readiness gate${c ? reset : ''}`);
1715
- console.log(` ${c ? gateColor : ''}${ready ? (packageMode ? '✓ Pronto para publicar' : '✓ Pronto para executar') : (packageMode ? '✗ Não pronto para publicar' : '✗ Não pronto para executar')}${c ? reset : ''}`);
1716
- if (packageMode) {
1717
- const releaseReadiness = report.releaseReadiness || { blockers: [], warnings: [] };
1718
- if (Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1719
- for (const blocker of releaseReadiness.blockers) {
1720
- console.log(` ${c ? red : ''} • ${blocker}${c ? reset : ''}`);
1721
- }
1722
- }
1723
- if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1724
- for (const warning of releaseReadiness.warnings) {
1725
- console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1726
- }
1727
- }
1728
- } else {
1729
- if (!specExists) console.log(` ${c ? dim : ''} • SPEC.md ausente — rode /oxe-spec${c ? reset : ''}`);
1730
- if (!planExists) console.log(` ${c ? dim : ''} • PLAN.md ausente — rode /oxe-plan${c ? reset : ''}`);
1731
- if (report.planWarn.length) {
1732
- for (const w of report.planWarn) {
1733
- console.log(` ${c ? yellow : ''} • ${w}${c ? reset : ''}`);
1734
- }
1735
- }
1736
- if (planExists) {
1737
- console.log(` ${c ? dim : ''} • Artefatos racionais:${c ? reset : ''} implementation=${report.implementationPackReady ? 'ok' : 'pendente'} · anchors=${report.referenceAnchorsReady ? 'ok' : 'pendente'} · fixtures=${report.fixturePackReady ? 'ok' : 'pendente'}`);
1738
- }
1739
- }
1716
+ const packageMode = report.workspaceMode === 'product_package';
1717
+ const ready = packageMode
1718
+ ? Boolean(report.releaseReadiness && report.releaseReadiness.ok)
1719
+ : specExists
1720
+ && planExists
1721
+ && report.executionRationalityReady
1722
+ && !report.planWarn.length
1723
+ && !report.runtimeWarn.length;
1724
+ const gateColor = ready ? green : yellow;
1725
+ console.log(`\n ${c ? yellow : ''}Readiness gate${c ? reset : ''}`);
1726
+ console.log(` ${c ? gateColor : ''}${ready ? (packageMode ? '✓ Pronto para publicar' : '✓ Pronto para executar') : (packageMode ? '✗ Não pronto para publicar' : '✗ Não pronto para executar')}${c ? reset : ''}`);
1727
+ if (packageMode) {
1728
+ const releaseReadiness = report.releaseReadiness || { blockers: [], warnings: [] };
1729
+ if (Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1730
+ for (const blocker of releaseReadiness.blockers) {
1731
+ console.log(` ${c ? red : ''} • ${blocker}${c ? reset : ''}`);
1732
+ }
1733
+ }
1734
+ if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1735
+ for (const warning of releaseReadiness.warnings) {
1736
+ console.log(` ${c ? yellow : ''} • ${warning}${c ? reset : ''}`);
1737
+ }
1738
+ }
1739
+ } else {
1740
+ if (!specExists) console.log(` ${c ? dim : ''} • SPEC.md ausente — rode /oxe-spec${c ? reset : ''}`);
1741
+ if (!planExists) console.log(` ${c ? dim : ''} • PLAN.md ausente — rode /oxe-plan${c ? reset : ''}`);
1742
+ if (report.planWarn.length) {
1743
+ for (const w of report.planWarn) {
1744
+ console.log(` ${c ? yellow : ''} • ${w}${c ? reset : ''}`);
1745
+ }
1746
+ }
1747
+ if (planExists) {
1748
+ console.log(` ${c ? dim : ''} • Artefatos racionais:${c ? reset : ''} implementation=${report.implementationPackReady ? 'ok' : 'pendente'} · anchors=${report.referenceAnchorsReady ? 'ok' : 'pendente'} · fixtures=${report.fixturePackReady ? 'ok' : 'pendente'}`);
1749
+ }
1750
+ }
1740
1751
 
1741
1752
  // Active run summary
1742
1753
  if (report.activeRun) {
@@ -1822,24 +1833,24 @@ function runStatusFull(target) {
1822
1833
  }
1823
1834
 
1824
1835
  // Plan self-evaluation
1825
- if (!packageMode && report.planSelfEvaluation) {
1826
- const pse = report.planSelfEvaluation;
1827
- const threshold = report.planConfidenceThreshold || 90;
1828
- console.log(`\n ${c ? yellow : ''}Autoavaliação do plano${c ? reset : ''}`);
1829
- if (pse.best_plan_current != null) {
1830
- const bestColor = pse.best_plan_current ? green : red;
1831
- console.log(` ${c ? dim : ''}Melhor plano atual:${c ? reset : ''} ${c ? bestColor : ''}${pse.best_plan_current ? 'sim' : 'não'}${c ? reset : ''}`);
1832
- }
1833
- if (pse.confidence != null) {
1834
- const confColor = report.planConfidenceExecutable
1835
- ? green
1836
- : Number(pse.confidence) >= Math.max(80, threshold - 10)
1837
- ? yellow
1838
- : red;
1839
- console.log(` ${c ? dim : ''}Confiança:${c ? reset : ''} ${c ? confColor : ''}${pse.confidence}%${c ? reset : ''}`);
1840
- console.log(` ${c ? dim : ''}Gate executável:${c ? reset : ''} > ${threshold}%${pse.executable ? ' (atingido)' : ' (ainda não atingido)'}`);
1841
- }
1842
- }
1836
+ if (!packageMode && report.planSelfEvaluation) {
1837
+ const pse = report.planSelfEvaluation;
1838
+ const threshold = report.planConfidenceThreshold || 90;
1839
+ console.log(`\n ${c ? yellow : ''}Autoavaliação do plano${c ? reset : ''}`);
1840
+ if (pse.best_plan_current != null) {
1841
+ const bestColor = pse.best_plan_current ? green : red;
1842
+ console.log(` ${c ? dim : ''}Melhor plano atual:${c ? reset : ''} ${c ? bestColor : ''}${pse.best_plan_current ? 'sim' : 'não'}${c ? reset : ''}`);
1843
+ }
1844
+ if (pse.confidence != null) {
1845
+ const confColor = report.planConfidenceExecutable
1846
+ ? green
1847
+ : Number(pse.confidence) >= Math.max(80, threshold - 10)
1848
+ ? yellow
1849
+ : red;
1850
+ console.log(` ${c ? dim : ''}Confiança:${c ? reset : ''} ${c ? confColor : ''}${pse.confidence}%${c ? reset : ''}`);
1851
+ console.log(` ${c ? dim : ''}Gate executável:${c ? reset : ''} > ${threshold}%${pse.executable ? ' (atingido)' : ' (ainda não atingido)'}`);
1852
+ }
1853
+ }
1843
1854
 
1844
1855
  console.log(`\n ${c ? dim : ''}Próximo passo:${c ? reset : ''} ${c ? cyan : ''}${report.next && report.next.cursorCmd ? report.next.cursorCmd : '—'}${c ? reset : ''}`);
1845
1856
  console.log(` ${c ? dim : ''}Motivo:${c ? reset : ''} ${report.next && report.next.reason ? report.next.reason : '—'}`);
@@ -1858,13 +1869,13 @@ function runStatus(target, opts = {}) {
1858
1869
  const next = report.next;
1859
1870
 
1860
1871
  if (opts.json) {
1861
- /** @type {Record<string, unknown>} */
1862
- const payload = {
1863
- oxeStatusSchema: 5,
1864
- projectRoot: path.resolve(target),
1865
- workspaceMode: report.workspaceMode || 'oxe_project',
1866
- releaseReadiness: report.releaseReadiness || null,
1867
- nextStep: report.next.step,
1872
+ /** @type {Record<string, unknown>} */
1873
+ const payload = {
1874
+ oxeStatusSchema: 5,
1875
+ projectRoot: path.resolve(target),
1876
+ workspaceMode: report.workspaceMode || 'oxe_project',
1877
+ releaseReadiness: report.releaseReadiness || null,
1878
+ nextStep: report.next.step,
1868
1879
  cursorCmd: report.next.cursorCmd,
1869
1880
  reason: report.next.reason,
1870
1881
  artifacts: report.next.artifacts,
@@ -1873,18 +1884,18 @@ function runStatus(target, opts = {}) {
1873
1884
  activeSession: report.activeSession,
1874
1885
  scanDate: report.scanDate,
1875
1886
  staleScan: report.stale,
1876
- compactDate: report.compactDate,
1877
- staleCompact: report.staleCompact,
1878
- planSelfEvaluation: report.planSelfEvaluation,
1879
- planConfidenceThreshold: report.planConfidenceThreshold,
1880
- planConfidenceExecutable: report.planConfidenceExecutable,
1881
- implementationPackReady: report.implementationPackReady,
1882
- referenceAnchorsReady: report.referenceAnchorsReady,
1883
- fixturePackReady: report.fixturePackReady,
1884
- executionRationalityReady: report.executionRationalityReady,
1885
- criticalExecutionGaps: report.criticalExecutionGaps,
1886
- executionRationality: report.executionRationality,
1887
- planReviewStatus: report.planReviewStatus,
1887
+ compactDate: report.compactDate,
1888
+ staleCompact: report.staleCompact,
1889
+ planSelfEvaluation: report.planSelfEvaluation,
1890
+ planConfidenceThreshold: report.planConfidenceThreshold,
1891
+ planConfidenceExecutable: report.planConfidenceExecutable,
1892
+ implementationPackReady: report.implementationPackReady,
1893
+ referenceAnchorsReady: report.referenceAnchorsReady,
1894
+ fixturePackReady: report.fixturePackReady,
1895
+ executionRationalityReady: report.executionRationalityReady,
1896
+ criticalExecutionGaps: report.criticalExecutionGaps,
1897
+ executionRationality: report.executionRationality,
1898
+ planReviewStatus: report.planReviewStatus,
1888
1899
  activeRun: report.activeRun,
1889
1900
  eventsSummary: report.eventsSummary,
1890
1901
  runtimeMode: report.runtimeMode,
@@ -1909,6 +1920,7 @@ function runStatus(target, opts = {}) {
1909
1920
  azureActive: report.azureActive,
1910
1921
  azure: report.azure,
1911
1922
  copilot: report.copilot,
1923
+ codex: report.codex,
1912
1924
  contextPacks: report.contextPacks,
1913
1925
  contextQuality: report.contextQuality,
1914
1926
  semanticsDrift: report.semanticsDrift,
@@ -1927,6 +1939,7 @@ function runStatus(target, opts = {}) {
1927
1939
  sessionWarnings: report.sessionWarn,
1928
1940
  installWarnings: report.installWarn,
1929
1941
  copilotWarnings: report.copilotWarn,
1942
+ codexWarnings: report.codexWarn,
1930
1943
  contextWarnings: report.contextWarn,
1931
1944
  semanticsWarnings: report.semanticsWarn,
1932
1945
  summaryGapWarning: report.summaryGapWarn,
@@ -1941,10 +1954,10 @@ function runStatus(target, opts = {}) {
1941
1954
  return;
1942
1955
  }
1943
1956
 
1944
- printSection('OXE ▸ status');
1945
- const c = useAnsiColors();
1946
- console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1947
- console.log(` ${c ? dim : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1957
+ printSection('OXE ▸ status');
1958
+ const c = useAnsiColors();
1959
+ console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${target}${c ? reset : ''}`);
1960
+ console.log(` ${c ? dim : ''}Workspace mode:${c ? reset : ''} ${report.workspaceMode || 'oxe_project'}`);
1948
1961
 
1949
1962
  const wfTgt = oxeWorkflows.resolveWorkflowsDir(target);
1950
1963
  if (!wfTgt) {
@@ -1962,6 +1975,8 @@ function runStatus(target, opts = {}) {
1962
1975
  const _claudeLocal = path.join(target, 'commands', 'oxe');
1963
1976
  const _claudeGlobal = path.join(require('os').homedir(), '.claude', 'commands');
1964
1977
  ideStatusLines.push(`Claude Code ${fs.existsSync(_claudeLocal) || fs.existsSync(_claudeGlobal) ? (c ? green + '✓' + reset : '✓') : (c ? dim + '✗' + reset : '✗')}`);
1978
+ const _codex = report.codex || oxeHealth.codexIntegrationReport(target);
1979
+ ideStatusLines.push(`Codex ${_codex.commandsReady ? (c ? green + '✓' + reset : '✓') : (c ? dim + '✗' + reset : '✗')}`);
1965
1980
  console.log(`\n ${c ? dim : ''}IDEs:${c ? reset : ''} ${ideStatusLines.join(' ')}`);
1966
1981
 
1967
1982
  // Gates pending in default view
@@ -1975,24 +1990,24 @@ function runStatus(target, opts = {}) {
1975
1990
  }
1976
1991
 
1977
1992
  // Explicit blockage diagnosis
1978
- const packageMode = report.workspaceMode === 'product_package';
1979
- const specMissing = !fs.existsSync(path.join(target, '.oxe', 'SPEC.md'));
1980
- const planMissing = !fs.existsSync(path.join(target, '.oxe', 'PLAN.md'));
1981
- const verifyMissing = !fs.existsSync(path.join(target, '.oxe', 'VERIFY.md'));
1982
- if (packageMode) {
1983
- const releaseReadiness = report.releaseReadiness || { ok: false, blockers: [], warnings: [] };
1984
- if (!releaseReadiness.ok && Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
1985
- console.log(` ${c ? yellow : ''}⚠ Release blockers:${c ? reset : ''} ${releaseReadiness.blockers[0]}`);
1986
- } else if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
1987
- console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} release warnings ativas — ${releaseReadiness.warnings[0]}`);
1988
- }
1989
- } else if (specMissing) {
1990
- console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} SPEC.md ausente — rode ${c ? cyan : ''}/oxe-spec${c ? reset : ''} antes de planejar`);
1991
- } else if (planMissing) {
1992
- console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} PLAN.md ausente — rode ${c ? cyan : ''}/oxe-plan${c ? reset : ''}`);
1993
- } else if (verifyMissing && !planMissing) {
1994
- console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} VERIFY.md ainda não gerado — rode ${c ? cyan : ''}/oxe-verify${c ? reset : ''} após executar`);
1995
- }
1993
+ const packageMode = report.workspaceMode === 'product_package';
1994
+ const specMissing = !fs.existsSync(path.join(target, '.oxe', 'SPEC.md'));
1995
+ const planMissing = !fs.existsSync(path.join(target, '.oxe', 'PLAN.md'));
1996
+ const verifyMissing = !fs.existsSync(path.join(target, '.oxe', 'VERIFY.md'));
1997
+ if (packageMode) {
1998
+ const releaseReadiness = report.releaseReadiness || { ok: false, blockers: [], warnings: [] };
1999
+ if (!releaseReadiness.ok && Array.isArray(releaseReadiness.blockers) && releaseReadiness.blockers.length) {
2000
+ console.log(` ${c ? yellow : ''}⚠ Release blockers:${c ? reset : ''} ${releaseReadiness.blockers[0]}`);
2001
+ } else if (Array.isArray(releaseReadiness.warnings) && releaseReadiness.warnings.length) {
2002
+ console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} release warnings ativas — ${releaseReadiness.warnings[0]}`);
2003
+ }
2004
+ } else if (specMissing) {
2005
+ console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} SPEC.md ausente — rode ${c ? cyan : ''}/oxe-spec${c ? reset : ''} antes de planejar`);
2006
+ } else if (planMissing) {
2007
+ console.log(` ${c ? yellow : ''}⚠ Bloqueio:${c ? reset : ''} PLAN.md ausente — rode ${c ? cyan : ''}/oxe-plan${c ? reset : ''}`);
2008
+ } else if (verifyMissing && !planMissing) {
2009
+ console.log(` ${c ? dim : ''}Obs.:${c ? reset : ''} VERIFY.md ainda não gerado — rode ${c ? cyan : ''}/oxe-verify${c ? reset : ''} após executar`);
2010
+ }
1996
2011
 
1997
2012
  if (opts.hints) {
1998
2013
  console.log(`\n ${c ? cyan : ''}Lembretes (rotina OXE)${reset}`);
@@ -2090,10 +2105,18 @@ function runDoctor(target, options = {}) {
2090
2105
  .sort();
2091
2106
 
2092
2107
  if (!wfTgt) {
2093
- console.log(
2094
- `${yellow}AVISO${reset} Não oxe/workflows/ nem .oxe/workflows/ neste projeto — rode ${cyan}npx oxe-cc@latest${reset} para instalar.`
2095
- );
2096
- process.exit(1);
2108
+ // If the project has .oxe/runs/ it's a runtime-only project — workflows are optional
2109
+ const hasRuntimeRuns = fs.existsSync(path.join(target, '.oxe', 'runs'));
2110
+ if (hasRuntimeRuns) {
2111
+ console.log(`${green}OK${reset} Runtime-only project (.oxe/runs/ presente) — workflows não obrigatórios.`);
2112
+ console.log(`${c ? dim : ''} Para instalar workflows completos: ${cyan}npx oxe-cc@latest${reset}`);
2113
+ } else {
2114
+ console.log(
2115
+ `${yellow}AVISO${reset} Não há oxe/workflows/ nem .oxe/workflows/ neste projeto — rode ${cyan}npx oxe-cc@latest${reset} para instalar.`
2116
+ );
2117
+ process.exit(1);
2118
+ }
2119
+ return;
2097
2120
  }
2098
2121
 
2099
2122
  const actual = fs
@@ -2178,6 +2201,8 @@ function runDoctor(target, options = {}) {
2178
2201
  }
2179
2202
  }
2180
2203
 
2204
+ const report = oxeHealth.buildHealthReport(target);
2205
+
2181
2206
  // IDE health gates
2182
2207
  console.log('');
2183
2208
  const ideChecks = [];
@@ -2192,22 +2217,44 @@ function runDoctor(target, options = {}) {
2192
2217
 
2193
2218
  const claudeLocalDir = path.join(target, 'commands', 'oxe');
2194
2219
  const claudeGlobalDir = path.join(require('os').homedir(), '.claude', 'commands');
2195
- const claudeReady = fs.existsSync(claudeLocalDir) || fs.existsSync(claudeGlobalDir);
2196
- ideChecks.push({ label: 'Claude Code', ready: claudeReady, hint: 'commands/oxe/ ou ~/.claude/commands/' });
2220
+ const claudeLocalReady = fs.existsSync(claudeLocalDir);
2221
+ const claudeGlobalReady = fs.existsSync(claudeGlobalDir);
2222
+ ideChecks.push({
2223
+ label: 'Claude Code',
2224
+ ready: claudeLocalReady || claudeGlobalReady,
2225
+ hint: claudeLocalReady
2226
+ ? 'commands/oxe/'
2227
+ : claudeGlobalReady
2228
+ ? '~/.claude/commands/ (global do utilizador)'
2229
+ : 'commands/oxe/ ou ~/.claude/commands/',
2230
+ status: claudeLocalReady ? 'local' : claudeGlobalReady ? 'global_only' : 'missing',
2231
+ });
2232
+
2233
+ const codexReport = oxeHealth.codexIntegrationReport(target);
2234
+ ideChecks.push({
2235
+ label: 'Codex',
2236
+ ready: codexReport.commandsReady,
2237
+ hint: codexReport.promptSource === 'workspace'
2238
+ ? '.codex/prompts/oxe.md'
2239
+ : codexReport.promptSource === 'global'
2240
+ ? '~/.codex/prompts/oxe.md (global do utilizador)'
2241
+ : '.codex/prompts/oxe.md ou ~/.codex/prompts/oxe.md',
2242
+ status: codexReport.promptSource,
2243
+ });
2197
2244
 
2198
2245
  for (const ide of ideChecks) {
2199
2246
  if (ide.ready) {
2200
- console.log(`${c ? green : ''}OK${c ? reset : ''} ${ide.label} pronto (${ide.hint})`);
2247
+ const suffix = ide.status === 'global_only' || ide.status === 'global'
2248
+ ? ' — apenas global'
2249
+ : '';
2250
+ console.log(`${c ? green : ''}OK${c ? reset : ''} ${ide.label} pronto (${ide.hint})${suffix}`);
2201
2251
  } else {
2202
2252
  console.log(`${c ? dim : ''}Obs.:${c ? reset : ''} ${ide.label} não detectado — esperado ${ide.hint}`);
2203
2253
  }
2204
2254
  }
2205
2255
 
2206
2256
  // Runtime compilation check
2207
- const runtimeCompiledPath = path.join(target, 'lib', 'runtime', 'index.js');
2208
- const runtimeDistPath = path.join(target, 'packages', 'runtime', 'dist-tests');
2209
- const runtimeCompiled = fs.existsSync(runtimeCompiledPath) || fs.existsSync(runtimeDistPath);
2210
- if (runtimeCompiled) {
2257
+ if (report.runtimeMode && report.runtimeMode.enterprise_available) {
2211
2258
  console.log(`${c ? green : ''}OK${c ? reset : ''} Runtime compilado detectado — modo enterprise disponível`);
2212
2259
  } else {
2213
2260
  console.log(`${c ? dim : ''}Obs.:${c ? reset : ''} Runtime não compilado — operando em modo legado (sem perda de UX)`);
@@ -2215,7 +2262,7 @@ function runDoctor(target, options = {}) {
2215
2262
 
2216
2263
  // Readiness gate summary
2217
2264
  const stateFilePath = path.join(target, '.oxe', 'STATE.md');
2218
- let readinessCmd = '/oxe-scan';
2265
+ let readinessCmd = '/oxe';
2219
2266
  let readinessDesc = 'Nenhum STATE.md encontrado';
2220
2267
  if (fs.existsSync(stateFilePath)) {
2221
2268
  try {
@@ -2223,7 +2270,7 @@ function runDoctor(target, options = {}) {
2223
2270
  const phaseMatch = stateContent.match(/fase[:\s]+([a-z_]+)/i) || stateContent.match(/phase[:\s]+([a-z_]+)/i) || stateContent.match(/status[:\s]+([a-z_]+)/i);
2224
2271
  const phase = phaseMatch ? phaseMatch[1].toLowerCase() : 'init';
2225
2272
  const phaseMap = {
2226
- init: { cmd: '/oxe-scan', desc: 'Pronto para /oxe-scan' },
2273
+ init: { cmd: '/oxe', desc: 'Pronto para /oxe' },
2227
2274
  scan_complete: { cmd: '/oxe-spec', desc: 'Pronto para /oxe-spec' },
2228
2275
  spec_complete: { cmd: '/oxe-plan', desc: 'Pronto para /oxe-plan' },
2229
2276
  plan_complete: { cmd: '/oxe-execute', desc: 'Pronto para /oxe-execute' },
@@ -2245,7 +2292,6 @@ function runDoctor(target, options = {}) {
2245
2292
  }
2246
2293
 
2247
2294
  printOxeHealthDiagnostics(target, c);
2248
- const report = oxeHealth.buildHealthReport(target);
2249
2295
  const statusColor = report.healthStatus === 'healthy' ? green : report.healthStatus === 'warning' ? yellow : red;
2250
2296
  console.log(`\n ${statusColor}Diagnóstico ${report.healthStatus}${reset}`);
2251
2297
  if (report.healthStatus === 'broken') {
@@ -2260,7 +2306,7 @@ function runDoctor(target, options = {}) {
2260
2306
  `Saúde lógica: ${report.healthStatus}`,
2261
2307
  ],
2262
2308
  nextSteps: [
2263
- { desc: 'Mapear ou atualizar o codebase no agente:', cmd: '/oxe-scan' },
2309
+ { desc: 'Entrar no fluxo OXE e deixar o router apontar o primeiro passo:', cmd: '/oxe' },
2264
2310
  { desc: 'Ver ajuda e ordem dos passos OXE:', cmd: '/oxe-help' },
2265
2311
  { desc: 'Reinstalar ou atualizar arquivos do OXE:', cmd: 'npx oxe-cc@latest --force' },
2266
2312
  ],
@@ -2481,7 +2527,7 @@ ${cyan}oxe-cc${reset} — instala workflows OXE (núcleo .oxe/ + integrações:
2481
2527
  npx oxe-cc init-oxe [opções] [pasta-do-projeto]
2482
2528
  npx oxe-cc context <build|inspect> [opções] [pasta-do-projeto]
2483
2529
  npx oxe-cc dashboard [opções] [pasta-do-projeto]
2484
- npx oxe-cc runtime <status|start|pause|resume|replay|compile|verify|project|ci|promote|recover|gates|agents> [opções] [pasta-do-projeto]
2530
+ npx oxe-cc runtime <status|start|pause|resume|replay|compile|verify|project|ci|promote|recover|gates|agents|execute> [opções] [pasta-do-projeto]
2485
2531
  npx oxe-cc azure <status|doctor|auth|sync|find|servicebus|eventgrid|sql|operations> [opções] [pasta-do-projeto]
2486
2532
  npx oxe-cc capabilities <list|install|remove|update> [opções] [id]
2487
2533
  npx oxe-cc uninstall [opções] [pasta-do-projeto]
@@ -2680,7 +2726,19 @@ function runInstall(opts) {
2680
2726
  assertNotWslWindowsNode();
2681
2727
  const home = os.homedir();
2682
2728
  const prevManifest = oxeManifest.loadFileManifest(home);
2683
- oxeManifest.backupModifiedFromManifest(home, prevManifest, opts, { yellow, cyan, dim, reset });
2729
+ const backupScopeRoots = [target];
2730
+ const installAgentPaths = oxeAgentInstall.buildAgentInstallPaths(!opts.ideLocal, target);
2731
+ if (opts.cursor) backupScopeRoots.push(installCursorBase(opts));
2732
+ if (opts.copilot) backupScopeRoots.push(path.join(target, '.github'));
2733
+ if (opts.copilotCli || opts.allAgents) {
2734
+ backupScopeRoots.push(installClaudeBase(opts), installCopilotCliHome(opts));
2735
+ }
2736
+ if (opts.agentOpenCode || opts.allAgents) backupScopeRoots.push(...installAgentPaths.opencodeCommandDirs);
2737
+ if (opts.agentGemini || opts.allAgents) backupScopeRoots.push(installAgentPaths.geminiCommandsBase);
2738
+ if (opts.agentCodex || opts.allAgents) backupScopeRoots.push(installAgentPaths.codexPromptsDir, installAgentPaths.codexAgentsSkillsRoot);
2739
+ if (opts.agentWindsurf || opts.allAgents) backupScopeRoots.push(installAgentPaths.windsurfWorkflowsDir);
2740
+ if (opts.agentAntigravity || opts.allAgents) backupScopeRoots.push(installAgentPaths.antigravitySkillsRoot);
2741
+ oxeManifest.backupModifiedFromManifest(home, prevManifest, opts, { yellow, cyan, dim, reset }, { scopeRoots: backupScopeRoots });
2684
2742
 
2685
2743
  printSection('OXE ▸ Instalação no projeto');
2686
2744
  const c = useAnsiColors();
@@ -2720,7 +2778,7 @@ function runInstall(opts) {
2720
2778
  }
2721
2779
 
2722
2780
  const copyOpts = { dryRun: opts.dryRun, force: opts.force };
2723
- const agentPaths = oxeAgentInstall.buildAgentInstallPaths(!opts.ideLocal, target);
2781
+ const agentPaths = installAgentPaths;
2724
2782
 
2725
2783
  if (fullLayout) {
2726
2784
  copyDir(path.join(PKG_ROOT, 'oxe'), path.join(target, 'oxe'), copyOpts, false);
@@ -2730,14 +2788,14 @@ function runInstall(opts) {
2730
2788
  copyDir(path.join(PKG_ROOT, 'oxe', 'templates'), path.join(nested, 'templates'), copyOpts, true);
2731
2789
  // Personas: copiar para .oxe/personas/ (não sobrescreve personalizações do projeto)
2732
2790
  const personasSrc = path.join(PKG_ROOT, 'oxe', 'personas');
2733
- if (fs.existsSync(personasSrc)) {
2734
- copyDir(personasSrc, path.join(nested, 'personas'), copyOpts, false);
2735
- }
2736
- const agentsSrc = path.join(PKG_ROOT, 'oxe', 'agents');
2737
- if (fs.existsSync(agentsSrc)) {
2738
- copyDir(agentsSrc, path.join(nested, 'agents'), copyOpts, false);
2739
- }
2740
- // Schemas: copiar para .oxe/schemas/ (ex.: plan-agents.schema.json para validação local)
2791
+ if (fs.existsSync(personasSrc)) {
2792
+ copyDir(personasSrc, path.join(nested, 'personas'), copyOpts, false);
2793
+ }
2794
+ const agentsSrc = path.join(PKG_ROOT, 'oxe', 'agents');
2795
+ if (fs.existsSync(agentsSrc)) {
2796
+ copyDir(agentsSrc, path.join(nested, 'agents'), copyOpts, false);
2797
+ }
2798
+ // Schemas: copiar para .oxe/schemas/ (ex.: plan-agents.schema.json para validação local)
2741
2799
  const schemasSrc = path.join(PKG_ROOT, 'oxe', 'schemas');
2742
2800
  if (fs.existsSync(schemasSrc)) {
2743
2801
  copyDir(schemasSrc, path.join(nested, 'schemas'), copyOpts, false);
@@ -2752,11 +2810,11 @@ function runInstall(opts) {
2752
2810
  if (fs.existsSync(cRules)) copyDir(cRules, path.join(cursorBase, 'rules'), copyOpts, idePathRewrite);
2753
2811
  }
2754
2812
 
2755
- const doAgentClis = opts.copilotCli || opts.allAgents;
2756
- if (doAgentClis) {
2757
- const cCmd = path.join(PKG_ROOT, '.cursor', 'commands');
2758
- const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2759
- const clBase = installClaudeBase(opts);
2813
+ const doAgentClis = opts.copilotCli || opts.allAgents;
2814
+ if (doAgentClis) {
2815
+ const cCmd = path.join(PKG_ROOT, '.cursor', 'commands');
2816
+ const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2817
+ const clBase = installClaudeBase(opts);
2760
2818
  const cpHome = installCopilotCliHome(opts);
2761
2819
  const clDest = path.join(clBase, 'commands');
2762
2820
  const cpCmdDest = path.join(cpHome, 'commands');
@@ -2765,24 +2823,24 @@ function runInstall(opts) {
2765
2823
  console.log(
2766
2824
  ` ${c ? green : ''}cli${c ? reset : ''} ${c ? dim : ''}Claude/Copilot: skills em${c ? reset : ''} ${c ? cyan : ''}${cpSkills}${c ? reset : ''} ${c ? dim : ''}(/oxe, /oxe-scan, …); comandos .md:${c ? reset : ''} ${c ? cyan : ''}${clDest}${c ? reset : ''} ${c ? dim : ''}+${c ? reset : ''} ${c ? cyan : ''}${cpCmdDest}${c ? reset : ''}`
2767
2825
  );
2768
- installOxeCopilotCliSkills(cCmd, cpHome, copyOpts, idePathRewrite);
2769
- copyDir(cCmd, clDest, copyOpts, idePathRewrite);
2770
- copyDir(cCmd, cpCmdDest, copyOpts, idePathRewrite);
2771
- if (fs.existsSync(canonicalAgents)) {
2772
- oxeAgentInstall.installCanonicalAgentMarkdowns(
2773
- canonicalAgents,
2774
- agentPaths.claudeAgentsDir,
2775
- copyOpts
2776
- );
2777
- }
2778
- } else {
2826
+ installOxeCopilotCliSkills(cCmd, cpHome, copyOpts, idePathRewrite);
2827
+ copyDir(cCmd, clDest, copyOpts, idePathRewrite);
2828
+ copyDir(cCmd, cpCmdDest, copyOpts, idePathRewrite);
2829
+ if (fs.existsSync(canonicalAgents)) {
2830
+ oxeAgentInstall.installCanonicalAgentMarkdowns(
2831
+ canonicalAgents,
2832
+ agentPaths.claudeAgentsDir,
2833
+ copyOpts
2834
+ );
2835
+ }
2836
+ } else {
2779
2837
  console.warn(`${yellow}aviso:${reset} pasta ausente ${cCmd} — ignorando comandos CLI`);
2780
2838
  }
2781
2839
  }
2782
2840
 
2783
- const cCmdAgents = path.join(PKG_ROOT, '.cursor', 'commands');
2784
- const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2785
- if (fs.existsSync(cCmdAgents) && (opts.allAgents || anyGranularAgent(opts))) {
2841
+ const cCmdAgents = path.join(PKG_ROOT, '.cursor', 'commands');
2842
+ const canonicalAgents = path.join(PKG_ROOT, 'oxe', 'agents');
2843
+ if (fs.existsSync(cCmdAgents) && (opts.allAgents || anyGranularAgent(opts))) {
2786
2844
  const logO = (d) => console.log(`${dim}omitido${reset} ${d} (já existe — use --force)`);
2787
2845
  const logW = (msg) => console.log(`${dim}agents${reset} ${msg}`);
2788
2846
  console.log(
@@ -2800,41 +2858,41 @@ function runInstall(opts) {
2800
2858
  if (opts.agentCodex || opts.allAgents) {
2801
2859
  oxeAgentInstall.installCodexPrompts(cCmdAgents, agentPaths, copyOpts, idePathRewrite, logO, logW);
2802
2860
  }
2803
- if (opts.agentAntigravity || opts.allAgents) {
2804
- oxeAgentInstall.installSkillTreeFromCursorCommands(
2861
+ if (opts.agentAntigravity || opts.allAgents) {
2862
+ oxeAgentInstall.installSkillTreeFromCursorCommands(
2805
2863
  cCmdAgents,
2806
2864
  agentPaths.antigravitySkillsRoot,
2807
2865
  copyOpts,
2808
2866
  idePathRewrite,
2809
2867
  logO,
2810
- logW
2811
- );
2812
- oxeAgentInstall.installCanonicalAgentSkills(
2813
- canonicalAgents,
2814
- agentPaths.antigravitySkillsRoot,
2815
- copyOpts,
2816
- logO,
2817
- logW
2818
- );
2819
- }
2820
- if (opts.agentCodex || opts.allAgents) {
2821
- oxeAgentInstall.installSkillTreeFromCursorCommands(
2868
+ logW
2869
+ );
2870
+ oxeAgentInstall.installCanonicalAgentSkills(
2871
+ canonicalAgents,
2872
+ agentPaths.antigravitySkillsRoot,
2873
+ copyOpts,
2874
+ logO,
2875
+ logW
2876
+ );
2877
+ }
2878
+ if (opts.agentCodex || opts.allAgents) {
2879
+ oxeAgentInstall.installSkillTreeFromCursorCommands(
2822
2880
  cCmdAgents,
2823
2881
  agentPaths.codexAgentsSkillsRoot,
2824
2882
  copyOpts,
2825
2883
  idePathRewrite,
2826
2884
  logO,
2827
- logW
2828
- );
2829
- oxeAgentInstall.installCanonicalAgentSkills(
2830
- canonicalAgents,
2831
- agentPaths.codexAgentsSkillsRoot,
2832
- copyOpts,
2833
- logO,
2834
- logW
2835
- );
2836
- }
2837
- }
2885
+ logW
2886
+ );
2887
+ oxeAgentInstall.installCanonicalAgentSkills(
2888
+ canonicalAgents,
2889
+ agentPaths.codexAgentsSkillsRoot,
2890
+ copyOpts,
2891
+ logO,
2892
+ logW
2893
+ );
2894
+ }
2895
+ }
2838
2896
 
2839
2897
  if (opts.copilot) {
2840
2898
  const gh = path.join(PKG_ROOT, '.github');
@@ -2924,11 +2982,11 @@ function runInstall(opts) {
2924
2982
  addTracked(copilotPromptsDirPath(opts), (n) => n.startsWith('oxe-'));
2925
2983
  trackFile(copilotWorkspaceManifestPath(opts));
2926
2984
  }
2927
- trackFile(runtimeSemanticsManifestPath(opts));
2928
- if (opts.copilotCli || opts.allAgents) {
2929
- addTracked(path.join(installClaudeBase(opts), 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2930
- addTracked(agentPaths.claudeAgentsDir, (n) => oxeAgentInstall.isOxeAgentMarkdownName(n));
2931
- addTracked(path.join(cpCliHome, 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2985
+ trackFile(runtimeSemanticsManifestPath(opts));
2986
+ if (opts.copilotCli || opts.allAgents) {
2987
+ addTracked(path.join(installClaudeBase(opts), 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2988
+ addTracked(agentPaths.claudeAgentsDir, (n) => oxeAgentInstall.isOxeAgentMarkdownName(n));
2989
+ addTracked(path.join(cpCliHome, 'commands'), (n) => oxeAgentInstall.isOxeCommandMarkdownName(n));
2932
2990
  const skRoot = path.join(cpCliHome, 'skills');
2933
2991
  if (fs.existsSync(skRoot)) {
2934
2992
  for (const sub of fs.readdirSync(skRoot, { withFileTypes: true })) {
@@ -3064,8 +3122,8 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
3064
3122
  track(manifest);
3065
3123
  }
3066
3124
 
3067
- if (u.copilotCli || u.allAgents) {
3068
- for (const base of [path.join(proj, '.claude'), path.join(proj, '.copilot')]) {
3125
+ if (u.copilotCli || u.allAgents) {
3126
+ for (const base of [path.join(proj, '.claude'), path.join(proj, '.copilot')]) {
3069
3127
  const cmdDir = path.join(base, 'commands');
3070
3128
  if (!fs.existsSync(cmdDir)) continue;
3071
3129
  for (const name of fs.readdirSync(cmdDir)) {
@@ -3074,19 +3132,19 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
3074
3132
  unlinkQuiet(p, u);
3075
3133
  track(p);
3076
3134
  }
3077
- }
3078
- }
3079
- const claudeAgentsDir = path.join(proj, '.claude', 'agents');
3080
- if (fs.existsSync(claudeAgentsDir)) {
3081
- for (const name of fs.readdirSync(claudeAgentsDir)) {
3082
- if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3083
- const p = path.join(claudeAgentsDir, name);
3084
- unlinkQuiet(p, u);
3085
- track(p);
3086
- }
3087
- }
3088
- }
3089
- const skillsRoot = path.join(proj, '.copilot', 'skills');
3135
+ }
3136
+ }
3137
+ const claudeAgentsDir = path.join(proj, '.claude', 'agents');
3138
+ if (fs.existsSync(claudeAgentsDir)) {
3139
+ for (const name of fs.readdirSync(claudeAgentsDir)) {
3140
+ if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3141
+ const p = path.join(claudeAgentsDir, name);
3142
+ unlinkQuiet(p, u);
3143
+ track(p);
3144
+ }
3145
+ }
3146
+ }
3147
+ const skillsRoot = path.join(proj, '.copilot', 'skills');
3090
3148
  if (fs.existsSync(skillsRoot)) {
3091
3149
  for (const ent of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
3092
3150
  if (!ent.isDirectory() || !/^oxe($|-)/.test(ent.name)) continue;
@@ -3130,6 +3188,31 @@ function uninstallLocalIdeFromProject(u, removedPaths) {
3130
3188
  }
3131
3189
  }
3132
3190
 
3191
+ /**
3192
+ * @param {UninstallOpts} u
3193
+ */
3194
+ function shouldAlsoRemoveLocalIdeArtifacts(u) {
3195
+ if (u.ideLocal) return true;
3196
+ if (u.noProject) return false;
3197
+ if (!(u.allAgents || anyGranularUninstallAgent(u) || u.cursor || u.copilot || u.copilotCli)) return false;
3198
+ const proj = path.resolve(u.dir);
3199
+ const localAgentPaths = oxeAgentInstall.buildAgentInstallPaths(false, proj);
3200
+ if (u.cursor && fs.existsSync(path.join(proj, '.cursor', 'commands'))) return true;
3201
+ if (u.copilot && (fs.existsSync(path.join(proj, '.github', 'prompts')) || fs.existsSync(path.join(proj, '.github', 'copilot-instructions.md')))) {
3202
+ return true;
3203
+ }
3204
+ if (u.copilotCli && (fs.existsSync(path.join(proj, '.claude', 'commands')) || fs.existsSync(path.join(proj, '.copilot', 'commands')))) {
3205
+ return true;
3206
+ }
3207
+ const selectedAll = u.allAgents || !anyGranularUninstallAgent(u);
3208
+ if ((selectedAll || u.agentOpenCode) && localAgentPaths.opencodeCommandDirs.some((dir) => fs.existsSync(dir))) return true;
3209
+ if ((selectedAll || u.agentGemini) && fs.existsSync(localAgentPaths.geminiCommandsBase)) return true;
3210
+ if ((selectedAll || u.agentCodex) && (fs.existsSync(localAgentPaths.codexPromptsDir) || fs.existsSync(localAgentPaths.codexAgentsSkillsRoot))) return true;
3211
+ if ((selectedAll || u.agentWindsurf) && fs.existsSync(localAgentPaths.windsurfWorkflowsDir)) return true;
3212
+ if ((selectedAll || u.agentAntigravity) && fs.existsSync(localAgentPaths.antigravitySkillsRoot)) return true;
3213
+ return false;
3214
+ }
3215
+
3133
3216
  /**
3134
3217
  * @param {string[]} argv
3135
3218
  * @returns {UninstallOpts}
@@ -3361,6 +3444,7 @@ function runUninstall(u) {
3361
3444
  if (u.dryRun) console.log(` ${c ? yellow : ''}(dry-run)${c ? reset : ''}`);
3362
3445
 
3363
3446
  const removedPaths = [];
3447
+ const removeLocalIdeArtifacts = shouldAlsoRemoveLocalIdeArtifacts(u);
3364
3448
 
3365
3449
  if (u.cursor) {
3366
3450
  const base = cursorUserDir(ideOpts);
@@ -3409,8 +3493,8 @@ function runUninstall(u) {
3409
3493
  cleanupLegacyCopilotVsCode(ideOpts, u, removedPaths);
3410
3494
  }
3411
3495
 
3412
- if (u.copilotCli) {
3413
- for (const base of [claudeUserDir(ideOpts), copilotUserDir(ideOpts)]) {
3496
+ if (u.copilotCli) {
3497
+ for (const base of [claudeUserDir(ideOpts), copilotUserDir(ideOpts)]) {
3414
3498
  const cmdDir = path.join(base, 'commands');
3415
3499
  if (!fs.existsSync(cmdDir)) continue;
3416
3500
  for (const name of fs.readdirSync(cmdDir)) {
@@ -3419,19 +3503,19 @@ function runUninstall(u) {
3419
3503
  unlinkQuiet(p, u);
3420
3504
  removedPaths.push(p);
3421
3505
  }
3422
- }
3423
- }
3424
- const claudeAgentsDir = path.join(claudeUserDir(ideOpts), 'agents');
3425
- if (fs.existsSync(claudeAgentsDir)) {
3426
- for (const name of fs.readdirSync(claudeAgentsDir)) {
3427
- if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3428
- const p = path.join(claudeAgentsDir, name);
3429
- unlinkQuiet(p, u);
3430
- removedPaths.push(p);
3431
- }
3432
- }
3433
- }
3434
- const skillsRoot = path.join(copilotUserDir(ideOpts), 'skills');
3506
+ }
3507
+ }
3508
+ const claudeAgentsDir = path.join(claudeUserDir(ideOpts), 'agents');
3509
+ if (fs.existsSync(claudeAgentsDir)) {
3510
+ for (const name of fs.readdirSync(claudeAgentsDir)) {
3511
+ if (oxeAgentInstall.isOxeAgentMarkdownName(name)) {
3512
+ const p = path.join(claudeAgentsDir, name);
3513
+ unlinkQuiet(p, u);
3514
+ removedPaths.push(p);
3515
+ }
3516
+ }
3517
+ }
3518
+ const skillsRoot = path.join(copilotUserDir(ideOpts), 'skills');
3435
3519
  if (fs.existsSync(skillsRoot)) {
3436
3520
  for (const ent of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
3437
3521
  if (!ent.isDirectory() || !/^oxe($|-)/.test(ent.name)) continue;
@@ -3516,7 +3600,7 @@ function runUninstall(u) {
3516
3600
  }
3517
3601
  }
3518
3602
 
3519
- if (u.ideLocal) {
3603
+ if (removeLocalIdeArtifacts) {
3520
3604
  uninstallLocalIdeFromProject(u, removedPaths);
3521
3605
  }
3522
3606
 
@@ -3961,6 +4045,13 @@ function parseRuntimeArgs(argv) {
3961
4045
  fromEventId: '',
3962
4046
  writeReport: false,
3963
4047
  gateId: '',
4048
+ // execute flags
4049
+ provider: '',
4050
+ apiKey: '',
4051
+ model: '',
4052
+ baseUrl: '',
4053
+ maxTurns: null,
4054
+ recompile: false,
3964
4055
  decision: '',
3965
4056
  actor: '',
3966
4057
  targetKind: '',
@@ -3998,6 +4089,12 @@ function parseRuntimeArgs(argv) {
3998
4089
  else if (a === '--status' && argv[i + 1]) out.gateStatus = String(argv[++i]);
3999
4090
  else if (a === '--scope' && argv[i + 1]) out.gateScope = String(argv[++i]);
4000
4091
  else if (a === '--json') out.jsonOutput = true;
4092
+ else if (a === '--provider' && argv[i + 1]) out.provider = String(argv[++i]);
4093
+ else if (a === '--api-key' && argv[i + 1]) out.apiKey = String(argv[++i]);
4094
+ else if (a === '--model' && argv[i + 1]) out.model = String(argv[++i]);
4095
+ else if (a === '--base-url' && argv[i + 1]) out.baseUrl = String(argv[++i]);
4096
+ else if (a === '--max-turns' && argv[i + 1]) out.maxTurns = Number(argv[++i]);
4097
+ else if (a === '--recompile') out.recompile = true;
4001
4098
  else if (!a.startsWith('-')) positionals.push(a);
4002
4099
  else {
4003
4100
  out.parseError = true;
@@ -4140,7 +4237,7 @@ function runContext(opts) {
4140
4237
  return;
4141
4238
  }
4142
4239
  console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${opts.dir}${c ? reset : ''}`);
4143
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
4240
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
4144
4241
  console.log(` ${c ? green : ''}Workflow:${c ? reset : ''} ${selectedWorkflow}`);
4145
4242
  console.log(` ${c ? green : ''}Tier:${c ? reset : ''} ${pack.context_tier}`);
4146
4243
  console.log(` ${c ? green : ''}Quality:${c ? reset : ''} ${pack.context_quality.score} (${pack.context_quality.status})`);
@@ -4207,7 +4304,7 @@ function runContext(opts) {
4207
4304
  return;
4208
4305
  }
4209
4306
  console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${opts.dir}${c ? reset : ''}`);
4210
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
4307
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
4211
4308
  console.log(` ${c ? green : ''}Packs:${c ? reset : ''} ${packs.length}`);
4212
4309
  for (const pack of packs) {
4213
4310
  const qualityFlag = (pack.context_quality.score < 30 || pack.context_quality.status === 'critical') ? ` ${yellow}[CRÍTICO]${reset}` : '';
@@ -4272,7 +4369,7 @@ async function runRuntime(opts) {
4272
4369
  const activeSession = opts.activeSession || oxeHealth.parseActiveSession(stateText) || null;
4273
4370
  const p = oxeOperational.operationalPaths(opts.dir, activeSession);
4274
4371
  console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${opts.dir}${c ? reset : ''}`);
4275
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
4372
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
4276
4373
 
4277
4374
  if (opts.action === 'status') {
4278
4375
  const current = oxeOperational.readRunState(opts.dir, activeSession);
@@ -4335,13 +4432,28 @@ async function runRuntime(opts) {
4335
4432
  console.log(` ${c ? green : ''}Runtime:${c ? reset : ''} ${runtimeMode.runtime_mode || 'legacy'} · fallback=${runtimeMode.fallback_mode || 'none'}`);
4336
4433
  }
4337
4434
  if (report.policyCoverage) {
4338
- console.log(` ${c ? green : ''}Policy coverage:${c ? reset : ''} ${report.policyCoverage.coveragePercent}% · uncovered=${report.policyCoverage.uncoveredMutations}`);
4435
+ const pctCov = report.policyCoverage.coveragePercent;
4436
+ const policyLabel = pctCov === 0
4437
+ ? `${c ? dim : ''}não configurada (opcional)${c ? reset : ''}`
4438
+ : `${pctCov}% · uncovered=${report.policyCoverage.uncoveredMutations}`;
4439
+ console.log(` ${c ? green : ''}Policy coverage:${c ? reset : ''} ${policyLabel}`);
4339
4440
  }
4340
4441
  if (report.promotionReadiness) {
4341
- console.log(` ${c ? green : ''}Promotion readiness:${c ? reset : ''} ${report.promotionReadiness.status}${Array.isArray(report.promotionReadiness.blockers) && report.promotionReadiness.blockers.length ? ` · ${report.promotionReadiness.blockers.join(', ')}` : ''}`);
4442
+ const promoStatus = report.promotionReadiness.status;
4443
+ const blockers = Array.isArray(report.promotionReadiness.blockers) ? report.promotionReadiness.blockers : [];
4444
+ // Only show blockers that are not solely due to unconfigured policy
4445
+ const meaningfulBlockers = blockers.filter(b => b !== 'policy_uncovered_mutations' || report.policyCoverage.coveragePercent > 0);
4446
+ const promoLabel = promoStatus === 'blocked' && meaningfulBlockers.length === 0
4447
+ ? `${c ? dim : ''}n/a (execução não concluída)${c ? reset : ''}`
4448
+ : `${promoStatus}${meaningfulBlockers.length ? ` · ${meaningfulBlockers.join(', ')}` : ''}`;
4449
+ console.log(` ${c ? green : ''}Promotion readiness:${c ? reset : ''} ${promoLabel}`);
4342
4450
  }
4343
4451
  if (report.recoveryState) {
4344
- console.log(` ${c ? green : ''}Recovery:${c ? reset : ''} ${report.recoveryState.status} · recoveries=${report.recoveryState.recoverCount ?? 0} · issues=${Array.isArray(report.recoveryState.issues) ? report.recoveryState.issues.length : 0}`);
4452
+ const recIssues = Array.isArray(report.recoveryState.issues) ? report.recoveryState.issues.length : 0;
4453
+ const recLabel = recIssues === 0
4454
+ ? `${report.recoveryState.status} · ok`
4455
+ : `${report.recoveryState.status} · issues=${recIssues} — rode ${c ? cyan : ''}runtime status --verbose${c ? reset : ''} para detalhes`;
4456
+ console.log(` ${c ? green : ''}Recovery:${c ? reset : ''} ${recLabel} · recoveries=${report.recoveryState.recoverCount ?? 0}`);
4345
4457
  }
4346
4458
  if (multiAgent) {
4347
4459
  console.log(` ${c ? green : ''}Multi-agent:${c ? reset : ''} ${multiAgent.enabled ? (multiAgent.mode || 'active') : 'disabled'} · agentes=${Array.isArray(multiAgent.agents) ? multiAgent.agents.length : 0} · ownership=${Array.isArray(multiAgent.ownership) ? multiAgent.ownership.length : 0}`);
@@ -4511,6 +4623,17 @@ async function runRuntime(opts) {
4511
4623
 
4512
4624
  if (opts.action === 'compile') {
4513
4625
  try {
4626
+ // --recompile: delete existing run state files so a fresh run_id is generated
4627
+ if (opts.recompile) {
4628
+ const runsDir = path.join(opts.dir, '.oxe', 'runs');
4629
+ if (require('fs').existsSync(runsDir)) {
4630
+ require('fs').readdirSync(runsDir).forEach(f => {
4631
+ if (f.endsWith('.json') && !f.includes('ci-results')) {
4632
+ require('fs').unlinkSync(path.join(runsDir, f));
4633
+ }
4634
+ });
4635
+ }
4636
+ }
4514
4637
  const compiled = oxeOperational.compileExecutionGraphFromArtifacts(opts.dir, activeSession);
4515
4638
  const suite = oxeOperational.compileVerificationSuiteFromArtifacts(opts.dir, activeSession, {
4516
4639
  runState: compiled.run,
@@ -4520,7 +4643,33 @@ async function runRuntime(opts) {
4520
4643
  console.log(` ${c ? green : ''}Graph:${c ? reset : ''} ${compiled.graph.metadata.node_count} nó(s) · ${compiled.graph.metadata.wave_count} onda(s)`);
4521
4644
  console.log(` ${c ? green : ''}Checks:${c ? reset : ''} ${Array.isArray(suite.suite.checks) ? suite.suite.checks.length : 0}`);
4522
4645
  if (compiled.validationErrors.length) {
4523
- console.log(` ${yellow}Validation:${reset} ${compiled.validationErrors.join(' | ')}`);
4646
+ // Bucket 1: static-analysis hints (HINT(...))
4647
+ const hints = compiled.validationErrors.filter(e => e.startsWith('HINT('));
4648
+ // Bucket 2: mutation-scope overlaps (info-only in single-agent)
4649
+ const mutationWarns = compiled.validationErrors.filter(e => e.includes('mutate the same paths in parallel'));
4650
+ // Bucket 3: structural errors (cycles, missing deps)
4651
+ const blocking = compiled.validationErrors.filter(e =>
4652
+ !e.startsWith('HINT(') && !e.includes('mutate the same paths in parallel')
4653
+ );
4654
+ if (blocking.length) {
4655
+ console.log(` ${yellow}Validation (erros):${reset} ${blocking.join(' | ')}`);
4656
+ }
4657
+ if (mutationWarns.length) {
4658
+ console.log(` ${c ? dim : ''}Info (single-agent — tarefas na mesma onda são sequenciais, sobreposição de arquivos não bloqueia):${c ? reset : ''}`);
4659
+ mutationWarns.forEach(w => console.log(` ${c ? dim : ''} · ${w}${c ? reset : ''}`));
4660
+ }
4661
+ if (hints.length) {
4662
+ console.log(` ${yellow}Dicas de spec/plan (detectadas em tempo de compilação):${reset}`);
4663
+ hints.forEach(h => {
4664
+ // Format: HINT(type): message
4665
+ const match = h.match(/^HINT\(([^)]+)\):\s*(.*)/s);
4666
+ if (match) {
4667
+ console.log(` ${yellow}⚑${reset} [${match[1]}] ${match[2]}`);
4668
+ } else {
4669
+ console.log(` ${yellow}⚑${reset} ${h}`);
4670
+ }
4671
+ });
4672
+ }
4524
4673
  }
4525
4674
  console.log(` ${c ? green : ''}Arquivo:${c ? reset : ''} ${path.join(p.runsDir, `${compiled.run.run_id}.json`)}`);
4526
4675
  return;
@@ -4570,7 +4719,7 @@ async function runRuntime(opts) {
4570
4719
  console.log(` ${c ? green : ''}✓${c ? reset : ''} Projeções geradas a partir do estado canônico.`);
4571
4720
  console.log(` ${c ? green : ''}Run:${c ? reset : ''} ${projected.run.run_id}`);
4572
4721
  console.log(` ${c ? green : ''}STATE:${c ? reset : ''} ${projected.paths.state}`);
4573
- console.log(` ${c ? green : ''}PLAN:${c ? reset : ''} ${projected.paths.plan}`);
4722
+ console.log(` ${c ? green : ''}PLAN-STATUS:${c ? reset : ''} ${projected.paths.plan.replace(/PLAN\.md$/, 'PLAN-STATUS.md')}`);
4574
4723
  console.log(` ${c ? green : ''}VERIFY:${c ? reset : ''} ${projected.paths.verify}`);
4575
4724
  console.log(` ${c ? green : ''}RUN-SUMMARY:${c ? reset : ''} ${projected.paths.runSummary}`);
4576
4725
  console.log(` ${c ? green : ''}PR-SUMMARY:${c ? reset : ''} ${projected.paths.prSummary}`);
@@ -4581,6 +4730,63 @@ async function runRuntime(opts) {
4581
4730
  }
4582
4731
  }
4583
4732
 
4733
+ if (opts.action === 'execute') {
4734
+ try {
4735
+ // Resolve provider: flag > env vars
4736
+ const apiKey = opts.apiKey || process.env.ANTHROPIC_API_KEY || process.env.OPENAI_API_KEY || '';
4737
+ const model = opts.model || process.env.OXE_MODEL || 'claude-sonnet-4-6';
4738
+ const baseUrl = opts.baseUrl || process.env.OXE_BASE_URL || 'https://api.anthropic.com/v1';
4739
+ if (!apiKey) {
4740
+ console.error(`${red}Erro: executor LLM não configurado.${reset}`);
4741
+ console.error(` Use: --api-key <chave> ou exporte ANTHROPIC_API_KEY`);
4742
+ console.error(` Exemplo: oxe-cc runtime execute --api-key $ANTHROPIC_API_KEY --model claude-sonnet-4-6`);
4743
+ process.exit(1);
4744
+ }
4745
+ const providerConfig = { baseUrl, apiKey, model, maxTurns: opts.maxTurns || 10 };
4746
+ const result = await oxeOperational.runRuntimeExecute(opts.dir, activeSession, {
4747
+ runId: opts.runId || undefined,
4748
+ heartbeatTimeoutMs: opts.heartbeatTimeoutMs || undefined,
4749
+ providerConfig,
4750
+ onProgress: (event) => {
4751
+ if (event.type === 'turn_start') {
4752
+ const turn = event.detail?.turn ?? 0;
4753
+ if (turn === 0) process.stdout.write(` → ${event.nodeId} `);
4754
+ } else if (event.type === 'tool_call') {
4755
+ process.stdout.write('.');
4756
+ } else if (event.type === 'VerificationStarted') {
4757
+ process.stdout.write(' [verify]');
4758
+ } else if (event.type === 'WorkItemCompleted') {
4759
+ process.stdout.write(` ✓\n`);
4760
+ } else if (event.type === 'WorkItemBlocked') {
4761
+ process.stdout.write(` ✗\n`);
4762
+ } else if (event.type === 'RetryScheduled') {
4763
+ process.stdout.write(` ↺ retry ${event.payload?.next_attempt}\n → ${event.work_item_id} `);
4764
+ }
4765
+ },
4766
+ });
4767
+ if (opts.jsonOutput) {
4768
+ console.log(JSON.stringify(result, null, 2));
4769
+ if (result.result && result.result.failed && result.result.failed.length > 0) process.exitCode = 1;
4770
+ return;
4771
+ }
4772
+ const r = result.result || {};
4773
+ const completed = Array.isArray(r.completed) ? r.completed : [];
4774
+ const failed = Array.isArray(r.failed) ? r.failed : [];
4775
+ const blocked = Array.isArray(r.blocked) ? r.blocked : [];
4776
+ console.log(` ${c ? green : ''}✓${c ? reset : ''} Runtime execute concluído (modo: ${result.mode})`);
4777
+ console.log(` ${c ? green : ''}Completados:${c ? reset : ''} ${completed.length}`);
4778
+ if (failed.length > 0)
4779
+ console.log(` ${c ? red : ''}Falhos:${c ? reset : ''} ${failed.length} — ${failed.join(', ')}`);
4780
+ if (blocked.length > 0)
4781
+ console.log(` ${c ? '\x1b[33m' : ''}Bloqueados:${c ? reset : ''} ${blocked.length} — ${blocked.join(', ')}`);
4782
+ if (failed.length > 0) process.exitCode = 1;
4783
+ return;
4784
+ } catch (err) {
4785
+ console.error(`${red}${err && err.message ? err.message : 'Falha ao executar runtime.'}${reset}`);
4786
+ process.exit(1);
4787
+ }
4788
+ }
4789
+
4584
4790
  if (opts.action === 'ci') {
4585
4791
  try {
4586
4792
  const report = await oxeOperational.runRuntimeCiChecks(opts.dir, activeSession, {
@@ -4750,7 +4956,7 @@ function runAzure(opts) {
4750
4956
  };
4751
4957
 
4752
4958
  console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${opts.dir}${c ? reset : ''}`);
4753
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
4959
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
4754
4960
 
4755
4961
  try {
4756
4962
  if (opts.scope === 'status') {
@@ -5074,7 +5280,7 @@ function runPlanVisual(opts) {
5074
5280
  const planPath = sp.plan || oxeHealth.oxePaths(opts.dir).plan;
5075
5281
 
5076
5282
  console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${opts.dir}${c ? reset : ''}`);
5077
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
5283
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
5078
5284
 
5079
5285
  if (!fs.existsSync(planPath)) {
5080
5286
  console.log(`\n ${yellow}PLAN.md não encontrado em ${planPath}${reset}`);
@@ -5128,7 +5334,7 @@ function runVerifyMatrix(opts) {
5128
5334
  const verifyPath = sp.verify || oxeHealth.oxePaths(opts.dir).verify;
5129
5335
 
5130
5336
  console.log(` ${c ? green : ''}Projeto:${c ? reset : ''} ${c ? cyan : ''}${opts.dir}${c ? reset : ''}`);
5131
- console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || 'modo legado'}${c ? reset : ''}`);
5337
+ console.log(` ${c ? green : ''}Sessão:${c ? reset : ''} ${c ? cyan : ''}${activeSession || ' (sem sessão ativa)'}${c ? reset : ''}`);
5132
5338
 
5133
5339
  const specMd = fs.existsSync(specPath) ? fs.readFileSync(specPath, 'utf8') : '';
5134
5340
  const planMd = fs.existsSync(planPath) ? fs.readFileSync(planPath, 'utf8') : '';
@@ -5512,7 +5718,8 @@ async function main() {
5512
5718
  nextSteps: [
5513
5719
  { desc: 'Validar o projeto:', cmd: 'npx oxe-cc doctor' },
5514
5720
  { desc: 'Instalar integrações IDE/CLI (se ainda não fez):', cmd: 'npx oxe-cc@latest' },
5515
- { desc: 'Começar o fluxo no agente:', cmd: '/oxe-scan' },
5721
+ { desc: 'Fluxo runtime criar spec (no agente):', cmd: '/oxe-spec → /oxe-plan → oxe-cc runtime compile → oxe-cc runtime execute' },
5722
+ { desc: 'Começar pelo scan do codebase (agente):', cmd: '/oxe-scan' },
5516
5723
  ],
5517
5724
  dryRun: opts.dryRun,
5518
5725
  });