Fase 0 — descoberta e arquitetura:
- Inventário do projeto, glossário de domínio, arquitetura com bounded
contexts e topologia de containers, threat model inicial.
- 12 ADRs cobrindo modular monolith, topologia de containers (Postgres
isolado + eden-core/parceiros/assinante em containers e portas
distintos), auth/sessões, modelo de permissões, criptografia/segredos,
contrato first-class, stock ledger, separação billing/finance/fiscal,
outbox transacional, adapters SaperX e Focus NFe, e identidade
compartilhada entre as 3 apps.
- 14 subagentes e 7 skills especializados por domínio em .claude/.
- Hooks de segurança (PreToolUse/PostToolUse/Stop) testados via pipe.
Fase 1 — plataforma (em andamento):
- Monorepo pnpm workspaces + Turborepo: apps/{api,worker,core-web,
reseller-web,subscriber-web} + 9 packages compartilhados.
- apps/api: NestJS mínimo com /health/live e /health/ready (checando
Postgres real via @eden/database).
- 3 frontends Vite + React + TypeScript + Tailwind, com o favicon
oficial do EDEN.
- packages/database: migration baseline (node-pg-migrate) criando
roles/role_permissions/applications/users/user_applications/sessions/
audit_log — audit log append-only com hash-chain, testado ao vivo
(UPDATE/DELETE bloqueados pelo trigger).
- compose.yaml implementando a topologia da ADR-0002, validada de ponta
a ponta: os 6 containers sobem e ficam saudáveis com um único
`docker compose up`.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
1.4 KiB
Bash
Executable File
36 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Stop hook (EDEN, Master Prompt §2.2/§3.4). Advisory only — never blocks.
|
|
# If the project is under git, scans the working tree diff (staged+unstaged)
|
|
# for obvious secret patterns and for critical TODO/FIXME markers introduced
|
|
# without a tracking reference. Silent (no output) when there's nothing to
|
|
# flag or when git/the repo isn't set up yet (expected in Fase 0).
|
|
set -uo pipefail
|
|
|
|
PROJECT_ROOT="/opt/eden"
|
|
cd "$PROJECT_ROOT" 2>/dev/null || exit 0
|
|
|
|
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
exit 0
|
|
fi
|
|
|
|
DIFF="$(git diff HEAD 2>/dev/null; git diff --cached 2>/dev/null)"
|
|
[ -z "$DIFF" ] && exit 0
|
|
|
|
SECRET_HITS="$(echo "$DIFF" | grep -E -i '^\+.*(AKIA[0-9A-Z]{16}|BEGIN (RSA|EC|OPENSSH|PRIVATE) KEY|password\s*=\s*["'"'"'][^"'"'"']+|api[_-]?key\s*=\s*["'"'"'][^"'"'"']+|secret\s*=\s*["'"'"'][^"'"'"']+)' || true)"
|
|
TODO_HITS="$(echo "$DIFF" | grep -E -i '^\+.*(TODO|FIXME).*(CRITICAL|SECURITY|URGENT)' || true)"
|
|
|
|
if [ -z "$SECRET_HITS" ] && [ -z "$TODO_HITS" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
MSG="[eden-hook] Verificação de fim de etapa (Master Prompt DoD):"
|
|
if [ -n "$SECRET_HITS" ]; then
|
|
MSG="$MSG Possível segredo em claro no diff (revisar antes de commitar)."
|
|
fi
|
|
if [ -n "$TODO_HITS" ]; then
|
|
MSG="$MSG TODO/FIXME crítico introduzido sem rastreamento (issue/ADR)."
|
|
fi
|
|
|
|
python3 -c "import json,sys; print(json.dumps({'systemMessage': sys.argv[1]}))" "$MSG"
|
|
exit 0
|