KB-7E7B
FIX6 02 — Native pg_depend callgraph (B) + v2 clone removal (C)
3 min read Revision 1
qt001fix6callgraphpg-dependv2-clone
FIX6 02 — Native dependency model (SUPERTRACK B) + v2-clone authority removal (SUPERTRACK C)
B — Native callgraph, regex demoted to diagnostic
Key catalog fact (verified): SELECT count(*) FROM pg_depend d JOIN pg_proc p1 ON p1.oid=d.objid AND d.classid='pg_proc'::regclass JOIN pg_proc p2 ON p2.oid=d.refobjid AND d.refclassid='pg_proc'::regclass WHERE p1.proname LIKE '%qt001%' = 0. PostgreSQL does not record function-body call edges, so a native callgraph is authoritative for VIEW dependencies only (5,638 real view edges via pg_depend/pg_rewrite).
Objects:
v_qt001_native_dependency_edges_v6— pg_depend/pg_rewrite view→relation/function edges (NORMAL/AUTO deptype).v_qt001_native_dependency_closure— recursive, no depth cap (DAG terminates), rooted at qt001 control views (audit scope), traversal follows edges to ANY object incl. non-qt001.v_qt001_callgraph_text_scan_diagnostic— wraps the old regexv_qt001_callgraph_edges_v2, flaggedis_authority=false, diagnostic_only=true.v_qt001_callgraph_unclassified_fail_guard— apply roots (writer/driver/builder) are plpgsql/sql functions withcatalog_call_edges=0→pass=false(BLOCKING; cannot natively certify legacy-free). This is the honest structural answer to B1: native no-legacy proof is IMPOSSIBLE in 2.6A; resolution (drop legacy fns / planner-as-views so pg_depend captures edges) routed 2.6B.v_qt001_callgraph_no_regex_authority_guard— proves via native pg_depend closure that the 4 authoritative guards (readiness v9, hardcode v7, no_bypass v4, scorecard) do NOT reach any regex view (authoritative_guards_reaching_regex=0) AND the readiness registry points at no regex view (registry_rows_pointing_at_regex=0) → pass=true.
C — v2-clone detected + blocked (not re-authored)
v_qt001_v2_logic_clone_detector— comparesprosrcof plan_v5 vs plan_v2:normalized_identical=true(after stripping comments + the'fact_source','PLAN_V5_NATIVE'labels + whitespace) AND all 5 signatures shared (EXECUTE format, ELIGIBLE_SYNTHETIC, apply_safe, legacy_id_single_colon,FROM %I t).clone_detected=true.v_qt001_current_planner_not_v2_clone_guard.pass=false(clone + performs apply-scale full scan) — BLOCKER feeding readiness; full-scan/keyset/perf declared NOT_SAFE, routed 2.6B (genuine re-authoring is 2.6B, not faked here).v_qt001_plan_facts— reads already-computed facts fromqt001_plan_snapshot(PG-driven facts, no rescan) for control reads.
Codex-honesty: detecting a clone via source comparison is a fail-closed DETECTOR (conservative), not a source-text safety CERTIFIER — and it is corroborated by the catalog-level normalized-md5 equality.