@codexa/cli 8.6.15 → 9.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexa/cli",
3
- "version": "8.6.15",
3
+ "version": "9.0.1",
4
4
  "description": "Orchestrated workflow system for Claude Code - manages feature development through parallel subagents with structured phases, gates, and quality enforcement.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,12 +18,12 @@ export interface Knowledge {
18
18
  severity: "info" | "warning" | "critical";
19
19
  }
20
20
 
21
- // v8.0: Raciocínio do subagent
21
+ // v9.0: Raciocinio do subagent (approach OBRIGATORIO para status "completed")
22
22
  export interface Reasoning {
23
- approach: string; // Como abordou o problema
23
+ approach: string; // OBRIGATORIO: Como abordou o problema (min 20 chars)
24
24
  challenges?: string[]; // Desafios encontrados
25
25
  alternatives?: string[]; // Alternativas consideradas
26
- recommendations?: string; // Recomendações para próximas tasks
26
+ recommendations?: string; // Recomendacoes para proximas tasks
27
27
  }
28
28
 
29
29
  export interface SubagentReturn {
@@ -282,7 +282,7 @@ export function parseSubagentReturn(input: string): ParseResult {
282
282
  }
283
283
  }
284
284
 
285
- // v8.0: reasoning (opcional, mas validar estrutura se presente)
285
+ // v9.0: reasoning (validar estrutura se presente)
286
286
  if (parsed.reasoning !== undefined) {
287
287
  if (typeof parsed.reasoning !== "object" || parsed.reasoning === null) {
288
288
  errors.push("Campo 'reasoning' deve ser um objeto");
@@ -305,6 +305,24 @@ export function parseSubagentReturn(input: string): ParseResult {
305
305
  }
306
306
  }
307
307
 
308
+ // v9.0: Validacao de reasoning obrigatorio para status "completed" (Gate 4.4)
309
+ if (parsed.status === "completed") {
310
+ if (!parsed.reasoning || typeof parsed.reasoning !== "object") {
311
+ errors.push(
312
+ "Status 'completed' requer campo 'reasoning' com pelo menos 'approach'. " +
313
+ "Isso preserva contexto entre tasks. Exemplo: {\"reasoning\": {\"approach\": \"Descreva como abordou o problema\"}}"
314
+ );
315
+ } else {
316
+ const r = parsed.reasoning as Record<string, unknown>;
317
+ if (!r.approach || typeof r.approach !== "string" || (r.approach as string).length < 20) {
318
+ errors.push(
319
+ "Campo 'reasoning.approach' obrigatorio com minimo 20 caracteres para status 'completed'. " +
320
+ "Descreva COMO voce abordou o problema, nao apenas O QUE fez."
321
+ );
322
+ }
323
+ }
324
+ }
325
+
308
326
  // v8.5: utilities_created (opcional, validar estrutura se presente)
309
327
  if (parsed.utilities_created !== undefined) {
310
328
  if (!Array.isArray(parsed.utilities_created)) {
@@ -392,6 +410,9 @@ export function formatValidationErrors(result: ParseResult): string {
392
410
  "summary": "Resumo do que foi feito (10-500 chars)",
393
411
  "files_created": ["path/to/file.ts"],
394
412
  "files_modified": ["path/to/other.ts"],
413
+ "reasoning": {
414
+ "approach": "OBRIGATORIO (min 20 chars): Como abordou o problema e POR QUE tomou essas decisoes"
415
+ },
395
416
  "patterns_discovered": ["Pattern identificado"],
396
417
  "decisions_made": [{"title": "...", "decision": "..."}],
397
418
  "blockers": ["Bloqueio se status != completed"],
package/workflow.ts CHANGED
@@ -6,8 +6,8 @@ import { checkRequest, checkApprove, checkReject } from "./commands/check";
6
6
  import { taskNext, taskStart, taskDone } from "./commands/task";
7
7
  import { decide, listDecisions } from "./commands/decide";
8
8
  import { reviewStart, reviewApprove, reviewSkip } from "./commands/review";
9
- import { addKnowledge, listKnowledge, acknowledgeKnowledge, queryGraph } from "./commands/knowledge";
10
- import { status, contextExport, recover, contextUpdate } from "./commands/utils";
9
+ import { addKnowledge, listKnowledge, acknowledgeKnowledge, queryGraph, resolveKnowledge } from "./commands/knowledge";
10
+ import { status, contextExport, recover, contextUpdate, contextDetail } from "./commands/utils";
11
11
  import {
12
12
  discoverStart,
13
13
  discoverConfirm,
@@ -190,8 +190,9 @@ taskCmd
190
190
  .command("start <ids>")
191
191
  .description("Inicia task(s) - pode ser multiplas separadas por virgula")
192
192
  .option("--json", "Saida em JSON")
193
+ .option("--full-context", "Incluir contexto completo (modo legado)")
193
194
  .action((ids: string, options) => {
194
- taskStart(ids, options.json);
195
+ taskStart(ids, options.json, options.fullContext);
195
196
  });
196
197
 
197
198
  taskCmd
@@ -280,6 +281,14 @@ knowledgeCmd
280
281
  acknowledgeKnowledge(id);
281
282
  });
282
283
 
284
+ knowledgeCmd
285
+ .command("resolve <ids>")
286
+ .description("Resolve/reconhece knowledge item(s) critico(s)")
287
+ .option("--resolution <text>", "Descricao de como o blocker foi resolvido")
288
+ .action((ids: string, opts: { resolution?: string }) => {
289
+ resolveKnowledge(ids, opts.resolution);
290
+ });
291
+
283
292
  knowledgeCmd
284
293
  .command("graph")
285
294
  .description("Consulta o knowledge graph (relacoes entre arquivos, decisoes, patterns)")
@@ -351,6 +360,14 @@ contextCmd
351
360
  contextUpdate(options);
352
361
  });
353
362
 
363
+ contextCmd
364
+ .command("detail <section>")
365
+ .description("Mostra secao especifica do contexto (standards, decisions, patterns, knowledge, architecture)")
366
+ .option("--json", "Output JSON")
367
+ .action((section: string, opts: { json?: boolean }) => {
368
+ contextDetail(section, opts.json);
369
+ });
370
+
354
371
  // Manter compatibilidade: context sem subcomando = export
355
372
  program
356
373
  .command("ctx")
@@ -541,6 +558,25 @@ discoverCmd
541
558
  patternsAnalyze(path, options.json);
542
559
  });
543
560
 
561
+ // v9.0: Analise profunda com metadata enriquecida + grepai
562
+ discoverCmd
563
+ .command("analyze-deep <files...>")
564
+ .description("Analise profunda de arquivos (hooks, patterns, directives)")
565
+ .option("--json", "Saida em JSON")
566
+ .action((files, options) => {
567
+ const { patternsAnalyzeDeep } = require("./commands/patterns");
568
+ patternsAnalyzeDeep(files, options.json);
569
+ });
570
+
571
+ // v9.0: Anti-patterns de gate bypasses
572
+ discoverCmd
573
+ .command("extract-anti-patterns")
574
+ .description("Extrai anti-patterns do historico de gate bypasses")
575
+ .action(() => {
576
+ const { extractAntiPatternsFromHistory } = require("./commands/patterns");
577
+ extractAntiPatternsFromHistory();
578
+ });
579
+
544
580
  discoverCmd
545
581
  .command("export-patterns")
546
582
  .description("Regenera arquivo patterns.md")