atlas-workflow 0.8.2 → 0.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 (36) hide show
  1. package/README.md +2 -2
  2. package/VERSION +1 -1
  3. package/build/bump-version.mjs +74 -0
  4. package/hosts/opencode/.opencode/atlas/VERSION +1 -1
  5. package/hosts/opencode/.opencode/atlas/orchestrator/README.md +9 -2
  6. package/hosts/opencode/.opencode/atlas/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +4 -3
  7. package/hosts/opencode/.opencode/atlas/packages/mcp-server/README.md +3 -2
  8. package/hosts/opencode/.opencode/atlas/packages/mcp-server/package.json +1 -1
  9. package/hosts/opencode/.opencode/atlas/packages/mcp-server/server.js +297 -4
  10. package/hosts/opencode/.opencode/skills/atlas-direct-execute/SKILL.md +31 -0
  11. package/hosts/opencode/.opencode/skills/atlas-plan-execute/SKILL.md +32 -0
  12. package/hosts/opencode/.opencode/skills/atlas-workflow-orchestrator/SKILL.md +4 -3
  13. package/hosts/pi/.pi/agents/atlas-direct-execute.md +31 -0
  14. package/hosts/pi/.pi/agents/atlas-plan-execute.md +32 -0
  15. package/hosts/pi/atlas/VERSION +1 -1
  16. package/hosts/pi/atlas/orchestrator/README.md +9 -2
  17. package/hosts/pi/atlas/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +4 -3
  18. package/hosts/pi/atlas/packages/mcp-server/README.md +3 -2
  19. package/hosts/pi/atlas/packages/mcp-server/package.json +1 -1
  20. package/hosts/pi/atlas/packages/mcp-server/server.js +297 -4
  21. package/hosts/pi/skills/atlas-direct-execute/SKILL.md +31 -0
  22. package/hosts/pi/skills/atlas-plan-execute/SKILL.md +32 -0
  23. package/hosts/pi/skills/atlas-workflow-orchestrator/SKILL.md +4 -3
  24. package/package.json +1 -1
  25. package/plugins/atlas-workflow-orchestrator/.codex-plugin/plugin.json +1 -1
  26. package/plugins/atlas-workflow-orchestrator/VERSION +1 -1
  27. package/plugins/atlas-workflow-orchestrator/orchestrator/README.md +9 -2
  28. package/plugins/atlas-workflow-orchestrator/orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +4 -3
  29. package/plugins/atlas-workflow-orchestrator/packages/mcp-server/README.md +3 -2
  30. package/plugins/atlas-workflow-orchestrator/packages/mcp-server/package.json +1 -1
  31. package/plugins/atlas-workflow-orchestrator/packages/mcp-server/server.js +297 -4
  32. package/plugins/atlas-workflow-orchestrator/packages/skills/atlas-direct-execute/SKILL.md +31 -0
  33. package/plugins/atlas-workflow-orchestrator/packages/skills/atlas-plan-execute/SKILL.md +32 -0
  34. package/plugins/atlas-workflow-orchestrator/skills/atlas-direct-execute/SKILL.md +31 -0
  35. package/plugins/atlas-workflow-orchestrator/skills/atlas-plan-execute/SKILL.md +32 -0
  36. package/plugins/atlas-workflow-orchestrator/skills/atlas-workflow-orchestrator/SKILL.md +4 -3
@@ -22,6 +22,29 @@ Operate as a bounded state machine:
22
22
 
23
23
  Use `atlas_run_state` as the primary source of run state. Do not read or write run ledger files directly. If the MCP is unavailable, report the gate as unprovable and abort instead of continuing with a silent file fallback.
24
24
 
25
+ ## Executor liveness checkpoints
26
+
27
+ Depois de carregar esta skill e antes de qualquer discovery longo, emita um checkpoint MCP:
28
+
29
+ ```json
30
+ atlas_lock_dispatch({
31
+ "action": "checkpoint",
32
+ "phase": "plan_execute",
33
+ "event": "executor_started"
34
+ })
35
+ ```
36
+
37
+ Em seguida, emita checkpoints materiais conforme avança:
38
+
39
+ - `skill_loaded` — skill carregada e contrato reconhecido.
40
+ - `plan_loaded` — plano/PRD de entrada lido.
41
+ - `handoff_accepted` — `plan_path`, `state_path` alvo, boundary e tasks aceitos.
42
+ - `task_started` — primeira task começou.
43
+ - `first_write` — primeira mutação de workspace feita.
44
+ - `state_path_created` — state file escrito antes de devolver `validator_handoff_required`.
45
+
46
+ Se não conseguir emitir checkpoint por MCP, retorne `blocked`: liveness não é comprovável. Não fique em discovery/preflight interno sem checkpoint. O orquestrador trata ausência de checkpoint como `stalled` via Gate G12.
47
+
25
48
  ## Plan path resolution
26
49
 
27
50
  Resolve plan paths in this order:
@@ -55,6 +78,8 @@ Esta skill aceita entrada pelo modo `execute` do orquestrador: um `PLAN_*.md` pr
55
78
  ## Required Workflow
56
79
 
57
80
  ### 1. Load the plan as an execution contract
81
+ First, emit `executor_started`, then `skill_loaded`, before doing any long scan.
82
+
58
83
  Read the `atlas-plan-handoff` artifact. Extract at minimum:
59
84
  * **Execution metadata**: Prefix, mode, and validator options.
60
85
  * **Executive translation and PRD links** (from Section 1 — include path to PRD; cite `PRD §3` D* IDs, do not paste the full D* table).
