feat(db): show whether each database is neutralized #30
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 532 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.376
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #30"
general
weight: 0.35
xaviedoanhduy
What
Every database row in the instances list now says whether it is neutralized:
Yellow
PARTIALLY NEUTRALIZEDfor a database whose signals disagree, and no tag at all where psql could not answer — guessing either way is the mistake this exists to prevent.instance_databases(MCP) returns the whole report, not just the state:Why not just read the flag
database.is_neutralizedis what the database claims. Written by hand, or left behind by a neutralization that someone switched a cron back on after, it marks a live database as safe — the exact failure the tag exists to catch. So the flag is corroborated against what the database can still do: the stub relay being in place, no real mail server or cron still active, and eight module surfaces that must not still be live (payment providers, IAP credits, fetchmail, templates pinned to a relay, WhatsApp, VoIP, bank feeds, signing certificates), each condition copied from that module's owndata/neutralize.sql.Claimed and clean is the only way to green. The two disagreeing is yellow.
Notable decisions
query_to_xml(SQL as a string, parsed only afterto_regclassconfirms the table). The report carriescheckedso a misspelled table name is distinguishable from a module that isn't installed.neutralize.sqlfirst ships. On 14/15 the flag is set by whatever copied the database, with no stub to find — demanding one would paint every correctly neutralized old staging yellow forever.payment_acquireris checked alongsidepayment_providerfor the same reason.is_test_catcher. Counting them would have the two halves of the app contradicting each other.res_company/res_users(sms_twilio, microsoft_calendar,l10n_*EDI credentials): those tables exist everywhere while their columns come and go with the module, which no static SQL can guard.Validation
Run against 22 real databases (5 docker + 17 host cluster), versions 16 through 19, every state cross-checked against direct SQL rather than through this code:
v17e_cpc_recycle_production(the surface-richest): 16 payment providers alldisabled, 0account_online_link, 0 fetchmail →extras {};ir_cron46 total / 2 active / 1 excluding autovacuum — matches exactly.iap_accountcaught live credentials on 6 databases (real 32-char tokens, not+disabled) — something the fourbasesignals cannot see.nextcallwas three weeks out, then restoring it).checkedaggregated over all 22:certificate_certificate,payment_acquirer,voip_providerandwhatsapp_accounthave never been evaluated anywhere — no database here has those tables. That is the observability working, not a gap in the checks.Not validated on real data: no database older than 16 exists here, so the relaxed-stub path and
payment_acquirerare covered by unit tests only.