@devtrack-solution/codesdd 1.2.4-rc3 → 1.2.4
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/.sdd/skills/curated/devtrack-api/SKILL.md +91 -12
- package/.sdd/skills/curated/devtrack-api/agents/claude-code.yaml +2 -0
- package/.sdd/skills/curated/devtrack-api/agents/codex.yaml +2 -0
- package/.sdd/skills/curated/devtrack-api/agents/cursor.yaml +2 -0
- package/.sdd/skills/curated/devtrack-api/agents/gemini.yaml +2 -0
- package/.sdd/skills/curated/devtrack-api/agents/kimi.yaml +2 -0
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +3 -3
- package/.sdd/skills/curated/devtrack-api/agents/opencode.yaml +2 -0
- package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +59 -3
- package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +15 -3
- package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +1898 -2
- package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +3 -1
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +40 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +20 -2
- package/.sdd/skills/curated/devtrack-api/references/generated-artifact-invalidation.md +97 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +30 -1
- package/.sdd/skills/curated/devtrack-api/references/portable-agent-contract.md +4 -3
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +22 -1
- package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +9 -5
- package/README.md +122 -25
- package/dist/cli/program.js +180 -11
- package/dist/commands/config.js +27 -1
- package/dist/commands/sdd/execution.js +64 -2
- package/dist/commands/sdd.js +119 -4
- package/dist/core/cli/command-matrix.d.ts +18 -0
- package/dist/core/cli/command-matrix.js +148 -0
- package/dist/core/cli-command-quality.js +2 -0
- package/dist/core/config-schema.d.ts +14 -1
- package/dist/core/config-schema.js +32 -1
- package/dist/core/config.d.ts +1 -0
- package/dist/core/config.js +11 -0
- package/dist/core/global-config.d.ts +13 -0
- package/dist/core/init.d.ts +2 -2
- package/dist/core/init.js +13 -14
- package/dist/core/sdd/agent-binding.d.ts +9 -9
- package/dist/core/sdd/agent-runtime-contract.d.ts +4 -4
- package/dist/core/sdd/allocator-recovery.d.ts +14 -0
- package/dist/core/sdd/allocator-recovery.js +30 -0
- package/dist/core/sdd/allocator-security.d.ts +18 -0
- package/dist/core/sdd/allocator-security.js +36 -0
- package/dist/core/sdd/api-foundation-baseline.d.ts +111 -0
- package/dist/core/sdd/api-foundation-baseline.js +151 -0
- package/dist/core/sdd/api-foundation-parity.d.ts +114 -0
- package/dist/core/sdd/api-foundation-parity.js +131 -0
- package/dist/core/sdd/api-profile-catalog.d.ts +36 -0
- package/dist/core/sdd/api-profile-catalog.js +132 -0
- package/dist/core/sdd/api-profile-dry-run-projection.d.ts +93 -0
- package/dist/core/sdd/api-profile-dry-run-projection.js +370 -0
- package/dist/core/sdd/api-profile-recipes.d.ts +82 -0
- package/dist/core/sdd/api-profile-recipes.js +484 -0
- package/dist/core/sdd/artifact-id-allocator.d.ts +368 -0
- package/dist/core/sdd/artifact-id-allocator.js +510 -0
- package/dist/core/sdd/check.d.ts +50 -1
- package/dist/core/sdd/check.js +286 -9
- package/dist/core/sdd/deepagent-contracts.d.ts +4 -4
- package/dist/core/sdd/deepagents/reversa-subagents.d.ts +3 -3
- package/dist/core/sdd/default-bootstrap-files.d.ts +1 -1
- package/dist/core/sdd/default-bootstrap-files.js +0 -2
- package/dist/core/sdd/default-skills.js +7 -5
- package/dist/core/sdd/devtrack-api-appliance.d.ts +34 -0
- package/dist/core/sdd/devtrack-api-appliance.js +138 -34
- package/dist/core/sdd/devtrack-api-architecture.d.ts +16 -0
- package/dist/core/sdd/devtrack-api-architecture.js +86 -0
- package/dist/core/sdd/docs-sync.js +3 -3
- package/dist/core/sdd/enterprise-mutating-command-gate.d.ts +27 -0
- package/dist/core/sdd/enterprise-mutating-command-gate.js +104 -0
- package/dist/core/sdd/enterprise-provenance-gates.d.ts +20 -0
- package/dist/core/sdd/enterprise-provenance-gates.js +63 -0
- package/dist/core/sdd/enterprise-provisioning-policy.d.ts +26 -0
- package/dist/core/sdd/enterprise-provisioning-policy.js +104 -0
- package/dist/core/sdd/governance-schemas.d.ts +2 -2
- package/dist/core/sdd/governance-schemas.js +11 -2
- package/dist/core/sdd/json-schema.js +4 -0
- package/dist/core/sdd/legacy-operations.js +93 -4
- package/dist/core/sdd/package-security-gates.js +2 -0
- package/dist/core/sdd/package-structure-gate.d.ts +85 -3
- package/dist/core/sdd/package-structure-gate.js +386 -8
- package/dist/core/sdd/parallel-feat-automation.d.ts +6 -6
- package/dist/core/sdd/plugin-policy.js +6 -1
- package/dist/core/sdd/plugin-registry.d.ts +3 -3
- package/dist/core/sdd/quality-validation.d.ts +5 -5
- package/dist/core/sdd/release-readiness.d.ts +49 -0
- package/dist/core/sdd/release-readiness.js +303 -8
- package/dist/core/sdd/reversa-architecture-extractor.d.ts +13 -0
- package/dist/core/sdd/reversa-architecture-extractor.js +89 -0
- package/dist/core/sdd/reversa-artifact-writer.d.ts +18 -0
- package/dist/core/sdd/reversa-artifact-writer.js +40 -0
- package/dist/core/sdd/reversa-command-policy.d.ts +136 -0
- package/dist/core/sdd/reversa-command-policy.js +361 -0
- package/dist/core/sdd/reversa-data-extractor.d.ts +11 -0
- package/dist/core/sdd/reversa-data-extractor.js +73 -0
- package/dist/core/sdd/reversa-equivalence.d.ts +20 -0
- package/dist/core/sdd/reversa-equivalence.js +34 -0
- package/dist/core/sdd/reversa-evidence.d.ts +298 -0
- package/dist/core/sdd/reversa-evidence.js +118 -0
- package/dist/core/sdd/reversa-reconstruction.d.ts +29 -0
- package/dist/core/sdd/reversa-reconstruction.js +32 -0
- package/dist/core/sdd/reversa-rules-extractor.d.ts +12 -0
- package/dist/core/sdd/reversa-rules-extractor.js +86 -0
- package/dist/core/sdd/reversa-source-safety.d.ts +19 -0
- package/dist/core/sdd/reversa-source-safety.js +105 -0
- package/dist/core/sdd/reversa-surface-scout.d.ts +13 -0
- package/dist/core/sdd/reversa-surface-scout.js +85 -0
- package/dist/core/sdd/reversa-ux-mapper.d.ts +11 -0
- package/dist/core/sdd/reversa-ux-mapper.js +73 -0
- package/dist/core/sdd/sdk-agent-plugin-quality-gates.d.ts +1 -1
- package/dist/core/sdd/services/archive-quality-coherence.service.d.ts +17 -0
- package/dist/core/sdd/services/archive-quality-coherence.service.js +141 -0
- package/dist/core/sdd/services/decide.service.js +1 -1
- package/dist/core/sdd/services/finalize.service.d.ts +2 -0
- package/dist/core/sdd/services/finalize.service.js +48 -2
- package/dist/core/sdd/services/historical-quality-regression.service.d.ts +35 -0
- package/dist/core/sdd/services/historical-quality-regression.service.js +228 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
- package/dist/core/sdd/services/planning-execution-coherence.service.d.ts +45 -0
- package/dist/core/sdd/services/planning-execution-coherence.service.js +225 -0
- package/dist/core/sdd/state.js +15 -5
- package/dist/core/sdd/types.d.ts +3 -3
- package/dist/core/sdd/workspace-schemas.d.ts +45 -4
- package/dist/core/sdd/workspace-schemas.js +27 -6
- package/dist/core/shared/skill-generation.d.ts +2 -0
- package/dist/core/shared/skill-generation.js +19 -2
- package/dist/core/shared/tool-detection.d.ts +19 -0
- package/dist/core/shared/tool-detection.js +89 -0
- package/package.json +6 -5
- package/schemas/sdd/5-quality.schema.json +43 -0
- package/schemas/sdd/reversa-evidence-bundle.schema.json +466 -0
- package/schemas/sdd/workspace-catalog.schema.json +511 -0
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ Os documentos canonicos desta fronteira ficam em `docs/`:
|
|
|
31
31
|
|
|
32
32
|
- [docs/CREDITS.md](docs/CREDITS.md): reconhecimento conceitual e fronteira clean-room (fora do fluxo operacional).
|
|
33
33
|
- [docs/THIRD_PARTY_NOTICES.md](docs/THIRD_PARTY_NOTICES.md): notices tecnicos/licencas para dependencias runtime.
|
|
34
|
+
- [docs/service-catalog-maturity-epic-0097.md](docs/service-catalog-maturity-epic-0097.md): scorecard e guardrails da maturidade 5 do catalogo de servicos.
|
|
34
35
|
- [positioning.md](positioning.md): narrativa de posicionamento enterprise do CodeSDD.
|
|
35
36
|
|
|
36
37
|
## O que o CodeSDD faz
|
|
@@ -73,6 +74,7 @@ Para a iniciativa EPIC-0065, o projeto formaliza a seguinte fronteira canonica:
|
|
|
73
74
|
- CodeSDD e o control plane soberano: estado canonico (`.sdd/state/*.yaml`), lifecycle, EPIC/FEAT, ADR, politicas, qualidade, evidencia e finalize.
|
|
74
75
|
- DeepAgents e execution plane governado: planejamento tatico, delegacao de subagentes, execucao em sandbox, memoria tatica controlada e coleta de evidencia estruturada.
|
|
75
76
|
- Plugins operam como plano de construcao deterministico via broker e envelopes; Reversa opera como pipeline especializado de engenharia reversa.
|
|
77
|
+
- Reversa URL opera como superficie governada de frontend renderizado: `codesdd sdd reversa url <url>` exige aceite legal, escopo de autorizacao, intake guiado, stack alvo, limites de volumetria, politica de assets, boundary frontend-only e, quando solicitado, inventario redigido de contratos backend observados. Ele nao copia backend, bancos, credenciais, regras servidoras ou infraestrutura.
|
|
76
78
|
- Planos de plugin standalone validam `package_governance`, runtime de linguagem e fronteira de storage antes de qualquer adaptador tratar a operacao como executavel.
|
|
77
79
|
- O core agora possui uma casca Foundation-like incremental em `src/domains`, `src/applications`, `src/infrastructures`, `src/presentations` e `src/shared`; detalhes em `docs/codesdd-foundation-layer-migration.md`.
|
|
78
80
|
- Gates de qualidade para SDK/agentes/plugins agregam governanca de pacote, runtime de linguagem, artifact map, planos DeepAgents/Codex/OpenCode, compliance de plugin e cobertura por escopo em `src/core/sdd/sdk-agent-plugin-quality-gates.ts`.
|
|
@@ -197,6 +199,47 @@ export CODESDD_REDIS_URL="redis://localhost:6379"
|
|
|
197
199
|
|
|
198
200
|
Redis nunca deve armazenar estado canonico do projeto, chaves de API, tokens, senhas, respostas cruas de providers ou dados pessoais. Use `docs/redis-operations.md` para o runbook completo.
|
|
199
201
|
|
|
202
|
+
### Provisionamento Enterprise de itens numerados
|
|
203
|
+
|
|
204
|
+
Em modo Enterprise multiagente, DEB, INS, EPIC, FEAT e demais artefatos numerados devem usar uma autoridade online de provisionamento antes de qualquer escrita canonica. O modo local/single-agent continua usando o estado versionado em `.sdd` sem contato remoto obrigatorio.
|
|
205
|
+
|
|
206
|
+
Configure a identidade do projeto e a autoridade em `~/.codesdd/config.toml`:
|
|
207
|
+
|
|
208
|
+
```toml
|
|
209
|
+
[enterprise.provisioning]
|
|
210
|
+
mode = "enterprise"
|
|
211
|
+
project_id = "proj_devtrack_tools"
|
|
212
|
+
tenant_id = "tenant-main"
|
|
213
|
+
authority_url_env = "CODESDD_ALLOCATOR_URL"
|
|
214
|
+
required_for_numbered_artifacts = true
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Mantenha a URL real no shell, password manager ou secret store:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
export CODESDD_ALLOCATOR_URL="https://allocator.example.test"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
`codesdd config doctor --json` expoe `enterprise_provisioning` com `disabled`, `ready` ou `blocked`. Quando Enterprise esta solicitado e falta `project_id` ou autoridade, o doctor bloqueia; quando a autoridade estiver indisponivel em execucao, agentes Enterprise devem criar apenas drafts nao canonicos ate uma reserva online posterior.
|
|
224
|
+
|
|
225
|
+
O contrato inicial do allocator vive em `src/core/sdd/artifact-id-allocator.ts`. Ele define requests/responses versionados para reservar IDs canonicos (`INS`, `DEB`, `EPIC`, `FEAT`, `FGAP`, `TD`), gera idempotency keys deterministicas, retorna `reserved` na primeira reserva e `replayed` quando a mesma chave/payload e repetida. Reuso da mesma idempotency key com outro payload e conflito bloqueante.
|
|
226
|
+
|
|
227
|
+
O mesmo contrato tambem define leases de allocator com TTL, fencing token monotônico e audit trail. Uma lease ativa bloqueia outra lease concorrente para o mesmo projeto/tipo de artefato; replay da mesma idempotency key retorna a lease original; fencing token expirado ou divergente falha antes de ser usado por gates de escrita nos FEATs seguintes.
|
|
228
|
+
|
|
229
|
+
CAS de escrita canonica tambem e modelado no contrato: `commitCanonicalArtifactWrite` exige lease existente, fencing token valido e `expected_revision` igual a revisao atual do artefato. Repetir a mesma idempotency key/payload retorna `replayed`; token vencido, token divergente ou revisao stale gera rejeicao auditavel.
|
|
230
|
+
|
|
231
|
+
O gate Enterprise de comandos mutantes vive em `src/core/sdd/enterprise-mutating-command-gate.ts`. Ele permite comandos read-only, bloqueia mutacoes numeradas Enterprise sem lease/fencing valido e marca tentativas de bypass como `bypass-detected` antes de avaliar o lease.
|
|
232
|
+
|
|
233
|
+
Modo draft nao canonico tambem vive no contrato do allocator. `createNoncanonicalDraft` cria um identificador `draft_<tipo>_<hash>` que nunca entra na sequencia canonica; `convertDraftToCanonicalArtifact` exige uma reserva real do allocator, vincula o draft ao ID canonico e retorna `replayed` se a conversao ja tiver sido aplicada.
|
|
234
|
+
|
|
235
|
+
Gates de provenance vivem em `src/core/sdd/enterprise-provenance-gates.ts`. Eles verificam se reservas, leases, writes canonicos e conversoes de draft possuem audit/provenance suficiente para `diagnose`, `check`, `finalize` e CI bloquearem estados sem trilha.
|
|
236
|
+
|
|
237
|
+
Recovery do allocator vive em `src/core/sdd/allocator-recovery.ts`. Ele reconstrói counters a partir do histórico de reservas e reporta branch lag quando uma revisão local está atrás da revisão canônica observada.
|
|
238
|
+
|
|
239
|
+
Segurança do allocator vive em `src/core/sdd/allocator-security.ts`, com decisões determinísticas para quota por tenant/tipo de artefato e replay fora da janela permitida.
|
|
240
|
+
|
|
241
|
+
A carta arquitetural de EPIC-0084 vive em `.sdd/core/adrs/ADR-FEAT-0363.md` e mapeia cada FEAT do fechamento para seu contrato, evidencia primaria e risco residual. Use essa matriz como trilha de auditoria antes de adicionar transporte remoto, persistencia ou wiring de comandos mutantes.
|
|
242
|
+
|
|
200
243
|
## Contrato de nomenclatura
|
|
201
244
|
|
|
202
245
|
O contrato canonico de identidade do produto vive em `.sdd/state/naming-contract.yaml`
|
|
@@ -289,6 +332,9 @@ Se o terminal nao encontrar `codesdd`, a instalacao provavelmente foi concluida,
|
|
|
289
332
|
- Em shell Zsh, `codesdd config init` garante um bloco idempotente no `~/.zshrc` para `source ~/.codesdd/env.zsh`.
|
|
290
333
|
- A fronteira funcional e validavel: estado versionado do projeto fica em `.sdd`; config/runtime/cache comum fica em `~/.codesdd`; `.codesdd` dentro do repositorio e invalido para novo estado.
|
|
291
334
|
- `codesdd config doctor --json` expoe `storage_boundary` com `project_state_dir`, `global_runtime_dir`, `global_cache_dir`, tiers de cache e regras de separacao.
|
|
335
|
+
- `codesdd config doctor --json` tambem expoe `generated_instructions`, que aponta skills/prompts gerados sem o anuncio `CodeSDD Canonical Workflow`; quando `status=stale`, rode `codesdd update` ou reinstale as ferramentas afetadas.
|
|
336
|
+
- `codesdd config doctor --json` tambem expoe `enterprise_provisioning`, que valida identidade de projeto e autoridade online obrigatoria para artefatos numerados em modo Enterprise multiagente.
|
|
337
|
+
- O contrato de reserva de IDs canonicos fica em `src/core/sdd/artifact-id-allocator.ts`; ele e propositalmente puro/testavel e ainda nao substitui os gates de lease/CAS/mutating commands dos FEATs dependentes.
|
|
292
338
|
- `codesdd sdd plugin plan --project-root <path>` reutiliza essa fronteira para bloquear writes de plugin em `.codesdd` local e expor `workcell_runner.standalone.storage_boundary`.
|
|
293
339
|
- O perfil gerado por `codesdd config init` e fail-closed: DeepAgents fica
|
|
294
340
|
desabilitado, runtime `disabled`, provider smoke `0` e rede `disabled` ate
|
|
@@ -390,16 +436,37 @@ docs de release/seguranca.
|
|
|
390
436
|
Entre no repositorio onde voce quer usar o sistema e rode:
|
|
391
437
|
|
|
392
438
|
```bash
|
|
393
|
-
codesdd
|
|
439
|
+
codesdd sdd init-context
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
O `init-context` e o primeiro comando de capacidade CodeSDD dentro do projeto: ele inspeciona a base, cria/atualiza `.sdd/`, preenche contexto inicial de arquitetura, stack, servicos e mapa do repositorio, e deixa o projeto pronto para operar com estado canonico. Em um projeto recem-inicializado, valide e leia o onboarding antes do primeiro trabalho:
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
codesdd sdd check --render
|
|
446
|
+
codesdd sdd onboard system
|
|
394
447
|
```
|
|
395
448
|
|
|
396
|
-
|
|
449
|
+
O `sdd check --render` separa ruido historico de pendencia real. Para frontend,
|
|
450
|
+
use `Gaps de frontend abertos` como indicador operacional de trabalho pendente;
|
|
451
|
+
`Gaps de frontend resolvidos/historicos` e `Gaps de frontend total historico`
|
|
452
|
+
preservam auditoria de FGAPs ja fechados. Para lock domains, apenas
|
|
453
|
+
`Lock domains compartilhados ativos` indica risco de paralelizacao atual;
|
|
454
|
+
locks compartilhados historicos/mistos sao contexto de auditoria e nao devem
|
|
455
|
+
ser tratados como blocker por si so.
|
|
456
|
+
|
|
457
|
+
Depois disso, o primeiro trabalho normalmente comeca assim:
|
|
397
458
|
|
|
398
459
|
```bash
|
|
399
|
-
codesdd
|
|
460
|
+
codesdd sdd insight "descreva a mudanca ou iniciativa"
|
|
400
461
|
```
|
|
401
462
|
|
|
402
|
-
Se quiser
|
|
463
|
+
Se quiser fixar idioma/layout em portugues:
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
codesdd sdd init-context --lang pt-BR --layout pt-BR
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
Se quiser gerar assets de assistente explicitamente para agentes como Codex, Claude, Cursor ou OpenCode, use `install --tools` depois que o projeto tiver contexto CodeSDD:
|
|
403
470
|
|
|
404
471
|
```bash
|
|
405
472
|
codesdd install --tools all
|
|
@@ -411,21 +478,19 @@ Ou somente algumas:
|
|
|
411
478
|
codesdd install --tools codex,cursor,claude
|
|
412
479
|
```
|
|
413
480
|
|
|
414
|
-
|
|
481
|
+
Para OpenCode, use `--tools opencode` para instalar skills/prompts gerados. O provider MCP do bridge SDD usa outro id: `--provider open-code`.
|
|
482
|
+
|
|
483
|
+
O `init-context` prepara a base CodeSDD do projeto:
|
|
415
484
|
|
|
416
|
-
- a base do runtime
|
|
417
485
|
- `.sdd/config.yaml`
|
|
418
486
|
- `.sdd/`
|
|
419
|
-
- skills curadas
|
|
420
|
-
- prompts recomendados por workflow
|
|
421
|
-
- templates
|
|
422
487
|
- estados YAML canonicos
|
|
423
488
|
- documentos iniciais do projeto
|
|
424
489
|
|
|
425
|
-
Se voce nao quiser habilitar frontend
|
|
490
|
+
Se voce nao quiser habilitar frontend na inicializacao de contexto:
|
|
426
491
|
|
|
427
492
|
```bash
|
|
428
|
-
codesdd
|
|
493
|
+
codesdd sdd init-context --no-frontend
|
|
429
494
|
```
|
|
430
495
|
|
|
431
496
|
Atalhos em portugues no CLI:
|
|
@@ -438,15 +503,21 @@ Atalhos em portugues no CLI:
|
|
|
438
503
|
|
|
439
504
|
## Como absorver um projeto que ja existe
|
|
440
505
|
|
|
441
|
-
Se o projeto ja esta em andamento, o
|
|
506
|
+
Se o projeto ja esta em andamento, rode o mesmo comando na raiz:
|
|
442
507
|
|
|
443
508
|
```bash
|
|
444
|
-
codesdd sdd init-context
|
|
509
|
+
codesdd sdd init-context
|
|
445
510
|
codesdd sdd check --render
|
|
446
511
|
codesdd sdd onboard system
|
|
447
512
|
```
|
|
448
513
|
|
|
449
|
-
O `init-context`
|
|
514
|
+
O `init-context` detecta marcadores de codigo existente e executa a absorcao inicial de contexto. Para reabsorver de forma controlada depois que o projeto ja estiver governado, rode o mesmo comando com as opcoes necessarias:
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
codesdd sdd init-context --frontend --lang en-US --layout en-US
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
Esse comando serve para:
|
|
450
521
|
|
|
451
522
|
- inspecionar a base existente
|
|
452
523
|
- preencher contexto inicial de arquitetura, stack, servicos e mapa do repositorio
|
|
@@ -734,8 +805,10 @@ do ciclo de vida.
|
|
|
734
805
|
|
|
735
806
|
Perfis aceitos por `--provider`: `codex`, `claude-code`, `kimmy-code`,
|
|
736
807
|
`kilo-code`, `open-code` e `generic`. Para OpenCode/Open Code, o bridge MCP usa
|
|
737
|
-
o identificador `open-code
|
|
738
|
-
|
|
808
|
+
o identificador `open-code`. Use `opencode` apenas como id tecnico de assets
|
|
809
|
+
gerados por `codesdd install --tools opencode` e em contratos de runtime
|
|
810
|
+
OpenCode que executam o binario `opencode`; esse id nao e aceito por
|
|
811
|
+
`sdd mcp-manifest` neste runtime.
|
|
739
812
|
|
|
740
813
|
Matriz de provedores: consulte
|
|
741
814
|
[docs/mcp-provider-compatibility.md](docs/mcp-provider-compatibility.md),
|
|
@@ -960,15 +1033,19 @@ Entre elas:
|
|
|
960
1033
|
- `frontend-extractor-sdd`
|
|
961
1034
|
- `planning-normalizer-sdd`
|
|
962
1035
|
- `api-clean-flask-langgraph` (bundle `python-agentic-backend`)
|
|
963
|
-
- `devtrack-api` (bundle `architecture-backend`,
|
|
1036
|
+
- `devtrack-api` (bundle `architecture-backend`, compatibility binding for Foundation-derived CodeSDD API profiles)
|
|
964
1037
|
- `devtrack-angular` (bundle `frontend-product`, canonical DevTrack Angular Admin architecture)
|
|
965
1038
|
- `devtrack-flutter` (bundle `frontend-product`, canonical DevTrack Flutter/Dart architecture)
|
|
966
1039
|
|
|
967
|
-
Skill routing is operational, not decorative. When `codesdd sdd context <FEAT-ID>` returns `recommended_skills`, or when a user explicitly directs a skill, the agent must read and follow that skill before implementation and record one `skill_evidence` entry per required skill in `.sdd/active/<FEAT-ID>/5-quality.yaml` before finalize. For API/backend work without an explicit alternative skill/profile, `
|
|
1040
|
+
Skill routing is operational, not decorative. When `codesdd sdd context <FEAT-ID>` returns `recommended_skills`, or when a user explicitly directs a skill, the agent must read and follow that skill before implementation and record one `skill_evidence` entry per required skill in `.sdd/active/<FEAT-ID>/5-quality.yaml` before finalize. For API/backend work without an explicit alternative skill/profile, select one CodeSDD API profile: `minimal-rest`, `rest-auth-rbac`, `rest-crud-typeorm`, `evented-api`, `ai-agent-api`, or `full-foundation-compatible`; `devtrack-api` remains the compatibility skill/alias. Angular Admin/backoffice work that names admin pages, dashboards, CRUD, data grids, admin Formly, admin NGXS/state, official Angular framework patterns, permissions, reports, workflow, admin realtime, or admin chat uses `devtrack-angular`. Flutter/Dart work that names Flutter apps, widgets, routing, localization, responsive layout, JSON, HTTP, previews, widget tests, integration tests, go_router, ARB, or l10n uses `devtrack-flutter`. Explicit Python/Flask API work remains routed to `api-clean-flask-langgraph`.
|
|
968
1041
|
|
|
969
1042
|
The `devtrack-api` skill has a Foundation-layout conformance test. When the Foundation checkout is not at `/Volumes/WORKSPACE/DEVTRACK_TOOLS/devtrack-foundation-api`, set `CODESDD_FOUNDATION_API_ROOT=/path/to/devtrack-foundation-api` before running `pnpm test -- test/specs/devtrack-api-foundation-layout.test.ts`.
|
|
970
1043
|
|
|
971
|
-
|
|
1044
|
+
That conformance test now checks the live Foundation BO and TypeORM topology: aggregate `.bo.ts` files must use `extends GenericBusinessObject<T>` followed by `implements <Name>Interface, IValidator`, and persistence wiring must use `src/infrastructure/adapters/orm/typeorm.module.ts` plus context modules such as `<context>-orm.module.ts`.
|
|
1045
|
+
|
|
1046
|
+
The executable `devtrack-api` contract pack lives in `.sdd/skills/curated/devtrack-api/references/contract-pack.yaml`. It defines the `prototype`, `foundation-compatible`, and `enterprise-strict` profiles, P0/P1/P2 severity semantics, early package-preview expectations, import/alias and TypeORM drift rules, mandatory `cleanup`/`cleanup:install` plus port-safe `start`/`start:dev` bootstrap scripts for linked/generated API projects, and the `codesdd-validate` plus field-evidence drift maps consumed by later governance gates.
|
|
1047
|
+
|
|
1048
|
+
The EPIC-0080 dual-boundary charter lives in `.sdd/core/adrs/ADR-FEAT-0373.md`. It freezes the rule that CodeSDD keeps plural internal layer roots for this CLI repository while every `devtrack-api` preview, artifact map, validator, and generated output must target singular Foundation-compatible roots. For this EPIC, `human_validation_gate.status` is limited to `approved`, `corrected`, `pending`, or `rejected`; any material source, profile, exception, or validator change invalidates prior approval back to `pending` until a human re-approves it.
|
|
972
1049
|
|
|
973
1050
|
The executable `devtrack-angular` contract pack lives in `.sdd/skills/curated/devtrack-angular/references/contract-pack.yaml`. It defines portable agent adapters, `prototype`, `production-admin`, and `enterprise-admin` profiles, pages-first Angular Admin architecture rules, Formly/NGXS/realtime/admin gates, official Angular skills mapping, and evidence expectations for Angular Admin delivery.
|
|
974
1051
|
|
|
@@ -978,6 +1055,8 @@ Consumer copies of `devtrack-api` are one-way CodeSDD materializations, not dura
|
|
|
978
1055
|
|
|
979
1056
|
Field validation for `devtrack-api` is governed by `.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md`. A consumer project must keep its own evidence showing at least two detailed implementation debates and closure of divergence classes D-01 through D-08; CodeSDD keeps the protocol and external reference, not private consumer ledgers.
|
|
980
1057
|
|
|
1058
|
+
Legacy generated `devtrack-api` previews, scaffold dry-runs, caches, artifact maps, validator results, and evidence bundles are governed by `.sdd/skills/curated/devtrack-api/references/generated-artifact-invalidation.md`. Pre-EPIC-0080 generated artifacts are noncanonical by default and must be classified as `revalidated`, `invalidated`, `grandfathered`, or `not_applicable` before supporting any Foundation-compatible claim.
|
|
1059
|
+
|
|
981
1060
|
Prompts recomendados tambem sao instalados em:
|
|
982
1061
|
|
|
983
1062
|
```text
|
|
@@ -1007,13 +1086,11 @@ Um agente novo deve seguir esta ordem:
|
|
|
1007
1086
|
|
|
1008
1087
|
## Comandos principais
|
|
1009
1088
|
|
|
1010
|
-
|
|
1089
|
+
Inicializacao e reparo de projeto:
|
|
1011
1090
|
|
|
1012
|
-
- `codesdd install --tools none`
|
|
1013
|
-
- `codesdd install --tools all`
|
|
1014
|
-
- `codesdd reload --tools none`
|
|
1015
1091
|
- `codesdd sdd init-context`
|
|
1016
1092
|
- `codesdd sdd init-context --frontend --lang en-US --layout en-US`
|
|
1093
|
+
- `codesdd reload --tools none`
|
|
1017
1094
|
- `codesdd sdd check --render`
|
|
1018
1095
|
- `codesdd sdd check --render --strict`
|
|
1019
1096
|
- `codesdd sdd diagnose`
|
|
@@ -1035,6 +1112,12 @@ Bootstrap:
|
|
|
1035
1112
|
- `codesdd sdd lint feature FEAT-0001 --strict --json`
|
|
1036
1113
|
- `codesdd sdd ingest-deposito`
|
|
1037
1114
|
|
|
1115
|
+
Assets de agentes:
|
|
1116
|
+
|
|
1117
|
+
- `codesdd install --tools none` (nao gera assets de agentes)
|
|
1118
|
+
- `codesdd install --tools all`
|
|
1119
|
+
- `codesdd install --tools opencode` (assets OpenCode; MCP continua `--provider open-code`)
|
|
1120
|
+
|
|
1038
1121
|
Onboarding e operacao:
|
|
1039
1122
|
|
|
1040
1123
|
- `codesdd sdd onboard system`
|
|
@@ -1049,6 +1132,11 @@ Onboarding e operacao:
|
|
|
1049
1132
|
- `codesdd sdd audit`
|
|
1050
1133
|
- `codesdd sdd finalize --ref FEAT-0001`
|
|
1051
1134
|
|
|
1135
|
+
Absorcao de contexto:
|
|
1136
|
+
|
|
1137
|
+
- `codesdd sdd init-context`
|
|
1138
|
+
- `codesdd sdd init-context --frontend --lang en-US --layout en-US`
|
|
1139
|
+
|
|
1052
1140
|
Descoberta:
|
|
1053
1141
|
|
|
1054
1142
|
- `codesdd sdd insight "..."`
|
|
@@ -1092,7 +1180,16 @@ pnpm run dev:cli
|
|
|
1092
1180
|
|
|
1093
1181
|
O repositório instala automaticamente um hook de `pre-commit` local via `.githooks/` durante `pnpm install`. Esse hook chama `node scripts/pre-commit-sdd-fast.mjs`, inspeciona arquivos staged e roda `codesdd sdd check --strict` somente quando houver arquivos `.sdd/` no commit. Para a validacao completa antes de PR/release, rode `pnpm run sdd:validate`.
|
|
1094
1182
|
|
|
1095
|
-
A matriz autoritativa de cobertura da CLI fica em `src/core/cli/command-matrix.ts`. Sempre que um novo leaf command for registrado, atualize a matriz junto para explicitar se a cobertura esperada e `contract`, `spawned-e2e` ou `exception
|
|
1183
|
+
A matriz autoritativa de cobertura e taxonomia publica da CLI fica em `src/core/cli/command-matrix.ts`. Sempre que um novo leaf command for registrado, atualize a matriz junto para explicitar se a cobertura esperada e `contract`, `spawned-e2e` ou `exception`, e classifique o comando como lifecycle canonico, bootstrap/repair, compatibilidade, migracao, diagnostico/governanca ou interno.
|
|
1184
|
+
|
|
1185
|
+
Harness pratico de comandos:
|
|
1186
|
+
|
|
1187
|
+
```bash
|
|
1188
|
+
pnpm exec vitest run test/helpers/practical-api-fixture.test.ts
|
|
1189
|
+
pnpm exec vitest run --testTimeout 120000 test/e2e/practical-api-command-system.test.ts
|
|
1190
|
+
```
|
|
1191
|
+
|
|
1192
|
+
Esse harness cria uma API ficticia `proposal-builder-api` em diretorio temporario, isola `HOME`, `USERPROFILE`, `XDG_*`, `CODEX_HOME` e flags de runtime, e valida um ciclo real do CodeSDD com exatamente um `INS`, um `DEB`, um `EPIC` e um `FEAT`. A cobertura da matriz publica deve terminar sem comandos faltantes: cada caminho fica marcado como `executed`, `dry_run`, `alias_covered` ou `skipped_external` com motivo explicito.
|
|
1096
1193
|
|
|
1097
1194
|
## Estado atual da distribuicao
|
|
1098
1195
|
|
|
@@ -1158,7 +1255,7 @@ Initial operational directives:
|
|
|
1158
1255
|
- CodeSDD is the official planner for any build request; other planners or agent-native plans are secondary execution aids only.
|
|
1159
1256
|
- In initialized CodeSDD repositories, any user request that implies implementation, file edits, validation, execution, or finalize must be treated as requiring CodeSDD planning unless the user explicitly marks it as read-only or outside CodeSDD.
|
|
1160
1257
|
- For change requests, agents must bind the work to an active or ready FEAT through `codesdd sdd next` and `codesdd sdd context <FEAT-ID>` before implementation; agent-native plans may only decompose execution after that CodeSDD context exists.
|
|
1161
|
-
- For API/backend work,
|
|
1258
|
+
- For API/backend work, select a CodeSDD API profile (`minimal-rest`, `rest-auth-rbac`, `rest-crud-typeorm`, `evented-api`, `ai-agent-api`, or `full-foundation-compatible`); `devtrack-api` remains the compatibility skill/alias and Python/Flask API work stays routed to `api-clean-flask-langgraph`.
|
|
1162
1259
|
- During init, onboard, insight, and debate flows, CodeSDD-managed agent instruction blocks must be inspected and reconfigured when they drift from this contract.
|
|
1163
1260
|
- Commit requests must follow Conventional Commits, selective staging, and grouping by modified directory plus change protocol (`src`, `.sdd`, docs, config, infra, dependencies, or generated files).
|
|
1164
1261
|
|
package/dist/cli/program.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import ora from 'ora';
|
|
4
|
+
import chalk from 'chalk';
|
|
4
5
|
import path from 'path';
|
|
5
6
|
import { promises as fs } from 'fs';
|
|
6
|
-
import { AI_TOOLS } from '../core/config.js';
|
|
7
|
-
import { CLI_NAME } from '../core/branding.js';
|
|
7
|
+
import { AI_TOOLS, getToolInstallGuidance } from '../core/config.js';
|
|
8
|
+
import { CLI_NAME, CLI_PRODUCT_NAME } from '../core/branding.js';
|
|
8
9
|
import { UpdateCommand } from '../core/update.js';
|
|
9
10
|
import { ListCommand } from '../core/list.js';
|
|
10
11
|
import { ArchiveCommand } from '../core/archive.js';
|
|
@@ -108,6 +109,114 @@ export function createCliProgram(options = {}) {
|
|
|
108
109
|
return value;
|
|
109
110
|
throw new Error(`Invalid value for --layout: "${value}". Use en-US, legacy, or pt-BR.`);
|
|
110
111
|
}
|
|
112
|
+
async function detectExistingCodebase(projectRoot) {
|
|
113
|
+
const markers = [
|
|
114
|
+
'package.json',
|
|
115
|
+
'pnpm-workspace.yaml',
|
|
116
|
+
'tsconfig.json',
|
|
117
|
+
'pyproject.toml',
|
|
118
|
+
'requirements.txt',
|
|
119
|
+
'go.mod',
|
|
120
|
+
'Cargo.toml',
|
|
121
|
+
'pom.xml',
|
|
122
|
+
'build.gradle',
|
|
123
|
+
'pubspec.yaml',
|
|
124
|
+
'src',
|
|
125
|
+
'test',
|
|
126
|
+
'tests',
|
|
127
|
+
'docs',
|
|
128
|
+
'README.md',
|
|
129
|
+
'.github',
|
|
130
|
+
];
|
|
131
|
+
const entries = await fs.readdir(projectRoot).catch(() => []);
|
|
132
|
+
const visibleEntries = entries.filter((entry) => !['.sdd', '.git', '.codex', '.claude', '.cursor', '.opencode'].includes(entry));
|
|
133
|
+
return markers.some((marker) => visibleEntries.includes(marker));
|
|
134
|
+
}
|
|
135
|
+
async function resolveInstallPrimaryNextAction(projectRoot) {
|
|
136
|
+
try {
|
|
137
|
+
const { loadProjectSddConfig, loadStateSnapshot, resolveSddPaths } = await import('../core/sdd/state.js');
|
|
138
|
+
const config = await loadProjectSddConfig(projectRoot);
|
|
139
|
+
const paths = resolveSddPaths(projectRoot, config);
|
|
140
|
+
const snapshot = await loadStateSnapshot(paths, config);
|
|
141
|
+
const activeFeature = snapshot.backlog.items.find((item) => item.status === 'IN_PROGRESS');
|
|
142
|
+
if (activeFeature) {
|
|
143
|
+
return `${CLI_NAME} sdd context ${activeFeature.id}`;
|
|
144
|
+
}
|
|
145
|
+
const readyFeature = snapshot.backlog.items.find((item) => item.status === 'READY');
|
|
146
|
+
if (readyFeature) {
|
|
147
|
+
return `${CLI_NAME} sdd start ${readyFeature.id}`;
|
|
148
|
+
}
|
|
149
|
+
const openDebate = snapshot.discoveryIndex.records.find((record) => record.type === 'DEB' && record.status === 'OPEN');
|
|
150
|
+
if (openDebate) {
|
|
151
|
+
return `${CLI_NAME} sdd decide ${openDebate.id} --outcome epic`;
|
|
152
|
+
}
|
|
153
|
+
const hasInsight = snapshot.discoveryIndex.records.some((record) => record.type === 'INS');
|
|
154
|
+
if (!hasInsight) {
|
|
155
|
+
return `${CLI_NAME} sdd insight "describe the change or initiative"`;
|
|
156
|
+
}
|
|
157
|
+
return `${CLI_NAME} sdd next`;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return `${CLI_NAME} sdd onboard system`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function formatInstallDefaults(options) {
|
|
164
|
+
return {
|
|
165
|
+
tools: options?.tools ? `explicit:${options.tools}` : 'auto',
|
|
166
|
+
language: options?.lang ? `explicit:${options.lang}` : 'auto',
|
|
167
|
+
layout: options?.layout ? `explicit:${options.layout}` : 'auto',
|
|
168
|
+
frontend: options?.frontend === false ? 'disabled' : 'auto',
|
|
169
|
+
check: 'rendered',
|
|
170
|
+
onboard: 'synced',
|
|
171
|
+
announce: 'synced',
|
|
172
|
+
legacy: 'warn-only',
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function resolveInstallToolIds(tools) {
|
|
176
|
+
if (!tools)
|
|
177
|
+
return [];
|
|
178
|
+
const raw = tools.trim().toLowerCase();
|
|
179
|
+
if (!raw || raw === 'none')
|
|
180
|
+
return [];
|
|
181
|
+
if (raw === 'all')
|
|
182
|
+
return availableToolIds;
|
|
183
|
+
return raw
|
|
184
|
+
.split(',')
|
|
185
|
+
.map((token) => token.trim())
|
|
186
|
+
.filter((token) => token.length > 0);
|
|
187
|
+
}
|
|
188
|
+
function displayFullInstallResult(result) {
|
|
189
|
+
console.log();
|
|
190
|
+
console.log(chalk.bold(`${CLI_PRODUCT_NAME} Setup Complete`));
|
|
191
|
+
console.log();
|
|
192
|
+
console.log(chalk.bold('Default-first engagement:'));
|
|
193
|
+
console.log(` Mode: ${result.mode}`);
|
|
194
|
+
console.log(` Tools: ${result.defaults.tools}`);
|
|
195
|
+
for (const note of result.toolNotes) {
|
|
196
|
+
console.log(` ${note}`);
|
|
197
|
+
}
|
|
198
|
+
console.log(` Language: ${result.defaults.language}`);
|
|
199
|
+
console.log(` Layout: ${result.defaults.layout}`);
|
|
200
|
+
console.log(` Frontend: ${result.frontendEnabled ? 'enabled' : 'disabled'} (${result.defaults.frontend})`);
|
|
201
|
+
console.log(` Views generated: ${result.rendered ? 'yes' : 'no'}`);
|
|
202
|
+
console.log(` Curated skills loaded: ${result.skillsSeeded}`);
|
|
203
|
+
console.log(` Local skills generated: ${result.localSkillsMaterialized}`);
|
|
204
|
+
console.log(` Tools synced: ${result.syncedTools.length > 0 ? result.syncedTools.join(', ') : 'none detected'}`);
|
|
205
|
+
if (result.mode === 'existing-codebase') {
|
|
206
|
+
const updatedKeys = Object.entries(result.contextUpdated)
|
|
207
|
+
.filter(([, updated]) => updated)
|
|
208
|
+
.map(([key]) => key);
|
|
209
|
+
console.log(` Existing context absorbed: ${updatedKeys.length > 0 ? updatedKeys.join(', ') : 'no structural updates needed'}`);
|
|
210
|
+
}
|
|
211
|
+
console.log(` Compatibility: ${result.defaults.legacy}`);
|
|
212
|
+
console.log();
|
|
213
|
+
console.log(chalk.bold('Primary next action:'));
|
|
214
|
+
console.log(` ${result.primaryNextAction}`);
|
|
215
|
+
console.log();
|
|
216
|
+
console.log(chalk.dim(`Advanced checks: ${CLI_NAME} sdd onboard system | ${CLI_NAME} sdd check --render`));
|
|
217
|
+
console.log(chalk.dim('Compatibility slash commands may exist for older workflows; prefer CodeSDD SDD commands in .sdd-native projects.'));
|
|
218
|
+
console.log();
|
|
219
|
+
}
|
|
111
220
|
async function runInitCommand(targetPath, options) {
|
|
112
221
|
// Validate that the path is a valid directory
|
|
113
222
|
const resolvedPath = path.resolve(targetPath);
|
|
@@ -142,15 +251,53 @@ export function createCliProgram(options = {}) {
|
|
|
142
251
|
await initCommand.execute(targetPath);
|
|
143
252
|
}
|
|
144
253
|
async function runFullInstallCommand(targetPath, options) {
|
|
145
|
-
|
|
146
|
-
const
|
|
254
|
+
const resolvedPath = path.resolve(targetPath);
|
|
255
|
+
const existingCodebase = await detectExistingCodebase(resolvedPath);
|
|
256
|
+
await runInitCommand(targetPath, {
|
|
257
|
+
...options,
|
|
258
|
+
allowNoToolsFallback: true,
|
|
259
|
+
interactive: false,
|
|
260
|
+
silent: true,
|
|
261
|
+
});
|
|
262
|
+
const { SddInitCommand, SddInitContextCommand } = await import('../core/sdd/init.js');
|
|
263
|
+
const language = normalizeSddLang(options?.lang);
|
|
264
|
+
const layout = normalizeSddLayout(options?.layout);
|
|
265
|
+
const frontendEnabled = options?.frontend ?? true;
|
|
147
266
|
const sddInitCommand = new SddInitCommand();
|
|
148
|
-
await sddInitCommand.execute(targetPath, {
|
|
149
|
-
frontendEnabled
|
|
150
|
-
language
|
|
151
|
-
layout
|
|
152
|
-
render:
|
|
267
|
+
const initResult = await sddInitCommand.execute(targetPath, {
|
|
268
|
+
frontendEnabled,
|
|
269
|
+
language,
|
|
270
|
+
layout,
|
|
271
|
+
render: !existingCodebase,
|
|
153
272
|
});
|
|
273
|
+
let contextUpdated = {};
|
|
274
|
+
let rendered = initResult.rendered;
|
|
275
|
+
if (existingCodebase) {
|
|
276
|
+
const contextCommand = new SddInitContextCommand();
|
|
277
|
+
const contextResult = await contextCommand.execute(targetPath, {
|
|
278
|
+
mode: 'merge',
|
|
279
|
+
deep: true,
|
|
280
|
+
render: true,
|
|
281
|
+
frontendEnabled,
|
|
282
|
+
language,
|
|
283
|
+
layout,
|
|
284
|
+
});
|
|
285
|
+
contextUpdated = contextResult.sddBootstrap.updated;
|
|
286
|
+
rendered = contextResult.rendered;
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
memoryDir: initResult.memoryDir,
|
|
290
|
+
frontendEnabled: initResult.frontendEnabled,
|
|
291
|
+
rendered,
|
|
292
|
+
skillsSeeded: initResult.skillsSeeded,
|
|
293
|
+
localSkillsMaterialized: initResult.localSkillsMaterialized,
|
|
294
|
+
syncedTools: initResult.syncedTools,
|
|
295
|
+
mode: existingCodebase ? 'existing-codebase' : 'new-project',
|
|
296
|
+
contextUpdated,
|
|
297
|
+
defaults: formatInstallDefaults(options),
|
|
298
|
+
toolNotes: getToolInstallGuidance(resolveInstallToolIds(options?.tools)),
|
|
299
|
+
primaryNextAction: await resolveInstallPrimaryNextAction(resolvedPath),
|
|
300
|
+
};
|
|
154
301
|
}
|
|
155
302
|
async function runReloadCommand(targetPath, options) {
|
|
156
303
|
await runInitCommand(targetPath, {
|
|
@@ -254,7 +401,8 @@ export function createCliProgram(options = {}) {
|
|
|
254
401
|
.option('--no-frontend', 'Disable frontend module in the SDD bootstrap')
|
|
255
402
|
.action(async (targetPath = '.', options) => {
|
|
256
403
|
try {
|
|
257
|
-
await runFullInstallCommand(targetPath, options);
|
|
404
|
+
const result = await runFullInstallCommand(targetPath, options);
|
|
405
|
+
displayFullInstallResult(result);
|
|
258
406
|
}
|
|
259
407
|
catch (error) {
|
|
260
408
|
console.log();
|
|
@@ -640,6 +788,27 @@ export function createCliProgram(options = {}) {
|
|
|
640
788
|
}
|
|
641
789
|
export async function runCli(argv = process.argv) {
|
|
642
790
|
const program = createCliProgram();
|
|
643
|
-
|
|
791
|
+
try {
|
|
792
|
+
await program.parseAsync(argv);
|
|
793
|
+
}
|
|
794
|
+
catch (error) {
|
|
795
|
+
const rawMessage = error instanceof Error ? error.message : `${error}`;
|
|
796
|
+
const formattedMessage = /^error:/i.test(rawMessage) ? rawMessage : `Error: ${rawMessage}`;
|
|
797
|
+
const errorExitCode = typeof error === 'object' &&
|
|
798
|
+
error !== null &&
|
|
799
|
+
'exitCode' in error &&
|
|
800
|
+
typeof error.exitCode === 'number'
|
|
801
|
+
? error.exitCode
|
|
802
|
+
: undefined;
|
|
803
|
+
console.error(formattedMessage);
|
|
804
|
+
if (typeof process.exitCode === 'number' && process.exitCode !== 0) {
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
if (typeof errorExitCode === 'number' && Number.isInteger(errorExitCode) && errorExitCode > 0) {
|
|
808
|
+
process.exitCode = errorExitCode;
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
process.exitCode = 1;
|
|
812
|
+
}
|
|
644
813
|
}
|
|
645
814
|
//# sourceMappingURL=program.js.map
|
package/dist/commands/config.js
CHANGED
|
@@ -7,9 +7,11 @@ import { getNestedValue, setNestedValue, deleteNestedValue, coerceValue, formatV
|
|
|
7
7
|
import { CORE_WORKFLOWS, ALL_WORKFLOWS, getProfileWorkflows } from '../core/profiles.js';
|
|
8
8
|
import { hasProjectConfigDrift } from '../core/profile-sync-drift.js';
|
|
9
9
|
import { CLI_NAME } from '../core/branding.js';
|
|
10
|
+
import { buildGeneratedInstructionDriftReport } from '../core/shared/tool-detection.js';
|
|
10
11
|
import { resolveLegacySpecLiveRoot } from '../core/sdd/services/legacy-capability.service.js';
|
|
11
12
|
import { buildRedisOperationalReport, deleteKeysByPrefix, RedisClientFactory, resolveRedisBoundaryConfig, runRedisBenchmark, } from '../core/sdd/coordination/index.js';
|
|
12
13
|
import { buildCodesddStorageBoundaryReport } from '../core/sdd/runtime-boundary-contract.js';
|
|
14
|
+
import { buildEnterpriseProvisioningPolicyReport } from '../core/sdd/enterprise-provisioning-policy.js';
|
|
13
15
|
import { buildDeepAgentsOperationalPreflight, createDeepAgentsPolicySnapshot, } from '../core/sdd/deepagents/policy.js';
|
|
14
16
|
import { detectShell } from '../utils/shell-detection.js';
|
|
15
17
|
import { ZshInstaller } from '../core/completions/installers/zsh-installer.js';
|
|
@@ -267,8 +269,11 @@ export function registerConfigCommand(program) {
|
|
|
267
269
|
env: process.env,
|
|
268
270
|
globalConfig: getGlobalConfig(),
|
|
269
271
|
});
|
|
272
|
+
const globalConfig = getGlobalConfig();
|
|
270
273
|
const cacheTiers = getGlobalCacheTierDirs();
|
|
271
274
|
const storageBoundary = buildCodesddStorageBoundaryReport(process.cwd());
|
|
275
|
+
const generatedInstructions = buildGeneratedInstructionDriftReport(process.cwd());
|
|
276
|
+
const enterpriseProvisioning = buildEnterpriseProvisioningPolicyReport(globalConfig, process.env);
|
|
272
277
|
const report = {
|
|
273
278
|
schema_version: 1,
|
|
274
279
|
global_config_path: getGlobalConfigPath(),
|
|
@@ -277,6 +282,7 @@ export function registerConfigCommand(program) {
|
|
|
277
282
|
tiers: Object.keys(cacheTiers),
|
|
278
283
|
},
|
|
279
284
|
storage_boundary: storageBoundary,
|
|
285
|
+
generated_instructions: generatedInstructions,
|
|
280
286
|
redis: {
|
|
281
287
|
requested: redisReport.requested,
|
|
282
288
|
namespace: redisReport.namespace,
|
|
@@ -288,6 +294,7 @@ export function registerConfigCommand(program) {
|
|
|
288
294
|
validation_errors: redisReport.validation_errors,
|
|
289
295
|
warnings: redisReport.warnings,
|
|
290
296
|
},
|
|
297
|
+
enterprise_provisioning: enterpriseProvisioning,
|
|
291
298
|
deepagents: preflight,
|
|
292
299
|
};
|
|
293
300
|
if (options.json) {
|
|
@@ -299,6 +306,13 @@ export function registerConfigCommand(program) {
|
|
|
299
306
|
console.log(`Cache tiers: ${report.cache.tiers.join(', ')}`);
|
|
300
307
|
console.log(`Project state: ${report.storage_boundary.project_state_dir}`);
|
|
301
308
|
console.log(`Global runtime: ${report.storage_boundary.global_runtime_dir}`);
|
|
309
|
+
console.log(`Generated instructions: ${generatedInstructions.status} (checked=${generatedInstructions.checked_count}, stale=${generatedInstructions.stale_count})`);
|
|
310
|
+
for (const warning of generatedInstructions.warnings) {
|
|
311
|
+
console.log(`- ${warning}`);
|
|
312
|
+
}
|
|
313
|
+
for (const staleFile of generatedInstructions.stale_files.slice(0, 10)) {
|
|
314
|
+
console.log(`- stale ${staleFile.kind}: ${staleFile.path}`);
|
|
315
|
+
}
|
|
302
316
|
console.log(`Redis: ${report.redis.status} (namespace=${report.redis.namespace}, fallback=${report.redis.fallback})`);
|
|
303
317
|
if (report.redis.redacted_url) {
|
|
304
318
|
console.log(`Redis URL: ${report.redis.redacted_url}`);
|
|
@@ -313,12 +327,24 @@ export function registerConfigCommand(program) {
|
|
|
313
327
|
for (const error of report.redis.validation_errors) {
|
|
314
328
|
console.log(`- ${error}`);
|
|
315
329
|
}
|
|
330
|
+
const enterpriseRequestedMode = enterpriseProvisioning.requested_mode ?? enterpriseProvisioning.mode;
|
|
331
|
+
const enterpriseEffectiveMode = enterpriseProvisioning.effective_mode ?? (enterpriseProvisioning.requested ? 'enterprise' : 'local');
|
|
332
|
+
const localModeExceptionAccepted = enterpriseProvisioning.local_mode_exception_accepted ?? !enterpriseProvisioning.requested;
|
|
333
|
+
console.log(`Enterprise provisioning: ${enterpriseProvisioning.status}`);
|
|
334
|
+
console.log(`Enterprise requested mode: ${enterpriseRequestedMode}`);
|
|
335
|
+
console.log(`Enterprise effective mode: ${enterpriseEffectiveMode}`);
|
|
336
|
+
console.log(`Enterprise local-mode exception accepted: ${localModeExceptionAccepted ? 'yes' : 'no'}`);
|
|
337
|
+
console.log(`Enterprise provisioning reason: ${enterpriseProvisioning.reason}`);
|
|
338
|
+
console.log(`Enterprise provisioning next action: ${enterpriseProvisioning.next_action}`);
|
|
339
|
+
for (const error of enterpriseProvisioning.validation_errors) {
|
|
340
|
+
console.log(`- ${error}`);
|
|
341
|
+
}
|
|
316
342
|
console.log(`DeepAgents preflight: ${preflight.status}`);
|
|
317
343
|
for (const reason of preflight.reasons) {
|
|
318
344
|
console.log(`- ${reason}`);
|
|
319
345
|
}
|
|
320
346
|
}
|
|
321
|
-
if (preflight.status === 'blocked' || redisReport.status === 'blocked') {
|
|
347
|
+
if (preflight.status === 'blocked' || redisReport.status === 'blocked' || enterpriseProvisioning.status === 'blocked') {
|
|
322
348
|
process.exitCode = 1;
|
|
323
349
|
}
|
|
324
350
|
});
|