48 Commits
Author SHA1 Message Date
Rafael Melgaço 7b08376cce checkpoint(G6): report emitido — COMPLETO, 7/7 features PASS [gov-loop]
Phase gate: awaits owner approval (loop/checkpoints/G6.approved) — which is
the trigger for the Vendaval FG phase. Closes the G1-G6 governance epic.
7 open inbox items (proposal/non-vetting) in report §3.
2026-07-18 21:54:56 -03:00
Rafael Melgaço f25cd3e2ee feat(G6-04): governance contract for external agents — spec 14 [gov-loop]
docs/specs/14 — the contract the Vendaval FG phase consumes. Edge-contract
style, header verified against gov/G6 @ ddcc511. Documents the 8 governance
tools with exact Zod I/O, assignee_kind/handoff/visibility_mode semantics,
ai_dispatch_mode (external → event stays pending), and prohibitions (never
cross-org, never bypass is_blocked/force_human/bot_silenced_until — 4 distinct
guards). Bidirectional 1:1 coverage (all 8 governance tools documented, none
omitted); ~20 file:line refs opened and verified. 'Consumer changes' section
feeds FG-01.
Verified-by: gov-verifier PASS 2026-07-18T21:53:23-0300
2026-07-18 21:53:24 -03:00
Rafael Melgaço ddcc5110b7 feat(G6-03): read tools expose governance — assignee/tags/queue/owner/stage [gov-loop]
4 MCP read tools gain additive fields (conversation: assignee_kind,
assigned_to_user_name, tags, queue_position; lead: owner_user_name,
stage{id,name}, tags). Surface only — RLS closed by G6-00/G4. queue_position
uses new getQueuePositions (batch, last_inbound_at ASC + id ASC) matching G5-03
inbox order exactly (coherence test). LGPD: id+name only, no email/phone.
No N+1 (batch name/queue/stage resolution). No migration.
Verified-by: gov-verifier PASS 2026-07-18T21:40:09-0300
2026-07-18 21:40:09 -03:00
Rafael Melgaço 80664d4c1a feat(G6-02): native dispatcher respects ai_dispatch_mode [gov-loop]
Audit: flag was absent in code (docs/plan only — vendaval chain didn't bring
it) → full implementation, not no-op. ai_dispatch_mode is a new key in
organizations.settings jsonb (Zod enum native|external, .catch('native')
fail-safe) — no schema migration. Native dispatcher skips 'external' orgs
BEFORE claim (pure continue: no claimEvent, no markEventProcessed, consumed_by
untouched) → event stays pending for Vendaval. skipped_external_dispatch is the
only non-consuming skip. Native unchanged (regression tested).
Verified-by: gov-verifier PASS 2026-07-18T21:19:20-0300
2026-07-18 21:19:21 -03:00
Rafael Melgaço d60c068972 feat(G6-01): MCP governance tools — assign/tags/queue + handoff v2 [gov-loop]
3 new MCP tools (crm_assign_conversation with race-safe idempotency via
fn_conversation_assign optimistic-lock; crm_manage_tags conv|contact|lead with
G3-05 normalizer; crm_get_queue_status read-only documented payload) + handoff
v2 (G5 routing, optional target, queue fallback+position, structured return).
All in catalog.ts (sanity 1:1) + audit on writes. Closes INB-12: unified the
two round-robins — pickRoundRobinAssignee removed, loadEligibleAttendants
extracted to eligibles.ts, shared by worker+handoff+queue. No migration.
Verified-by: gov-verifier PASS 2026-07-18T20:33:57-0300 (re-verified after external hash noise)
2026-07-18 20:33:58 -03:00
Rafael Melgaço ee908ed67d feat(G6-06): user_organizations SELECT org-wide for manager+ — migration 0044 [gov-loop]
Closes INB-14: user_orgs_select threshold admin->manager (SELECT only;
self-read preserved for all, write insert/update/delete unchanged at admin).
fn_role_at_least is SECURITY DEFINER (no recursion — policy already called it).
gov-1b: manager reads all=5, agent self-read=1, cross-org=0; GET /team returns
full roster for manager again. G5-04 /attendants workaround (admin client) intact.
Verified-by: gov-verifier PASS 2026-07-18T19:54:05-0300
2026-07-18 19:54:05 -03:00
Rafael Melgaço 3d68c4dc03 feat(G6-05): fix agent-dispatcher invalid event_log status [gov-loop]
Closes INB-13 (runtime bug): dispatcher wrote status 'processed'/'failed'
which violate event_log_status_check (pending|processing|done|dead) — UPDATE
failed at runtime, event stuck in pending (latent reprocessing). Fix:
processed->done (:403), failed->dead (:456, terminal branch — retry stays in
requeueEvent as pending+backoff, not collapsed). No migration (constraint
correct, code wrong). Invariant proves the violation + full done/dead cycle;
no downstream reader of the old statuses. Mirrors G5-02 routing-worker.
Verified-by: gov-verifier PASS 2026-07-18T19:30:19-0300
2026-07-18 19:30:19 -03:00
Rafael Melgaço f12172450a feat(G6-00): per-role RLS on lead activities/links — migration 0042 [gov-loop]
Closes INB-10 (G6-03 precondition): SELECT of crm_lead_activities/crm_lead_links
now requires parent-lead visibility via EXISTS + fn_can_view_lead (reused from
G4-03, not scalar-subquery). crm_lead_links FOR ALL dropped, re-expressed
per-command. Write kept org-scope (polymorphic timeline written by service
role/AI/panel must not break — service-role-insert=1, agent-own-insert=1).
gov-5e (8 tests): cross-attendant reads = 0, own = 1, manager org-wide.
Verified-by: gov-verifier PASS 2026-07-18T19:07:30-0300
2026-07-18 19:07:30 -03:00
Rafael Melgaço c4c5e2e6fa chore(gov-loop): registra virada G5 + integração origin + INBs aprovados [gov-loop] 2026-07-18 18:23:35 -03:00
Rafael Melgaço 1cd048310d plan(G6): mini-features INB-10/13/14 aprovadas pelo dono + gate G6-00→G6-03 [gov-loop]
DESKCOMM_GOV_PLAN_EDIT=1: ordens do dono via chat 2026-07-18
('aprova G5, INB-10 sim, INB-13 sim, INB-14 sim').
2026-07-18 18:22:38 -03:00
Rafael Melgaço 417c0d0504 checkpoint(G5): report emitido — COMPLETO, 4/4 features PASS [gov-loop]
Phase gate: awaits owner approval (loop/checkpoints/G5.approved).
9 open inbox items (proposal/non-vetting) in report §3; INB-10 is a G6 precondition.
2026-07-18 12:38:59 -03:00
Rafael Melgaço 0ae26c0125 feat(G5-04): attendant management panel — status/load/capacity + routing config [gov-loop]
'Atendimento' tab in app/app/team: agent+ roster with honest status
(isHeartbeatStale), current load (OPEN_LOAD_STATUSES single source — worker
imports it), inline capacity/schedule (manager+), routing mode card
(manual|round_robin; 'load' disabled) via PATCH /settings/routing. GET
extended to self-sufficient org-scoped roster (service role + manual org
filter) since /team RLS limits manager to own row. No migration.
config-worker 4/4: mode/capacity/backoff changes reflect in worker.
Verified-by: gov-verifier PASS 2026-07-18T12:37:35-0300 (resumed after auth error)
2026-07-18 12:37:35 -03:00
Rafael Melgaço 14b4ebda61 feat(G5-03): visible queue with position + assignment notification [gov-loop]
Queue ordered by wait time (last_inbound_at ASC, id ASC tiebreak) with
position + 'Aguardando há X' — single time source, order matches position.
Count == counts.unassigned. Notification = unread badge + realtime (fallback;
no new system, decision in spec §5). No migration; fn_conversation_assign
already zeroes unread on assign (tested worker path 7->0).
Verified-by: gov-verifier PASS 2026-07-18T11:40:45-0300 (re-verified after hash false-positive)
2026-07-18 11:40:45 -03:00
Rafael Melgaço 7cb8686bc3 feat(G5-02): routing worker via event_log — migration 0040 [gov-loop]
AFTER INSERT trigger emits conversation.routing_requested only when a
conversation is born unowned (no UPDATE trigger → worker's assign can't
re-emit: anti-echo by construction). Worker claims via event_log status
(pending/processing/done/dead), assigns via fn_conversation_assign(reason=
routing) atomically; pure decide.ts (round_robin/manual/backoff/dead).
Idempotent (optimistic lock), backoff from config, load unreachable by schema.
gov-4b invariant (7 tests): anti-echo count stays 1 after 2 assigns.
Verified-by: gov-verifier PASS 2026-07-18T10:58:19-0300
2026-07-18 10:58:19 -03:00
Rafael Melgaço a777b32207 feat(G5-01): attendant availability + routing config — migration 0039 [gov-loop]
attendant_availability (is_available/capacity/schedule tz-aware/heartbeat) with
per-command RLS (own-or-manager write); settings.routing Zod (manual|round_robin,
default manual, knobs as config). Eligibility in TS (injected clock, tz via Intl);
AT-08 heartbeat auto-offline 15min via cron (no HTTP in trigger); 3 v1 routes +
audit. NNNN 0039 (0038 taken by feat/webhooks-automation). Ratchet flip: gov-4
attendant_availability it.fails (DESKCOMM_GOV_INVARIANTS_EDIT=1).
Verified-by: gov-verifier PASS 2026-07-18T10:30:26-0300
2026-07-18 10:30:26 -03:00
Rafael Melgaço aeb2509303 fix(main): exclude .claude worktrees from vitest discovery — smoke estava vermelho [gov-loop]
Nested worktree .claude/worktrees/webhooks/ (Vendaval fusion) polluted vitest:
275 files/5218 tests instead of our 165, plus double-React (worktree node_modules)
breaking component tests with useContext null. Add .claude/** to exclude and
fix node_modules glob to **/node_modules/**. Suite back to 165 tests.
2026-07-17 18:48:06 -03:00
Rafael Melgaço dfcfc2fbc7 chore(gov-loop): registra incidente disco+trombada e acordo de NNNN [gov-loop] 2026-07-17 17:25:34 -03:00
Rafael Melgaço 01729ef78f chore(gov-loop): registra virada de fase G4 no progress [gov-loop] 2026-07-17 16:12:05 -03:00
Rafael Melgaço 6d55c6eb50 checkpoint(G4): report emitido — COMPLETO, 5/5 features PASS [gov-loop]
Phase gate: awaits owner approval (loop/checkpoints/G4.approved).
5 open inbox items (proposal/non-vetting) copied to report §3.
2026-07-17 15:01:55 -03:00
Rafael Melgaço 57c57cc4e4 feat(G4-04): per-attendant metrics — funnel + individual performance [gov-loop]
Spec §6 defined before code (won/lost by owner, conversations by assignee,
TTFR = first human outbound minus first inbound, bot excluded via
sent_by_user_id). fn_attendant_metrics SECURITY INVOKER — RLS 0035/0036 is the
gate (agent aggregates own only, manager+ org-wide + filter). Migration 0037:
2 partial indexes; EXPLAIN under agent AND manager roles, no seq scan.
User-scoped route, new Desempenho page. gov-8 asserts exact numbers.
Verified-by: gov-verifier PASS 2026-07-17T15:00:26-0300
2026-07-17 15:00:27 -03:00
Rafael Melgaço bc30259807 feat(G4-03): per-attendant lead scope RLS — migration 0036 [gov-loop]
fn_can_view_lead mirrors fn_can_view_conversation (owner_user_id, same
visibility_mode); crm_leads FOR ALL dropped, re-expressed per-command
(SELECT visibility-aware, agent own-write keeps drag-and-drop + queue pull,
manager+ org-wide, bulk assign intact). Empty-owner lead mirrors conversation
queue (own_and_unassigned: see+move; own: neither). DIRC in spec.
gov-5c invariant added (13 tests). No UI code changed.
Verified-by: gov-verifier PASS 2026-07-17T13:37:13-0300
2026-07-17 13:37:13 -03:00
Rafael Melgaço b662993a7e feat(G4-02): scoped inbox views — mine/queue/all + RLS-scoped counts [gov-loop]
Tab 'Todas' hidden for agent when visibility_mode != all (cosmetic); real
guard is G4-01 RLS. Counts via user-scoped GET /conversations/counts (inherits
RLS, never admin — gov-5b proves agent all=2 < manager all=3). Tab in URL
?filter=; out-of-scope deep-link -> clear empty state, no stack trace.
Verified-by: gov-verifier PASS 2026-07-17T13:09:02-0300
2026-07-17 13:09:03 -03:00
Rafael Melgaço 122f4f6f93 feat(G4-01): per-attendant conversation visibility RLS — migration 0035 [gov-loop]
fn_can_view_conversation (stable definer, row fields) drives visibility-aware
SELECT on conversations + messages (EXISTS on parent); only agent restricted,
default own_and_unassigned. Root-cause fixes: EXISTS over scalar-subquery
(NULL-as-queue leak), fn_conversation_assign->DEFINER (RLS blocked transfer's
UPDATE RETURNING), FOR ALL write policies split per-command (USING also gated
SELECT). Ratchet flip: eixo 5 it.fails->it (DESKCOMM_GOV_INVARIANTS_EDIT=1).
Verified-by: gov-verifier PASS 2026-07-17T11:31:28-0300
2026-07-17 11:31:29 -03:00
Rafael Melgaço 0f7505b942 feat(G4-00): revoke anon EXECUTE on write SECURITY DEFINERs — migration 0034 [gov-loop]
Hardening from INB-07: 6 write definers were anon-executable (Group A via
direct grant, Group B via inherited PUBLIC). 0034 revokes accordingly and
re-grants Group B to authenticated/service_role; invariant proves all 6
permission-denied under real anon role. Closes INB-09: bulk owner validation
fails closed when service role absent, org resolved from authz not first lead.
Verified-by: gov-verifier PASS 2026-07-17T10:58:01-0300 (re-spawned after API timeout)
2026-07-17 10:58:01 -03:00
Rafael Melgaço 07c97907b5 chore(gov-loop): registra virada G3 + hardening G4-00 + reconciliação do dev [gov-loop] 2026-07-17 10:28:49 -03:00
Rafael Melgaço ca36202e91 plan(G4-00): hardening SECURITY DEFINER anon — aprovado pelo dono (INB-07) [gov-loop]
DESKCOMM_GOV_PLAN_EDIT=1: feature nova autorizada pelo dono via chat
('INB-07 sim', 2026-07-17). Agrupa as notas do INB-09.
2026-07-17 10:23:58 -03:00
Rafael Melgaço 1b9fe1151d checkpoint(G3): report emitido — COMPLETO, 5/5 features PASS [gov-loop]
Phase gate: awaits owner approval (loop/checkpoints/G3.approved).
7 open inbox items (proposal/non-vetting) copied to report §3.
2026-07-17 10:11:36 -03:00
Rafael Melgaço 141bac42f0 feat(G3-05): conversation tags + inbox filter — migration 0033 [gov-loop]
conversations.tags text[]+GIN + canonical vocabulary in org settings;
PATCH accepts normalized tags (Zod: lowercase/trim/dedup, <=20, <=40) with
audit; tag editor in side panel + org-scoped tag filter in inbox. Ratchet
flip: 1 GAP(G3) it.fails in gov-7-tags.test.ts flipped + org-scoped filter
invariant (DESKCOMM_GOV_INVARIANTS_EDIT=1).
Verified-by: gov-verifier PASS 2026-07-17T10:10:21-0300
2026-07-17 10:10:21 -03:00
Rafael Melgaço ad0255e0cc feat(G3-04): bulk lead assignment — manager gate + owner validation + audit [gov-loop]
Assign path of /leads/bulk gains per-action manager gate (authz.denied),
owner membership validation (422 invalid_owner), aggregate audit
leads.bulk_assigned with count, and count toast. Limit stays 50 (AT-06).
No migration.
Verified-by: gov-verifier PASS 2026-07-17T09:22:40-0300
2026-07-17 09:22:40 -03:00
Rafael Melgaço 8dec8e8825 feat(G3-03): lead owner on kanban — OwnerBadge + URL filter + reassign [gov-loop]
Card shows owner name/avatar (dashed 'Sem responsável' when null); owner
filter persisted in URL query param; reassign via card submenu reusing
useEditLead + /team/assignable + board's existing realtime channel.
No migration (owner_user_id already exists).
Verified-by: gov-verifier PASS 2026-07-17T09:02:12-0300
2026-07-17 09:02:12 -03:00
Rafael Melgaço c23f71ee44 feat(G3-02): first-class AI assignee — assignee_kind + bot veto + INB-06a guard [gov-loop]
Migration 0032: assignee_kind coherence CHECK + backfill; handoff writes
reason=handoff event (kind ai->user or queue); ai-response-worker vetoes bot
when kind='user'. INB-06a forward-fix: fn_conversation_assign validates dest
membership via fn_member_role_in_org (revoke execute from anon — closes the
cross-org enumeration leak the verifier caught). Ratchet flip: 1 GAP(G3)
it.fails in gov-6-ai-handoff.test.ts flipped (DESKCOMM_GOV_INVARIANTS_EDIT=1).
Verified-by: gov-verifier PASS 2026-07-17T08:38:44-0300 (repaired 1 round)
2026-07-17 08:38:44 -03:00
Rafael Melgaço 84f8d93eb8 feat(G3-01): auditable assignment events — migration 0031 + transfer + ReassignDialog [gov-loop]
conversation_assignment_events (append-only, org RLS) + fn_conversation_assign
(SECURITY INVOKER, atomic update+event, auth.uid() as changed_by); claim/release
via rpc keeping 409; new immediate transfer route + inbox ReassignDialog;
database.types.ts regenerated. Ratchet flip: 1 GAP(G3) it.fails in
tests/invariants/gov-3-transfer.test.ts flipped to normal test
(DESKCOMM_GOV_INVARIANTS_EDIT=1, legit exception).
Verified-by: gov-verifier PASS 2026-07-17T07:48:02-0300
2026-07-17 07:48:02 -03:00
Rafael Melgaço 6d44e70edc merge: fase G2 do gov-loop aprovada (gov/G2 → main)
Checkpoint: loop/checkpoints/G2-report.md (COMPLETO, 4/4)
Aprovação: loop/checkpoints/G2.approved (by Rafael via Maestro, opção A)
Conflito em plan/progress.md resolvido preservando ambos os lados (append-only).
Envs de exceção por MERGE DE FASE (conteúdo já verificado na gov/G2):
- MIGRATION_EDIT: 0030 vem da gov/G2 por merge, não é colisão nova.
- INVARIANTS_EDIT: flip da catraca gov-1-rbac (2 GAP(G2) → testes normais),
  feito na G2-03 sob a mesma env e citado naquele commit (f3954ab).
2026-07-17 07:04:29 -03:00
Rafael Melgaço 713c53abf7 checkpoint(G2): report emitido — COMPLETO, 4/4 features PASS [gov-loop]
Phase gate: awaits owner approval (loop/checkpoints/G2.approved).
2026-07-16 23:34:25 -03:00
Rafael Melgaço da453e4020 feat(G2-04): role matrix e2e — Playwright rbac-roles + admin MFA login [gov-loop]
4 e2e tests proving the role matrix in the browser (agent 403, admin in
via real TOTP challenge, viewer message denied); seed extended with viewer
+ idempotent admin TOTP; billing page gains the missing admin-only gate.
Verified-by: gov-verifier PASS 2026-07-16T23:29:21-0300
2026-07-16 23:29:22 -03:00
Rafael Melgaço f3954ab7bf feat(G2-03): role-based RLS on config tables — migration 0030 [gov-loop]
Triple migration: crm_pipelines/crm_stages write manager+, conversations
write agent+ (viewer read-only), SELECTs unchanged; old ALL policies dropped.
Ratchet flip: 2 GAP(G2) it.fails in tests/invariants/gov-1-rbac.test.ts
flipped to normal tests (DESKCOMM_GOV_INVARIANTS_EDIT=1, legit exception).
Verified-by: gov-verifier PASS 2026-07-16T23:07:32-0300
2026-07-16 23:07:32 -03:00
Rafael Melgaço b157aeeaa3 feat(G2-02): editable member role — canonical PATCH + audit + team UI [gov-loop]
Single handler in _shared.ts (admin gate, last-admin guard, Zod, audit
team.role_changed appended to union); /role kept as thin alias; inline
role selector with optimistic update + rollback; 8 new tests.
Verified-by: gov-verifier PASS 2026-07-16T22:52:28-0300
2026-07-16 22:52:28 -03:00
Rafael Melgaço 4e90ad4d07 feat(G2-01): role×endpoint matrix enforced server-side in /api/v1 [gov-loop]
Single authz helper (getUser + fn_user_role_in_org + standardized 403 +
authz.denied audit); ~47 routes gated per spec 13 §4 matrix; org-of-resource
override for LGPD anonymize. 21 new unit tests (115 total).
Verified-by: gov-verifier PASS 2026-07-16T23:05-03:00 (round 2 after 1 repair)
2026-07-16 22:32:05 -03:00
Rafael Melgaço b796bda61f chore(gov-loop): registra virada de fase G1 no progress [gov-loop] 2026-07-16 21:52:38 -03:00
Rafael Melgaço 20fe969aa3 feat(G1-06): owner product decisions transcribed — spec 13 §3.5/§4/§5 [gov-loop]
Owner answered INB-01/INB-02: visibility own_and_unassigned, manual+round-robin,
reuse agent role, immediate audited transfer, manager sees individual metrics,
supervisor read-only §10 dropped. Matrix has 0 PENDENTEs.
Verified-by: gov-verifier PASS 2026-07-16T20:36-03:00
2026-07-16 20:34:57 -03:00
Rafael Melgaço 8833cd9c92 checkpoint(G1): report emitido — INCOMPLETO, bloqueado em G1-06 (human_input) [gov-loop]
5/6 features PASS; INB-02 aberto com as 5 decisões de produto do dono.
Loop parado aguardando loop/checkpoints/G1.approved.
2026-07-16 20:15:24 -03:00
Rafael Melgaço 5e77e55962 feat(G1-05): target data model + role×resource matrix — spec 13 §3-§4 [gov-loop]
5 draft DDL structures with DIRC each; 11×4 matrix, 7 cells PENDENTE G1-06
+ 1 PENDENTE INB-01. No product decision invented.
Verified-by: gov-verifier PASS 2026-07-16T20:24-03:00
2026-07-16 20:13:39 -03:00
Rafael Melgaço cedf0ade73 feat(G1-04): gap audit specs 04/05 vs real code — spec 13 Apêndice B [gov-loop]
20 items audited (9 impl / 5 partial / 6 absent), file:line evidence;
INB-01 opened (supervisor read-only §10 uncovered, conflicts spec 13 §4).
Verified-by: gov-verifier PASS 2026-07-16T20:12-03:00
2026-07-16 20:03:49 -03:00
Rafael Melgaço f7a6b3c83d feat(G1-03): governance invariants suite — 7 eixos, 22 green + 7 GAP ratchets [gov-loop]
tests/invariants/gov-1..7: per-eixo invariants against disposable Postgres;
it.fails ratchets flag known gaps (G2-G6). Spec 13 Apêndice A filled.
Verified-by: gov-verifier PASS 2026-07-16T19:48-03:00
2026-07-16 19:47:49 -03:00
Rafael Melgaço 35899eab65 feat(G1-02): disposable Postgres harness — baseline install+update + 2-tenant RLS isolation [gov-loop]
pnpm test:db: ephemeral pgvector:pg17, Supabase stubs prelude, baseline in
install (ON_ERROR_STOP=1) and update modes, 9 vitest RLS isolation tests.
Verified-by: gov-verifier PASS 2026-07-16T19:26-03:00
2026-07-16 19:27:13 -03:00
Rafael Melgaço 98eb5e6e40 feat(G1-01): consolidated CI gate — gov:verify + ci.yml [gov-loop]
Adds gov:verify script (typecheck && lint && test:unit) and ci.yml
workflow (pull_request + push main, pnpm 9 / node 20 as perf.yml).
Verified-by: gov-verifier PASS 2026-07-16T19:01:24-0300
2026-07-16 19:01:42 -03:00
Rafael Melgaço 3e344b8777 fix(main): type-safe loop/update-feature.ts — smoke estava vermelho [gov-loop]
Typecheck estrito falhava com 12 erros no script da máquina do loop.
Tipagem real (sem any/casts), validações explícitas antes de qualquer escrita.
Verified-by: gov-verifier PASS 2026-07-16T18:50-03:00
2026-07-16 18:52:18 -03:00
Rafael MelgaçoandClaude Fable 5 b1fc966033 feat(gov-loop): instala loop de governança de atendimento — plano G1-G6 + máquina maker/verifier
Backlog: 27 features em 6 fases (provas/invariantes → RBAC → atribuição →
escopo → roteador/fila/painel → contrato p/ agentes externos), derivado de 7
eixos de feedbacks reais do sistema-modelo (abstraídos, zero PII) + recon do
código (baseline.sql, specs 04/05, MCP tools).

Máquina portada do vendaval-loop: LOOP.md (maker≠checker + hash-check),
checkpoint humano por fase (.approved), gates mecânicos em loop/hooks/
(features.json imutável fora de passes/verification; tripla de migration
migrations+baseline+MANIFEST com NNNN validado contra todas as branches;
tests/invariants/** congelado; push só com DESKCOMM_GOV_PHASE_MERGE=1),
update-feature.ts real, guard PreToolUse com merge aditivo (Lina preservado).

Checkpoint G6 aprovado → dono cria loop/checkpoints/FG-CRM.approved no
Vendaval e destrava a fase FG de lá.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 18:16:57 -03:00