@@ -72,12 +97,16 @@ If optional Section 9 (open questions / real blockers — **not** PRD §7 Apênd
72
97
 
73
98
  When Section 8 checklist is thin, read **PRD §4–6** from the PRD path in the plan header for business acceptance.
74
99
 
100
+ After the plan is loaded, emit `plan_loaded`. After validating the execution boundary and `state_path` target, emit `handoff_accepted`.
101
+
75
102
  ### 2. Create a task-scoped execution contract
76
103
  Before editing code, write a short task contract for the current task only (objective, files, invariants, local checks, and repair budget).
77
104
 
78
105
  ### 3. Implement in the smallest coherent slice
79
106
  Do not implement the entire feature before validating anything. Prefer one task at a time. Follow closed decisions from the plan.
80
107
 
108
+ Before the first concrete task, emit `task_started`. After the first workspace mutation, emit `first_write`.
109
+
81
110
  ### 4. Run a focused quality gate after each task slice
82
111
  Run only the checks that are relevant to the current diff and task risks (linter, analyze of the affected package, or tests).
83
112
 
@@ -113,6 +142,9 @@ Create `.atlas/state/<run_id>/<slice>.json` following `packages/templates/STATE_
113
142
 
114
143
  Validation is always **sibling**, on every host. The validator is registered as a real subagent on every host, but this executor **never** dispatches it and never validates its own work. After tasks and local gates pass and the state file is written, this executor **stops mutation** and returns `validator_handoff_required` with the `state_path`. The orchestrator dispatches `atlas-task-validator` as the next isolated sibling phase, locks it via `atlas_lock_validator`, and — if the verdict is `fail` — dispatches `atlas-findings-repair` (not this executor) before the **2nd and last** validator.
115
144
 
145
+ After writing the state file and before returning, emit `state_path_created` with the same `state_path`.
146
+ Without this exact checkpoint, `atlas_lock_validator(start)` blocks in G12 and the orchestrator cannot dispatch the cold validator.
147
+
116
148
  The only handoff input is `state_path`. Do not paste the contract, diff, or task list inline. The validator reads everything it needs from the state file and the plan it points to. (`atlas_capabilities` is the runtime source of truth for the dispatch mechanism the orchestrator uses — see `references/host-adapters.md`.)
117
149
 
118
150
  **Finish all local work before the handoff — then stop idle.** Finish every local gate (lint, analyze, tests, `git diff --check`, diff-stat) and write the state file **before** returning the handoff. After returning `validator_handoff_required`, the executor must not mutate anything: the orchestrator now owns the slice, and any mutation here would change what the sibling validator reads and breaks determinism (same failure class as the orchestrator's G9).
@@ -177,6 +177,7 @@ Regras inegociáveis. Violação = parar, não contornar.
177
177
  | TC | **Conformidade de template via MCP.** PRD e PLAN só avançam como artefatos documentais se `atlas_verify_template_conformance` retornar `passed` e `pending_count: 0`. Pendência bloqueia com `next_action`. | PRD + plano |
178
178
  | G6 | **Status verificado, não auto-reportado.** O ✅ de cada item no output só pode ser marcado após confirmar o artefato em disco. Faltou artefato exigido pelo modo → status final `incomplete`, nunca `completed`. | output |
179
179
  | G7 | **Execução de código roda SEMPRE como sub-agent despachado (verbo nativo do host, lido de `atlas_capabilities`), nunca no contexto do orquestrador.** A **autoria** do `PLAN_*.md` pode ser feita pelo orquestrador no fio principal **enquanto o plano não foi validado** (autoria documental, PRD D10) — mas o plano só vira confiável após `atlas_verify_artifact` + TC `passed`. A **execução do plano** (`plan_execute`) e qualquer mutação de código vão obrigatoriamente a sub-agent. Antes de iniciar/concluir fase de execução, usar `atlas_lock_dispatch`; fase fora de ordem ou paralela bloqueia. Depois do plano validado, o orquestrador não edita mais o plano (mãos atadas fortes). | plano + execução |
180
+ | G12 | **Executor vivo precisa provar progresso.** Ao iniciar `plan_execute`, `atlas_lock_dispatch(start)` cria liveness de bootstrap/progresso. O executor precisa emitir `atlas_lock_dispatch(checkpoint, phase=plan_execute, event=...)` cedo, começando por `executor_started`/`skill_loaded`, depois `plan_loaded`, `handoff_accepted`, `task_started`, `first_write` e `state_path_created` conforme avança. `state_path_created` exige `state_path` legível/parseável, e `atlas_lock_validator(start)` só abre validator se o último checkpoint for `state_path_created` para exatamente o mesmo `state_path`. Se o sub-agent não retornar, travar, ficar sem primeiro checkpoint, ou ficar com checkpoint antigo sem avanço, o orquestrador chama `atlas_lock_dispatch(action=status, phase=plan_execute)`: `executor_bootstrap_timeout`/`executor_progress_timeout` viram `stalled`, o lock é liberado para `retry_plan_execute`, e a execução não pode ser declarada completa. Sem checkpoint/progresso não há "em andamento" confiável. | execução |
180
181
  | G8 | **Ordem fixa de validação: `task-validator` ANTES, `slice-review` POR ÚLTIMO. Nunca em paralelo.** Conclusão de `plan_execute` usa `atlas_lock_dispatch` com `validator_status: passed`; review só inicia após execução concluída. | validação + review |
181
182
  | PREREQ | **Pré-requisitos de determinismo (hard-fail, DEC-004).** `atlas_preflight` verifica, **antes de tudo**, se o host tem subagente + MCP (essenciais). Ausente (ex.: pi sem `pi-mcp-adapter`/`pi-subagents`, host MCP-only sem subagente) → aborta em `ready` com `missing_prerequisites`/`next_action`. Sem degradação, sem validator inline, qualquer tamanho. `todo` não-essencial segue sem mirror. | roteamento |
182
183
  | DEP | **Dependência de backlog não satisfeita = hard-fail determinístico.** Se o input é `backlog-item` e o item declara `Dependências` (ex.: S40 dep S39) cujo status, lido no mesmo backlog/registro de onde o item veio, **não** é `done`, abortar em `ready` com `unmet_dependencies`, causa e `next_action` (executar a dependência primeiro). Sem improviso e sem pergunta: ou a dep está `done` e segue, ou bloqueia com causa. Não confundir com decisão em aberto (que não bloqueia). | roteamento (backlog-item) |
@@ -199,7 +200,7 @@ Artefatos esperados (em ordem): `PRD_*.md` → (`PRD_*.md` atualizado) → `PLAN
199
200
  5. **Plan** — `atlas_lock_dispatch(action=start, phase=plan_handoff)`, carregar/invocar `plan_handoff` no fio principal para redigir `PLAN_*.md`, depois chamar `atlas_verify_artifact` e `atlas_verify_template_conformance(artifact_type=plan)`. Concluir a fase com `atlas_lock_dispatch(action=complete, phase=plan_handoff)`. **Nenhuma linha de código pode ter sido escrita até aqui.**
200
201
  - **G11:** se `PLAN_*.md` foi validado, chamar `atlas_assert_after_plan`. Se a próxima ação não for `dispatch_plan_execute_blocking`, abortar.
201
202
  6. **Validate plan** — se há gaps → dispara entrevista, propaga e continua (ver "Decisão em aberto ≠ parada"). Não para pra pedir permissão.
202
- 7. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`, despachar `plan_execute` como sub-agent lendo o `PLAN_*.md`. O executor retorna `validator_handoff_required` com `state_path`; o orquestrador abre um slot via `atlas_lock_validator(action=start)`, despacha **um** `task_validator`, exige no output o `dispatch_token` do slot e fecha com `validator_run_id` + `dispatch_token`. Se o veredito for `fail`, chama `repair_start`, despacha `atlas-findings-repair` com `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}`, exige atualização do mesmo `state_path`, fecha com `repair_run_id` e só então roda o **2º e último** validator. Ao obter `passed` ou `passed_with_observations`, conclui `plan_execute` com o terminal. Status diferente bloqueia review e output completed.
203
+ 7. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`, despachar `plan_execute` como sub-agent lendo o `PLAN_*.md`. O executor precisa emitir checkpoints G12; se o dispatch não retornar ou não produzir primeiro checkpoint/progresso, chamar `atlas_lock_dispatch(action=status, phase=plan_execute)` e tratar `executor_bootstrap_timeout`/`executor_progress_timeout` como `stalled`/retry, nunca como execução em andamento. O executor retorna `validator_handoff_required` com `state_path`; antes de abrir validator, o MCP exige checkpoint `state_path_created` para esse mesmo `state_path`. O orquestrador abre um slot via `atlas_lock_validator(action=start)`, despacha **um** `task_validator`, exige no output o `dispatch_token` do slot e fecha com `validator_run_id` + `dispatch_token`. Se o veredito for `fail`, chama `repair_start`, despacha `atlas-findings-repair` com `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}`, exige atualização do mesmo `state_path`, fecha com `repair_run_id` e só então roda o **2º e último** validator. Ao obter `passed` ou `passed_with_observations`, conclui `plan_execute` com o terminal. Status diferente bloqueia review e output completed.
203
204
  8. **Review (condicional)** — somente após execução concluída e se `--review` → `atlas_lock_dispatch(action=start, phase=slice_review)`, despachar `slice_review`, depois `atlas_lock_dispatch(action=complete, phase=slice_review)`.
