KB-4091

Process Discovery — 03 On-Demand Producer Inventory Fix (LIVE)

4 min read Revision 1
process-discoveryinventory-fixon-demandproducerlive2026-06-04

03 — On-Demand Producer Inventory Fix (Workstream B) — LIVE

3.1 The exact blind spot

v_axis_process_inventory (v1) builds its DOT rows in a dotp CTE with:

FROM dot_tools d
WHERE d.trigger_type = ANY (ARRAY['cron','event','dual','on-deploy'])

on-demand is excluded. All 18 KG producers (the C·ấp B on-demand half) are dropped; only the 18 cron/dual verifiers survive. The process axis showed half the KG automation. Confirmed live: KG = 18 on-demand + 18 cron/dual, all paired.

3.2 The fix — v_axis_process_inventory_v2 (companion, LIVE)

A new additive view; v1 is left untouched (its 60-row count contract is consumed by AX-PROCESS pivots PIV-340..353 and the RP UI — changing it in place would be a silent contract break).

Design choices, each tied to a macro constraint:

  • No blind spotdot_base includes all literal-DOT_ tools regardless of trigger_type.
  • No inflation → DOTs are collapsed by pair: pair_group = LEAST(code, paired_dot) when paired, else code; one process row per pair (component_count = 2). A producer/verifier pair is one process, not two.
  • Roles exposedhas_producer (any on-demand member), has_verifier (any cron/dual/event/on-deploy member), member_components (the DOT codes in the pair).
  • Honest classification → DOT pairs stay TYPE_1_DOT_CONTAINED; workflows/pipelines keep their v1 types.
  • dot_tools not mutated.

3.3 Live read-back (independent MCP channel)

metric value
v_axis_process_inventory (v1) 60 (unchanged)
v_axis_process_inventory_v2 46
v2 dot-process rows (source_object='dot_tools') 43 pair-groups
v2 rows exposing a producer (has_producer) 28
KG pair-groups 18, all pair_complete (producer and verifier present)

Reading: KG now contributes 18 process rows (same as v1's verifier-count — no inflation), but each row now shows its producer as a visible member (has_producer=true) — blind spot removed. v2's 46 < v1's 60 because pairing collapses two DOTs into one process and the universe is restricted to literal-DOT_ (the discovery engine's universe), where v1 counted every cron/dual DOT individually.

3.4 Safety

  • Additive (CREATE OR REPLACE VIEW only); birth-free (birth_registry 1,158,148 before == after); rehearsed BEGIN/ROLLBACK net-zero then committed; DROP-reversible (/tmp/01_views_v2_rollback.sql, staged contabo:/tmp).
  • v1 untouched → zero downstream pivot/UI breakage. RP can adopt v2 when ready (doc 09).

3.5 Honest caveat (no silent cap)

The discovery universe is literal-DOT_ tools. ~200 DOT…-prefixed tools with no underscore family token (carrying the backfilled last_executed) are not covered by either inventory or the discovery engine. This is a naming-convention coverage gap, surfaced here rather than hidden; closing it is a candidate for a later macro (normalise DOT codes or relax the family-split rule).

Back to Knowledge Hub knowledge/dev/reports/architecture/process-discovery-correlation-runtime-inventory-fix-2026-06-04/03-on-demand-producer-inventory-fix.md