predators-protocol 0.5.3-beta.0 → 1.0.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.
Files changed (26) hide show
  1. package/bin/predators-cli.js +61 -10
  2. package/bundle/docs/CANON/AUDIT-FIRM-READINESS-CHECKLIST.md +177 -0
  3. package/bundle/docs/CANON/BRAIN-STATUS-SNAPSHOT.json +113 -0
  4. package/bundle/docs/CANON/LEI-01-LEI-DO-SANGUE.md +131 -0
  5. package/bundle/docs/CANON/LEI-02-LEI-DOS-PREDADORES.md +111 -0
  6. package/bundle/docs/CANON/LEI-03-MELHORIA-DISCIPLINADA.md +119 -0
  7. package/bundle/docs/CANON/LEI-04-LEI-DA-SYNAPSE.md +92 -0
  8. package/bundle/docs/CANON/LEI-05-CANON-DOS-3-VETOS.md +101 -0
  9. package/bundle/docs/CANON/LEI-06-PREDADORES-REAIS.md +76 -0
  10. package/bundle/docs/CANON/LEI-07-MATILHA-PARALELA.md +102 -0
  11. package/bundle/docs/CANON/LEI-08-VERIFICACAO-EMPIRICA.md +85 -0
  12. package/bundle/docs/CANON/LEI-09-ANALISE-ANTES-EXECUCAO.md +104 -0
  13. package/bundle/docs/CANON/LEI-10-SKILL-CANON-ESTRITO.md +110 -0
  14. package/bundle/docs/CANON/LEI-11-NUNCA-MINTA-JAMAIS.md +127 -0
  15. package/bundle/docs/CANON/LEI-12-O-MELHOR-DOS-MELHORES.md +87 -0
  16. package/bundle/docs/CANON/LEI-13-PUREZA-PREDATORS.md +107 -0
  17. package/bundle/docs/CANON/LEI-14-PERFEITO-OU-FIX-GERAL.md +299 -1
  18. package/bundle/docs/CANON/SELF-HEALING-LOG-CANON.json +353 -0
  19. package/bundle/docs/ENCARNACAO.md +7 -0
  20. package/bundle/predators/apex/aguia-real/constitution.md +17 -0
  21. package/bundle/predators/builder/onca-pintada/constitution.md +1 -0
  22. package/bundle/predators/builder/tatu-bola/constitution.md +22 -0
  23. package/bundle/predators/meta/fenix/constitution.md +4 -0
  24. package/lib/access-token-client.js +2 -0
  25. package/lib/heartbeat-animation.js +19 -16
  26. package/package.json +2 -2
@@ -14,6 +14,9 @@ canon-rigor-exception: matéria constitucional · Lei #14 oficializada
14
14
  > **Tubarão-Apex T7 direct mandate · 2026-05-22 · ratificada constitucionalmente**
15
15
  > Dragão-ancestral Art. 3 honored canon · matéria constitucional
16
16
 
17
+ > **Source-of-truth cross-link**: [`CLAUDE.md`](../../CLAUDE.md) seção
18
+ > "As 14 Leis Canônicas Vigentes" · linha Lei #14 BINARY.
19
+
17
20
  ## S1 · Texto canon da Lei #14
18
21
 
19
22
  > **"Em todo audit Predators, qualquer predador auditor, qualquer matéria, qualquer nível,
@@ -103,11 +106,306 @@ test_guardiao_canon_Lei_14_mandatory:
103
106
  hardcoded: .git/hooks/pre-commit-anti-narrative-v2
