KB-3176

KG/dot-kg Discovery — 07 Read-only Discovery Views (LIVE) + Apply Packet

5 min read Revision 1
process-discoveryviewsapply-packetworkstream-flive2026-06-04

07 — Read-only Discovery Views (LIVE) + Apply/Rollback Packet (Workstream F)

Status: APPLIED LIVE. 6 additive read-only views committed via ssh contabo → docker exec postgres psql -U directus. 0 births (birth_registry 1,158,132 before == after == post-commit). Rehearsed BEGIN…ROLLBACK net-zero first, then committed. Independent MCP read-back PASS. Fully drop-reversible.

7.1 The 6 views

view rows (live) purpose
v_process_discovery_evidence_graph 113 one node per process component (dots+jobs+workflows), with role/trigger/pairing/runtime/inventory-coverage
v_process_discovery_candidates 17 components grouped into candidate processes; producer/verifier/orphan counts
v_process_discovery_orphan_components 84 components not covered by v_axis_process_inventory, classified
v_process_discovery_quality_score 17 start/end/correlation/runtime/pairing signals → confidence_score + readiness_band
v_process_discovery_drift_signals 17 component_hash / trigger_hash / route_hash per candidate (drift baseline)
v_process_discovery_birth_ready_queue 17 readiness band + blockers + birth_gate_status

7.2 Safety properties (all satisfied)

  • Additive: only CREATE OR REPLACE VIEW; no base table touched; no INSERT/UPDATE/DELETE.
  • Read-only: views are SELECT-only over existing tables/views.
  • Birth-free: verified before==after==1,158,132 (views don't fire birth triggers).
  • Drop-reversible: /tmp/process_discovery_views_rollback.sql (6 DROP VIEW IF EXISTS).
  • No promotion / no process born / no taxonomy node / no approval.
  • Generic: keyed on trigger_type, paired_dot, run_id, job_kind, process_code, naming-splits — no literal kg branch. Covers 17 candidates across 14 DOT families + jobs + workflows.

7.3 Live results (MCP read-back, sorted by confidence)

candidate kind members orphaned confidence band gate
PROC-CAND:job:cut job 8 8 90 verified_candidate BIRTH_READY_PENDING_OWNER
PROC-CAND:dot:kg dot 36 18 50 strong_candidate_structural BLOCKED_NEEDS_RUNTIME_AND_CORRELATION
PROC-CAND:dot:nrm dot 11 7 50 strong_candidate_structural BLOCKED_NEEDS_RUNTIME_AND_CORRELATION
PROC-CAND:dot:doc dot 3 2 50 strong_candidate_structural BLOCKED_NEEDS_RUNTIME_AND_CORRELATION
PROC-CAND:dot:kb dot 3 1 50 strong_candidate_structural BLOCKED_NEEDS_RUNTIME_AND_CORRELATION
PROC-CAND:dot:gov dot 2 2 30 weak_candidate BLOCKED_NEEDS_EVIDENCE
PROC-CAND:dot:schema dot 34 34 10 weak_candidate BLOCKED_NEEDS_EVIDENCE
PROC-CAND:dot:collection dot 4 4 10 weak_candidate BLOCKED_NEEDS_EVIDENCE
(8 more: migration, birth, api, seed, sync, field, WF-001, WF-002) 1–3 0–10 not_a_process / weak

Reading: only job:cut is verified (it has a real completed run with a shared run_id). Every DOT family — including KG — is blocked on runtime/correlation, exactly reflecting "0 DOT executions system-wide." dot:schema (34 members, all orphaned, confidence 10) shows the engine also flags large NULL-trigger families as weak, not falsely grouping them.

7.4 Apply / rollback packet

  • Apply SQL: /tmp/process_discovery_views.sql (idempotent CREATE OR REPLACE).
  • Rollback SQL: /tmp/process_discovery_views_rollback.sql.
  • Apply channel: cat process_discovery_views.sql | ssh contabo "docker exec -i postgres psql -U directus -v ON_ERROR_STOP=1".
  • Rehearsal recipe (proves net-zero before any real apply): wrap in BEGIN; … SELECT count(*) FROM birth_registry; ROLLBACK; and confirm before==after.

7.5 Not done here (consciously)

  • process_discovery_baseline table (persist hashes for automatic drift diff) — needs a real table = owner-gated; designed in doc 06 §6.9, not created.
  • process_run_id correlation column — owner-gated schema change; designed in doc 06 §6.11.
  • No pivot_definitions insert — avoids unretirable births + unratified equations (consistent with the AX-PROCESS pilot). RP surfacing stays report-only via the views.
Back to Knowledge Hub knowledge/dev/reports/architecture/kg-dot-process-discovery-and-document-building-pilot-2026-06-04/07-readonly-discovery-views-or-apply-packet.md