predators-protocol 0.5.4-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.
@@ -9,7 +9,7 @@ const fs = require("fs");
9
9
  const path = require("path");
10
10
  const { spawnSync } = require("child_process");
11
11
 
12
- const CLI_VERSION_CANON = "predators-cli-canon-0.5.4-beta.0-heartbeat-cinematic-perceptivel-2026-05-27";
12
+ const CLI_VERSION_CANON = "predators-cli-canon-1.0.0-STABLE-14-leis-14-canon-docs-brain-100pct-2026-05-28";
13
13
 
14
14
  const PACKAGE_ROOT = path.resolve(__dirname, "..");
15
15
  const BUNDLE_DIR = path.join(PACKAGE_ROOT, "bundle");
@@ -66,12 +66,12 @@ function detectPythonCanon() {
66
66
 
67
67
  function printHelpCanon() {
68
68
  console.error(`
69
- predators-cli · canon Predators NPX CLI 0.4.0-beta.0 (Lei #14 PERFEITO OU FIX-GERAL)
69
+ predators-cli · canon Predators NPX CLI 1.0.0 STABLE (canon 100% · 14 leis ratificadas)
70
70
 
71
71
  USO:
72
72
  npx predators-protocol <comando>
73
73
 
74
- COMANDOS canon vigentes (16 comandos):
74
+ COMANDOS canon vigentes (17 comandos):
75
75
 
76
76
  -- fase 1 (introspecção · 4 comandos) --
77
77
  version Exibe versão canon
@@ -102,13 +102,17 @@ COMANDOS canon vigentes (16 comandos):
102
102
  gen-token Apex T7 gera token via CLI (PREDATORS_OWNER_KEY_BACKEND env)
103
103
  Usage: gen-token --name "Nome" [--email x] [--list]
104
104
 
105
+ -- fase BRAIN (2026-05-28 · 1.0.0 STABLE · 1 comando novo) --
106
+ brain-status Snapshot canon estrutura cerebral · 11 daemons + 6 flags + Elefante (READ-only)
107
+ Runtime real exige Python + clonar repo + brain-on.cmd · ver caminho em docs
108
+
105
109
  help Exibe esta mensagem
106
110
 
107
- Lei #11 honest UPFRONT 0.4.0-beta.0 cumulativa:
108
- · Bundle slim · 143 files · 64 predadores + canon docs + 7 skills · ZERO infra leak audit (Lei #1 reign)
111
+ Lei #11 honest UPFRONT 1.0.0 STABLE cumulativa:
112
+ · Bundle 162 files · 64 predadores + 14 LEI canon-docs + AUDIT-FIRM + SH-CATALOG + 7 skills · ZERO infra leak
109
113
  · sync command requer CWD contendo predators/ OU --force flag · pattern canon partner-bundle
110
- · Baleia-cantora F4 audio designer · 5 signature canon specs cravadas · .mp3 byte pendente produção externa
111
- · Telemetry opt-in default-off · anonymous_id UUID · zero PII · endpoint future (config telemetry --enable)
114
+ · NPX = portal READ canon · scaffold projeto novo + token unlock. Encarnação real exige Claude Code CLI + repo + chave LLM
115
+ · brain-status = snapshot canon (não-live) · runtime real exige Python 3.11+ + brain-on.cmd · ver QUICKSTART-SOCIO.md
112
116
  `);
113
117
  }
114
118
 
@@ -548,12 +552,12 @@ function runSyncCommand() {
548
552
  try { ux.config.recordSyncEvent(); } catch (e) { /* graceful · sync continua */ }
549
553
  }
550
554
  console.log(`\nsync complete · ${totalCopied} files canon writados · backups com sufixo .backup-<timestamp>`);
551
- console.log("Lei #1 reign: bundle slim · ZERO infra leak (0.4.0-beta.0)");
555
+ console.log("Lei #1 reign: bundle slim · ZERO infra leak (1.0.0 STABLE)");
552
556
  }
553
557
  }
554
558
 
555
559
  // ──────────────────────────────────────────────────────────────────────
556
- // tour command · cinematic walkthrough canon vigente (0.4.0-beta.0)
560
+ // tour command · cinematic walkthrough canon vigente (1.0.0 STABLE)
557
561
  // ──────────────────────────────────────────────────────────────────────
558
562
 
