From e24e9fa8059955b6d73500042aaec291f914977c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 18 Jul 2026 22:49:36 +0000 Subject: [PATCH] fix(switch-db): clean 261 spec_match rows unmasked by the 144 curated-row fix The 14 false curated rows had been raising the evidence-based ceiling for those 1G-only switches, masking 261 algorithmic spec_match rows claiming >1G transceivers on the same hardware. With the ceiling honest again, v_compat_speed_errors correctly flagged them; standard 125-B/138 remediation applied (backup in unmasked_spec_match_backup_20260718). Gate green again. --- sql/145-unmasked-spec-match-cleanup.sql | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/145-unmasked-spec-match-cleanup.sql diff --git a/sql/145-unmasked-spec-match-cleanup.sql b/sql/145-unmasked-spec-match-cleanup.sql new file mode 100644 index 0000000..3e3d909 --- /dev/null +++ b/sql/145-unmasked-spec-match-cleanup.sql @@ -0,0 +1,25 @@ +-- sql/145-unmasked-spec-match-cleanup.sql +-- Follow-up to sql/144: the 14 false curated 10G-on-1G rows had been RAISING +-- the evidence-based ceiling (v_switch_effective_max takes the fastest curated +-- compatible transceiver as evidence) for those 1G-only switches, thereby +-- MASKING every algorithmic spec_match row claiming >1G parts on the same +-- switches. With the curated rows corrected, the ceiling is honestly 1G again +-- and v_compat_speed_errors correctly flags the previously-hidden rows (261 +-- found live 2026-07-18). Same remediation as sql/125-B/138: flip algorithmic +-- rows exceeding the ceiling to incompatible. Backup first. Idempotent. + +create table if not exists unmasked_spec_match_backup_20260718 as +select c.*, now() as backed_up_at +from compatibility c +where c.id in (select compat_id from v_compat_speed_errors); + +update compatibility c + set status = 'incompatible', + notes = case when c.notes is null or c.notes = '' + then 'auto(145): transceiver speed exceeds switch max port speed (unmasked by 144 curated-row correction)' + else c.notes || ' | auto(145): transceiver speed exceeds switch max port speed (unmasked by 144)' end + where c.id in (select compat_id from v_compat_speed_errors); + +insert into _migrations (filename, applied_at) +select '145-unmasked-spec-match-cleanup.sql', now() +where not exists (select 1 from _migrations where filename = '145-unmasked-spec-match-cleanup.sql');