forjajs 1.1.2 → 1.1.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/.claude/agents/governance.md +33 -10
- package/.claude/agents/release-auditor.md +44 -45
- package/CHANGELOG.md +74 -0
- package/DOC-MAP.md +2 -2
- package/README.md +2 -2
- package/docs/agent-harnesses.md +30 -3
- package/docs/token-optimization.md +28 -20
- package/lib/core/checks.mjs +138 -0
- package/lib/core/health.mjs +475 -0
- package/lib/core/registry.mjs +6 -1
- package/lib/core/release.mjs +452 -0
- package/memory/40-delivery/current-sprint.md +13 -7
- package/memory/90-decisions/0021-guardrails-de-harness.md +5 -1
- package/memory/90-decisions/0022-congelar-dashboard-web.md +101 -0
- package/memory/90-decisions/0023-doctor-como-gate-do-nucleo.md +114 -0
- package/memory/90-decisions/0024-gate-do-tarball.md +103 -0
- package/package.json +7 -7
- package/prompts/governance-agent.md +2 -1
- package/scripts/hook-session-start.mjs +29 -39
- package/scripts/release-check.mjs +56 -0
- package/scripts/spec-cli.mjs +80 -13
- package/scripts/tools-doctor.mjs +65 -10
- package/specs/coerencia-do-sistema/spec.md +122 -0
- package/specs/doctor-do-nucleo/plan.md +165 -0
- package/specs/doctor-do-nucleo/spec.md +139 -0
- package/specs/doctor-do-nucleo/tasks.md +172 -0
- package/specs/reestruturacao-forja-v2/plan.md +1 -1
- package/specs/reestruturacao-forja-v2/spec.md +16 -12
- package/specs/reestruturacao-forja-v2/tasks.md +1 -1
- package/specs/release-gate/plan.md +174 -0
- package/specs/release-gate/spec.md +122 -0
- package/specs/release-gate/tasks.md +183 -0
- package/docs/dashboard.md +0 -102
- package/specs/agent-dashboard/plan.md +0 -165
- package/specs/agent-dashboard/spec.md +0 -89
- package/specs/agent-dashboard/tasks.md +0 -168
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# Tasks: agent-dashboard
|
|
2
|
-
|
|
3
|
-
- **Spec**: ./spec.md
|
|
4
|
-
- **Plan**: ./plan.md
|
|
5
|
-
- **Criado em**: 2026-05-11
|
|
6
|
-
|
|
7
|
-
Decomposição em 12 tasks. Estimativas: P=≤2h, M=2-6h, G=6h+. Ordem reflete execução padrão; T2-T9 podem rodar em paralelo após T1.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## T1 — Bootstrap do projeto `dashboard/`
|
|
12
|
-
- **Owner**: Worker
|
|
13
|
-
- **Estimativa**: P
|
|
14
|
-
- **Depende de**: —
|
|
15
|
-
- **Paths**: `dashboard/package.json`, `dashboard/server/index.mjs`, `dashboard/.gitignore`, `package.json` (root)
|
|
16
|
-
- **Done quando**:
|
|
17
|
-
- [ ] `dashboard/package.json` com fastify, @fastify/static, @fastify/cors, better-sqlite3
|
|
18
|
-
- [ ] `dashboard/server/index.mjs` sobe Fastify em 127.0.0.1:7777 com `GET /api/health` → `{ok:true}`
|
|
19
|
-
- [ ] Root `package.json` ganha script `"dashboard": "cd dashboard && npm start"`
|
|
20
|
-
- [ ] `.gitignore` ignora `dashboard/node_modules`, `dashboard/web/dist`
|
|
21
|
-
- [ ] `npm run dashboard` sobe sem erro
|
|
22
|
-
|
|
23
|
-
## T2 — Allowlist + util de spawn seguro
|
|
24
|
-
- **Owner**: Worker
|
|
25
|
-
- **Estimativa**: P
|
|
26
|
-
- **Depende de**: T1
|
|
27
|
-
- **Paths**: `dashboard/server/lib/allowlist.mjs`, `dashboard/server/lib/run-command.mjs`
|
|
28
|
-
- **Done quando**:
|
|
29
|
-
- [ ] `allowlist.mjs` exporta `COMMAND_ALLOWLIST` exato como no plan §4
|
|
30
|
-
- [ ] `run-command.mjs` valida nome, faz `spawn` sem `shell: true`
|
|
31
|
-
- [ ] Teste: comando fora da allowlist → throw `CommandNotAllowed`
|
|
32
|
-
- [ ] Teste: comando válido devolve stream readable de stdout
|
|
33
|
-
|
|
34
|
-
## T3 — Rota Specs (read-only)
|
|
35
|
-
- **Owner**: Worker
|
|
36
|
-
- **Estimativa**: P
|
|
37
|
-
- **Depende de**: T1
|
|
38
|
-
- **Paths**: `dashboard/server/routes/specs.mjs`
|
|
39
|
-
- **Done quando**:
|
|
40
|
-
- [ ] `GET /api/specs` lê `specs/*/spec.md`, retorna array conforme contrato §4
|
|
41
|
-
- [ ] `GET /api/specs/:slug` devolve conteúdo cru de spec/plan/tasks
|
|
42
|
-
- [ ] Teste de integração com fixture: 2 specs fake → 2 itens
|
|
43
|
-
|
|
44
|
-
## T4 — Rota Handoffs com transição
|
|
45
|
-
- **Owner**: Worker
|
|
46
|
-
- **Estimativa**: M
|
|
47
|
-
- **Depende de**: T1
|
|
48
|
-
- **Paths**: `dashboard/server/routes/handoffs.mjs`
|
|
49
|
-
- **Done quando**:
|
|
50
|
-
- [ ] `GET /api/handoffs?status=&to=` consulta `universal.db.handoffs`
|
|
51
|
-
- [ ] `POST /api/handoffs/:id/transition` valida `to ∈ {in_progress,done,cancelled}` e shell-out para `agent-router.mjs`
|
|
52
|
-
- [ ] Teste: transição inválida → 400; válida → 200 + status atualizado
|
|
53
|
-
|
|
54
|
-
## T5 — Rota Projects
|
|
55
|
-
- **Owner**: Worker
|
|
56
|
-
- **Estimativa**: P
|
|
57
|
-
- **Depende de**: T1
|
|
58
|
-
- **Paths**: `dashboard/server/routes/projects.mjs`
|
|
59
|
-
- **Done quando**:
|
|
60
|
-
- [ ] `GET /api/projects` lê `projects/*`, cruza com SQLite por slug
|
|
61
|
-
- [ ] `last_commit` via `git -C` (null se não-git)
|
|
62
|
-
- [ ] `memory_bytes` = `du -sb` de `projects/<name>/memory/`
|
|
63
|
-
|
|
64
|
-
## T6 — Rota Tokens (estimador)
|
|
65
|
-
- **Owner**: Worker
|
|
66
|
-
- **Estimativa**: M
|
|
67
|
-
- **Depende de**: T1
|
|
68
|
-
- **Paths**: `dashboard/server/routes/tokens.mjs`, `dashboard/server/lib/token-estimator.mjs`
|
|
69
|
-
- **Done quando**:
|
|
70
|
-
- [ ] `token-estimator.mjs` calcula chars/4 sobre `.context/*` e `memory/60-runs/*.json` agregado por dia
|
|
71
|
-
- [ ] `GET /api/tokens?project=&days=30` devolve série temporal
|
|
72
|
-
- [ ] Resposta < 500ms p95 com 10 projetos (kill criterion §8)
|
|
73
|
-
- [ ] Cada datapoint rotulado como "estimativa"
|
|
74
|
-
|
|
75
|
-
## T7 — Rota Commands com SSE
|
|
76
|
-
- **Owner**: Worker
|
|
77
|
-
- **Estimativa**: M
|
|
78
|
-
- **Depende de**: T2
|
|
79
|
-
- **Paths**: `dashboard/server/routes/commands.mjs`
|
|
80
|
-
- **Done quando**:
|
|
81
|
-
- [ ] `POST /api/commands/:name` valida allowlist, abre SSE
|
|
82
|
-
- [ ] Eventos `stdout`, `stderr`, `exit` (com código)
|
|
83
|
-
- [ ] Fora da allowlist → 403 `{error:"command not allowlisted"}`
|
|
84
|
-
- [ ] E2E: dispara `spec:check` e recebe ≥1 evento `stdout` + `exit:0`
|
|
85
|
-
|
|
86
|
-
## T8 — Rota Briefing → spec
|
|
87
|
-
- **Owner**: Worker
|
|
88
|
-
- **Estimativa**: M
|
|
89
|
-
- **Depende de**: T2
|
|
90
|
-
- **Paths**: `dashboard/server/routes/briefing.mjs`, `dashboard/server/lib/briefing-parser.mjs`
|
|
91
|
-
- **Done quando**:
|
|
92
|
-
- [ ] Parser: split parágrafos, detecta keywords (`problema`, `queremos`, `para que <persona>`, `como <persona>`), preenche seções 1-3
|
|
93
|
-
- [ ] `POST /api/briefing` valida `slug` kebab-case, cria via `spec-cli.mjs new`, sobrescreve seções 1-3
|
|
94
|
-
- [ ] Status fica em `draft` (nunca `approved` automático)
|
|
95
|
-
- [ ] Teste com 3 briefings de exemplo: cada um produz spec parseável
|
|
96
|
-
|
|
97
|
-
## T9 — Frontend bootstrap (Vite + Tailwind + shadcn)
|
|
98
|
-
- **Owner**: Worker
|
|
99
|
-
- **Estimativa**: M
|
|
100
|
-
- **Depende de**: T1
|
|
101
|
-
- **Paths**: `dashboard/web/`
|
|
102
|
-
- **Done quando**:
|
|
103
|
-
- [ ] `dashboard/web/` com Vite + React + Tailwind
|
|
104
|
-
- [ ] shadcn instalado, 3-4 componentes copiados (button, card, badge, dialog)
|
|
105
|
-
- [ ] Layout base: sidebar com 6 links (Briefing, Specs, Handoffs, Tokens, Comandos, Projetos)
|
|
106
|
-
- [ ] `vite build` < 500KB gzipped (NFR)
|
|
107
|
-
- [ ] `npm run dashboard` serve `dist/` via @fastify/static
|
|
108
|
-
|
|
109
|
-
## T10 — Telas Specs + Handoffs + Projetos
|
|
110
|
-
- **Owner**: Worker
|
|
111
|
-
- **Estimativa**: G
|
|
112
|
-
- **Depende de**: T3, T4, T5, T9
|
|
113
|
-
- **Paths**: `dashboard/web/src/pages/{Specs,Handoffs,Projects}.tsx`
|
|
114
|
-
- **Done quando**:
|
|
115
|
-
- [ ] Specs: tabela com status colorido + drawer com spec/plan/tasks markdown renderizado
|
|
116
|
-
- [ ] Handoffs: 3 colunas kanban com botão de transição
|
|
117
|
-
- [ ] Projetos: cards com badges (specs, handoffs, último commit, memória)
|
|
118
|
-
- [ ] Polling 30s em cada tela
|
|
119
|
-
|
|
120
|
-
## T11 — Telas Tokens + Comandos + Briefing
|
|
121
|
-
- **Owner**: Worker
|
|
122
|
-
- **Estimativa**: G
|
|
123
|
-
- **Depende de**: T6, T7, T8, T9
|
|
124
|
-
- **Paths**: `dashboard/web/src/pages/{Tokens,Commands,Briefing}.tsx`
|
|
125
|
-
- **Done quando**:
|
|
126
|
-
- [ ] Tokens: gráfico de linha (Recharts) 30d com toggle de projeto
|
|
127
|
-
- [ ] Comandos: 5 botões, painel lateral com stdout/stderr ao vivo via EventSource
|
|
128
|
-
- [ ] Briefing: textarea ≥10 linhas + select de projeto + botão "Gerar spec" → redireciona para `/specs/<slug>`
|
|
129
|
-
|
|
130
|
-
## T12 — Documentação + handoff de governance
|
|
131
|
-
- **Owner**: Worker → Governance
|
|
132
|
-
- **Estimativa**: P
|
|
133
|
-
- **Depende de**: T10, T11
|
|
134
|
-
- **Paths**: `docs/dashboard.md`, `DOC-MAP.md`, `CHANGELOG.md`
|
|
135
|
-
- **Done quando**:
|
|
136
|
-
- [ ] `docs/dashboard.md` cobre: como subir, porta, allowlist, troubleshooting
|
|
137
|
-
- [ ] `DOC-MAP.md` ganha entrada para o dashboard
|
|
138
|
-
- [ ] `CHANGELOG.md` ganha entrada `[Unreleased]`
|
|
139
|
-
- [ ] Handoff `worker → governance` aberto via `agent-router append`
|
|
140
|
-
- [ ] `npm test` e `npm run spec:check` ambos verdes
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Caminho crítico
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
T1 ─┬─ T2 ─┬─ T7 ─┐
|
|
148
|
-
├─ T3 ─┤ │
|
|
149
|
-
├─ T4 ─┤ ├─ T10 ─┐
|
|
150
|
-
├─ T5 ─┤ │ ├─ T12
|
|
151
|
-
├─ T6 ─┤ ├─ T11 ─┘
|
|
152
|
-
├─ T9 ─┘ │
|
|
153
|
-
└─ T2 → T8 ───┘
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
T1 destrava todas. T10 espera rotas read-only + frontend base. T11 espera rotas mutáveis + frontend base. T12 fecha com Governance.
|
|
157
|
-
|
|
158
|
-
## Handoffs sugeridos
|
|
159
|
-
|
|
160
|
-
Quando T1 concluir:
|
|
161
|
-
```bash
|
|
162
|
-
node scripts/agent-router.mjs append '{"from":"sdd-architect","to":"worker","intent":"implement","context":"specs/agent-dashboard/plan.md §2-§5; tasks.md T2-T9 destravadas","acceptance":"rotas /api/* respondem com schema do plan §4; testes verdes","constraints":"allowlist hard-coded; bind 127.0.0.1; sem shell:true","return":"PR + handoff para governance","spec_slug":"agent-dashboard"}'
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Antes do merge (após T11):
|
|
166
|
-
```bash
|
|
167
|
-
node scripts/agent-router.mjs append '{"from":"worker","to":"governance","intent":"review","context":"PR agent-dashboard; rotas + 5 telas + allowlist","acceptance":"project:check verde, spec:check verde, auditoria de RCE na rota /api/commands","constraints":"bloquear merge se allowlist contornável","return":"veredicto APROVADO ou findings","spec_slug":"agent-dashboard"}'
|
|
168
|
-
```
|