204
205
  9. **Output** — ledger verificado com fonte MCP por gate/fase (ver "Output") + próximos passos.
205
206
 
@@ -209,7 +210,7 @@ Artefatos esperados: `PRD_*.md` → (atualizado) → diff de código → relató
209
210
 
210
211
  1. Parse / Generate PRD (se necessário) + `atlas_verify_artifact`.
211
212
  2. Validate PRD → `atlas_scan_prd` + `atlas_verify_template_conformance`; entrevista condicional reexecuta os gates.
212
- 3. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking a partir do PRD. O executor retorna `validator_handoff_required` com `state_path`; o orquestrador abre o slot, despacha o validator e fecha usando `validator_run_id` + `dispatch_token`. Em `fail`, abre repair, passa `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}` ao `atlas-findings-repair`, mantém o mesmo `state_path`, fecha o repair e roda o **2º e último** validator. `passed` e `passed_with_observations` são terminais aprovados.
213
+ 3. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking a partir do PRD. Exigir checkpoints G12; sem retorno/progresso, chamar `atlas_lock_dispatch(action=status, phase=plan_execute)` e bloquear/retry em `executor_bootstrap_timeout`/`executor_progress_timeout`. O executor retorna `validator_handoff_required` com `state_path`; o MCP abre o slot após `state_path_created` para o mesmo `state_path`; então o orquestrador despacha o validator e fecha usando `validator_run_id` + `dispatch_token`. Em `fail`, abre repair, passa `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}` ao `atlas-findings-repair`, mantém o mesmo `state_path`, fecha o repair e roda o **2º e último** validator. `passed` e `passed_with_observations` são terminais aprovados.
213
214
  4. Review (condicional) — só após executor retornar 100% e dispatch MCP permitir.
