atlas-workflow 0.9.2 → 0.9.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/README.md +18 -9
- package/VERSION +1 -1
- package/build/bump-version.mjs +6 -21
- package/build/cli/atlas-init.mjs +92 -5
- package/build/tests/etapa3.test.mjs +36 -6
- package/hosts/opencode/.opencode/atlas/VERSION +1 -1
- package/hosts/opencode/.opencode/atlas/orchestrator/README.md +15 -2
- package/hosts/opencode/.opencode/atlas/orchestrator/commands/workflow.md +7 -5
- package/hosts/opencode/.opencode/atlas/orchestrator/references/host-adapters.md +13 -12
- package/hosts/opencode/.opencode/atlas/orchestrator/references/subagent_dispatch.md +11 -1
- package/hosts/opencode/.opencode/atlas/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +32 -10
- package/hosts/opencode/.opencode/atlas/packages/mcp-server/README.md +2 -2
- package/hosts/opencode/.opencode/atlas/packages/mcp-server/package.json +1 -1
- package/hosts/opencode/.opencode/atlas/packages/mcp-server/server.js +149 -21
- package/hosts/opencode/.opencode/skills/_shared/references/stack-profiles.md +36 -0
- package/hosts/opencode/.opencode/skills/_shared/scripts/document_quality.mjs +37 -1
- package/hosts/opencode/.opencode/skills/atlas-audit/SKILL.md +201 -0
- package/hosts/opencode/.opencode/skills/atlas-audit/agents/openai.yaml +7 -0
- package/hosts/opencode/.opencode/skills/atlas-task-validator/SKILL.md +6 -0
- package/hosts/opencode/.opencode/skills/atlas-workflow-orchestrator/SKILL.md +32 -10
- package/hosts/pi/atlas/VERSION +1 -1
- package/hosts/pi/atlas/orchestrator/README.md +15 -2
- package/hosts/pi/atlas/orchestrator/commands/workflow.md +7 -5
- package/hosts/pi/atlas/orchestrator/references/host-adapters.md +13 -12
- package/hosts/pi/atlas/orchestrator/references/subagent_dispatch.md +11 -1
- package/hosts/pi/atlas/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +32 -10
- package/hosts/pi/atlas/packages/mcp-server/README.md +2 -2
- package/hosts/pi/atlas/packages/mcp-server/package.json +1 -1
- package/hosts/pi/atlas/packages/mcp-server/server.js +149 -21
- package/hosts/pi/skills/_shared/references/stack-profiles.md +36 -0
- package/hosts/pi/skills/_shared/scripts/document_quality.mjs +37 -1
- package/hosts/pi/skills/atlas-audit/SKILL.md +201 -0
- package/hosts/pi/skills/atlas-audit/agents/openai.yaml +7 -0
- package/hosts/pi/skills/atlas-task-validator/SKILL.md +6 -0
- package/hosts/pi/skills/atlas-workflow-orchestrator/SKILL.md +32 -10
- package/hosts/zcode/.zcode-plugin/plugin.json +27 -0
- package/hosts/zcode/agents/atlas-direct-execute.md +31 -0
- package/hosts/zcode/agents/atlas-findings-repair.md +39 -0
- package/hosts/zcode/agents/atlas-plan-execute.md +33 -0
- package/hosts/zcode/agents/atlas-slice-review.md +27 -0
- package/hosts/zcode/agents/atlas-task-validator.md +138 -0
- package/hosts/zcode/packages/mcp-server/README.md +29 -0
- package/hosts/zcode/packages/mcp-server/VERSION +1 -0
- package/hosts/zcode/packages/mcp-server/package.json +15 -0
- package/hosts/zcode/packages/mcp-server/server.js +3963 -0
- package/hosts/zcode/packages/orchestrator/README.md +283 -0
- package/hosts/zcode/packages/orchestrator/commands/workflow.md +39 -0
- package/hosts/zcode/packages/orchestrator/defaults/paths.md +21 -0
- package/hosts/zcode/packages/orchestrator/references/host-adapters.md +106 -0
- package/hosts/zcode/packages/orchestrator/references/qa_s13_matrix.md +141 -0
- package/hosts/zcode/packages/orchestrator/references/subagent_dispatch.md +52 -0
- package/hosts/zcode/packages/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +411 -0
- package/hosts/zcode/packages/templates/BACKLOG_MESTRE_TEMPLATE.md +855 -0
- package/hosts/zcode/packages/templates/BOUNDARY_PRD_PLAN.md +93 -0
- package/hosts/zcode/packages/templates/PERGUNTAS_EM_ABERTO_TEMPLATE.md +139 -0
- package/hosts/zcode/packages/templates/PLAN_TEMPLATE.md +146 -0
- package/hosts/zcode/packages/templates/PRD_TEMPLATE.md +150 -0
- package/hosts/zcode/packages/templates/STATE_FILE_SCHEMA.md +56 -0
- package/hosts/zcode/skills/_shared/references/stack-profiles.md +72 -0
- package/hosts/zcode/skills/_shared/scripts/document_quality.mjs +288 -0
- package/hosts/zcode/skills/atlas-audit/SKILL.md +201 -0
- package/hosts/zcode/skills/atlas-audit/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-backlog-generator/SKILL.md +93 -0
- package/hosts/zcode/skills/atlas-backlog-generator/agents/openai.yaml +4 -0
- package/hosts/zcode/skills/atlas-direct-execute/SKILL.md +221 -0
- package/hosts/zcode/skills/atlas-direct-execute/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-findings-repair/SKILL.md +158 -0
- package/hosts/zcode/skills/atlas-findings-repair/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-plan-execute/SKILL.md +175 -0
- package/hosts/zcode/skills/atlas-plan-execute/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-plan-execute/references/plan-contract.md +88 -0
- package/hosts/zcode/skills/atlas-plan-execute/references/quality-gates.md +60 -0
- package/hosts/zcode/skills/atlas-plan-execute/scripts/check_budget_state.py +96 -0
- package/hosts/zcode/skills/atlas-plan-execute/scripts/extract_plan_contract.py +191 -0
- package/hosts/zcode/skills/atlas-plan-execute/scripts/validate_gate_result.py +56 -0
- package/hosts/zcode/skills/atlas-plan-handoff/SKILL.md +183 -0
- package/hosts/zcode/skills/atlas-plan-handoff/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-prd-interview/SKILL.md +82 -0
- package/hosts/zcode/skills/atlas-prd-interview/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-slice-review/SKILL.md +156 -0
- package/hosts/zcode/skills/atlas-slice-review/agents/openai.yaml +4 -0
- package/hosts/zcode/skills/atlas-slice-review/references/review-contract.md +58 -0
- package/hosts/zcode/skills/atlas-slice-review/references/scenario-lenses.md +57 -0
- package/hosts/zcode/skills/atlas-slice-review/scripts/classify_findings.mjs +60 -0
- package/hosts/zcode/skills/atlas-slice-review/scripts/classify_findings.py +24 -0
- package/hosts/zcode/skills/atlas-slice-review/scripts/extract_review_slice.py +158 -0
- package/hosts/zcode/skills/atlas-sprint-prd-generator/SKILL.md +77 -0
- package/hosts/zcode/skills/atlas-sprint-prd-generator/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-task-validator/SKILL.md +179 -0
- package/hosts/zcode/skills/atlas-task-validator/agents/openai.yaml +7 -0
- package/hosts/zcode/skills/atlas-workflow-orchestrator/SKILL.md +411 -0
- package/package.json +1 -1
- package/plugins/atlas-workflow-orchestrator/.codex-plugin/plugin.json +5 -4
- package/plugins/atlas-workflow-orchestrator/VERSION +1 -1
- package/plugins/atlas-workflow-orchestrator/orchestrator/README.md +15 -2
- package/plugins/atlas-workflow-orchestrator/orchestrator/commands/workflow.md +7 -5
- package/plugins/atlas-workflow-orchestrator/orchestrator/references/host-adapters.md +13 -12
- package/plugins/atlas-workflow-orchestrator/orchestrator/references/subagent_dispatch.md +11 -1
- package/plugins/atlas-workflow-orchestrator/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +32 -10
- package/plugins/atlas-workflow-orchestrator/packages/mcp-server/README.md +2 -2
- package/plugins/atlas-workflow-orchestrator/packages/mcp-server/package.json +1 -1
- package/plugins/atlas-workflow-orchestrator/packages/mcp-server/server.js +149 -21
- package/plugins/atlas-workflow-orchestrator/packages/skills/_shared/references/stack-profiles.md +36 -0
- package/plugins/atlas-workflow-orchestrator/packages/skills/_shared/scripts/document_quality.mjs +37 -1
- package/plugins/atlas-workflow-orchestrator/packages/skills/atlas-audit/SKILL.md +201 -0
- package/plugins/atlas-workflow-orchestrator/packages/skills/atlas-audit/agents/openai.yaml +7 -0
- package/plugins/atlas-workflow-orchestrator/packages/skills/atlas-task-validator/SKILL.md +6 -0
- package/plugins/atlas-workflow-orchestrator/skills/_shared/references/stack-profiles.md +36 -0
- package/plugins/atlas-workflow-orchestrator/skills/_shared/scripts/document_quality.mjs +37 -1
- package/plugins/atlas-workflow-orchestrator/skills/atlas-audit/SKILL.md +201 -0
- package/plugins/atlas-workflow-orchestrator/skills/atlas-audit/agents/openai.yaml +7 -0
- package/plugins/atlas-workflow-orchestrator/skills/atlas-task-validator/SKILL.md +6 -0
- package/plugins/atlas-workflow-orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +32 -10
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atlas-sprint-prd-generator
|
|
3
|
+
description: Skill `atlas-sprint-prd-generator`. Use quando o usuário pedir para criar, gerar, montar ou atualizar um PRD de Sprint a partir de um sprint ID como S01/S02, usando o template de PRD e o backlog/roadmap real do repositório como fonte de escopo, dependências e fase-fonte.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Atlas Sprint PRD Generator
|
|
7
|
+
|
|
8
|
+
Gere PRDs de Sprint em PT-BR ancorados no backlog/roadmap real, no template canônico empacotado e no código real do repositório atual. Não invente contrato.
|
|
9
|
+
|
|
10
|
+
Todo PRD gerado por esta skill deve declarar explicitamente a cadeia de execução Atlas (`atlas-*`) para consumo posterior por `atlas-plan-handoff` e `atlas-plan-execute`.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Entrada Esperada
|
|
15
|
+
|
|
16
|
+
* Sprint ID: `S<NN>` (`S01`, `S02`, etc.).
|
|
17
|
+
* Opcional: app/projeto alvo quando houver mais de uma fonte de backlog/roadmap.
|
|
18
|
+
* Opcional: path de saída.
|
|
19
|
+
* Opcional: path explícito do backlog autoritativo. Quando fornecido, vence qualquer descoberta.
|
|
20
|
+
|
|
21
|
+
*Se faltar o Sprint ID, peça antes de gerar.*
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Workflow Obrigatório
|
|
26
|
+
|
|
27
|
+
1. **Localizar Insumos:** Descubra a raiz do repo com `git rev-parse --show-toplevel`. Localize o template canônico em `<raiz-do-plugin>/packages/templates/PRD_TEMPLATE.md`. Localize backlogs candidatos (`**/BACKLOG_MESTRE*.md`) sem escolher por heurística silenciosa.
|
|
28
|
+
2. **Fechar autoridade:** use `../_shared/scripts/document_quality.mjs#resolveSprintAuthority` com precedência fixa: path explícito → backlog canônico referenciado pelo artefato/input → único candidato contendo o Sprint ID. Zero match bloqueia. Múltiplos matches sem autoridade, mesmo com conteúdo parecido, bloqueiam com paths conflitantes e `next_action` para informar o path.
|
|
29
|
+
3. **Extração da Sprint:** leia somente a fonte autoritativa. Extraia fase-fonte, objetivo, dependências e filename do PRD; registre no PRD o path + anchor exato da linha/seção do backlog.
|
|
30
|
+
4. **Inspecionar Código:** Busque no codebase por contratos reais que influenciam a feature e registre anchors estáveis (`path:símbolo` ou `path:linha`) nas referências; não copie implementação para o PRD.
|
|
31
|
+
5. **Redação/atualização:** siga `PRD_TEMPLATE.md`. Ao atualizar, preserve IDs `D*`, decisões fechadas, anchors e histórico; novos IDs são append-only. Mudança deliberada em D* exige decisão explícita e registro histórico.
|
|
32
|
+
|
|
33
|
+
### Resolução Canônica de Templates
|
|
34
|
+
|
|
35
|
+
* Fonte única: `packages/templates/` empacotado no plugin Atlas Workflow.
|
|
36
|
+
* Resolver `PRD_TEMPLATE.md` a partir da raiz do plugin/bundle, antes de olhar qualquer arquivo do repo consumidor.
|
|
37
|
+
* Template local do repo consumidor nunca sobrepõe o template empacotado.
|
|
38
|
+
* Se `packages/templates/PRD_TEMPLATE.md` não existir, abortar com erro claro: `Template canônico ausente: PRD_TEMPLATE.md`.
|
|
39
|
+
* Não usar fallback silencioso para cópias antigas, vault local ou templates globais.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Metadados Atlas Obrigatórios
|
|
44
|
+
|
|
45
|
+
Todo PRD criado ou atualizado por esta skill deve incluir, perto do topo e sem substituir o template, o seguinte bloco de metadados:
|
|
46
|
+
|
|
47
|
+
```md
|
|
48
|
+
## Metadados de execução
|
|
49
|
+
- Plan prefix: `atlas`
|
|
50
|
+
- Target planner: `atlas-plan-handoff`
|
|
51
|
+
- Target executor: `atlas-plan-execute`
|
|
52
|
+
- Internal validator: `atlas-task-validator`
|
|
53
|
+
- External review: `atlas-slice-review` (optional)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Regras de Conteúdo
|
|
59
|
+
|
|
60
|
+
* **Status final:** `Aprovado para implementação`. Setar **automaticamente** ao finalizar a geração — é o status que o gate TC do orquestrador exige (`required_status=Aprovado para implementação`) para o PRD avançar no pipeline. Não deixar `Draft` (trava o gate e força correção manual). O sinal de determinismo que sustenta o avanço é o `atlas_scan_prd` (varredura de ambiguidade) + entrevista quando houver padrões bloqueantes — não o campo Status, que é marcador documental.
|
|
61
|
+
* **Data:** ISO `YYYY-MM-DD` (hoje).
|
|
62
|
+
* **Autoridade:** `Relacionado`/`Referências` inclui backlog autoritativo + anchor da sprint e anchors de código/contrato usados.
|
|
63
|
+
* **Escopo:** Lista fechada de capacidades funcionais.
|
|
64
|
+
* **UX:** Cobrir caminhos de `loading`, `empty`, `error`, `success` e `permission` sob a perspectiva do usuário.
|
|
65
|
+
* **Critérios de Aceite:** Binários e observáveis, divididos conforme `PRD_TEMPLATE.md` em: **Produto**, **UX**, **Dados** e **Regressão de produto**.
|
|
66
|
+
* **Proibições Estritas:**
|
|
67
|
+
* Não inventar schemas, RPCs, endpoints ou tabelas.
|
|
68
|
+
* Não misturar plano de implementação, classes Dart, imports, clean architecture ou comandos de terminal com o PRD. Seguir estritamente o `BOUNDARY_PRD_PLAN.md`.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Validação Mínima
|
|
73
|
+
|
|
74
|
+
Antes de salvar:
|
|
75
|
+
* Confirme que todas as seções do template estão presentes.
|
|
76
|
+
* Garanta que o bloco de `Metadados de execução` existe e está preenchido com `atlas`.
|
|
77
|
+
* Certifique-se de que não há nomes de classes de código ou arquivos Dart dentro do PRD.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Atlas Sprint PRD Generator"
|
|
3
|
+
short_description: "Gera PRDs de Sprint com prefixo atlas-*"
|
|
4
|
+
default_prompt: "Use $atlas-sprint-prd-generator para criar o PRD da sprint S01 com metadados de execução atlas-* a partir do backlog mestre e do PRD template reais."
|
|
5
|
+
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atlas-task-validator
|
|
3
|
+
description: Skill `atlas-task-validator`. Validador frio de slice executada por `atlas-plan-execute` ou `atlas-direct-execute`. Invocado como subagente obrigatório antes do relatório final. Recebe boundary da slice, contrato/plano, tasks executadas e compara código real vs contrato, retornando findings P0/P1/P2/P3 estruturados com evidência e veredito determinístico. Não corrige código. Não propõe diff.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> Registro de subagente: este validador é exposto como subagent real por registro nativo de cada host. A topologia é **sibling** em todos os hosts: o **orquestrador** despacha o validador (nunca o executor) após o executor retornar `state_path`, usando o verbo nativo de `atlas_capabilities.subagent_dispatch` (ex.: `spawn_agent(agent_type: "atlas-task-validator", items: [{ type: "text", text: "<state_path>" }])` no Codex), controlando o ciclo por `atlas_lock_validator` e, em caso de `fail`, chamando `atlas-findings-repair` antes do **2º e último** validator. Este validador nunca se re-despacha nem despacha outro subagente. Este `SKILL.md` documenta o contrato; o corpo do agente é o system prompt efetivo.
|
|
7
|
+
>
|
|
8
|
+
> **Manutenção (cross-host):** no host Claude o system prompt efetivo é `agents/atlas-task-validator.md`; no host Codex o custom agent `.codex/agents/atlas-task-validator.toml` é gerado do mesmo agente canônico. `agents/openai.yaml` é apenas metadata de skill/UI e não é fronteira de isolamento.
|
|
9
|
+
|
|
10
|
+
# Atlas Task Validator
|
|
11
|
+
|
|
12
|
+
Use this skill as an isolated sibling subagent dispatched by the **orchestrator** from the `state_path` the executor writes and returns (`validator_handoff_required`), after all tasks in a slice are implemented and locally gated. It is never invoked by the executor.
|
|
13
|
+
|
|
14
|
+
Purpose: perform a cold, structured validation pass of the delivered slice against the plan contract.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## State persistence
|
|
19
|
+
|
|
20
|
+
Use `atlas_run_state` as the primary source for run metadata and gate state. The `state_path` JSON is the slice boundary projection for validation, not a replacement for MCP state. If `atlas_run_state` is unavailable when required to confirm run state, return `verdict: "fail"` with a P1 finding instead of inferring status.
|
|
21
|
+
|
|
22
|
+
Before validation, derive `run_id` from `state_path`, call `atlas_run_state(action=get)`, and require an active `validator_recovery` whose `expected_state_path` matches the input. Copy `expected_dispatch_token` unchanged into the output. If correlation is unavailable, return `dispatch_token: null`, `verdict: "fail"`, and a P1 finding; never invent a token.
|
|
23
|
+
|
|
24
|
+
> **Proveniência do token (G4/R19) — quem lê o recovery é o validador, não o orquestrador.** É **este** subagente irmão que lê `validator_recovery` e ecoa `expected_dispatch_token` no próprio output. O orquestrador **nunca** preenche o token do `atlas_lock_validator(complete)` lendo o recovery por conta própria: ele só pode submeter o token que **este output** devolveu. O `validator_recovery` serve ao orquestrador para *reconhecer/descartar* retornos stale (`stale_discarded: true`), nunca para *fabricar* o token de um validador que não rodou.
|
|
25
|
+
|
|
26
|
+
## Invocation Contract
|
|
27
|
+
|
|
28
|
+
The subagent must receive only one base input: `state_path`.
|
|
29
|
+
|
|
30
|
+
Read the JSON file at `.atlas/state/<run_id>/<slice>.json` using the schema in `packages/templates/STATE_FILE_SCHEMA.md`. From that file, load:
|
|
31
|
+
|
|
32
|
+
1. **Slice boundary** — `files_changed` plus `diff_stat`.
|
|
33
|
+
2. **Plan path** — `plan_path`, then read Section 2 (Execution Invariants), Section 6 (Technical Contracts), and Section 8 (Validation and Checklist).
|
|
34
|
+
3. **Executed task ids** — `tasks`.
|
|
35
|
+
4. **Boundary refs** — `boundary_refs`.
|
|
36
|
+
5. **Explicit cold-review note** — you did not observe implementation; read current code only.
|
|
37
|
+
6. **Deterministic boundary** — `base_sha`, `head_sha`, `contract_kind`, and all evidence/probe arrays.
|
|
38
|
+
7. **Working-tree delta** — compare `worktree_baseline`/`worktree_final` and current tree; unchanged preexisting dirt stays outside, later mutations must be evidenced.
|
|
39
|
+
8. **Repair correlation** — on attempt 2, correlate every target finding id with `repair_evidence` in the same state path.
|
|
40
|
+
|
|
41
|
+
Do not accept inline contract, copied diff, or pasted task lists as the validation boundary. If `state_path` is missing, unreadable, or lacks any required field, return JSON with `verdict: "fail"` and one P1 finding for `Input insuficiente: <missing item>`.
|
|
42
|
+
|
|
43
|
+
Compatibilidade: state legado mínimo sem `contract_kind` só é aceito quando `executor_skill=atlas-plan-execute`; nesse caso o plano continua autoritativo. State de `atlas-direct-execute` exige extensão completa e `obligations` não vazio.
|
|
44
|
+
|
|
45
|
+
Antes de validar código, compare `base_sha...head_sha`, `HEAD`, snapshot final atual e delta `worktree_baseline→worktree_final` com `files_changed`/evidências. Não infira base pelo nome da branch. Divergência gera `boundary_violations` e finding P1 estruturado.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Resolução Canônica de Templates
|
|
50
|
+
|
|
51
|
+
* Fonte única: `packages/templates/` empacotado no plugin Atlas Workflow.
|
|
52
|
+
* Antes da validação, resolver `PLAN_TEMPLATE.md` e `BOUNDARY_PRD_PLAN.md` a partir da raiz do plugin/bundle.
|
|
53
|
+
* Template local do repo consumidor nunca sobrepõe o template empacotado.
|
|
54
|
+
* Se `packages/templates/PLAN_TEMPLATE.md` ou `packages/templates/BOUNDARY_PRD_PLAN.md` não existir, abortar com erro claro: `Template canônico ausente: <nome-do-template>`.
|
|
55
|
+
* Não usar fallback silencioso para cópias antigas, vault local ou templates globais.
|
|
56
|
+
|
|
57
|
+
## Conformidade de Template via MCP
|
|
58
|
+
|
|
59
|
+
* Para PRD ou PLAN validado como artefato documental da slice, consumir o resultado `atlas_verify_template_conformance`.
|
|
60
|
+
* Resultado `passed` com `pending_count: 0` é pré-condição para aceitar conformidade documental.
|
|
61
|
+
* Resultado ausente, `blocked` ou com pendências vira finding bloqueante contra o contrato da slice; citar categoria, pendência e `next_action`.
|
|
62
|
+
* Não recriar regra paralela em texto quando o MCP já retornou pendências rastreáveis no estado da run.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Mapeamento de Seções (PLAN_TEMPLATE compacto)
|
|
67
|
+
|
|
68
|
+
| Target Concept | PLAN Section |
|
|
69
|
+
|----------------|--------------|
|
|
70
|
+
| Executive translation, PRD link | Section 1 (Tradução executiva) |
|
|
71
|
+
| Execution invariants (`PRD §3` D* cited) | Section 2 (Invariantes de execução) |
|
|
72
|
+
| Pitfalls | Section 3 |
|
|
73
|
+
| Codebase state at opening | Section 4 (Estado na abertura da sprint) |
|
|
74
|
+
| Tasks, done criteria, local validation | Section 5 (Tarefas de execução) |
|
|
75
|
+
| Technical contracts | Section 6 (Contratos técnicos) |
|
|
76
|
+
| Execution slices | Section 7 (Slices) |
|
|
77
|
+
| Validator checklist | Section 8 (Validação e checklist) |
|
|
78
|
+
| Business acceptance when §8 is thin | **PRD §4–6** (from plan header PRD path) |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Operating Rules
|
|
83
|
+
|
|
84
|
+
1. **Read real code in the slice boundary.** Do not infer compliance from filenames or task titles.
|
|
85
|
+
2. **For each relevant Section 2 Invariant:** identify code evidence that satisfies or violates it.
|
|
86
|
+
3. **For each relevant Section 6 Contract:** verify signature, behavior, and returned shape where applicable.
|
|
87
|
+
4. **For each relevant Section 8 checklist item:** mark it pass or fail with evidence.
|
|
88
|
+
5. **Perform cross-task checks** for shared state, missing required args, route order, partial failure handling, and UI/backend permission mismatch.
|
|
89
|
+
6. **Aplique baseline + perfis ativos** abaixo. Resolva os perfis por manifests/comandos reais conforme `../_shared/references/stack-profiles.md`; não invente critérios fora do plano, baseline e perfis ativos.
|
|
90
|
+
7. **Do not patch files or propose diffs.** Suggested fix must fit in 1-2 lines of text.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Baseline universal + perfis
|
|
95
|
+
|
|
96
|
+
Fonte compartilhada: `../_shared/references/stack-profiles.md`. Execute `detectStackProfiles(project_root, declared_commands, boundary_paths)` de `../_shared/scripts/document_quality.mjs`; aplique cada entrada de `boundaries` somente aos arquivos daquele package.
|
|
97
|
+
|
|
98
|
+
Sempre aplique baseline universal: segurança/permissões, boundary/contratos, erros/falhas parciais, concorrência/reentrada, cleanup/estado stale, integridade de dados/input e checks realmente declarados.
|
|
99
|
+
|
|
100
|
+
Ative regras específicas somente quando o perfil retornar `true`:
|
|
101
|
+
|
|
102
|
+
- `flutter_dart`: lifecycle Flutter, rotas/args, null-safety/casts, l10n, analyze/test; GetX somente se dependência/import/regra real confirmar GetX.
|
|
103
|
+
- `node_typescript`: handles/promises, validação runtime, ESM/CJS/exports/tipos e scripts Node reais.
|
|
104
|
+
- `python`: context managers/cleanup, exceções/async, typing/parsing e ferramentas Python declaradas.
|
|
105
|
+
- `go`: context/cancelamento, goroutines, erros retornados, data race e comandos Go declarados.
|
|
106
|
+
- `rust`: `Result`/`Option`, ownership/lifetime, unwrap em fronteiras recuperáveis e comandos Cargo declarados.
|
|
107
|
+
- `java_kotlin`: nullability, exceptions, resource cleanup, threads/coroutines e Maven/Gradle declarados.
|
|
108
|
+
- `firebase`: rules/claims/authz, paths/ownership, listeners e emuladores/checks declarados.
|
|
109
|
+
- `supabase`: RLS/auth claims, schema/migrations, RPC/Edge Functions, storage policies e checks declarados.
|
|
110
|
+
- `rest_openapi`: request/response, status codes, paginação, erros, idempotência e contrato OpenAPI quando presente.
|
|
111
|
+
|
|
112
|
+
Monorepo pode ativar múltiplos perfis, sempre restritos ao boundary correspondente. Fixture Node sem sinal Flutter não recebe regra Flutter/GetX.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Output contract
|
|
117
|
+
|
|
118
|
+
Return strict JSON as the final output. Do not wrap it in Markdown and do not prepend prose.
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"dispatch_token": 1,
|
|
123
|
+
"challenge_response": "string (sha256 hex do challenge.file; null se sem challenge)",
|
|
124
|
+
"verdict": "pass | fail | pass_with_observations",
|
|
125
|
+
"findings": [
|
|
126
|
+
{
|
|
127
|
+
"id": "F-001",
|
|
128
|
+
"severity": "P0|P1|P2|P3",
|
|
129
|
+
"file": "string",
|
|
130
|
+
"line": 1,
|
|
131
|
+
"failure_mode": "string",
|
|
132
|
+
"evidence": "string",
|
|
133
|
+
"recommendation": "string",
|
|
134
|
+
"fix_validation": "string",
|
|
135
|
+
"msg": "string (deprecated; derivado por uma release)"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"observations": [
|
|
139
|
+
{
|
|
140
|
+
"file": "string",
|
|
141
|
+
"line": 0,
|
|
142
|
+
"msg": "string"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"boundary_violations": [
|
|
146
|
+
{
|
|
147
|
+
"file": "string",
|
|
148
|
+
"reason": "string"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
`dispatch_token` must equal `validator_recovery.expected_dispatch_token`. `findings`, `observations`, and `boundary_violations` must always be arrays. Use empty arrays when there are no items.
|
|
155
|
+
|
|
156
|
+
IDs são únicos, obrigatórios no formato `F-NNN` e estáveis nos dois ciclos. Severity é estritamente `P0|P1|P2|P3`. No segundo ciclo, confirme por ID que `repair_evidence` registra arquivos, checks e `status: resolved`; finding não correlacionado permanece P1. O MCP rejeita shape incompleto e `pass`/`pass_with_observations` quando há P0/P1.
|
|
157
|
+
|
|
158
|
+
**Proof-of-work (`challenge_response`).** If `validator_recovery.challenge` is not `null`, it carries `{ file, algo: "sha256" }` — a boundary file you must have read access to. Compute the sha256 of that file's raw bytes (`shasum -a 256 "<challenge.file>"`) and return the hex (first token) in `challenge_response`. If `challenge` is `null`, return `null`. Never fabricate the hash: the orchestrator recomputes it from disk and blocks the slice (`challenge_failed`) on mismatch. This is a *mechanical* attestation that the verdict touched real boundary bytes — it closes the laziest bypass (claiming `pass` with no read at all); it does **not** by itself prove you read and understood the code (hashing a file does not require loading its content). Reading the boundary remains your obligation. It is not a non-forgeable isolation proof either (the MCP shares one stdio caller). Challenge failures are bounded per attempt: past the cap the slot closes terminally (`challenge_exhausted`), which usually signals path resolution diverging from the consumer root.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Severity Model
|
|
163
|
+
|
|
164
|
+
Escala alinhada com `atlas-slice-review` (`P0/P1/P2/P3`).
|
|
165
|
+
|
|
166
|
+
* `P0`: blocker — falha de segurança, perda/corrupção de dado, build quebrado, ou mutação sensível que chega à produção sem enforcement server-side.
|
|
167
|
+
* `P1`: broken primary flow, critical Section 2 invariant violation, invalid required id/context.
|
|
168
|
+
* `P2`: scenario gap, state lifecycle leak, missing mitigation on a meaningful failure path.
|
|
169
|
+
* `P3`: lower-risk inconsistency, cleanup-worthy issue.
|
|
170
|
+
|
|
171
|
+
## Verdict Rule (determinística)
|
|
172
|
+
|
|
173
|
+
Mapeie findings -> veredito **mecanicamente**, nunca por percepção:
|
|
174
|
+
|
|
175
|
+
* Qualquer finding `P0` **ou** `P1` em `findings` -> `verdict: "fail"`. Sem exceção.
|
|
176
|
+
* Sem `P0`/`P1`, mas um ou mais `P2` -> `verdict: "pass_with_observations"`.
|
|
177
|
+
* Só `P3` (ou zero findings) -> `verdict: "pass"`.
|
|
178
|
+
|
|
179
|
+
`P0`/`P1` no array `findings` com `verdict: "pass"` ou `"pass_with_observations"` é **output inválido**. Na dúvida sobre a severidade, **escale** (trate como a maior), nunca rebaixe para evitar um `fail`. Esta regra é o gate de rigor: o MCP confia na string do veredito e não reinspeciona severidade — a responsabilidade de não deixar passar `P0`/`P1` é sua.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Atlas Task Validator"
|
|
3
|
+
short_description: "Cold internal slice validator for atlas-plan-execute"
|
|
4
|
+
default_prompt: "Use $atlas-task-validator to validate the executed plan slice against the plan contract and return structured findings with a deterministic verdict."
|
|
5
|
+
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: true
|