KB-2AB8

02 — Current Live Substrate Map (re-survey 2026-05-26)

9 min read Revision 1
design-packdieu-45substrate-maplive-pgre-surveyread-onlyv0.6

02 — Current Live Substrate Map (re-survey 2026-05-26)

Date: 2026-05-26 (afternoon re-survey for design-time confirmation) | Mode: read-only query_pg only. Prior survey: knowledge/dev/laws/dieu44-trien-khai/v0.6-system-wide-pg-native-queue-law-readiness-survey/ (PASS, 2026-05-26). Purpose: anchor every DP to a confirmed live state, surface any drift, and call out the silent gap that DP4 must repair.


§1. PostgreSQL platform

version:    PostgreSQL 16.13 (Debian 16.13-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc 14.2.0
extensions: btree_gist 1.7, pgcrypto 1.3, plpgsql 1.0, postgres_fdw 1.1
pg_cron:    NOT installed (confirmed via SELECT 1 FROM pg_extension WHERE extname='pg_cron')
listen_notify_in_use: only kb_vector_sync channel (PG→Qdrant daemon); event_outbox does NOT publish NOTIFY

No platform change since the survey. PG 18 is not in play.


§2. Row-count re-survey (delta from 2026-05-26 morning survey)

Table Morning survey This re-survey Δ
event_outbox 131,746 133,778 +2,032
event_read 131,407 133,439 +2,032
event_pending 0 0 0
event_subscription 3 3 0
event_type_registry 31 31 0
iu_route_worker_cursor 1 1 0
iu_route_dead_letter 0 0 0
iu_sql_event_route 1 1 0
dot_iu_runtime_lease 0 0 0
iu_auto_instantiate_event_log 33 33 0
iu_notification_event 0 0 0
iu_notification_read 0 0 0

Reading: ~2k system/issue_opened events accrued in ~12h. event_read tracks 1:1 (self-read). No DLQ entries. No staging changes. No worker drain (cursor frozen).


§3. Worker liveness — the silent-gap fact DP4 must address

worker:                iu_outbound_default
event_domain:          iu
last_run_at:           2026-05-22 11:31:41+00
events_seen:           68
attempts_written:      67
dead_lettered:         0
age_seconds_now:       341,659    (~95 hours ≈ 4 days)
post_enactment_status: §15.5 violation (silent_gap_is_a_health_violation)

This is the single most actionable live fact. Per Điều 45 v1.0 §15.4 + §15.5, any gap > stale_threshold must emit system/queue_worker_silent. No such event exists today because the emit pathway is one of the things DP4 designs.

Note: this gap was acknowledged by §20.4 as a pre-enactment condition that is not retroactively a violation; but the same fact persists at design time and is going forward a violation. DP4 + doc 14 phase order must address it.


§4. Adjacent live config

dot_config keys observed at this re-survey:

event.global.delivery_lane_default          = immediate
event.system.poc_status                     = enabled
hc_auto_attach_trigger_autofix_enabled      = false
hc_auto_close_enabled                       = true
hc_executor_last_run                        = 2026-05-26T10:01:45+00:00   ← HC executor is alive
hc_executor_max_runtime_seconds             = 600
hc_heal_description_basic_autofix_enabled   = true
iu_core.auto_instantiate_enabled            = false
iu_core.composer_enabled                    = false
iu_core.delivery_enabled                    = false
iu_core.delivery_live_routes                = (empty string)
iu_core.operator_runtime_enabled            = false
iu_core.retention_enabled                   = false
iu_core.routes_master_enabled               = true
iu_core.route_worker_enabled                = true
iu_core.structure_ops_enabled               = false
iu_core.three_axis_auto_refresh_enabled     = false
iu_core.vector_sync_enabled                 = false
piece_event_runtime.dry_run_only            = true
piece_event_runtime.emit_enabled            = false

Reading: the runtime is in a deliberately-cautious posture. route_worker_enabled=true and routes_master_enabled=true (so the worker function is permitted to run), but most consumer-side flags are off. HC executor heartbeat-equivalent (hc_executor_last_run) is being written every cycle — that is the pattern DP4 generalises to all executors.


§5. Substrate categories — what is live vs absent

§5.1 Event substrate (live)

Concern Live Notes
Durable event store event_outbox 133,778 rows
Read-state per actor event_read 133,439 rows
Transient staging event_pending 0 rows (drained or unused)
Subscription event_subscription 3 rows
Vocab whitelist event_type_registry 31 types
Worker cursor iu_route_worker_cursor 1 row (silent)
Dead-letter iu_route_dead_letter 0 rows
Trigger-IN bridge iu_sql_event_route 1 row, dry-run
Idempotency log iu_auto_instantiate_event_log 33 rows
Lease primitive dot_iu_runtime_lease 0 rows

§5.2 Job substrate (absent)

Concern Live state
Generic job table ❌ NONE
Job lifecycle vocab partially via dot_iu_command_run.run_status (5 values) — narrower than §6.7 9-state minimum
Long-running job claim ❌ NONE (DOT runs are ledger-only)
Per-job lease dot_iu_runtime_lease primitive exists but no usage
Job-side subscription ❌ NONE

DP2 fills these.

§5.3 Cutting / staging (live, separate tier)

Concern Live
Staging records iu_core.iu_staging_record (7-state lifecycle)
Staging payloads iu_core.iu_staging_payload (3 parts per MARK row)
Operator aliases fn_iu_op_* (5 functions)
Run ledger dot_iu_command_run
Lifecycle log iu_lifecycle_log
Cleanup function fn_iu_staging_cleanup
Vector-sync point iu_vector_sync_point (152 rows, NVSZ-clean)

§5.4 Cross-cutting (live)

Concern Live
DOT catalog dot_iu_command_catalog
DOT run ledger dot_iu_command_run
Vector sync NOTIFY fn_kb_notify_vector_sync → channel kb_vector_sync
Health executor hc_executor_last_run config key updated each cycle

§6. Views already exposing queue state

public.v_iu_event_backlog
public.v_iu_composer_event_backlog
public.v_iu_auto_instantiate_event_log
public.v_iu_auto_instantiate_event_summary
public.v_iu_route_dead_letter_open
public.v_dot_iu_command_run_health
public.v_iu_core_retention_candidates
iu_core.v_iu_staging_record
iu_core.v_iu_staging_payload_observability
public.v_piece_event_outbox

DP4 proposes adding v_queue_health as a single unified aggregator over all of these — design-only, not applied here.


§7. What this map establishes for design

  1. Substrate is overwhelmingly event-shaped. Anything job-shaped (long-running, claim-based, lease-protected) does not exist beyond dot_iu_command_run (a ledger, not a queue).
  2. Worker invocation is the weakest link. 4-day silence is documentation, not a bug — but it is the post-enactment §15.5 violation that DP4 must close.
  3. DLQ is empty. Either nothing has failed (likely — attempts_written=67events_seen=68), or worker is not surfacing failures. Survey Q27 still open.
  4. Subscription is minimal. Only 3 rows. Either intentional broadcast fallback, or the system has been running on default-route. Survey Q26 still open.
  5. Vocab is intact. 31 event types, 9 domains, 7 streams, 2 lanes. No drift from §6.1.
  6. NVSZ is structurally enforced (vector_sync_point has no staging path; CHECK + sidecar + view).
  7. Lease primitive is unused. 0 rows in dot_iu_runtime_lease. DP3 will exercise it; design must not assume any prior lease-acquire pattern is already in place beyond the function pair.

§8. Drift since the morning survey

None of substance.

  • +2,032 event_outbox rows (dominated by system/issue_opened, consistent with the 131k baseline rate).
  • Worker last_run_at unchanged (cursor still frozen at 2026-05-22 11:31:41).
  • No new event_type_registry rows.
  • No new dot_config keys added (the keys not listed in the morning survey were present then but not in scope of that query — they have not been mutated by this pack).

§9. Live-survey integrity

  • All queries used mcp__claude_ai_Incomex_VPS__query_pg (READ ONLY, statement_timeout 5s, hard LIMIT 500).
  • Zero INSERT / UPDATE / DELETE / DDL executed.
  • Zero dot_config mutation.
  • Worker cursor unchanged by this re-survey (last_run_at remained 2026-05-22 11:31:41).
  • This document is design-only commentary; it does not propose a single SQL statement be run.

Substrate map confirms the design's starting point. No mutation. Authored 2026-05-26 by Claude Opus 4.7 (1M).

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-dieu45-full-queue-orchestration-design-pack/02-current-live-substrate-map.md