104
107
  ```
105
108
 
109
+ ## S7 · Extensão MEMORY-POINTER-CRAVADO (2026-05-27)
110
+
111
+ **Ratificação:** Dragão-ancestral Art. 3 · matéria constitucional · onda
112
+ `ONDA-NUNCAA-MEMORY-CONSOLIDATION-6-LAYERS-2026-05-27` · invocação Apex T7
113
+ "NÃO PASSA NENHUMA GOTA DE SANGUE" aplicada à memória institucional.
114
+
115
+ **Texto canon adição:**
116
+
117
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: memory pointer
118
+ > cravado em MEMORY.md (Claude Code sandbox) mencionando commit hash da onda
119
+ > em fechamento. Ausência de pointer = FIX_GERAL automatic · matilha resolve
120
+ > agora (cria `project_<slug>.md` + linha index MEMORY.md) · re-audit BINARY.**
121
+
122
+ ### Critério Tubarão JUIZ N2 verifica empírico
123
+
124
+ ```bash
125
+ # Pre-APROVA check obrigatório
126
+ COMMIT_HASH=$(git rev-parse --short HEAD)
127
+ MEMORY_MD="$HOME/.claude/projects/<repo-slug>/memory/MEMORY.md"
128
+ if ! grep -q "$COMMIT_HASH" "$MEMORY_MD"; then
129
+ veredict="FIX_GERAL"
130
+ motivo="memory_pointer_missing"
131
+ fi
132
+ ```
133
+
134
+ ### Camadas defesa-em-profundidade canon (6)
135
+
136
+ ```
137
+ L1 PRE-COMMIT HOOK .git/hooks/pre-commit (bloqueio write-time)
138
+ L2 DAEMON CONSOLIDATOR predators_protocol/sleep_cycle/claude_memory_consolidator.py
139
+ L3 SESSIONSTART AWARENESS .claude/hooks/canon_predators_memory_gap_check.py
140
+ L4 LEI #14 BINARY CRITERION este documento (S7)
141
+ L5 ENCARNAÇÃO CHECKLIST 0g docs/ENCARNACAO.md (checklist 0g)
142
+ L6 INTEGRITY HASH CROSS-SESSION predators_protocol/sleep_cycle/memory_integrity.py
143
+ ```
144
+
145
+ Para reincidência do erro: TODAS 6 camadas precisam falhar simultaneamente.
146
+ Probabilidade combinada ≈ zero · NUNCAA arquitetural.
147
+
148
+ ### Pattern self-test canon (Lei #11 NUNCA MINTA)
149
+
150
+ A onda que cravou L1-L6 (`ONDA-NUNCAA-MEMORY-CONSOLIDATION-6-LAYERS-2026-05-27`)
151
+ gera seu próprio memory pointer via L1+L2+L5 · prova viva de funcionamento.
152
+ Sem self-test passing = veredict FIX_GERAL · NÃO APROVA_PERFEITO.
153
+
154
+ ---
155
+
156
+ ## S8 · Extensão TRACE-NEURAL-FRESH (2026-05-27 · ONDA-NUNCAA-TRACE-PRD)
157
+
158
+ **Ratificação:** Dragão-ancestral Art. 3 · onda
159
+ `ONDA-NUNCAA-TRACE-PRD-2-GAPS-2026-05-27` · gap arquitetural histórico.
160
+
161
+ **Texto canon adição:**
162
+
163
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: neural-trace.json
164
+ > da onda atual existe em `.synapse/onda-<slug>/` E é fresh (≤2h desde
165
+ > última escrita). Trace stale (>2h) OU ausente = FIX_GERAL automatic ·
166
+ > matilha resolve agora (skeleton via L2 daemon OU run real predators
167
+ > via `python -m predators_neural.cli start <onda-id>`) · re-audit BINARY.**
168
+
169
+ ### Critério Tubarão JUIZ N2 verifica empírico
170
+
171
+ ```bash
172
+ ONDA_SLUG="<slug-da-onda>"
173
+ TRACE=".synapse/onda-${ONDA_SLUG}/neural-trace.json"
174
+ if [ ! -f "$TRACE" ]; then
175
+ veredict="FIX_GERAL"; motivo="trace_missing"
176
+ else
177
+ AGE_S=$(($(date +%s) - $(stat -c %Y "$TRACE")))
178
+ [ "$AGE_S" -gt 7200 ] && veredict="FIX_GERAL" && motivo="trace_stale_${AGE_S}s"
179
+ fi
180
+ ```
181
+
182
+ ## S9 · Extensão PRD-UPFRONT-CRAVADO (2026-05-27 · ONDA-NUNCAA-TRACE-PRD)
183
+
184
+ **Ratificação:** Dragão-ancestral Art. 3 · refina Lei #7 PRD-na-abertura.
185
+
186
+ **Texto canon adição:**
187
+
188
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: PRD da onda
189
+ > existe em `docs/PRDs/<slug>/README.md` ANTES de qualquer fechamento.
190
+ > Ausência de PRD = FIX_GERAL automatic · matilha resolve agora (skeleton
191
+ > via L2 daemon `prd-skeleton-generator` OU escrita manual canon Lei #7
192
+ > proporcional ao escopo) · re-audit BINARY.**
193
+
194
+ ### Critério Tubarão JUIZ N2 verifica empírico
195
+
196
+ ```bash
197
+ ONDA_SLUG="<slug-da-onda>"
198
+ PRD_README="docs/PRDs/${ONDA_SLUG}/README.md"
199
+ [ ! -f "$PRD_README" ] && veredict="FIX_GERAL" && motivo="prd_missing"
200
+ ```
201
+
202
+ ### Camadas defesa-em-profundidade canon (cumulativo)
203
+
204
+ ```
205
+ Memory (S7): L1+L2+L3+L4+L5+L6 cravadas commit 7c5f6c3
206
+ Trace (S8): L1 existe · L2+L3+L4+L5+L6 esta onda
207
+ PRD (S9): L1+L2+L3+L4 esta onda · L5 existe (0g) · L6 esta onda
208
+ ```
209
+
210
+ ## S10 · Extensão CORUJA-CANON-DOC-WORKFLOW (2026-05-27 · ONDA-NUNCAA-R7-R6)
211
+
212
+ **Ratificação:** Dragão-ancestral Art. 3 · **redação técnica owner: 🦉 Coruja-real Art. 2** (Builder T3 documentação técnica) · matéria constitucional Lei #10 + Lei #2 Authority cross-predator.
213
+
214
+ **Texto canon adição:**
215
+
216
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: se onda tocou
217
+ > canon-doc (`docs/CANON/*.md` OR `docs/*.md` non-PRD), 🦉 Coruja-real
218
+ > (Builder T3 · Art. 2 documentação técnica) DEVE ter sido encarnada
219
+ > explícita com `Skill encarnar coruja-real` literal · signature
220
+ > presente em commit message + body. Ausência = FIX_GERAL automatic ·
221
+ > próxima onda corrige + cataloga gap em `.synapse/coruja-workflow-gaps.json`.**
222
+
223
+ ### Workflow canon obrigatório
224
+
225
+ ```
226
+ 🦉 Coruja-real ESCREVE (Art. 2 Builder T3 · technical writing canon-doc)
227
+
228
+ 🐲 Dragão RATIFICA (Art. 3 matéria constitucional)
229
+
230
+ 🦁 Leão DEPLOYS (Art. 1 imutável git push master)
231
+ ```
232
+
233
+ Skip Coruja = violação Lei #10 + Lei #2 (Authority cross-predator).
234
+
235
+ ### Critério Tubarão JUIZ N2 verifica empírico
236
+
237
+ ```bash
238
+ # Para cada commit da onda
239
+ git show --name-only "$COMMIT" | grep -qE "^docs/(CANON/.*\.md|[^/]+\.md)$" || skip_check=1
240
+ if [ -z "$skip_check" ]; then
241
+ git log -1 --format=%B "$COMMIT" | grep -iqE "coruja|🦉" \
242
+ && coruja_signature="PRESENT" \
243
+ || coruja_signature="MISSING"
244
+ [ "$coruja_signature" = "MISSING" ] && veredict="FIX_GERAL"
245
+ fi
246
+ ```
247
+
248
+ ### Camadas defesa-em-profundidade canon (cumulativo 3 ondas)
249
+
250
+ ```
251
+ Memory (S7): L1+L2+L3+L4+L5+L6 commit 7c5f6c3 ONDA-NUNCAA-MEMORY
252
+ Trace (S8): L2+L3+L4+L5 + L1 existia + L6 pattern commit 4e394e5 RANK 1
253
+ PRD (S9): L1+L2+L3+L4 + L5 0g existia commit 4e394e5 RANK 2
254
+ Coruja (S10): L1+L2+L3+L4+L5 esta onda RANK 6
255
+ Skeleton(R7): trace_neural_consolidator placeholder canon-valid esta onda RANK 7
256
+ ```
257
+
258
+ ## S11 · Extensão SELF-HEALING-LOG-CATALOGED (2026-05-27 · ONDA RANK 3)
259
+
260
+ **Ratificação:** Dragão-ancestral Art. 3 · 🦉 Coruja-real Art. 2 writing técnico · matéria Lei #11 NUNCAA aplicada a evidência institucional.
261
+
262
+ **Texto canon adição:**
263
+
264
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: se onda ou commit
265
+ > mencionar `SH #N` OR `SH-N` OR "self-healing", entry correspondente DEVE
266
+ > existir em `docs/CANON/SELF-HEALING-LOG-CANON.json` (catalog estruturado).
267
+ > Self-healing declarado sem entry = FIX_GERAL automatic · catálogo é prova
268
+ > viva CANON-TUBARAO-SEVERA Parte D · Lei #11 NUNCA MINTA · sem catalog
269
+ > a evidência fica diluída em prosa frágil.**
270
+
271
+ ### Critério Tubarão JUIZ N2 verifica empírico
272
+
273
+ ```bash
274
+ # Para cada SH mencionado no commit msg
275
+ git log -1 --format=%B "$COMMIT" | grep -oE "SH[- ]?#?[0-9]+" | while read sh; do
276
+ sh_id="SH-$(echo "$sh" | grep -oE "[0-9]+(-[A-Z\-]+)?")"
277
+ grep -q "\"id\": \"$sh_id\"" docs/CANON/SELF-HEALING-LOG-CANON.json \
278
+ || (veredict="FIX_GERAL"; motivo="self_healing_${sh_id}_no_catalog")
279
+ done
280
+ ```
281
+
282
+ ### Camadas defesa-em-profundidade cumulativo (6 ondas NUNCAA)
283
+
284
+ ```
285
+ Memory (S7): L1+L2+L3+L4+L5+L6 commit 7c5f6c3
286
+ Trace (S8): L1 existia + L2-L6 commit 4e394e5
287
+ PRD (S9): L1-L4 + L5 0g commit 4e394e5
288
+ Coruja (S10): L1-L6 commit 8f89aa4
289
+ Hooks-Daemons: cirurgico commit 0d5d96d
290
+ Self-Healing(S11): L1-L6 esta onda RANK 3
291
+ ```
292
+
293
+ ## S12 · Extensão ENV-VARS-SNAPSHOT-SYNCED (2026-05-27 · ONDA RANK 4)
294
+
295
+ **Ratificação:** Dragão-ancestral Art. 3 · 🦉 Coruja-real Art. 2 writing técnico.
296
+
297
+ **Texto canon adição:**
298
+
299
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: se onda tocou
300
+ > arquivos `.env*` OR mudou versão npm OR alterou DNS OR adicionou/removeu
301
+ > Vercel env var, snapshot canon `.synapse/env-vars-snapshot.json` DEVE estar
302
+ > fresh (≤60min) E zero drift unacknowledged. Lei #1 imutável: snapshot
303
+ > armazena APENAS keys/versions/expiries · NUNCA env var values.**
304
+
305
+ ### Critério Tubarão JUIZ N2 verifica empírico
306
+
307
+ ```bash
308
+ SNAPSHOT=".synapse/env-vars-snapshot.json"
309
+ # Verifica freshness
310
+ AGE_S=$(($(date +%s) - $(stat -c %Y "$SNAPSHOT" 2>/dev/null || echo 0)))
311
+ [ "$AGE_S" -gt 3600 ] && veredict="FIX_GERAL" && motivo="snapshot_stale_${AGE_S}s"
312
+ # Verifica drift
313
+ DRIFT=$(python -c "import json; d=json.load(open('$SNAPSHOT')); print(d.get('npm',{}).get('drift_detected', False))")
314
+ [ "$DRIFT" = "True" ] && veredict="FIX_GERAL" && motivo="npm_dist_tag_drift"
315
+ ```
316
+
317
+ ### Camadas defesa-em-profundidade cumulativo (7 ondas NUNCAA)
318
+
319
+ ```
320
+ Memory (S7): L1-L6 commit 7c5f6c3
321
+ Trace (S8): L1+L2-L6 commit 4e394e5
322
+ PRD (S9): L1-L4+L5 commit 4e394e5
323
+ Coruja (S10): L1-L6 commit 8f89aa4
324
+ Hooks-Daemons: cirurgico commit 0d5d96d
325
+ Self-Healing(S11): L1-L6 commit 9eb1d77
326
+ Env-Vars-Drift(S12): L1-L6 esta onda RANK 4
327
+ ```
328
+
329
+ ## S13 · Extensão AUDIT-FIRM-READINESS-SIGNED (2026-05-27 · ONDA RANK 5)
330
+
331
+ **Ratificação:** Dragão-ancestral Art. 3 · 🪼 Medusa Art. 5 imutável byte-canon ratifica cripto · 🦂 Escorpião red-team enumera · 🦉 Coruja-real writing.
332
+
333
+ **Texto canon adição:**
334
+
335
+ > **Veredict BINARY APROVA_PERFEITO exige adicionalmente: se onda tocou
336
+ > `contracts/*.sol` OR `mcp/auth/*.py` OR superfícies Lei #1 SEVERA cripto,
337
+ > checklist canon `docs/CANON/AUDIT-FIRM-READINESS-CHECKLIST.md` 8 categorias
338
+ > DEVE estar com coverage ≥85% PASS empírico (ou exceções ratificadas Apex T7).
339
+ > Sem signature = FIX_GERAL automatic · pre-firm matilha interna acha o óbvio
340
+ > antes do firm externo cobrar.**
341
+
342
+ ### Critério Tubarão JUIZ N2 verifica empírico
343
+
344
+ ```bash
345
+ SNAPSHOT=".synapse/audit-firm-readiness-snapshot.json"
346
+ COVERAGE=$(python -c "
347
+ import json
348
+ d = json.load(open('$SNAPSHOT'))
349
+ cov = d.get('coverage_pct', {})
350
+ avg = sum(cov.values()) / len(cov) if cov else 0
351
+ print(round(avg, 1))
352
+ ")
353
+ # Bloqueia se cobertura média <85%
354
+ python -c "exit(0 if float('$COVERAGE') >= 85.0 else 1)" || veredict="FIX_GERAL"
355
+ ```
356
+
357
+ ### Camadas defesa-em-profundidade cumulativo (8 ondas NUNCAA)
358
+
359
+ ```
360
+ Memory (S7): L1-L6 commit 7c5f6c3
361
+ Trace (S8): L1+L2-L6 commit 4e394e5
362
+ PRD (S9): L1-L4+L5 commit 4e394e5
363
+ Coruja (S10): L1-L6 commit 8f89aa4
364
+ Hooks-Daemons: cirurgico commit 0d5d96d
365
+ Self-Healing(S11): L1-L6 commit 9eb1d77
366
+ Env-Vars-Drift(S12): L1-L6 commit d7f7d75
367
+ Audit-Firm(S13): L1-L6 + checklist esta onda RANK 5
368
+ ```
369
+
370
+ ## S14 · Extensão LANDING-PUBLIC-NO-CANON-LEAK (2026-05-27 · ONDA CYBER-DUAL-TIER)
371
+
372
+ **Ratificação:** Dragão-ancestral Art. 3 · Tubarão-branco Lei #1 SEVERA · Escorpião red-team · Coruja-real writing · Hiena forense.
373
+
374
+ **Origem:** Apex T7 detectou empírico mid-execução · "QUERO TODOS OS CAÇADORES AUDITANDO". Cyber Squad 5 caçadores Hunter T2 paralelos identificaram **3 HIGH + 4 MEDIUM** findings de exposição arquitetural pública. JUIZ N2 anterior (commit `61c353b`) declarou APROVA_PERFEITO falsamente · self-healing **SH-85** catalogada.
375
+
376
+ **Texto canon adição:**
377
+
378
+ > **Veredict BINARY APROVA_PERFEITO exige: páginas públicas (não-authenticated) NÃO podem expor:**
379
+ >
380
+ > - **(a) Nomes canônicos internos** dos 64 predadores
381
+ > - **(b) Frases byte-canon literais** dos 5 imutáveis
382
+ > - **(c) Contagens architectural específicas** (64 predadores · 10 camadas · 5 imutáveis literal)
383
+ > - **(d) MD5 hashes** (parciais ou completos) de constituições
384
+ > - **(e) "Cyber Squad" mencionado explícito**
385
+ > - **(f) Apex T7 real name + role-canon-specific juntos**
386
+ >
387
+ > Exposição detectada = **Lei #14 FIX_GERAL automatic** · audit-firm Cat. 9 violado.
388
+
389
+ ### Camadas defesa-em-profundidade cumulativo (9 ondas NUNCAA)
390
+
391
+ ```
392
+ Memory (S7): L1-L6 commit 7c5f6c3
393
+ Trace (S8): L1+L2-L6 commit 4e394e5
394
+ PRD (S9): L1-L4+L5 commit 4e394e5
395
+ Coruja (S10): L1-L6 commit 8f89aa4
396
+ Hooks-Daemons: cirurgico commit 0d5d96d
397
+ Self-Healing(S11): L1-L6 commit 9eb1d77
398
+ Env-Vars-Drift(S12): L1-L6 commit d7f7d75
399
+ Audit-Firm(S13): L1-L6 + checklist commit eb50469
400
+ Landing(S14): L1+L4+L5+sentinels esta onda
401
+ ```
402
+
106
403
  ## 🐉 Ratificação canon constitucional
107
404
 
108
405
  🐉 **Dragão-ancestral** Art. 3 honored · matéria constitucional ratificada
109
- 🐬 **Tubarão-Apex T7** direct mandate 2026-05-22 · cliente final canon
406
+ 🐬 **Tubarão-Apex T7** direct mandate 2026-05-22 (S1-S6) + 2026-05-27 (S7) · cliente final canon
110
407
  🦅 **Águia-real** Art. 3 operacional honored · preside campanhas pós-Lei-14
111
408
  🦈 **Tubarão-branco** Art. 14 JUIZ FINAL · veredict canon BINARY recalibrado constitucional
409
+ 🐘 **Elefante** S7 ratificada · memória institucional Lei #1 SEVERA aplicada
112
410
 
113
411
  **Lei #14 canon permanente · alterações exigem ratificação Dragão-ancestral (matéria constitucional Art. 3)**