sinapse-ai 7.7.5 → 7.7.6

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.
@@ -1,6 +1,6 @@
1
1
  # SINAPSE Constitution
2
2
 
3
- > **Version:** 2.1.0 | **Ratified:** 2025-01-30 | **Last Amended:** 2026-04-02
3
+ > **Version:** 2.2.0 | **Ratified:** 2025-01-30 | **Last Amended:** 2026-04-03
4
4
 
5
5
  Este documento define os princípios fundamentais e inegociáveis do SINAPSE. Todos os agentes, tasks, e workflows DEVEM respeitar estes princípios. Violações são bloqueadas automaticamente via gates.
6
6
 
@@ -239,6 +239,72 @@ Usuários são product builders, não especialistas em git. Agentes DEVEM gerenc
239
239
 
240
240
  ---
241
241
 
242
+ ### X. Security & Data Protection (NON-NEGOTIABLE)
243
+
244
+ Todo projeto que manipula dados de usuarios DEVE seguir praticas de seguranca rigorosas. Nenhum atalho e aceito — seguranca e inegociavel desde o primeiro commit.
245
+
246
+ **Regras — Banco de Dados:**
247
+ - MUST: TODA tabela com dados de usuario DEVE ter Row Level Security (RLS) ativado
248
+ - MUST: Chave `service_role` NUNCA exposta no frontend — apenas no servidor
249
+ - MUST: Queries DEVEM ser parametrizadas (`$1, $2`) — NUNCA string interpolation
250
+ - MUST: Cada servico DEVE usar role com privilegios minimos (principio do menor privilegio)
251
+ - MUST: Dados sensiveis (CPF, cartao, saude) DEVEM ser criptografados em repouso
252
+
253
+ **Regras — APIs:**
254
+ - MUST: TODA API publica DEVE ter rate limiting configurado
255
+ - MUST: TODA API DEVE validar input (schema validation com Zod ou equivalente)
256
+ - MUST: CORS DEVE restringir origens permitidas (NUNCA `origin: '*'` em producao)
257
+ - MUST: Headers de seguranca DEVEM estar ativos (helmet ou equivalente)
258
+ - MUST: Autenticacao DEVE usar OAuth 2.0 / OIDC ou Supabase Auth
259
+
260
+ **Regras — Secrets & Keys:**
261
+ - MUST: API keys, tokens e credenciais DEVEM estar em variaveis de ambiente (.env)
262
+ - MUST: Arquivos .env NUNCA commitados no repositorio (gitignore obrigatorio)
263
+ - MUST: .env.example DEVE existir com placeholders (sem valores reais)
264
+ - MUST: Variaveis prefixadas com `NEXT_PUBLIC_` sao PUBLICAS — NUNCA colocar secrets nelas
265
+ - MUST: Rotacao de chaves DEVE ser feita ao menor sinal de vazamento
266
+ - MUST NOT: Nenhum agente pode commitar arquivos contendo credentials em plaintext
267
+
268
+ **Regras — LGPD (Lei Geral de Protecao de Dados):**
269
+ - MUST: Consentimento explicito DEVE ser coletado antes de processar dados pessoais (Art. 7)
270
+ - MUST: Usuarios DEVEM poder acessar, corrigir e deletar seus dados (Art. 18)
271
+ - MUST: DPO/Encarregado DEVE ser designado para projetos com dados pessoais (Art. 37)
272
+ - MUST: Medidas de seguranca tecnica DEVEM proteger dados contra acesso nao autorizado (Art. 46)
273
+ - MUST: Incidentes de seguranca DEVEM ser notificados a ANPD e titulares (Art. 48)
274
+ - MUST: Dados pessoais DEVEM ter periodo de retencao definido e documentado
275
+ - MUST: Audit logging DEVE registrar todo acesso a dados pessoais
276
+
277
+ **Regras — Repositorio:**
278
+ - MUST: Repositorios com codigo de producao DEVEM ser privados por padrao
279
+ - MUST: Branch protection DEVE estar ativa em main (PR + approval)
280
+ - MUST: GitHub Secret Scanning DEVE estar habilitado
281
+ - MUST: Dependabot DEVE estar configurado para alertas de seguranca
282
+ - MUST: CODEOWNERS DEVE proteger arquivos criticos
283
+
284
+ **Delegacao:**
285
+
286
+ | Dominio de Seguranca | Agente Responsavel |
287
+ |----------------------|-------------------|
288
+ | Threat modeling, MITRE ATT&CK | @cyber-orqx → Shield (threat-analyst) |
289
+ | Penetration testing, OWASP | @cyber-orqx → Breach (penetration-tester) |
290
+ | SOC, detection engineering | @cyber-orqx → Sentinel (soc-analyst) |
291
+ | Incident response | @cyber-orqx → Rapid (incident-responder) |
292
+ | Cloud security, IAM, encryption | @cyber-orqx → Nimbus (cloud-security-engineer) |
293
+ | Network security, zero trust | @cyber-orqx → Wire (network-security-engineer) |
294
+ | LGPD, GDPR, SOC 2, ISO 27001 | @cyber-orqx → Govern (compliance-officer) |
295
+ | Database security, RLS | @data-engineer (Dara) |
296
+ | Application security, hooks | @developer (Dex) + hooks automaticos |
297
+
298
+ **Gates:**
299
+ - Hook `sql-governance.py` — BLOCK DDL perigoso
300
+ - Hook `secret-scanning.cjs` — BLOCK credentials em commits
301
+ - Hook `staged-secret-scan.js` — BLOCK .env e tokens pre-commit
302
+ - Checklist: `.claude/rules/security-data-protection.md`
303
+
304
+ **Rule file:** `.claude/rules/security-data-protection.md`
305
+
306
+ ---
307
+
242
308
  ## Governance
243
309
 
244
310
  ### Amendment Process
@@ -29,6 +29,7 @@ const KEY_ARTICLES = [
29
29
  'Ecosystem Metrics Accuracy',
30
30
  'Mandatory Delegation',
31
31
  'Safe Collaboration',
32
+ 'Security & Data Protection',
32
33
  ];
33
34
 
34
35
  /**
@@ -28,6 +28,7 @@ const EXPECTED_ARTICLES = [
28
28
  { number: 'VII', title: 'Ecosystem Metrics Accuracy', severity: 'NON-NEGOTIABLE' },
29
29
  { number: 'VIII', title: 'Mandatory Delegation', severity: 'NON-NEGOTIABLE' },
30
30
  { number: 'IX', title: 'Safe Collaboration', severity: 'NON-NEGOTIABLE' },
31
+ { number: 'X', title: 'Security & Data Protection', severity: 'NON-NEGOTIABLE' },
31
32
  ];
32
33
 
33
34
  /**