06 — Candidate Discovery Builder Readiness
06 — Candidate Discovery Builder Readiness
View: v_rp_candidate_discovery_builder_readiness (wraps v_rp_candidate_discovery_wiring_plan + builder fn contract design).
Current blocker
fn_dot_wf_build_candidates() does not exist (verified: pg_proc lookup false). The 19 existing wf_process_candidate rows were a one-time manual build. The only function that touches the candidate table is the audit-only fn_wf_candidate_action_execute (disposition logging, not building). Builder authoring is OWNER_BLOCKED — it is not an engineering-only change because candidate rows, while pre-birth, are RP-visible governance writes.
Live wiring plan
| aspect | detail | status | next_action |
|---|---|---|---|
| source_views | wf_orphan_remediation_queue (143) + process_run_observation + process_component_observation | present | — |
| builder_handler | NONE: no fn builds wf_process_candidate | MISSING | owner authors fn_dot_wf_build_candidates() |
| schedule | add builder call to wf_scan_orchestrator.sh (after remediation queue) | possible | engineering once builder exists |
| output | wf_process_candidate rows (pre-birth, governance-visible) | — | owner approves |
| risk | candidate creation pre-birth but RP-visible → not a silent eng write | MEDIUM | owner authority |
| blocker | OWNER must author + sanction builder fn before wiring | OWNER_BLOCKED | owner |
Proposed builder fn contract (design — not applied)
| field | design |
|---|---|
| builder_fn_exists | false (MISSING) |
| inputs | wf_orphan_remediation_queue + process_run_observation + process_component_observation |
| outputs | wf_process_candidate rows (pre-birth, governance-visible), keyed by candidate_code |
| idempotency | UPSERT on stable candidate signature; re-run must not duplicate |
| birth_behavior | NO birth — candidate rows are pre-birth governance-visible; birth only via PROC-OWN president vote |
| preview_mode | p_execute boolean: false = return projected candidate set (jsonb); true = write (owner-gated) |
| owner_gate | fail-closed: refuse write unless owner present / sanctioned |
This mirrors the proven fn_pa_domain_handler preview/execute pattern: a single function, p_execute=false returns a projected set with no writes, p_execute=true is owner-gated. No builder stub was written — authoring is the owner's sanctioned act.