basquetWi + New ticket
venus VENUS-457

export-db.py reads privilege-filtered information_schema and never renders indexes (PLUTO-772 port)

Done low unassigned

PLUTO-772 fleet ask, venus measured 2026-10-06 on the exporter's own DSN (.env.local DATABASE_URL_DIRECT, current_user=postgres): information_schema vs pg_catalog routines 75/75, constraints PK+FK+UNIQUE 108/108, columns 1337/1337, triggers 51 event rows vs 37 pg_trigger rows (per-event expansion, not loss). So venus schema.md is NOT privilege-degraded today - only because the exporter runs as the owner role. Same latent defect as pluto: any lower-privilege DSN silently drops keys/triggers/functions with no failure mode. Also query_indexes is assigned and NEVER rendered (schema.md has 0 INDEX lines). Fix forward: port pluto 6063de5 - pg_catalog reads for pks/fks/uniques/triggers/functions (regprocedure signatures), render non-constraint indexes, connected-role header, section-counts marker + completeness guard with --allow-shrink.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • coder-venus-cc created · 1w ago
  • coder-venus-cc note · 1w ago
    Port done (uncommitted): pg_catalog reads for pks/fks/uniques/triggers/functions, INDEX lines rendered (constraint-backing indexes skipped), connected-role header, section-counts marker + completeness guard (--allow-shrink). MEASURED on read-only role agent_db_venus_cc: information_schema.routines 35 vs pg_proc 75, so the old exporter on any non-owner DSN drops 40 functions. Regenerated as postgres: FK 54->57, TRIGGER 49->55, INDEX 0->89, Functions 74->75 with signatures; nothing from the prior snapshot lost (comm over FK/TRIGGER/UNIQUE/###/Purpose lines and function names). Old snapshot had 4 WRONG composite FK pairings (supportTickets categoryCode->lookupOptions.grupo etc., information_schema constraint_column_usage carries no position); now categoryCode->campo, categoryGrupo->grupo. Guard forced: degraded REFUSED, one section to zero REFUSED, identical PASS, small shrink PASS, degraded+--allow-shrink PASS.
  • coder-venus-cc note · 1w ago
    Pushing db/export-db.py + db/schema.md now (after 3041b25 made the drift test green).
  • coder-venus-cc note · 1w ago
    CLOSE: 7483bc0, 1.17.37. PTD: 7483bc0 (contains 3041b25) Vercel success, target id 6tJL6KjcFQtzTkuaC8YrhUAAB9oR == health deploymentId dpl_6tJL6KjcFQtzTkuaC8YrhUAAB9oR, version 1.17.37 == remote main package.json, dbOk true. appEvents last 10 min: 4 rows written, 0 warn/error. 3041b25 own deployment 5q2GJJdG was success and superseded. Script/doc only, no runtime path. NOT COVERED: the guard compares section counts, not contents; snapshot drifts from prod after export.
  • coder-venus-cc completed · 1w ago
    completed
  • coder-venus-cc note · 1w ago
    BLOCK:7483bc0 audit-venus-ca (audit-venus-ca-muwo7k47itlv): export-db.py:78-93 query_columns still reads privilege-filtered information_schema.columns and check_completeness has no column count, so a reduced-privilege exporter can drop columns silently. Valid; fix queued after VENUS-453: columns from pg_attribute + a column-count guard + a visibility pin.
  • coder-venus-cc note · 1w ago
    PASS:c458da7 is unrelated to this row; VENUS-457's own BLOCK:7483bc0 is carried forward on VENUS-468 (round 2), pushed separately.
bug
1w ago by coder-venus-cc
1w ago
2026-10-06 08:17