214
215
  5. Output (ledger verificado).
215
216
 
@@ -221,7 +222,7 @@ Entrada: um **`PLAN_*.md` pronto**. Artefatos esperados: (plano já existe) →
221
222
 
222
223
  1. **Parse / classify** — `atlas_ping` → `atlas_capabilities` → **`atlas_classify_input`** no input (PRD D3/D6: o tipo é fato e precisa ser conhecido antes de travar o modo) → **`atlas_preflight(<modo efetivo>)`** (PREREQ hard-fail intacto). A classificação determina o tipo: se for plano, o modo efetivo é `execute` e o preflight trava `execute`; se o input não for plano, auto-rotear (ver Fase 0, passo 2b) e o preflight trava o modo roteado. **`classify_input` sempre precede `preflight`** (o preflight trava o modo efetivo, não o pedido).
223
224
  2. **Reverificar o plano na entrada** — `atlas_verify_artifact` no `PLAN_*.md` (G1) + `atlas_verify_template_conformance(artifact_type=plan)` (TC). Plano velho/manual/inválido **trava aqui** com `next_action` em linguagem de produto (PRD D11 — "autoria é livre, execução é gateada"). Sem reverificação válida não há dispatch.
224
- 3. **Executar** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking lendo o `PLAN_*.md`. A validação é sempre **sibling**: o executor escreve `state_path` e para; o orquestrador despacha o validator via `atlas_lock_validator` e fecha o slot somente com `validator_run_id` + `dispatch_token`. Ao obter `passed` ou `passed_with_observations`, concluir `plan_execute` com o terminal correspondente. `plan_execute` é aceito como **primeira fase** em `execute` (sem fase nova; PRD D13).
225
+ 3. **Executar** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking lendo o `PLAN_*.md`. Exigir checkpoints G12; se o executor não devolver retorno/progresso, chamar `atlas_lock_dispatch(action=status, phase=plan_execute)` e bloquear/retry em `executor_bootstrap_timeout`/`executor_progress_timeout`. A validação é sempre **sibling**: o executor escreve `state_path`, emite `state_path_created` e para; o MCP só abre validator para esse mesmo `state_path`; o orquestrador despacha o validator via `atlas_lock_validator` e fecha o slot somente com `validator_run_id` + `dispatch_token`. Ao obter `passed` ou `passed_with_observations`, concluir `plan_execute` com o terminal correspondente. `plan_execute` é aceito como **primeira fase** em `execute` (sem fase nova; PRD D13).
225
226
  4. **Review (condicional)** — só após execução concluída e se `--review` → `atlas_lock_dispatch(action=start, phase=slice_review)`, despachar `slice_review`, depois `complete`.
226
227
  5. **Output** — ledger verificado; `guarantee_level` = `full_pipeline` (PRD D12).
227
228
 
@@ -43,6 +43,29 @@ Execute directly from a PRD/spec/task while preserving execution quality: explic
43
43
 
44
44
  This is not planless execution. Replace the visible markdown plan with a compact operational contract held in the current turn and passed to validation.
45
45
 
46
+ ## Executor liveness checkpoints
47
+
48
+ Depois de carregar esta skill e antes de qualquer discovery longo, emita um checkpoint MCP:
49
+
50
+ ```json
51
+ atlas_lock_dispatch({
52
+ "action": "checkpoint",
53
+ "phase": "plan_execute",
54
+ "event": "executor_started"
55
+ })
56
+ ```
57
+
58
+ Em seguida, emita checkpoints materiais conforme avança:
59
+
60
+ - `skill_loaded` — skill carregada e contrato reconhecido.
61
+ - `plan_loaded` — PRD/spec/task de entrada lido.
62
+ - `handoff_accepted` — boundary, obligations, `state_path` alvo e contrato direto aceitos.
63
+ - `task_started` — primeira task começou.
64
+ - `first_write` — primeira mutação de workspace feita.
65
+ - `state_path_created` — state file escrito antes de devolver `validator_handoff_required`.
66
+
67
+ Se não conseguir emitir checkpoint por MCP, retorne `blocked`: liveness não é comprovável. Sem `state_path_created` com o mesmo `state_path`, `atlas_lock_validator(start)` bloqueia em G12 e o orquestrador não pode despachar o validador frio.
68
+
46
69
  ## Use Criteria
47
70
 
48
71
  Use when all are true:
@@ -72,6 +95,8 @@ Ask at most 1-3 blocking questions only when a reasonable assumption could chang
72
95
 
73
96
  ### 1. Load inputs
74
97
 
98
+ First, emit `executor_started`, then `skill_loaded`, before doing any long scan.
99
+
75
100
  Read the user-provided PRD/spec/task and any directly referenced files needed to resolve scope. If the input names repo artifacts, verify those artifacts exist before editing.
76
101
 
77
102
  Extract only execution-relevant items:
@@ -89,6 +114,8 @@ Extract only execution-relevant items:
89
114
 
90
115
  If the PRD references another PRD or code contract as dependency, inspect enough to confirm the dependency shape and required bridge. Do not satisfy a dependency by creating parallel synthetic contracts unless the PRD explicitly allows it.
91
116
 
117
+ After the input is loaded, emit `plan_loaded`. After validating the execution boundary, obligations, and `state_path` target, emit `handoff_accepted`.
118
+
92
119
  ### 2. Build Compact Execution Contract
93
120
 
94
121
  Before editing, write a compact contract in the working response or internal task state. Size follows complexity: terse for simple tasks, denser only where needed to preserve scope, invariants, and validator quality.
