@jaimevalasek/aioson 1.29.1 → 1.30.0
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/CHANGELOG.md +19 -0
- package/README.md +7 -5
- package/docs/en/5-reference/cli-reference.md +40 -10
- package/docs/pt/4-agentes/pm.md +1 -1
- package/docs/pt/5-referencia/autopilot-handoff.md +4 -4
- package/docs/pt/5-referencia/comandos-cli.md +5 -3
- package/docs/pt/5-referencia/fluxo-artefatos.md +1 -1
- package/docs/pt/5-referencia/memoria-e-contexto.md +2 -2
- package/docs/pt/_arquivo/monitor-de-contexto.md +2 -2
- package/package.json +4 -2
- package/src/cli.js +67 -24
- package/src/commands/ac-test-audit.js +45 -0
- package/src/commands/artifact-validate.js +62 -50
- package/src/commands/classify.js +73 -2
- package/src/commands/context-brief.js +59 -0
- package/src/commands/context-guard.js +88 -0
- package/src/commands/context-monitor.js +1 -1
- package/src/commands/context-search.js +101 -52
- package/src/commands/context-select.js +11 -2
- package/src/commands/feature-archive.js +21 -12
- package/src/commands/feature-current.js +82 -0
- package/src/commands/gate-check.js +32 -15
- package/src/commands/harness-check.js +17 -1
- package/src/commands/hooks-install.js +169 -26
- package/src/commands/hygiene-scan.js +423 -0
- package/src/commands/rules-lint.js +11 -3
- package/src/commands/sdd-benchmark.js +134 -0
- package/src/commands/spec-analyze.js +6 -4
- package/src/commands/store-system.js +329 -49
- package/src/constants.js +8 -3
- package/src/context-brief.js +585 -0
- package/src/context-guard.js +209 -0
- package/src/context-search.js +796 -96
- package/src/context-selector.js +802 -444
- package/src/handoff-contract.js +14 -6
- package/src/harness/contract-schema.js +1 -1
- package/src/i18n/messages/en.js +12 -5
- package/src/i18n/messages/es.js +11 -4
- package/src/i18n/messages/fr.js +11 -4
- package/src/i18n/messages/pt-BR.js +12 -5
- package/src/lib/ac-test-audit.js +194 -0
- package/src/preflight-engine.js +10 -6
- package/src/squad/state-manager.js +1 -1
- package/template/.aioson/agents/analyst.md +41 -17
- package/template/.aioson/agents/architect.md +4 -2
- package/template/.aioson/agents/briefing-refiner.md +15 -2
- package/template/.aioson/agents/briefing.md +12 -8
- package/template/.aioson/agents/committer.md +1 -1
- package/template/.aioson/agents/copywriter.md +20 -9
- package/template/.aioson/agents/design-hybrid-forge.md +9 -5
- package/template/.aioson/agents/dev.md +22 -25
- package/template/.aioson/agents/deyvin.md +126 -124
- package/template/.aioson/agents/discover.md +3 -1
- package/template/.aioson/agents/discovery-design-doc.md +11 -2
- package/template/.aioson/agents/forge-run.md +3 -0
- package/template/.aioson/agents/genome.md +9 -5
- package/template/.aioson/agents/neo.md +30 -24
- package/template/.aioson/agents/orache.md +10 -6
- package/template/.aioson/agents/orchestrator.md +4 -2
- package/template/.aioson/agents/pentester.md +22 -12
- package/template/.aioson/agents/pm.md +5 -3
- package/template/.aioson/agents/product.md +25 -18
- package/template/.aioson/agents/profiler-enricher.md +10 -6
- package/template/.aioson/agents/profiler-forge.md +10 -6
- package/template/.aioson/agents/profiler-researcher.md +10 -6
- package/template/.aioson/agents/qa.md +21 -19
- package/template/.aioson/agents/scope-check.md +9 -3
- package/template/.aioson/agents/sheldon.md +22 -8
- package/template/.aioson/agents/site-forge.md +2 -0
- package/template/.aioson/agents/squad.md +4 -2
- package/template/.aioson/agents/tester.md +19 -15
- package/template/.aioson/agents/ux-ui.md +16 -8
- package/template/.aioson/config.md +4 -3
- package/template/.aioson/design-docs/agent-loading-contract.md +3 -3
- package/template/.aioson/docs/autopilot-handoff.md +3 -3
- package/template/.aioson/docs/dev/simple-plan-lane.md +73 -27
- package/template/.aioson/docs/dev/stack-conventions.md +1 -1
- package/template/.aioson/docs/deyvin/continuity-recovery.md +1 -1
- package/template/.aioson/docs/deyvin/runtime-handoffs.md +3 -3
- package/template/.aioson/docs/feature-expansion-taxonomy.md +53 -0
- package/template/.aioson/docs/handoff-persistence.md +14 -12
- package/template/.aioson/docs/product/conversation-playbook.md +1 -1
- package/template/.aioson/docs/sheldon/enrichment-paths.md +44 -1
- package/template/.aioson/docs/sheldon/harness-contract.md +23 -21
- package/template/.aioson/docs/tester/coverage-quality.md +1 -1
- package/template/.aioson/docs/ux-ui/design-execution.md +9 -7
- package/template/.aioson/rules/README.md +35 -17
- package/template/.aioson/rules/agent-structural-contract.md +165 -160
- package/template/.aioson/rules/aioson-context-boundary.md +5 -4
- package/template/.aioson/rules/canonical-path-contract.md +5 -4
- package/template/.aioson/rules/data-format-convention.md +5 -4
- package/template/.aioson/rules/disk-first-artifacts.md +2 -2
- package/template/.aioson/rules/implementation-structure-and-data-access.md +50 -0
- package/template/.aioson/rules/security-baseline.md +4 -3
- package/template/.aioson/rules/simple-plan-lane.md +18 -6
- package/template/.aioson/rules/source-code-language-convention.md +34 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +24 -23
- package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +4 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +2 -2
- package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +1 -1
- package/template/.aioson/skills/process/briefing-expansion-scout/SKILL.md +72 -0
- package/template/.aioson/skills/process/product-scope-expansion/SKILL.md +74 -0
- package/template/.aioson/skills/process/sheldon-expansion-audit/SKILL.md +67 -0
- package/template/.aioson/skills/static/context-budget-guide.md +1 -1
- package/template/.aioson/skills/static/multi-agent-patterns.md +5 -4
- package/template/AGENTS.md +36 -19
- package/template/CLAUDE.md +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.30.0] - 2026-06-22
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Context intelligence and hygiene tooling.** Added the `context:brief` recall path, operational `context:guard` hook adapter/injection flow, guard rule attribution, and the read-only `hygiene:scan` diagnostic for stale session/context noise.
|
|
9
|
+
- **Gate D proof hardening.** Added AC-to-test audit and evidence-gated Gate D expectations across SDD, QA, and agent contracts.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **Agent context loading now uses canonical context paths.** Gateway and agent prompts resolve `project-pulse.md`, `features.md`, `dev-state.md`, `last-handoff.json`, and `workflow.state.json` to `.aioson/context/`, preventing root or `.aioson/` misreads during activation recovery.
|
|
13
|
+
- **Feature routing and recall are stricter.** Slug resolution, recall index isolation, `context:guard` salience, and selected-context loading were tightened across the spec chain.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **Context intelligence safety fixes.** Hardened hook agent-name validation, tester test-plan/test-inventory scoping, Sheldon validation scoping, deleted-file recall cleanup, Windows temp-dir cleanup, and the context subsystem P1-P5 audit findings.
|
|
17
|
+
- **Feature archive restore cleanup.** Retried empty archive-directory removal during restore to avoid leaving `.aioson/context/done/{slug}/` behind on transient Windows filesystem locks.
|
|
18
|
+
|
|
19
|
+
## [1.29.2] - 2026-06-13
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **`aioson system:publish` crashava com `Error: archiver is not a function`.** O `archiver` tinha sido atualizado para `^8.0.0`, uma reescrita ESM que removeu a API chamável `archiver('zip', opts)` e passou a exportar só classes nomeadas (`Archiver`, `ZipArchive`, …) — sem função default. Fixado de volta em `^7.0.1` (CommonJS, API chamável que `createZipBuffer` em `src/commands/store-system.js` espera), o que também elimina o `ExperimentalWarning` de ESM-em-require no Node 23.
|
|
23
|
+
|
|
5
24
|
## [1.29.1] - 2026-06-12
|
|
6
25
|
|
|
7
26
|
### Docs
|
package/README.md
CHANGED
|
@@ -246,7 +246,7 @@ aioson context:monitor # ASCII bars, warning/critical detection
|
|
|
246
246
|
```
|
|
247
247
|
```
|
|
248
248
|
Context usage ████████████░░░░ 73% ⚠ approaching threshold (SMALL: 65%)
|
|
249
|
-
Agents recommend /
|
|
249
|
+
Agents recommend /compact before the next same-feature phase; /clear is reserved for hard resets
|
|
250
250
|
```
|
|
251
251
|
|
|
252
252
|
**FTS5 Search Index** — find anything across all your project artifacts in milliseconds:
|
|
@@ -730,10 +730,12 @@ aioson intake:ask [path] --agent=<agent> --schema=<questions.json> [--out=<answe
|
|
|
730
730
|
|
|
731
731
|
```bash
|
|
732
732
|
aioson preflight [path] [--json]
|
|
733
|
-
aioson classify [path] [--json]
|
|
734
|
-
aioson gate:check [path] --gate=A|B|C|D [--json]
|
|
735
|
-
aioson artifact:validate [path] --feature=<slug> [--json]
|
|
736
|
-
aioson
|
|
733
|
+
aioson classify [path] [--json]
|
|
734
|
+
aioson gate:check [path] --gate=A|B|C|D [--json]
|
|
735
|
+
aioson artifact:validate [path] --feature=<slug> [--json]
|
|
736
|
+
aioson ac:test-audit [path] --feature=<slug> [--json]
|
|
737
|
+
aioson sdd:benchmark [path] --feature=<slug> [--json]
|
|
738
|
+
aioson detect:test-runner [path] [--json]
|
|
737
739
|
aioson agent:audit [path] [--json]
|
|
738
740
|
aioson brief:gen [path] --feature=<slug> [--json]
|
|
739
741
|
aioson verify:gate [path] --feature=<slug> [--json]
|
|
@@ -677,23 +677,53 @@ aioson harness:check . --slug=checkout
|
|
|
677
677
|
# Run only a subset of criteria
|
|
678
678
|
aioson harness:check . --slug=checkout --criteria=C1,C3
|
|
679
679
|
|
|
680
|
-
# Custom timeout and JSON output (exit 0 = pass)
|
|
681
|
-
aioson harness:check . --slug=checkout --timeout=120000 --json
|
|
680
|
+
# Custom timeout and JSON output (exit 0 = pass)
|
|
681
|
+
aioson harness:check . --slug=checkout --timeout=120000 --json
|
|
682
|
+
|
|
683
|
+
# Strict mode: binary criteria without verification block the result
|
|
684
|
+
aioson harness:check . --slug=checkout --strict
|
|
682
685
|
```
|
|
683
686
|
|
|
684
687
|
**Options:**
|
|
685
688
|
- `--slug=<feature>` — feature slug matching the harness contract. If omitted, the active contract is auto-discovered.
|
|
686
|
-
- `--criteria=C1,C2` — run only the listed criteria instead of all verifiable ones.
|
|
687
|
-
- `--timeout=<ms>` — per-criterion timeout override.
|
|
688
|
-
- `--
|
|
689
|
+
- `--criteria=C1,C2` — run only the listed criteria instead of all verifiable ones.
|
|
690
|
+
- `--timeout=<ms>` — per-criterion timeout override.
|
|
691
|
+
- `--strict` — fail when binary criteria lack executable `verification` or no executable criterion exists.
|
|
692
|
+
- `--json` — structured output; exit code propagated.
|
|
689
693
|
|
|
690
694
|
**What it does:** the `verification` field is authored per criterion by `@sheldon` for every mechanically-checkable `binary: true` criterion (prefer the project test runner; deterministic; cross-platform; exit 0 = pass). `harness:check` is the standalone deterministic verification of those criteria — it never touches the circuit-breaker state (that stays exclusive to `harness:validate`/`apply-validation`). Legacy contracts without `verification` remain valid; `validateContract` only emits an advisory **warning** for `binary: true` criteria lacking it. `@validator` runs `harness:check` first and copies the exit-code verdicts verbatim into `results[].passed`, LLM-judging only the criteria without `verification`.
|
|
691
695
|
|
|
692
|
-
See [Executable verification](./executable-verification.md) for the full theme.
|
|
693
|
-
|
|
694
|
-
---
|
|
695
|
-
|
|
696
|
-
##
|
|
696
|
+
See [Executable verification](./executable-verification.md) for the full theme.
|
|
697
|
+
|
|
698
|
+
---
|
|
699
|
+
|
|
700
|
+
## ac:test-audit
|
|
701
|
+
|
|
702
|
+
Map declared acceptance criteria to deterministic test evidence.
|
|
703
|
+
|
|
704
|
+
```bash
|
|
705
|
+
aioson ac:test-audit . --feature=checkout
|
|
706
|
+
aioson ac:test-audit . --feature=checkout --json
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
**What it does:** extracts `AC-*` IDs from `requirements-{slug}.md`, `prd-{slug}.md`, and `conformance-{slug}.yaml`, then checks whether each ID appears in a test file or an executable harness criterion. Gate D treats missing evidence as blocking when ACs are declared.
|
|
710
|
+
|
|
711
|
+
---
|
|
712
|
+
|
|
713
|
+
## sdd:benchmark
|
|
714
|
+
|
|
715
|
+
Generate a deterministic SDD quality snapshot for a feature.
|
|
716
|
+
|
|
717
|
+
```bash
|
|
718
|
+
aioson sdd:benchmark . --feature=checkout
|
|
719
|
+
aioson sdd:benchmark . --feature=checkout --strict --json
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
**What it does:** combines artifact presence, `spec:analyze`, and `ac:test-audit` into a reproducible score and writes `.aioson/context/retro/sdd-benchmark-{slug}.md`.
|
|
723
|
+
|
|
724
|
+
---
|
|
725
|
+
|
|
726
|
+
## harness:validate
|
|
697
727
|
|
|
698
728
|
Generate the `validator-prompt.txt` for the binary success contract and append a self-contained **review payload** so the validator can judge in a fresh, isolated context. Consumes the verdict back through the circuit breaker.
|
|
699
729
|
|
package/docs/pt/4-agentes/pm.md
CHANGED
|
@@ -117,7 +117,7 @@ aioson workflow:status .
|
|
|
117
117
|
**Feature MEDIUM (pré-dev):**
|
|
118
118
|
- **Vem de:** `@discovery-design-doc`
|
|
119
119
|
- **Produz:** `implementation-plan-{slug}.md` (Gate C)
|
|
120
|
-
- **Vai para:** STOP — desenvolvedor faz `/
|
|
120
|
+
- **Vai para:** STOP — desenvolvedor faz `/compact` e ativa `/dev` quando continuar a mesma feature; usa `/clear` só para reset forte
|
|
121
121
|
|
|
122
122
|
**Projeto MEDIUM (modo completo):**
|
|
123
123
|
- **Vem de:** `@ux-ui`
|
|
@@ -33,7 +33,7 @@ Sem essa flag (ou com `false`), o comportamento padrão é handoff manual — ca
|
|
|
33
33
|
STOP — human entra com /dev
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
A cadeia pré-dev **sempre para antes do primeiro `@dev`**. O desenvolvedor faz `/
|
|
36
|
+
A cadeia pré-dev **sempre para antes do primeiro `@dev`**. O desenvolvedor faz `/compact` quando continua a mesma feature e inicia a implementação a partir do pacote/checkpoint de contexto — `@dev` é pesado e se beneficia de um handoff operacional compacto. Use `/clear` apenas para reset forte, troca de feature, contexto poluído ou reset sensível a segurança.
|
|
37
37
|
|
|
38
38
|
### Segmento 2 — Ciclo de revisão pós-dev (hub = @qa)
|
|
39
39
|
|
|
@@ -87,7 +87,7 @@ O autopilot interrompe a cadeia e emite o handoff manual normal quando:
|
|
|
87
87
|
3. **Cap de correções atingido** — ciclo `@qa` ↔ `@dev` limitado a 2 rounds.
|
|
88
88
|
4. **Finding crítico de segurança** — keywords auth/secret/credential/session/password/token/PII detectados pelo gate de segurança do `@qa` → STOP, requer intervenção humana.
|
|
89
89
|
5. **Verdict não passou** — `@scope-check` não aprovado, `@architect` Gate B bloqueado, `@discovery-design-doc` readiness bloqueado, `@pm` Gate C bloqueado, `@validator` FAIL sem caminho seguro → STOP, roteamento manual.
|
|
90
|
-
6. **Orçamento de contexto** — uso ≥ `context_warning_threshold`: grava checkpoint em `last-handoff.json`, STOP, recomenda `/
|
|
90
|
+
6. **Orçamento de contexto** — uso ≥ `context_warning_threshold`: grava checkpoint em `last-handoff.json`, STOP, recomenda `/compact` para continuidade na mesma feature. A próxima sessão reentra no autopilot automaticamente. Use `/clear` apenas para reset forte, troca de feature, contexto poluído ou reset sensível a segurança.
|
|
91
91
|
7. **Ambiguidade** — estado do workflow indisponível ou qualquer decisão real requer input humano → STOP.
|
|
92
92
|
|
|
93
93
|
O usuário pode interromper a qualquer momento com Ctrl+C. O autopilot nunca retenta uma invocação interrompida.
|
|
@@ -130,9 +130,9 @@ Você > /analyst (start)
|
|
|
130
130
|
@scope-check → pre-dev check → autopilot: invocando @architect
|
|
131
131
|
@architect → Gate B PASS → autopilot: invocando @discovery-design-doc
|
|
132
132
|
@discovery-design-doc → readiness ok → autopilot: invocando @pm (MEDIUM)
|
|
133
|
-
@pm → Gate C PASS → STOP — "Recomendo /
|
|
133
|
+
@pm → Gate C PASS → STOP — "Recomendo /compact e /dev"
|
|
134
134
|
|
|
135
|
-
Você > /
|
|
135
|
+
Você > /compact
|
|
136
136
|
Você > /dev (implementação manual — contexto limpo)
|
|
137
137
|
|
|
138
138
|
@dev → testes ok → autopilot retoma: invocando @qa
|
|
@@ -226,8 +226,10 @@ Scripts determinísticos que movem verificações de estado, validação de arte
|
|
|
226
226
|
| `feature:archive` | Move artefatos de uma feature `done` para `.aioson/context/done/{slug}/` e atualiza o manifest | Chamado pelo `feature:close` automaticamente; também disponível para retroativo com `--dry-run` e `--restore` |
|
|
227
227
|
| `feature:export` | **Copia** todos os artefatos de uma feature para um `--out` limpo, sem mexer na origem; gera `INDEX.md` | Exportar specs para analisar fora, entregar a cliente, ou usar o AIOSON só como gerador de specs. Veja [feature-export.md](./feature-export.md) |
|
|
228
228
|
| `gate:check` | Valida pré-requisitos e artefatos de um phase gate (A/B/C/D); retorna PASS ou BLOCKED | Antes de avançar para o próximo agente |
|
|
229
|
-
| `artifact:validate` | Verifica a cadeia completa de artefatos de uma feature (PRD → spec → plano → conformance) | A qualquer momento para checar completude |
|
|
230
|
-
| `
|
|
229
|
+
| `artifact:validate` | Verifica a cadeia completa de artefatos de uma feature (PRD → spec → plano → conformance) | A qualquer momento para checar completude |
|
|
230
|
+
| `ac:test-audit` | Mapeia cada `AC-*` declarado em PRD/requisitos/conformance para evidência em testes ou critério executável do harness | Antes do Gate D; falha quando algum AC não tem prova de teste |
|
|
231
|
+
| `sdd:benchmark` | Gera score determinístico de SDD usando cadeia de artefatos, `spec:analyze` e `ac:test-audit`; salva relatório em `.aioson/context/retro/` | Para medir a qualidade do harness sem depender de julgamento solto |
|
|
232
|
+
| `spec:analyze` | Irmão de **conteúdo** do `artifact:validate`: consistência cruzada entre os artefatos (rastreabilidade REQ/AC, staleness, readiness, sanidade do contrato, vínculo AC→contrato, overlap de waves) antes do gate de execução | No preflight do `@scope-check` — errors viram blockers, warnings viram evidência de drift |
|
|
231
233
|
| `forge:compile` | **Lane B:** compila os artefatos de uma feature MEDIUM num `forge-run.workflow.js` auditável e versionável (parallel por Wave → convergência no `harness:check` → revisão adversarial → validador fresh-context) | Quando quer execução compilada e reproduzível via `@forge-run`; nunca roda `feature:close`/publish |
|
|
232
234
|
| `workflow:execute` | Monta e executa o plano de agentes baseado na classificação; aceita `--dry-run` e `--start-from` | Para orquestrar features sem o dashboard |
|
|
233
235
|
| `runner:run` | Executa uma tarefa ou worker diretamente pelo runner | Quando quer executar fora do loop principal de sessão |
|
|
@@ -987,7 +989,7 @@ O manifest em `.aioson/context/done/MANIFEST.md` registra todas as features arqu
|
|
|
987
989
|
# Verificar se está no safe zone (< 60%), warning (60–80%) ou critical (≥ 80%)
|
|
988
990
|
aioson context:monitor . --budget=80000 --tokens=52000
|
|
989
991
|
# ⚠ Context: 52,000 tokens (65%) — WARNING
|
|
990
|
-
# Suggestion: /
|
|
992
|
+
# Suggestion: /compact before next agent activation; use /clear only for a hard reset
|
|
991
993
|
|
|
992
994
|
# Verificar com output JSON para integrar em scripts
|
|
993
995
|
aioson context:monitor . --budget=80000 --tokens=67000 --json
|
|
@@ -52,7 +52,7 @@ O PRD produzido pelo @product é o **documento base vivo** — nenhum agente dow
|
|
|
52
52
|
- `sheldon-enrichment-{slug}.md` (ou `sheldon-enrichment.md`) em `.aioson/context/` — log de cada rodada, decisões de gray areas, score e readiness
|
|
53
53
|
|
|
54
54
|
**No Modo C (validação completa)**, gera adicionalmente:
|
|
55
|
-
- `sheldon-validation.md` — relatório de auditoria com gate por agente (🟢/🟡/🔴)
|
|
55
|
+
- `sheldon-validation-{slug}.md` (projeto: `sheldon-validation.md`) — relatório de auditoria com gate por agente (🟢/🟡/🔴)
|
|
56
56
|
- `.aioson/plans/{slug}/checklist.md` — checklist de implementação por fase
|
|
57
57
|
|
|
58
58
|
**Pesquisas web (RF-WEB)** ficam em:
|
|
@@ -229,13 +229,13 @@ aioson context:monitor . --budget=80000 --tokens=52000
|
|
|
229
229
|
|
|
230
230
|
```
|
|
231
231
|
⚠ Context: 52,000 tokens (65%) — WARNING
|
|
232
|
-
Suggestion: /
|
|
232
|
+
Suggestion: /compact before next agent activation; use /clear only for a hard reset
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
| Zona | Faixa | Ação |
|
|
236
236
|
|---|---|---|
|
|
237
237
|
| safe | < 60% | Continuar normalmente |
|
|
238
|
-
| warning | 60–80% | Planejar `/
|
|
238
|
+
| warning | 60–80% | Planejar `/compact` antes do próximo agente; usar `/clear` só para reset forte |
|
|
239
239
|
| critical | ≥ 80% | Rodar `context:health` e reduzir carga |
|
|
240
240
|
|
|
241
241
|
**Thresholds por classificação** (para automonitoramento dos agentes, configurado em `.aioson/config.md`):
|
|
@@ -69,7 +69,7 @@ aioson context:monitor [path] --budget=<tokens-totais> --tokens=<tokens-atuais>
|
|
|
69
69
|
| Zona | Faixa | Ícone | Ação sugerida |
|
|
70
70
|
|---|---|---|---|
|
|
71
71
|
| safe | < 60% | ✓ | Continuar normalmente |
|
|
72
|
-
| warning | 60–80% | ⚠ | Planejar `/
|
|
72
|
+
| warning | 60–80% | ⚠ | Planejar `/compact` antes do próximo agente; usar `/clear` só para reset forte |
|
|
73
73
|
| critical | ≥ 80% | ! | Rodar `context:health` e reduzir carga |
|
|
74
74
|
|
|
75
75
|
**Exemplos:**
|
|
@@ -82,7 +82,7 @@ aioson context:monitor . --budget=80000 --tokens=28000
|
|
|
82
82
|
# Sessão em warning zone
|
|
83
83
|
aioson context:monitor . --budget=80000 --tokens=52000
|
|
84
84
|
# ⚠ Context: 52,000 tokens (65%) — WARNING
|
|
85
|
-
# Suggestion: /
|
|
85
|
+
# Suggestion: /compact before next agent activation; use /clear only for a hard reset
|
|
86
86
|
|
|
87
87
|
# Sessão em critical zone
|
|
88
88
|
aioson context:monitor . --budget=80000 --tokens=67000
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaimevalasek/aioson",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "AI operating framework for hyper-personalized software.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -46,8 +46,10 @@
|
|
|
46
46
|
"ci": "npm run lint && npm test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"archiver": "^
|
|
49
|
+
"archiver": "^7.0.1",
|
|
50
50
|
"better-sqlite3": "^12.6.2",
|
|
51
|
+
"ignore": "^7.0.5",
|
|
52
|
+
"javascript-obfuscator": "^5.4.3",
|
|
51
53
|
"terser": "^5.48.0"
|
|
52
54
|
}
|
|
53
55
|
}
|
package/src/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ const { runAgentsList, runAgentPrompt } = require('./commands/agents');
|
|
|
14
14
|
const { runContextValidate } = require('./commands/context-validate');
|
|
15
15
|
const { runContextPack } = require('./commands/context-pack');
|
|
16
16
|
const { runContextSelect } = require('./commands/context-select');
|
|
17
|
+
const { runContextBrief } = require('./commands/context-brief');
|
|
17
18
|
const { runRulesLint } = require('./commands/rules-lint');
|
|
18
19
|
const { runContextLoad } = require('./commands/context-load');
|
|
19
20
|
const { runChainAudit } = require('./commands/chain-audit');
|
|
@@ -148,15 +149,17 @@ const { runBackupLocal } = require('./commands/backup-local-cmd');
|
|
|
148
149
|
const { runRecoveryGenerate, runRecoveryShow } = require('./commands/recovery');
|
|
149
150
|
const { runContextMonitor } = require('./commands/context-monitor');
|
|
150
151
|
const { runContextSearch, runContextSearchIndex } = require('./commands/context-search');
|
|
152
|
+
const { runContextGuard } = require('./commands/context-guard');
|
|
151
153
|
const { runContextCacheList, runContextCacheSave, runContextCacheRestore, runContextCacheCleanup } = require('./commands/context-cache');
|
|
152
154
|
const { runSandboxExec } = require('./commands/sandbox');
|
|
153
155
|
const { runAgentLoad, runAgentShardIndex } = require('./commands/agent-loader');
|
|
154
156
|
const { runLearningEvolve, runLearningApply } = require('./commands/learning-evolve');
|
|
155
157
|
const { runLearningRollback } = require('./commands/learning-rollback');
|
|
156
|
-
const { runToolRegistry } = require('./commands/tool-registry-cmd');
|
|
157
|
-
const { runHealth } = require('./commands/health');
|
|
158
|
-
const { runContextHealth } = require('./commands/context-health');
|
|
159
|
-
const {
|
|
158
|
+
const { runToolRegistry } = require('./commands/tool-registry-cmd');
|
|
159
|
+
const { runHealth } = require('./commands/health');
|
|
160
|
+
const { runContextHealth } = require('./commands/context-health');
|
|
161
|
+
const { runHygieneScan } = require('./commands/hygiene-scan');
|
|
162
|
+
const { runContextTrim } = require('./commands/context-trim');
|
|
160
163
|
const { runHooksEmit } = require('./commands/hooks-emit');
|
|
161
164
|
const { runHooksInstall, runHooksUninstall } = require('./commands/hooks-install');
|
|
162
165
|
const { runSessionGuard } = require('./commands/session-guard');
|
|
@@ -198,12 +201,15 @@ const { runOpMigrate } = require('./commands/op-migrate');
|
|
|
198
201
|
const { runFeatureClose } = require('./commands/feature-close');
|
|
199
202
|
const { runFeatureArchive, runFeatureSweep } = require('./commands/feature-archive');
|
|
200
203
|
const { runFeatureExport } = require('./commands/feature-export');
|
|
204
|
+
const { runFeatureCurrent } = require('./commands/feature-current');
|
|
201
205
|
const { runDossierInit, runDossierShow, runDossierAddFinding, runDossierAddCodemap, runDossierLinkRule, runDossierCompact } = require('./commands/dossier');
|
|
202
206
|
const { runDossierAddResearch } = require('./commands/dossier-add-research');
|
|
203
207
|
const { runDossierAudit } = require('./commands/dossier-audit');
|
|
204
208
|
const { runDevResumeData } = require('./commands/dev-resume');
|
|
205
|
-
const { runRevisionOpen, runRevisionList, runRevisionResolve } = require('./commands/revision');
|
|
206
|
-
const {
|
|
209
|
+
const { runRevisionOpen, runRevisionList, runRevisionResolve } = require('./commands/revision');
|
|
210
|
+
const { runAcTestAudit } = require('./commands/ac-test-audit');
|
|
211
|
+
const { runSddBenchmark } = require('./commands/sdd-benchmark');
|
|
212
|
+
const { runGateCheck } = require('./commands/gate-check');
|
|
207
213
|
const { runGateApprove } = require('./commands/gate-approve');
|
|
208
214
|
const { runArtifactValidate } = require('./commands/artifact-validate');
|
|
209
215
|
const { runWorkflowExecute } = require('./commands/workflow-execute');
|
|
@@ -258,6 +264,10 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
258
264
|
'context-pack',
|
|
259
265
|
'context:select',
|
|
260
266
|
'context-select',
|
|
267
|
+
'context:brief',
|
|
268
|
+
'context-brief',
|
|
269
|
+
'context:guard',
|
|
270
|
+
'context-guard',
|
|
261
271
|
'rules:lint',
|
|
262
272
|
'rules-lint',
|
|
263
273
|
'context:load',
|
|
@@ -278,6 +288,8 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
278
288
|
'workflow-next',
|
|
279
289
|
'workflow:status',
|
|
280
290
|
'workflow-status',
|
|
291
|
+
'feature:current',
|
|
292
|
+
'feature-current',
|
|
281
293
|
'harness:retro',
|
|
282
294
|
'harness-retro',
|
|
283
295
|
'harness:preview',
|
|
@@ -599,12 +611,16 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
599
611
|
'recovery-show',
|
|
600
612
|
'context:monitor',
|
|
601
613
|
'context-monitor',
|
|
602
|
-
'context:health',
|
|
603
|
-
'context-health',
|
|
604
|
-
'
|
|
614
|
+
'context:health',
|
|
615
|
+
'context-health',
|
|
616
|
+
'hygiene:scan',
|
|
617
|
+
'hygiene-scan',
|
|
618
|
+
'context:trim',
|
|
605
619
|
'context-trim',
|
|
606
620
|
'context:search',
|
|
607
621
|
'context-search',
|
|
622
|
+
'context:index',
|
|
623
|
+
'context-index',
|
|
608
624
|
'context:search:index',
|
|
609
625
|
'context-search-index',
|
|
610
626
|
'context:cache',
|
|
@@ -669,6 +685,8 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
669
685
|
'feature-sweep',
|
|
670
686
|
'feature:export',
|
|
671
687
|
'feature-export',
|
|
688
|
+
'feature:current',
|
|
689
|
+
'feature-current',
|
|
672
690
|
'dossier:init',
|
|
673
691
|
'dossier-init',
|
|
674
692
|
'dossier:show',
|
|
@@ -691,9 +709,13 @@ const JSON_SUPPORTED_COMMANDS = new Set([
|
|
|
691
709
|
'revision-open',
|
|
692
710
|
'revision:list',
|
|
693
711
|
'revision-list',
|
|
694
|
-
'revision:resolve',
|
|
695
|
-
'revision-resolve',
|
|
696
|
-
'
|
|
712
|
+
'revision:resolve',
|
|
713
|
+
'revision-resolve',
|
|
714
|
+
'ac:test-audit',
|
|
715
|
+
'ac-test-audit',
|
|
716
|
+
'sdd:benchmark',
|
|
717
|
+
'sdd-benchmark',
|
|
718
|
+
'gate:check',
|
|
697
719
|
'gate-check',
|
|
698
720
|
'gate:approve',
|
|
699
721
|
'gate-approve',
|
|
@@ -810,9 +832,10 @@ function printHelp(t, logger) {
|
|
|
810
832
|
logHelpLine(t, logger, 'cli.help_install');
|
|
811
833
|
logHelpLine(t, logger, 'cli.help_setup');
|
|
812
834
|
logHelpLine(t, logger, 'cli.help_update');
|
|
813
|
-
logHelpLine(t, logger, 'cli.help_info');
|
|
814
|
-
logHelpLine(t, logger, 'cli.help_doctor');
|
|
815
|
-
logHelpLine(t, logger, 'cli.
|
|
835
|
+
logHelpLine(t, logger, 'cli.help_info');
|
|
836
|
+
logHelpLine(t, logger, 'cli.help_doctor');
|
|
837
|
+
logHelpLine(t, logger, 'cli.help_hygiene_scan');
|
|
838
|
+
logHelpLine(t, logger, 'cli.help_i18n_add');
|
|
816
839
|
logHelpLine(t, logger, 'cli.help_agents');
|
|
817
840
|
logHelpLine(t, logger, 'cli.help_agent_prompt');
|
|
818
841
|
logHelpLine(t, logger, 'cli.help_agent_help');
|
|
@@ -820,7 +843,10 @@ function printHelp(t, logger) {
|
|
|
820
843
|
logHelpLine(t, logger, 'cli.help_agent_epilogue');
|
|
821
844
|
logHelpLine(t, logger, 'cli.help_context_validate');
|
|
822
845
|
logHelpLine(t, logger, 'cli.help_context_pack');
|
|
846
|
+
logHelpLine(t, logger, 'cli.help_context_search');
|
|
823
847
|
logHelpLine(t, logger, 'cli.help_context_select');
|
|
848
|
+
logHelpLine(t, logger, 'cli.help_context_brief');
|
|
849
|
+
logHelpLine(t, logger, 'cli.help_context_guard');
|
|
824
850
|
logHelpLine(t, logger, 'cli.help_context_load');
|
|
825
851
|
logHelpLine(t, logger, 'cli.help_memory_status');
|
|
826
852
|
logHelpLine(t, logger, 'cli.help_memory_summary');
|
|
@@ -1108,6 +1134,10 @@ async function main() {
|
|
|
1108
1134
|
result = await runContextPack({ args, options, logger: commandLogger, t });
|
|
1109
1135
|
} else if (command === 'context:select' || command === 'context-select') {
|
|
1110
1136
|
result = await runContextSelect({ args, options, logger: commandLogger, t });
|
|
1137
|
+
} else if (command === 'context:brief' || command === 'context-brief') {
|
|
1138
|
+
result = await runContextBrief({ args, options, logger: commandLogger, t });
|
|
1139
|
+
} else if (command === 'context:guard' || command === 'context-guard') {
|
|
1140
|
+
result = await runContextGuard({ args, options, logger: commandLogger, t });
|
|
1111
1141
|
} else if (command === 'rules:lint' || command === 'rules-lint') {
|
|
1112
1142
|
result = await runRulesLint({ args, options, logger: commandLogger, t });
|
|
1113
1143
|
} else if (command === 'context:load' || command === 'context-load') {
|
|
@@ -1510,13 +1540,20 @@ async function main() {
|
|
|
1510
1540
|
result = await runRecoveryShow({ args, options, logger: commandLogger, t });
|
|
1511
1541
|
} else if (command === 'context:monitor' || command === 'context-monitor') {
|
|
1512
1542
|
result = await runContextMonitor({ args, options, logger: commandLogger, t });
|
|
1513
|
-
} else if (command === 'context:health' || command === 'context-health') {
|
|
1514
|
-
result = await runContextHealth({ args, options, logger: commandLogger });
|
|
1515
|
-
} else if (command === '
|
|
1516
|
-
result = await
|
|
1543
|
+
} else if (command === 'context:health' || command === 'context-health') {
|
|
1544
|
+
result = await runContextHealth({ args, options, logger: commandLogger });
|
|
1545
|
+
} else if (command === 'hygiene:scan' || command === 'hygiene-scan') {
|
|
1546
|
+
result = await runHygieneScan({ args, options, logger: commandLogger });
|
|
1547
|
+
} else if (command === 'context:trim' || command === 'context-trim') {
|
|
1548
|
+
result = await runContextTrim({ args, options, logger: commandLogger });
|
|
1517
1549
|
} else if (command === 'context:search' || command === 'context-search') {
|
|
1518
1550
|
result = await runContextSearch({ args, options, logger: commandLogger, t });
|
|
1519
|
-
} else if (
|
|
1551
|
+
} else if (
|
|
1552
|
+
command === 'context:index' ||
|
|
1553
|
+
command === 'context-index' ||
|
|
1554
|
+
command === 'context:search:index' ||
|
|
1555
|
+
command === 'context-search-index'
|
|
1556
|
+
) {
|
|
1520
1557
|
result = await runContextSearchIndex({ args, options, logger: commandLogger, t });
|
|
1521
1558
|
} else if (command === 'context:cache' || command === 'context-cache') {
|
|
1522
1559
|
result = await runContextCacheList({ args, options, logger: commandLogger, t });
|
|
@@ -1596,6 +1633,8 @@ async function main() {
|
|
|
1596
1633
|
result = await runFeatureSweep({ args, options, logger: commandLogger });
|
|
1597
1634
|
} else if (command === 'feature:export' || command === 'feature-export') {
|
|
1598
1635
|
result = await runFeatureExport({ args, options, logger: commandLogger });
|
|
1636
|
+
} else if (command === 'feature:current' || command === 'feature-current') {
|
|
1637
|
+
result = await runFeatureCurrent({ args, options, logger: commandLogger });
|
|
1599
1638
|
} else if (command === 'dossier:init' || command === 'dossier-init') {
|
|
1600
1639
|
result = await runDossierInit({ args, options, logger: commandLogger });
|
|
1601
1640
|
} else if (command === 'dossier:show' || command === 'dossier-show') {
|
|
@@ -1618,10 +1657,14 @@ async function main() {
|
|
|
1618
1657
|
result = await runRevisionOpen({ args, options, logger: commandLogger });
|
|
1619
1658
|
} else if (command === 'revision:list' || command === 'revision-list') {
|
|
1620
1659
|
result = await runRevisionList({ args, options, logger: commandLogger });
|
|
1621
|
-
} else if (command === 'revision:resolve' || command === 'revision-resolve') {
|
|
1622
|
-
result = await runRevisionResolve({ args, options, logger: commandLogger });
|
|
1623
|
-
} else if (command === '
|
|
1624
|
-
result = await
|
|
1660
|
+
} else if (command === 'revision:resolve' || command === 'revision-resolve') {
|
|
1661
|
+
result = await runRevisionResolve({ args, options, logger: commandLogger });
|
|
1662
|
+
} else if (command === 'ac:test-audit' || command === 'ac-test-audit') {
|
|
1663
|
+
result = await runAcTestAudit({ args, options, logger: commandLogger });
|
|
1664
|
+
} else if (command === 'sdd:benchmark' || command === 'sdd-benchmark') {
|
|
1665
|
+
result = await runSddBenchmark({ args, options, logger: commandLogger });
|
|
1666
|
+
} else if (command === 'gate:check' || command === 'gate-check') {
|
|
1667
|
+
result = await runGateCheck({ args, options, logger: commandLogger });
|
|
1625
1668
|
} else if (command === 'gate:approve' || command === 'gate-approve') {
|
|
1626
1669
|
result = await runGateApprove({ args, options, logger: commandLogger });
|
|
1627
1670
|
} else if (command === 'artifact:validate' || command === 'artifact-validate') {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
const { auditAcceptanceCriteriaTests } = require('../lib/ac-test-audit');
|
|
5
|
+
|
|
6
|
+
async function runAcTestAudit({ args, options = {}, logger }) {
|
|
7
|
+
const targetDir = path.resolve(process.cwd(), args?.[0] || '.');
|
|
8
|
+
const slug = String(options.feature || options.slug || '').trim();
|
|
9
|
+
|
|
10
|
+
if (!slug) {
|
|
11
|
+
if (options.json) return { ok: false, error: 'missing_feature' };
|
|
12
|
+
logger.error('--feature=<slug> is required.');
|
|
13
|
+
return { ok: false, error: 'missing_feature' };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const report = await auditAcceptanceCriteriaTests(targetDir, slug);
|
|
17
|
+
|
|
18
|
+
if (options.json) {
|
|
19
|
+
logger.log(JSON.stringify(report, null, 2));
|
|
20
|
+
return report;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
logger.log('');
|
|
24
|
+
logger.log(`AC test audit — ${slug}`);
|
|
25
|
+
logger.log('━'.repeat(45));
|
|
26
|
+
logger.log(`ACs: ${report.summary.covered}/${report.summary.acs_total} covered; tests scanned: ${report.summary.test_files_scanned}`);
|
|
27
|
+
|
|
28
|
+
if (report.summary.acs_total === 0) {
|
|
29
|
+
logger.log('No acceptance criteria IDs found in requirements, PRD, or conformance artifacts.');
|
|
30
|
+
} else {
|
|
31
|
+
for (const item of report.items) {
|
|
32
|
+
const mark = item.status === 'covered' ? '✓' : '✗';
|
|
33
|
+
const evidence = item.evidence.length
|
|
34
|
+
? ` — ${item.evidence.map((e) => e.file).join(', ')}`
|
|
35
|
+
: '';
|
|
36
|
+
logger.log(` ${mark} ${item.ac}: ${item.status}${evidence}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
logger.log('');
|
|
41
|
+
logger.log(report.ok ? 'Result: PASS' : `Result: BLOCKED — missing tests for ${report.missing.join(', ')}`);
|
|
42
|
+
return report;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = { runAcTestAudit };
|