KB-3E49
FIX5 02 Authoritative Callgraph v2
2 min read Revision 1
qt001fix5callgraphlegacy
02 — Authoritative Callgraph v2 (recursive, structural)
Reproduces Codex's method: trace the ACTUAL dependency closure, not a name list.
v_qt001_callgraph_edges_v2: caller→callee edge for every qt001 function/proc/view, extracted by word-boundary match of the callee name insidepg_get_functiondef/pg_get_viewdef(caller)._is a word char in PG regex sofn_qt001_machine_tierdoes NOT match inside..._v4— versions are distinguished.v_qt001_authoritative_callgraph_v2: MATERIALIZED edges + node-deduped recursive reachability from the 3 registered roots (is_root): writerfn_dot_birth_qt001_apply, driversp_dot_birth_qt001_apply, builderfn_qt001_build_plan_registry. Everything else authoritative is REACHED from these.qt001_authoritative_object_registry: classifies every node (authoritative_root/current, governed_engine/registry, safe_planner, diagnostic_only, routed_2_6b, legacy_superseded, external_dependency) +is_sentinel_planner. It is a TABLE (data) — never scanned for edges — so legacy NAMES live here, not in any reachable view body.v_qt001_authoritative_legacy_dependency_guard: FAILS CLOSED if any reached node islegacy_supersededOR UNCLASSIFIED. LIVE: pass=true, legacy_reached=0, unclassified_reached=0.
CRITICAL design rule discovered live: a reachable guard that embeds a legacy object NAME as a string literal (even to assert its absence) creates a spurious structural edge and explodes the closure (first rehearsal: 60 legacy-reached, all via no_legacy_planner_guard's literal IN-list). Fix: identify legacy via registry joins / is_sentinel_planner, never via literals in reachable views. v_qt001_no_legacy_planner_guard and v_qt001_planner_v2_sentinel_only_guard were rewritten registry-driven.