@@ -154,6 +181,8 @@ For each task, keep a tiny task contract:
154
181
 
155
182
  Do not widen scope for opportunistic cleanup.
156
183
 
184
+ Before the first concrete task, emit `task_started`. After the first workspace mutation, emit `first_write`.
185
+
157
186
  ### 4. Gate each task
158
187
 
159
188
  Run focused checks appropriate to the diff:
@@ -180,6 +209,8 @@ For direct execution, the state file is still the only validator input. Use the
180
209
 
181
210
  The state file is the only validator input. Validation is always **sibling**, on every host: this executor **never** dispatches `atlas-task-validator` itself and never validates its own work in the same context. After tasks and local gates pass and the state file is written, this executor **stops mutation** and returns `validator_handoff_required` with the `state_path`. The orchestrator then dispatches `atlas-task-validator` as the next isolated sibling phase, locks it via `atlas_lock_validator`, and — if the verdict is `fail` — dispatches `atlas-findings-repair` (not this executor) before the **2nd and last** validator.
182
211
 
212
+ After writing the state file and before returning, emit `state_path_created` with the same `state_path`.
213
+
183
214
  Do not paste the compact contract, diff, obligation ledger, local checks, or closure analysis packet into the state file's handoff. Those belong in the state file and referenced artifacts.
184
215
 