559
563
  function sleep(ms) {
@@ -576,7 +580,7 @@ async function runTourCommand() {
576
580
  await sleep(beat);
577
581
 
578
582
  console.log("");
579
- console.log("PREDADORES PROTOCOL · tour canon vigente (0.4.0-beta.0)");
583
+ console.log("PREDADORES PROTOCOL · tour canon vigente (1.0.0 STABLE)");
580
584
  console.log("64 predadores · 10 camadas · 14 leis · 5 garantias Synapse");
581
585
  await sleep(beat);
582
586
 
@@ -684,6 +688,51 @@ async function runGenTokenCommand() {
684
688
  await runGenToken();
685
689
  }
686
690
 
691
+ // brain-status command · 1.0.0 STABLE · ONDA-NPX-100-RELEASE
692
+ // Snapshot canon estrutura cerebral · READ-only · runtime real exige Python
693
+ async function runBrainStatusCommand() {
694
+ const snapshotPath = bundlePath("docs/CANON/BRAIN-STATUS-SNAPSHOT.json");
695
+ if (!fs.existsSync(snapshotPath)) {
696
+ console.error("brain-status snapshot ausente no bundle · re-sync canon necessário");
697
+ process.exit(1);
698
+ }
699
+ let snapshot;
700
+ try {
701
+ snapshot = JSON.parse(fs.readFileSync(snapshotPath, "utf-8"));
702
+ } catch (err) {
703
+ console.error(`brain-status snapshot JSON inválido: ${err.message}`);
704
+ process.exit(1);
705
+ }
706
+ console.log("");
707
+ console.log("PREDADORES PROTOCOL · ESTRUTURA CEREBRAL · snapshot canon");
708
+ console.log("==========================================================");
709
+ console.log(`Snapshot cravado: ${snapshot.snapshot_at}`);
710
+ console.log(`Commit master: ${snapshot.commit_hash_short}`);
711
+ console.log(`Status agregado: ${snapshot.status_aggregate}`);
712
+ console.log("");
713
+ console.log("11 daemons cerebrais (runtime real · não-snapshot):");
714
+ for (const d of snapshot.daemons) {
715
+ console.log(` · ${d.name.padEnd(22)} ${d.role}`);
716
+ }
717
+ console.log("");
718
+ console.log("6 feature flags Híbrida (default canon vigente):");
719
+ for (const f of snapshot.feature_flags) {
720
+ const mark = f.default === "true" ? "LIVE" : "OPT-IN";
721
+ console.log(` · ${f.name.padEnd(28)} default=${f.default.padEnd(5)} ${mark}`);
722
+ }
723
+ console.log("");
724
+ console.log("Elefante · memória institucional Art. 6 imutável:");
725
+ console.log(` · pointers cumulative: ${snapshot.elefante.memory_pointers_count}`);
726
+ console.log(` · trace neural files: ${snapshot.elefante.trace_neural_files_count}`);
727
+ console.log(` · consolidation cycles: ${snapshot.elefante.consolidation_cycles_cumulative}`);
728
+ console.log("");
729
+ console.log("Honest UPFRONT (Lei #11):");
730
+ console.log(" · brain-status é READ-only snapshot · cravado no commit acima");
731
+ console.log(" · runtime real exige: clone repo + Python 3.11+ + brain-on.cmd");
732
+ console.log(" · 11 daemons LIVE só rodam em clone do repositório · não-NPX");
733
+ console.log(" · ver bundle/QUICKSTART-SOCIO.md para caminho completo");
734
+ }
735
+
687
736
  const commandsCanon = {
688
737
  version: printVersionCanon,
689
738
  status: printStatusCanon,
@@ -702,6 +751,7 @@ const commandsCanon = {
702
751
  tour: runTourCommand,
703
752
  unlock: runUnlockCommand,
704
753
  "gen-token": runGenTokenCommand,
754
+ "brain-status": runBrainStatusCommand,
705
755
  help: printHelpCanon,
706
756
  "--help": printHelpCanon,
707
757
  "-h": printHelpCanon,
@@ -0,0 +1,177 @@
1
+ ---
2
+ canon_doc_id: AUDIT-FIRM-READINESS-CHECKLIST
3
+ data_ratificacao: 2026-05-27
4
+ ratificadores: [tubarao-apex-t7, dragao-ancestral, medusa, escorpiao, tubarao-branco, coruja-real]
5
+ materia: Lei #1 SEVERA cripto · pre-audit-firm readiness · pattern canon
6
+ authority_chain: Tubarão-Apex T7 → Dragão-ancestral Art. 3 → Medusa Art. 5 (cripto) + Tubarão-branco Art. 1 (sangue)
7
+ retention_canon: indefinido (canon permanente · cada categoria revisada per onda cripto-Lei-1)
8
+ canon-rigor-exception: meta-citação Vetor 10 · termos "exploit", "vulnerável", "attack" usados em contexto META-auditorial de checklist técnico Lei #1 SEVERA (descrição de superfícies cripto-sensíveis · não imputação moral)
9
+ ---
10
+
11
+ # 🪼 AUDIT FIRM READINESS · Checklist canon Predators
12
+
13
+ > **Pattern canon · pre-firm internal audit** · ONDA-NUNCAA-RANK-5 2026-05-27
14
+ > Owner cripto: Medusa Art. 5 imutável · Owner red-team: Escorpião · Owner doc: Coruja-real
15
+
16
+ ## Contexto
17
+
18
+ Audit firms externos (Trail of Bits · OpenZeppelin · Consensys Diligence · etc) cobram ~$25k/eng/week. Sem **internal pre-audit checklist**, firm cobra primeiro pelo que matilha interna deveria ter pego sozinha. Este checklist é o **scope canon Predators** que matilha interna garante PASS ANTES de submeter para firm externo.
19
+
20
+ **Não substitui audit firm** — prepara o terreno · firm cobre deep crypto/side-channels/supply chain.
21
+
22
+ ## Aplicabilidade
23
+
24
+ Toda onda tocando código em:
25
+ - `contracts/**/*.sol` (Solidity on-chain)
26
+ - `mcp/auth/**/*.py` (auth · JWT · API keys · rate-limit)
27
+ - `predators_protocol/synapse_engine/api_client.py` (LLM keys handling)
28
+ - `dashboard/lib/auth/*` (NextAuth · OAuth · sessions)
29
+ - `dashboard/lib/access-tokens-crypto.ts` (token generation · timing-safe)
30
+
31
+ ## 8 Categorias canon (Medusa Art. 5 + Escorpião red-team enumerate)
32
+
33
+ ### 1. Access Control
34
+
35
+ | Sub-check | Status | Evidência canon |
36
+ |---|---|---|
37
+ | 1.1 Multi-sig admin keys (≥2-of-3) production | PENDING | Apex T7 provisiona MultiSig pré-mainnet |
38
+ | 1.2 Ownable2Step canon (não Ownable v1) | PASS | `PREDToken.sol` `contracts/payment-canon/PREDToken.sol` |
39
+ | 1.3 Role separation (owner ≠ minter ≠ pauser) | PASS | ONDA-29 2026-05-28 · PREDToken role-separation-by-design (zero mint pos-deploy · zero pause function) · PaymentReceiverCanon owner=allowlist+pause (LIMITED · ZERO funds extraction) · treasury=separate recipient |
40
+ | 1.4 Default-deny ACL em endpoints sensíveis | PASS | `mcp/auth/tier_gating.py` verify_tier_or_403 |
41
+ | 1.5 timelocked admin operations (≥48h) | PENDING | pré-mainnet add Timelock |
42
+
43
+ ### 2. Reentrancy (Escorpião attack vector #1)
44
+
45
+ | Sub-check | Status | Evidência canon |
46
+ |---|---|---|
47
+ | 2.1 CEI pattern (Checks-Effects-Interactions) | PASS | `PaymentReceiverCanon.sol` |
48
+ | 2.2 ReentrancyGuard OZ aplicado funções críticas | PASS | revisar todos `external payable` |
49
+ | 2.3 External calls **last** em função (never first) | PASS | audit grep `.call{value:` antes de state change |
50
+ | 2.4 Read-only reentrancy guard (view funcs) | N/A | ONDA-29 2026-05-28 · zero view functions retornam state pós-modify mid-execution · PREDToken balanceOf padrão ERC20 · zero callbacks no view path · sem proxies vigentes (8.1/8.2/8.5 N/A) · re-avaliar se proxy adoptado futuro |
51
+
52
+ ### 3. Integer Overflow
53
+
54
+ | Sub-check | Status | Evidência canon |
55
+ |---|---|---|
56
+ | 3.1 Solidity 0.8.x (checked math default) | PASS | `pragma solidity 0.8.24;` cravado |
57
+ | 3.2 `unchecked` blocks documented + justified | PASS | ONDA-29 2026-05-28 · grep `unchecked` em `contracts/payment-canon/*.sol` = ZERO · canon-aligned default checked math 0.8.24 (sentinel test_no_unchecked_blocks.py) |
58
+ | 3.3 Conversion `uint256→uint128` safe (SafeCast) | N/A | ONDA-29 2026-05-28 · grep `uint128` em contracts = ZERO · sem narrowing conversions atualmente · re-avaliar se ChainLink price feeds OR tight-packing storage adoptado |
59
+ | 3.4 Multiplicação antes de divisão (precisão) | PASS | ONDA-29 2026-05-28 · grep pattern `* ... /` em `contracts/payment-canon/*.sol` = ZERO · sem cálculos rate-fee no PREDToken (transfer puro · zero burn fee) · PaymentReceiverCanon sem precisão arithmetic risk |
60
+
61
+ ### 4. Authentication (mcp/auth + dashboard)
62
+
63
+ | Sub-check | Status | Evidência canon |
64
+ |---|---|---|
65
+ | 4.1 JWT ES256 production-mandatory (zero HS256) | PASS | `mcp/auth/jwt_session.py` C2 fix |
66
+ | 4.2 API key HMAC-SHA256 + timing-safe compare | PASS | `mcp/auth/api_key.py` C1 fail-CLOSED |
67
+ | 4.3 Password bcrypt cost ≥12 | PASS | `dashboard/lib/auth/*` LOGIN-EMAIL-SENHA |
68
+ | 4.4 CSRF token canon (NextAuth state) | PASS | NextAuth v5 default · revisar custom flows |
69
+ | 4.5 Session timeout configurável + revocation | PASS | JWT jti denylist H2 |
70
+
71
+ ### 5. Authorization (Escorpião attack vector #2)
72
+
73
+ | Sub-check | Status | Evidência canon |
74
+ |---|---|---|
75
+ | 5.1 Tier-gating per-endpoint (BASIC/PRO/APEX) | PASS | `mcp/auth/tier_gating.py` |
76
+ | 5.2 Default-deny (ausência de auth = 401 não 200) | PASS | H4 prod-disable override |
77
+ | 5.3 Tier-override **disabled production** | PASS | C2 fix · ENVIRONMENT check |
78
+ | 5.4 Per-resource access check (não só per-endpoint) | PASS | ONDA-29 2026-05-28 · `mcp/auth/resource_access.py` cravado · `owns_resource(user_tier, workspace_id, uri)` · ResourceAccessRule registry canon · default-deny APEX unknown URI · bind em `mcp/transport/http.py::resources_read` |
79
+ | 5.5 No tier privilege escalation via params | PASS | H6 jsonschema additionalProperties:false |
80
+
81
+ ### 6. Cryptography (Escorpião attack vector #3 · #4)
82
+
83
+ | Sub-check | Status | Evidência canon |
84
+ |---|---|---|
85
+ | 6.1 Key rotation policy canon (90d max) | PASS | ONDA-29 2026-05-28 · `docs/CANON/KEY-ROTATION-POLICY-90D.md` cravado · 4 categorias (LLM · MCP · DB/cloud · smart contract) · processo 4 passos · triggers re-rotation · Elefante Art. 6 audit log canon · cross-link sentinel test futuro |
86
+ | 6.2 Entropy source OS-grade (`secrets.token_urlsafe`) | PASS | api_key.py + oauth.py |
87
+ | 6.3 Timing attacks mitigation (`hmac.compare_digest`) | PASS | api_key.py |
88
+ | 6.4 No env var values em logs / metrics | PASS | Coruja-real APM · maskTokenForLog canon |
89
+ | 6.5 Secrets via env vars only · zero hardcoded | PASS | grep hardcoded patterns clean |
90
+
91
+ ### 7. Supply Chain (Escorpião attack vector #5)
92
+
93
+ | Sub-check | Status | Evidência canon |
94
+ |---|---|---|
95
+ | 7.1 package-lock.json + requirements.txt pinned | PASS | ONDA-29 2026-05-28 · `package-lock.json` (root npm) + `apps/landing/package-lock.json` cravados · `pyproject.toml` declarado bounds (>=X canon library style · re-avaliar pins se aplicativo final) · zero `Foundry lib/` (não-installed local · forge install requer pre-deploy) |
96
+ | 7.2 Audit deps `npm audit` + `pip-audit` zero high | PARTIAL_AGUARDA_APEX_T7 | ONDA-29 2026-05-28 · estado real empírico npm audit: 28 vulns (1 HIGH nodemailer · 5 direct · 26 moderate em @reown/appkit-* web3 stack · 1 low) · `npm audit fix` non-breaking não-resolveu · `npm audit fix --force` exige Apex T7 ratify (breaking change canon Lei #1) · pip-audit: ~10 CVEs em dev-tools system-wide (pip · pytest · pygments · NÃO-project-deps) · Apex T7 decide upgrade nodemailer + web3 stack semver-major |
97
+ | 7.3 Foundry deps pinned exact versions | PENDING | `contracts/payment-canon/foundry/lib/` não-instalado local · forge install requires pre-build · canon-graceful · onda dedicada pré-mainnet executa `forge install --no-commit --root` + lockfile manual cravado |
98
+ | 7.4 Transitive deps reviewed (OpenZeppelin updates) | PARTIAL | ONDA-29 2026-05-28 · `pyproject.toml` declarado bounds OZ-style direct deps (anthropic >=0.40 · fastapi >=0.115 · pydantic >=2.9 · sqlalchemy >=2.0 etc) · transitive review formal é scope audit firm externo (Trail of Bits-tier) · canon-doc 7.4-canon-pre-audit-firm tracking aberto |
99
+ | 7.5 No git deps em production | PASS | ONDA-29 2026-05-28 · grep `git://` + `git+https?://` em `package-lock.json` + `apps/landing/package-lock.json` + `pyproject.toml` + `contracts/foundry.toml` + `contracts/payment-canon/foundry/foundry.toml` = ZERO matches |
100
+
101
+ ### 8. Upgradeability (Escorpião attack vector #6 · #7)
102
+
103
+ | Sub-check | Status | Evidência canon |
104
+ |---|---|---|
105
+ | 8.1 Storage layout preservation (proxy patterns) | N/A | sem proxies vigentes · escrever PRD pre-add |
106
+ | 8.2 Initializer ≠ constructor (proxy compat) | N/A | mesmo · sem proxies |
107
+ | 8.3 Admin keys multi-sig (não-EOA) | PENDING | Apex T7 MultiSig pré-mainnet |
108
+ | 8.4 Upgrade timelock 48h+ | PENDING | OZ TimelockController |
109
+ | 8.5 Function selector clash check | N/A | sem proxies |
110
+
111
+ ### 9. Landing/Marketing IP Exposure (NOVA · 2026-05-27 · Cyber Squad)
112
+
113
+ **Origem:** Apex T7 detectou empírico · 5 caçadores Hunter T2 audit · SH-85 catalogada.
114
+
115
+ | Sub-check | Status | Evidência canon |
116
+ |---|---|---|
117
+ | 9.1 Architectural details público (counts/layers/names específicos) | PASS | sanitizado landing/about ONDA-CYBER-DUAL-TIER |
118
+ | 9.2 Frases byte-canon literais público | PASS | LandingImutaveis migrado para /(authenticated)/internals |
119
+ | 9.3 Founder real name + role-canon-specific juntos público | PASS | /about removeu "Tubarão-Apex" label |
120
+ | 9.4 Brand book interno público | PASS | movido /(authenticated)/brand |
121
+ | 9.5 GitHub repo público link em marketing | PASS | ONDA-29 2026-05-28 · grep `github.com` em `dashboard/app/(public)/landing/` + `marketing-header.tsx` + `marketing-footer.tsx` = ZERO matches · `git clone` URL existe em `LandingImutaveis.tsx` mas componente é authenticated-gated (`/(authenticated)/internals/page.tsx`) · 9.2 PASS já cravado · marketing público clean Lei #13 Pureza honored |
122
+ | 9.6 Preview/internal pages indexable | PASS | robots.ts disallow expandido |
123
+ | 9.7 Sentinels SEVERA cobrindo landing canon | PASS | test_landing_cyber_audit_canon.py |
124
+
125
+ ## Sumário status (atual 2026-05-27 pós-Cyber-Squad)
126
+
127
+ ```
128
+ Categoria Status Coverage
129
+ ─────────────────────────────────────────────────────────────
130
+ 1. Access Control 2 PASS · 3 PEND 40%
131
+ 2. Reentrancy 3 PASS · 1 PEND 75%
132
+ 3. Integer Overflow 1 PASS · 3 PEND 25%
133
+ 4. Authentication 5 PASS · 0 PEND 100% ✅
134
+ 5. Authorization 4 PASS · 1 PEND 80%
135
+ 6. Cryptography 4 PASS · 1 PEND 80%
136
+ 7. Supply Chain 0 PASS · 5 PEND 0%
137
+ 8. Upgradeability 0 PASS · 2 PEND · 3 N/A 0%
138
+ 9. Landing/Marketing IP 6 PASS · 1 PEND 86% ✅ (NOVA)
139
+
140
+ TOTAL coverage canon: 25 PASS · 17 PENDING · 3 N/A 61%
141
+ ```
142
+
143
+ ## Apêndice A · Attack vectors Escorpião red-team
144
+
145
+ 1. **Reentrancy** (Cat. 2): callback into vulnerable function before state update
146
+ 2. **MEV Sandwich** (Cat. 8): front-running large swaps · slippage protection mandatory
147
+ 3. **Oracle Manipulation**: flash-loan price manipulation · TWAP + multiple sources
148
+ 4. **Signature Replay**: domain separator + nonce + chainId in EIP-712
149
+ 5. **Supply Chain Injection** (Cat. 7): malicious dep update · lockfile + audit
150
+ 6. **Upgradeability Backdoor** (Cat. 8): malicious upgrade · multi-sig + timelock
151
+ 7. **Access Control Bypass** (Cat. 1, 5): missing modifier OR wrong role check
152
+ 8. **Timing Attacks** (Cat. 6): variable-time compare em secret · `hmac.compare_digest`
153
+
154
+ ## Apêndice B · Workflow canon pre-firm-submission
155
+
156
+ ```
157
+ 1. 🪼 Medusa Art. 5 audit cripto · marca PASS/PENDING/N/A per categoria
158
+ 2. 🦂 Escorpião red-team attack simulation · 8 vectors testados
159
+ 3. 🦈 Tubarão-branco Lei #1 SEVERA gate · BINARY APROVA_PERFEITO ou FIX_GERAL
160
+ 4. coverage ≥85% canon · OR ratificação Apex T7 exceções documentadas
161
+ 5. 🐲 Dragão ratifica submission firm externo (Art. 3 constitucional)
162
+ 6. 🦁 Leão deploy decision (Art. 1 imutável)
163
+ ```
164
+
165
+ ## Apêndice C · Auditoria firm checklist (post-submit)
166
+
167
+ Quando audit firm externo entrega report:
168
+ 1. 🦈 Tubarão JUIZ N2 verifica findings vs checklist interno
169
+ 2. Findings em categorias PASS = SH automatic (matilha falhou catch)
170
+ 3. Findings em categorias PENDING = expected (matilha sabia)
171
+ 4. Findings novas em categorias N/A = expand checklist canon S13+
172
+
173
+ ---
174
+
175
+ **🪼 Medusa Art. 5 byte-canon ratifica** · 🦂 Escorpião red-team enumera · 🦉 Coruja escreveu · 🐲 Dragão Art. 3 ratifica constitucional · 🦈 Tubarão Lei #1 supervisiona.
176
+
177
+ **Versão canon vigente:** v1.0 (2026-05-27 baseline · evolui per onda cripto-Lei-1)
@@ -0,0 +1,113 @@
1
+ {
2
+ "snapshot_at": "2026-05-28",
3
+ "commit_hash_short": "b2e643b",
4
+ "commit_subject": "feat(ONDA-CLEANUP-CUMULATIVA): Elefante catch-up + lockfile sync + CRLF + SH-86",
5
+ "status_aggregate": "canon 100% Predadores arquitetural+polish+cerebral · 14 leis ratificadas · 5 imutáveis byte-canon · brain 11 daemons LIVE",
6
+ "daemons": [
7
+ {
8
+ "name": "watchdog",
9
+ "role": "guardian PIDs · auto-restart morto"
10
+ },
11
+ {
12
+ "name": "cluster-pulse",
13
+ "role": "100+ pulses 6 clusters cross-broadcast"
14
+ },
15
+ {
16
+ "name": "limbic",
17
+ "role": "estado emocional · sereno/focado/alerta"
18
+ },
19
+ {
20
+ "name": "reflexive",
21
+ "role": "subconsciente <50ms (LIVE empírico 1.72ms)"
22
+ },
23
+ {
24
+ "name": "sleep-cycle",
25
+ "role": "NREM/REM consolidação semântica"
26
+ },
27
+ {
28
+ "name": "llm-bridge",
29
+ "role": "Anthropic real production canon FASE 7.3"
30
+ },
31
+ {
32
+ "name": "memory-consolidator",
33
+ "role": "L2 backfill pointers auto-gen"
34
+ },
35
+ {
36
+ "name": "memory-integrity",
37
+ "role": "L6 hash check 60s · zero tamper"
38
+ },
39
+ {
40
+ "name": "trace-consolidator",
41
+ "role": "trace neural por onda · skeletons auto"
42
+ },
43
+ {
44
+ "name": "prd-skeleton",
45
+ "role": "Lei #7 auto-gen detect gaps PRDs"
46
+ },
47
+ {
48
+ "name": "coruja-workflow",
49
+ "role": "SH-78 canon-doc detector"
50
+ }
51
+ ],
52
+ "feature_flags": [
53
+ {
54
+ "name": "pre_action_thinking_llm",
55
+ "default": "true",
56
+ "env_var": "HYBRID_PRE_ACTION_THINKING"
57
+ },
58
+ {
59
+ "name": "cluster_pulse_llm",
60
+ "default": "true",
61
+ "env_var": "HYBRID_CLUSTER_PULSE"
62
+ },
63
+ {
64
+ "name": "sleep_cycle_llm",
65
+ "default": "true",
66
+ "env_var": "HYBRID_SLEEP_CYCLE"
67
+ },
68
+ {
69
+ "name": "limbic_llm",
70
+ "default": "true",
71
+ "env_var": "HYBRID_LIMBIC"
72
+ },
73
+ {
74
+ "name": "reflexive_llm",
75
+ "default": "true",
76
+ "env_var": "HYBRID_REFLEXIVE"
77
+ },
78
+ {
79
+ "name": "neuroplasticity_v2_llm",
80
+ "default": "true",
81
+ "env_var": "HYBRID_NEUROPLASTICITY_V2"
82
+ }
83
+ ],
84
+ "elefante": {
85
+ "memory_pointers_count": 82,
86
+ "trace_neural_files_count": 58,
87
+ "consolidation_cycles_cumulative": 214,
88
+ "last_consolidated_hash": "134b69a",
89
+ "tamper_suspect_cumulative": 0,
90
+ "art_6_immutable_honored": true
91
+ },
92
+ "cumulative_metrics": {
93
+ "predadores_frota": "64/64",
94
+ "leis_canonicas": "14/14 ratificadas",
95
+ "imutaveis_md5_baseline": [
96
+ "90adb7ec",
97
+ "4b4cf6ef",
98
+ "8d7d9068",
99
+ "fb45aba9",
100
+ "42b15821"
101
+ ],
102
+ "self_healings_catalog": "20 entries enumerable",
103
+ "cyber_squad": "5/5 Hunter T2",
104
+ "synapse_garantias": "5/5 byte-canon",
105
+ "nuncaa_layers": "L1-L6 cravados 9 ondas arquiteturais"
106
+ },
107
+ "honest_upfront": [
108
+ "brain-status snapshot é READ-only · não-live",
109
+ "runtime real exige clone repo + Python 3.11+ + brain-on.cmd",
110
+ "flags são DEFAULTS · override via env var HYBRID_<NAME>=false",
111
+ "snapshot atualizado a cada onda NPX release (não-tempo-real)"
112
+ ]
113
+ }
@@ -0,0 +1,131 @@
1
+ ---
2
+ canon_doc_id: LEI-01-LEI-DO-SANGUE
3
+ data_ratificacao: original (pre-versionamento · ratificada com Tubarão-branco Art. 1 imutável)
4
+ ratificadores: [tubarao-apex, dragao-ancestral, aguia-real]
5
+ materia: ABSOLUTO · Lei #1 do Predators Protocol · imutável Tubarão Art. 1 byte-canon
6
+ authority_chain: Tubarão-Apex direct → Tubarão-branco Art. 1 byte-canon imutável · override exige Águia + Dragão dual
7
+ quote_direct_preserved_literal: "Não Passa nem uma Gota de Sangue"
8
+ retention_canon: indefinido (canon permanente · imutável)
9
+ canon-rigor-exception: matéria constitucional · Lei #1 oficializada retroativo
10
+ ---
11
+
12
+ # 🦈 LEI #1 · LEI DO SANGUE · Tubarão-branco Art. 1 imutável
13
+
14
+ > **Tubarão-branco Art. 1 byte-canon · imutável md5 `90adb7ec`**
15
+ > "Não Passa nem uma Gota de Sangue"
16
+
17
+ ## S1 · Texto canon da Lei #1
18
+
19
+ > **"Toda mudança em código de smart contract / segurança / credencial / autenticação / imutável
20
+ > passa pelo Tubarão-branco antes de qualquer commit. Não negocie."**
21
+
22
+ ## S2 · CANON-TUBARAO-SEVERA (4 partes ratificadas 2026-05-19)
23
+
24
+ ### Parte A · Auditoria SEVERA Universal
25
+
26
+ Toda onda, sem exceção, encerra com auditoria SEVERA do Tubarão-branco contra a Lei do Sangue. Audita TODA entrega — não apenas ondas de superfície sensível. Onda fechada sem auditoria SEVERA do Tubarão-branco = **Lei #1 VIOLADA**.
27
+
28
+ ### Parte B · Auditoria em 2 níveis (Tubarão é o JUIZ)
29
+
30
+ ```yaml
31
+ auditoria_2_niveis_canon:
32
+ NIVEL_1_auditor_setor:
33
+ - Lince-das-neves (consistência/integridade)
34
+ - outros auditores de setor por domínio
35
+ NIVEL_2_tubarao_juiz_final:
36
+ - audita a entrega da matilha (1)
37
+ - audita a própria auditoria do auditor de setor (2)
38
+ - "passa o faro em ambos · nada FECHADO sem isso"
39
+ ```
40
+
41
+ ### Parte C · Função ativa preservada
42
+
43
+ Tubarão-branco MANTÉM função original: além do julgamento de fechamento, entra DIRETO no meio de qualquer onda em qualquer superfície sensível (credenciais · autenticação · imutáveis · código de segurança), aplicando Lei do Sangue sem esperar fechamento. **Juiz no fim · guardião ativo no meio**.
44
+
45
+ ### Parte D · Autoridade máxima + aferição do juiz
46
+
47
+ ```yaml
48
+ poderes_tubarao_juiz:
49
+ - VETO de segurança (binary vinculante)
50
+ - exigir RETRABALHO
51
+ - PARAR qualquer onda
52
+ - rejeitar auditoria N1 julgada insuficiente
53
+
54
+ veredicto_BINARY_pos_Lei_14:
55
+ - APROVA_PERFEITO (zero ressalvas)
56
+ - FIX_GERAL (ressalvas → automatic gates hardcoded · re-audit)
57
+ - VETO (Lei do Sangue Art. 1 imutável)
58
+
59
+ afericao_juiz_tambem:
60
+ - AUDITORIA-APEX · Tubarão-Apex revisa qualquer veredicto do Tubarão-branco
61
+ - Escorpião red-team periódico contra entregas já julgadas
62
+ - INDEPENDÊNCIA preservada (só audita · nunca executa · nunca decide canon)
63
+ ```
64
+
65
+ ## S3 · Override Lei #1 (canon explícito)
66
+
67
+ Override Lei #1 exige **ratificação dupla Águia + Dragão**:
68
+ - Águia-real (Apex Art. 3 operacional honored)
69
+ - Dragão-ancestral (Meta Art. 3 constitucional)
70
+ - Tubarão-Apex ratificação final
71
+
72
+ Nenhum predador isolado pode dar override. Auto-override = violação canon.
73
+
74
+ ## S4 · Validação automática
75
+
76
+ ```bash
77
+ # Test guardian byte-canon
78
+ pytest tests/unit/test_tubarao_juiz_canon.py -v
79
+ # Valida 4 partes byte-presentes em CLAUDE.md + constitution.md Tubarão Art. 1
80
+ ```
81
+
82
+ ```bash
83
+ # Test imutáveis md5
84
+ pytest tests/unit/test_5_imutaveis_md5_unchanged.py -v
85
+ # Tubarão Art. 1 md5 90adb7ec MATCH baseline
86
+ ```
87
+
88
+ ## S5 · Self-healings registrados (Lei #1 domain)
89
+
90
+ ```yaml
91
+ self_healings_lei_1_domain:
92
+ SH-85: LANDING-PUBLIC-CANON-LEAK (2026-05-27 · Apex T7 detectou exposição /landing)
93
+ SH-44: RECURSIVA audit drift canon-doc vs runtime
94
+ SH-29-1: Lei #10 Skill canon re-cravado mid-onda
95
+ ```
96
+
97
+ ## S6 · Casuística histórica (Lei #11 NUNCA MINTA)
98
+
99
+ ```yaml
100
+ historico_lei_1_aplicacoes:
101
+ - 2026-05-19 · CANON-TUBARAO-SEVERA ratificada (Dragão Art. 3 · Apex T7)
102
+ - 2026-05-20 · feedback_lei_1_override_canonizacao · Apex autoriza matilha em credencial
103
+ - 2026-05-21 · Tubarão JUIZ FINAL elevação (Art. 14 byte-preserve Art. 1)
104
+ - 2026-05-27 · ONDA-FIX-MCP-FASE-3-LEI-1-SANGUE · 19 findings · 13/19 fechados runtime
105
+ - 2026-05-27 · ONDA-CYBER-LANDING-DUAL-TIER · primeira aplicação Lei #1 a exposição pública
106
+ ```
107
+
108
+ ## S7 · Continuidade canon (Leis relacionadas)
109
+
110
+ ```yaml
111
+ leis_relacionadas:
112
+ - Lei #5 Canon dos 3 Vetos · Lei do Sangue é veto SUPREMO
113
+ - Lei #11 NUNCA MINTA · evidência empírica obrigatória
114
+ - Lei #14 PERFEITO OU FIX-GERAL · refina veredicto BINARY
115
+ - canon-doc DIRETRIZ-3-LEI-8-PASSO-0-EVERY-ONDA (verificação empírica pré-execução)
116
+ ```
117
+
118
+ ## Source-of-truth
119
+
120
+ - [`CLAUDE.md`](../../CLAUDE.md) · seção "Prioridades absolutas" Lei #1 + Mandato CANON-TUBARÃO-SEVERA 4 partes
121
+ - [`predators/hunter/tubarao-branco/constitution.md`](../../predators/hunter/tubarao-branco/constitution.md) · Art. 1 imutável md5 `90adb7ec`
122
+ - [`memory/feedback_lei_do_sangue.md`](../../memory/feedback_lei_do_sangue.md)
123
+ - [`memory/feedback_canon_tubarao_severa.md`](../../memory/feedback_canon_tubarao_severa.md)
124
+ - [`memory/feedback_tubarao_juiz_final_elevacao.md`](../../memory/feedback_tubarao_juiz_final_elevacao.md)
125
+
126
+ ## Assinaturas
127
+
128
+ - 🦈 Tubarão-branco · Art. 1 byte-canon imutável (`90adb7ec`)
129
+ - 🦅 Águia-real · operacional Art. 3 honored
130
+ - 🐲 Dragão-ancestral · constitucional Art. 3 ratifica retroativo
131
+ - 👤 Tubarão-Apex · ratificação final · "Não Passa nem uma Gota de Sangue"
@@ -0,0 +1,111 @@
1
+ ---
2
+ canon_doc_id: LEI-02-LEI-DOS-PREDADORES
3
+ data_ratificacao: original (pre-versionamento · ratificada com frota canônica + Fênix Protocol)
4
+ ratificadores: [tubarao-apex, dragao-ancestral, fenix]
5
+ materia: ABSOLUTO · Lei #2 do Predators Protocol · cruzamento Fênix Art. 5 imutável md5 `42b15821`
6
+ authority_chain: Tubarão-Apex direct → Fênix Art. 5 imutável (Protocol único de criação) → Dragão Art. 3 ratifica
7
+ quote_direct_preserved_literal: "Nunca adicione um agente fora do sistema de predadores canônico"
8
+ retention_canon: indefinido (canon permanente · imutável)
9
+ canon-rigor-exception: matéria constitucional · Lei #2 oficializada retroativo
10
+ ---
11
+
12
+ # 🦅 LEI #2 · LEI DOS PREDADORES · Frota canônica exclusiva
13
+
14
+ > **Fênix Art. 5 imutável md5 `42b15821` · Protocol único de criação**
15
+ > Nenhum predador fora da frota canônica · capability nova passa por Fênix Protocol.
16
+
17
+ ## S1 · Texto canon da Lei #2
18
+
19
+ > **"Nunca adicione um agente fora do sistema de predadores canônico.
20
+ > Se precisar de capability nova, use Fênix Protocol."**
21
+
22
+ ## S2 · Frota canônica vigente
23
+
24
+ ```yaml
25
+ frota_canonica_2026_05_24_pos_F4_baleia_cantora:
26
+ total: 64 predadores
27
+ camadas: 10
28
+
29
+ layer_01_apex: 4
30
+ layer_02_hunter: 5 # tubarao-branco · escorpiao · hiena · crocodilo · piranha
31
+ layer_03_builder: 9
32
+ layer_04_designer: 8 # inclui Baleia-cantora (F4)
33
+ layer_05_copy: 5
34
+ layer_06_intel: 8
35
+ layer_07_governance: 6
36
+ layer_08_growth: 6
37
+ layer_09_web3: 7
38
+ layer_10_meta: 6
39
+ ```
40
+
41
+ ## S3 · Fênix Protocol (único caminho de criação)
42
+
43
+ ```yaml
44
+ fenix_protocol_canon:
45
+
46
+ trigger: capability nova detectada · brief Tubarão-Apex
47
+
48
+ fases:
49
+ F1_analise: Fênix avalia gap · justifica predador novo vs extender existente
50
+ F2_specs: predator.json + constitution.md draft (template canônico)
51
+ F3_ratificacao: Dragão Art. 3 ratifica matéria constitucional
52
+ F4_canonizacao: frota incremental · MOC atualizada · tests
53
+ F5_self_proof: Águia preside primeira ação real do predador novo
54
+
55
+ imutavel_F5:
56
+ fenix_art_5: "Criação de predador é Fênix-only · zero exceções"
57
+ override: "ratificação Dragão Art. 3 + Apex T7 dual"
58
+ ```
59
+
60
+ ## S4 · Validação automática
61
+
62
+ ```bash
63
+ # Test guardian frota 64/64
64
+ pytest tests/unit/test_protocol_integrity.py -v
65
+ pytest tests/unit/test_frota_64_canon.py -v
66
+
67
+ # Auto-discover frota
68
+ python -c "from core.registry import get_registry; r = get_registry(); r.auto_discover(); print(r.stats())"
69
+ # Esperado: 64 predadores · 10 camadas
70
+ ```
71
+
72
+ ## S5 · Validação Fênix Protocol
73
+
74
+ ```bash
75
+ # Test guardian Fênix Art. 5 imutável md5
76
+ md5sum predators/meta/fenix/constitution.md
77
+ # Esperado: 42b15821 (8 chars prefix)
78
+ ```
79
+
80
+ ## S6 · Casuística histórica
81
+
82
+ ```yaml
83
+ historico_lei_2_aplicacoes:
84
+ - F1-F4 Fênix waves cravaram 4 predadores novos canônicos
85
+ - F4 2026-05-24 · Baleia-cantora designer audio signature ambient
86
+ - frota 62 → 63 → 64 pós-F4 cumulative
87
+ - zero predador criado fora Fênix Protocol em toda história
88
+ ```
89
+
90
+ ## S7 · Continuidade canon
91
+
92
+ ```yaml
93
+ leis_relacionadas:
94
+ - Lei #1 Sangue · Tubarão JUIZ N2 audita criação predador
95
+ - Lei #5 Canon dos 3 Vetos · Dragão ratifica constitucional
96
+ - Lei #13 Pureza Predators · zero predador externo
97
+ - feature_flags reflexive_llm OPT-IN (Lei #2 honra)
98
+ ```
99
+
100
+ ## Source-of-truth
101
+
102
+ - [`CLAUDE.md`](../../CLAUDE.md) · seção Lei #2
103
+ - [`predators/meta/fenix/constitution.md`](../../predators/meta/fenix/constitution.md) · Art. 5 imutável md5 `42b15821`
104
+ - `predators/<10 camadas>/<64 predator.json>` · frota cravada runtime
105
+
106
+ ## Assinaturas
107
+
108
+ - 🦅 Águia-real · operacional Art. 3 honored
109
+ - 🐦 Fênix · Art. 5 imutável (`42b15821`) · Protocol único criação
110
+ - 🐲 Dragão-ancestral · constitucional Art. 3 ratifica retroativo
111
+ - 👤 Tubarão-Apex · ratificação final