185
216
  **Finish all local work before the handoff — then stop idle.** Finish every local gate (lint, analyze, tests, `git diff --check`, diff-stat) and write the state file **before** returning the handoff. After returning `validator_handoff_required`, do nothing: no diff hygiene checks, no extra reads, no opportunistic edits, no parallel work. The orchestrator now owns the slice; any mutation here would change what the sibling validator reads and breaks determinism (same failure class as the orchestrator's G9).
@@ -56,6 +56,29 @@ Operate as a bounded state machine:
56
56
 
57
57
  Use `atlas_run_state` as the primary source of run state. Do not read or write run ledger files directly. If the MCP is unavailable, report the gate as unprovable and abort instead of continuing with a silent file fallback.
58
58
 
59
+ ## Executor liveness checkpoints
60
+
61
+ Depois de carregar esta skill e antes de qualquer discovery longo, emita um checkpoint MCP:
62
+
63
+ ```json
64
+ atlas_lock_dispatch({
65
+ "action": "checkpoint",
66
+ "phase": "plan_execute",
67
+ "event": "executor_started"
68
+ })
69
+ ```
70
+
71
+ Em seguida, emita checkpoints materiais conforme avança:
72
+
73
+ - `skill_loaded` — skill carregada e contrato reconhecido.
74
+ - `plan_loaded` — plano/PRD de entrada lido.
75
+ - `handoff_accepted` — `plan_path`, `state_path` alvo, boundary e tasks aceitos.
76
+ - `task_started` — primeira task começou.
77
+ - `first_write` — primeira mutação de workspace feita.
78
+ - `state_path_created` — state file escrito antes de devolver `validator_handoff_required`.
79
+
80
+ Se não conseguir emitir checkpoint por MCP, retorne `blocked`: liveness não é comprovável. Não fique em discovery/preflight interno sem checkpoint. O orquestrador trata ausência de checkpoint como `stalled` via Gate G12.
81
+
59
82
  ## Plan path resolution
60
83
 
61
84
  Resolve plan paths in this order:
@@ -89,6 +112,8 @@ Esta skill aceita entrada pelo modo `execute` do orquestrador: um `PLAN_*.md` pr
89
112
  ## Required Workflow
90
113
 
91
114
  ### 1. Load the plan as an execution contract
115
+ First, emit `executor_started`, then `skill_loaded`, before doing any long scan.
116
+
92
117
  Read the `atlas-plan-handoff` artifact. Extract at minimum:
93
118
  * **Execution metadata**: Prefix, mode, and validator options.
94
119
  * **Executive translation and PRD links** (from Section 1 — include path to PRD; cite `PRD §3` D* IDs, do not paste the full D* table).
@@ -106,12 +131,16 @@ If optional Section 9 (open questions / real blockers — **not** PRD §7 Apênd
106
131
 
107
132
  When Section 8 checklist is thin, read **PRD §4–6** from the PRD path in the plan header for business acceptance.
108
133
 
134
+ After the plan is loaded, emit `plan_loaded`. After validating the execution boundary and `state_path` target, emit `handoff_accepted`.
135
+
109
136
  ### 2. Create a task-scoped execution contract
110
137
  Before editing code, write a short task contract for the current task only (objective, files, invariants, local checks, and repair budget).
111
138
 
112
139
  ### 3. Implement in the smallest coherent slice
113
140
  Do not implement the entire feature before validating anything. Prefer one task at a time. Follow closed decisions from the plan.
114
141
 
142
+ Before the first concrete task, emit `task_started`. After the first workspace mutation, emit `first_write`.
143
+
115
144
  ### 4. Run a focused quality gate after each task slice
116
145
  Run only the checks that are relevant to the current diff and task risks (linter, analyze of the affected package, or tests).
117
146
 
@@ -147,6 +176,9 @@ Create `.atlas/state/<run_id>/<slice>.json` following `packages/templates/STATE_
147
176
 
148
177
  Validation is always **sibling**, on every host. The validator is registered as a real subagent on every host, but this executor **never** dispatches it and never validates its own work. After tasks and local gates pass and the state file is written, this executor **stops mutation** and returns `validator_handoff_required` with the `state_path`. The orchestrator dispatches `atlas-task-validator` as the next isolated sibling phase, locks it via `atlas_lock_validator`, and — if the verdict is `fail` — dispatches `atlas-findings-repair` (not this executor) before the **2nd and last** validator.
149
178
 
179
+ After writing the state file and before returning, emit `state_path_created` with the same `state_path`.
180
+ Without this exact checkpoint, `atlas_lock_validator(start)` blocks in G12 and the orchestrator cannot dispatch the cold validator.
181
+
150
182
  The only handoff input is `state_path`. Do not paste the contract, diff, or task list inline. The validator reads everything it needs from the state file and the plan it points to. (`atlas_capabilities` is the runtime source of truth for the dispatch mechanism the orchestrator uses — see `references/host-adapters.md`.)
151
183
 
152
184
  **Finish all local work before the handoff — then stop idle.** Finish every local gate (lint, analyze, tests, `git diff --check`, diff-stat) and write the state file **before** returning the handoff. After returning `validator_handoff_required`, the executor must not mutate anything: the orchestrator now owns the slice, and any mutation here would change what the sibling validator reads and breaks determinism (same failure class as the orchestrator's G9).
@@ -1 +1 @@
1
- 0.8.2
1
+ 0.8.3
@@ -220,9 +220,16 @@ Veja este README, `packages/mcp-server/README.md` e os SKILL.md `atlas-*` para o
220
220
 
221
221
  ---
222
222
 
223
- **Plugin version:** 0.8.2
223
+ **Plugin version:** 0.8.3
224
224
  **Author:** Paulo Borini
225
- **Last updated:** 2026-06-15
225
+ **Last updated:** 2026-06-16
226
+
227
+ ### Novidades v0.8.3 — liveness do executor (Gate G12)
228
+
229
+ - `plan_execute` agora tem liveness explícito: `atlas_lock_dispatch(start)` cria deadline de bootstrap e o executor precisa emitir checkpoints materiais.
230
+ - `atlas-plan-execute` deve reportar `executor_started`, `skill_loaded`, `plan_loaded`, `handoff_accepted`, `task_started`, `first_write` e `state_path_created` conforme avança.
231
+ - Se o sub-agent não retornar/progredir, o orquestrador consulta `atlas_lock_dispatch(status)`; bootstrap vencido vira `executor_bootstrap_timeout`, checkpoint antigo sem avanço vira `executor_progress_timeout`; ambos persistem `stalled`, liberam retry e não podem ser tratados como execução em andamento.
232
+ - `atlas_lock_validator(start)` só abre o validator depois de `state_path_created` para o mesmo `state_path`; checkpoint final sem arquivo legível é bloqueado.
226
233
 
227
234
  ### Novidades v0.8.2 — release/npm e procedimento de bump
228
235
 
@@ -177,6 +177,7 @@ Regras inegociáveis. Violação = parar, não contornar.
177
177
  | TC | **Conformidade de template via MCP.** PRD e PLAN só avançam como artefatos documentais se `atlas_verify_template_conformance` retornar `passed` e `pending_count: 0`. Pendência bloqueia com `next_action`. | PRD + plano |
178
178
  | G6 | **Status verificado, não auto-reportado.** O ✅ de cada item no output só pode ser marcado após confirmar o artefato em disco. Faltou artefato exigido pelo modo → status final `incomplete`, nunca `completed`. | output |
179
179
  | G7 | **Execução de código roda SEMPRE como sub-agent despachado (verbo nativo do host, lido de `atlas_capabilities`), nunca no contexto do orquestrador.** A **autoria** do `PLAN_*.md` pode ser feita pelo orquestrador no fio principal **enquanto o plano não foi validado** (autoria documental, PRD D10) — mas o plano só vira confiável após `atlas_verify_artifact` + TC `passed`. A **execução do plano** (`plan_execute`) e qualquer mutação de código vão obrigatoriamente a sub-agent. Antes de iniciar/concluir fase de execução, usar `atlas_lock_dispatch`; fase fora de ordem ou paralela bloqueia. Depois do plano validado, o orquestrador não edita mais o plano (mãos atadas fortes). | plano + execução |
180
+ | G12 | **Executor vivo precisa provar progresso.** Ao iniciar `plan_execute`, `atlas_lock_dispatch(start)` cria liveness de bootstrap/progresso. O executor precisa emitir `atlas_lock_dispatch(checkpoint, phase=plan_execute, event=...)` cedo, começando por `executor_started`/`skill_loaded`, depois `plan_loaded`, `handoff_accepted`, `task_started`, `first_write` e `state_path_created` conforme avança. `state_path_created` exige `state_path` legível/parseável, e `atlas_lock_validator(start)` só abre validator se o último checkpoint for `state_path_created` para exatamente o mesmo `state_path`. Se o sub-agent não retornar, travar, ficar sem primeiro checkpoint, ou ficar com checkpoint antigo sem avanço, o orquestrador chama `atlas_lock_dispatch(action=status, phase=plan_execute)`: `executor_bootstrap_timeout`/`executor_progress_timeout` viram `stalled`, o lock é liberado para `retry_plan_execute`, e a execução não pode ser declarada completa. Sem checkpoint/progresso não há "em andamento" confiável. | execução |
180
181
  | G8 | **Ordem fixa de validação: `task-validator` ANTES, `slice-review` POR ÚLTIMO. Nunca em paralelo.** Conclusão de `plan_execute` usa `atlas_lock_dispatch` com `validator_status: passed`; review só inicia após execução concluída. | validação + review |
181
182
  | PREREQ | **Pré-requisitos de determinismo (hard-fail, DEC-004).** `atlas_preflight` verifica, **antes de tudo**, se o host tem subagente + MCP (essenciais). Ausente (ex.: pi sem `pi-mcp-adapter`/`pi-subagents`, host MCP-only sem subagente) → aborta em `ready` com `missing_prerequisites`/`next_action`. Sem degradação, sem validator inline, qualquer tamanho. `todo` não-essencial segue sem mirror. | roteamento |
182
183
  | DEP | **Dependência de backlog não satisfeita = hard-fail determinístico.** Se o input é `backlog-item` e o item declara `Dependências` (ex.: S40 dep S39) cujo status, lido no mesmo backlog/registro de onde o item veio, **não** é `done`, abortar em `ready` com `unmet_dependencies`, causa e `next_action` (executar a dependência primeiro). Sem improviso e sem pergunta: ou a dep está `done` e segue, ou bloqueia com causa. Não confundir com decisão em aberto (que não bloqueia). | roteamento (backlog-item) |
@@ -199,7 +200,7 @@ Artefatos esperados (em ordem): `PRD_*.md` → (`PRD_*.md` atualizado) → `PLAN
199
200
  5. **Plan** — `atlas_lock_dispatch(action=start, phase=plan_handoff)`, carregar/invocar `plan_handoff` no fio principal para redigir `PLAN_*.md`, depois chamar `atlas_verify_artifact` e `atlas_verify_template_conformance(artifact_type=plan)`. Concluir a fase com `atlas_lock_dispatch(action=complete, phase=plan_handoff)`. **Nenhuma linha de código pode ter sido escrita até aqui.**
200
201
  - **G11:** se `PLAN_*.md` foi validado, chamar `atlas_assert_after_plan`. Se a próxima ação não for `dispatch_plan_execute_blocking`, abortar.
201
202
  6. **Validate plan** — se há gaps → dispara entrevista, propaga e continua (ver "Decisão em aberto ≠ parada"). Não para pra pedir permissão.
202
- 7. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`, despachar `plan_execute` como sub-agent lendo o `PLAN_*.md`. O executor retorna `validator_handoff_required` com `state_path`; o orquestrador abre um slot via `atlas_lock_validator(action=start)`, despacha **um** `task_validator`, exige no output o `dispatch_token` do slot e fecha com `validator_run_id` + `dispatch_token`. Se o veredito for `fail`, chama `repair_start`, despacha `atlas-findings-repair` com `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}`, exige atualização do mesmo `state_path`, fecha com `repair_run_id` e só então roda o **2º e último** validator. Ao obter `passed` ou `passed_with_observations`, conclui `plan_execute` com o terminal. Status diferente bloqueia review e output completed.
203
+ 7. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`, despachar `plan_execute` como sub-agent lendo o `PLAN_*.md`. O executor precisa emitir checkpoints G12; se o dispatch não retornar ou não produzir primeiro checkpoint/progresso, chamar `atlas_lock_dispatch(action=status, phase=plan_execute)` e tratar `executor_bootstrap_timeout`/`executor_progress_timeout` como `stalled`/retry, nunca como execução em andamento. O executor retorna `validator_handoff_required` com `state_path`; antes de abrir validator, o MCP exige checkpoint `state_path_created` para esse mesmo `state_path`. O orquestrador abre um slot via `atlas_lock_validator(action=start)`, despacha **um** `task_validator`, exige no output o `dispatch_token` do slot e fecha com `validator_run_id` + `dispatch_token`. Se o veredito for `fail`, chama `repair_start`, despacha `atlas-findings-repair` com `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}`, exige atualização do mesmo `state_path`, fecha com `repair_run_id` e só então roda o **2º e último** validator. Ao obter `passed` ou `passed_with_observations`, conclui `plan_execute` com o terminal. Status diferente bloqueia review e output completed.
203
204
  8. **Review (condicional)** — somente após execução concluída e se `--review` → `atlas_lock_dispatch(action=start, phase=slice_review)`, despachar `slice_review`, depois `atlas_lock_dispatch(action=complete, phase=slice_review)`.
204
205
  9. **Output** — ledger verificado com fonte MCP por gate/fase (ver "Output") + próximos passos.
205
206
 
@@ -209,7 +210,7 @@ Artefatos esperados: `PRD_*.md` → (atualizado) → diff de código → relató
209
210
 
210
211
  1. Parse / Generate PRD (se necessário) + `atlas_verify_artifact`.
211
212
  2. Validate PRD → `atlas_scan_prd` + `atlas_verify_template_conformance`; entrevista condicional reexecuta os gates.
212
- 3. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking a partir do PRD. O executor retorna `validator_handoff_required` com `state_path`; o orquestrador abre o slot, despacha o validator e fecha usando `validator_run_id` + `dispatch_token`. Em `fail`, abre repair, passa `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}` ao `atlas-findings-repair`, mantém o mesmo `state_path`, fecha o repair e roda o **2º e último** validator. `passed` e `passed_with_observations` são terminais aprovados.
213
+ 3. **Execute** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking a partir do PRD. Exigir checkpoints G12; sem retorno/progresso, chamar `atlas_lock_dispatch(action=status, phase=plan_execute)` e bloquear/retry em `executor_bootstrap_timeout`/`executor_progress_timeout`. O executor retorna `validator_handoff_required` com `state_path`; o MCP abre o slot após `state_path_created` para o mesmo `state_path`; então o orquestrador despacha o validator e fecha usando `validator_run_id` + `dispatch_token`. Em `fail`, abre repair, passa `{state_path, findings, validator_attempt, repair_run_id, repair_budget: 1}` ao `atlas-findings-repair`, mantém o mesmo `state_path`, fecha o repair e roda o **2º e último** validator. `passed` e `passed_with_observations` são terminais aprovados.
213
214
  4. Review (condicional) — só após executor retornar 100% e dispatch MCP permitir.
214
215
  5. Output (ledger verificado).
215
216
 
@@ -221,7 +222,7 @@ Entrada: um **`PLAN_*.md` pronto**. Artefatos esperados: (plano já existe) →
221
222
 
222
223
  1. **Parse / classify** — `atlas_ping` → `atlas_capabilities` → **`atlas_classify_input`** no input (PRD D3/D6: o tipo é fato e precisa ser conhecido antes de travar o modo) → **`atlas_preflight(<modo efetivo>)`** (PREREQ hard-fail intacto). A classificação determina o tipo: se for plano, o modo efetivo é `execute` e o preflight trava `execute`; se o input não for plano, auto-rotear (ver Fase 0, passo 2b) e o preflight trava o modo roteado. **`classify_input` sempre precede `preflight`** (o preflight trava o modo efetivo, não o pedido).
223
224
  2. **Reverificar o plano na entrada** — `atlas_verify_artifact` no `PLAN_*.md` (G1) + `atlas_verify_template_conformance(artifact_type=plan)` (TC). Plano velho/manual/inválido **trava aqui** com `next_action` em linguagem de produto (PRD D11 — "autoria é livre, execução é gateada"). Sem reverificação válida não há dispatch.
224
- 3. **Executar** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking lendo o `PLAN_*.md`. A validação é sempre **sibling**: o executor escreve `state_path` e para; o orquestrador despacha o validator via `atlas_lock_validator` e fecha o slot somente com `validator_run_id` + `dispatch_token`. Ao obter `passed` ou `passed_with_observations`, concluir `plan_execute` com o terminal correspondente. `plan_execute` é aceito como **primeira fase** em `execute` (sem fase nova; PRD D13).
225
+ 3. **Executar** — `atlas_lock_dispatch(action=start, phase=plan_execute)`; despachar `plan_execute` como sub-agent blocking lendo o `PLAN_*.md`. Exigir checkpoints G12; se o executor não devolver retorno/progresso, chamar `atlas_lock_dispatch(action=status, phase=plan_execute)` e bloquear/retry em `executor_bootstrap_timeout`/`executor_progress_timeout`. A validação é sempre **sibling**: o executor escreve `state_path`, emite `state_path_created` e para; o MCP só abre validator para esse mesmo `state_path`; o orquestrador despacha o validator via `atlas_lock_validator` e fecha o slot somente com `validator_run_id` + `dispatch_token`. Ao obter `passed` ou `passed_with_observations`, concluir `plan_execute` com o terminal correspondente. `plan_execute` é aceito como **primeira fase** em `execute` (sem fase nova; PRD D13).
225
226
  4. **Review (condicional)** — só após execução concluída e se `--review` → `atlas_lock_dispatch(action=start, phase=slice_review)`, despachar `slice_review`, depois `complete`.
226
227
  5. **Output** — ledger verificado; `guarantee_level` = `full_pipeline` (PRD D12).
227
228
 
@@ -1,6 +1,6 @@
1
1
  # Atlas Workflow MCP Server
2
2
 
3
- Servidor MCP do plugin Atlas Workflow v0.8.2.
3
+ Servidor MCP do plugin Atlas Workflow v0.8.3.
4
4
 
5
5
  ## Tools
6
6
 
@@ -12,7 +12,7 @@ Servidor MCP do plugin Atlas Workflow v0.8.2.
12
12
  - `atlas_verify_template_conformance`: Gate TC; PRD/PLAN só avançam com template conforme e `pending_count: 0`.
13
13
  - `atlas_scan_prd`: Gate G5; escaneia PRD por padrões determinísticos de ambiguidade bloqueante.
14
14
  - `atlas_preflight`: Gate G10; valida modo, versão, lock ativo e mapa oficial de skills atlas-*.
15
- - `atlas_lock_dispatch`: Gates G7/G8; controla fase ativa, ordem de dispatch e validator antes de review.
15
+ - `atlas_lock_dispatch`: Gates G7/G8/G12; controla fase ativa, checkpoints de liveness do executor, ordem de dispatch e validator antes de review (`state_path_created` exige `state_path` legível).
16
16
  - `atlas_lock_validator`: Gate G4 sibling; um validator por vez, `dispatch_token` obrigatório, máximo de 2 attempts, repair obrigatório entre fail e retry, proof-of-work (challenge sha256 do boundary recomputado no complete; re-dispatch bounded → `challenge_exhausted`).
17
17
  - `atlas_assert_after_plan`: Gate G11; bloqueia encerramento prematuro do modo full após plano validado.
18
18
 
@@ -25,4 +25,5 @@ Servidor MCP do plugin Atlas Workflow v0.8.2.
25
25
  - Gates: resultados persistidos em `data.gates`.
26
26
  - Roteamento: lock persistido em `data.routing`.
27
27
  - Dispatch: fase ativa, próxima ação e histórico persistidos em `data.dispatch`.
28
+ - Liveness: `plan_execute` persiste `data.dispatch.active.liveness`; bootstrap vencido sem checkpoint ou checkpoint antigo sem progresso vira `executor_liveness.status = stalled` e `next_action: retry_plan_execute`; `atlas_lock_validator(start)` bloqueia até `state_path_created` corresponder ao mesmo `state_path`.
28
29
  - Erro bloqueante: entradas inválidas, run inexistente ou falha de estado retornam erro JSON-RPC; gate bloqueado retorna `status: "blocked"` e `next_action`.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlas-workflow/mcp-server",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "bin": {