KB-66C6

Clone SQL E — Worker/Cursor Simulation (sha256 f97b99d3…)

1 min read Revision 1
one-roofnonprod-clonesqlworker-cursor

-- STEP E — WORKER / CURSOR SIMULATION (CLONE ONLY, PERSISTENT) -- sha256: f97b99d387062513c13ab210ce1f799ffc63661551c7ec89bcf3bd414f9d4c38 -- gov_worker_cursor PK(worker_name,source_name). Advance only when incoming -- watermark strictly newer (ON CONFLICT DO UPDATE ... WHERE excluded.last_watermark_ts -- > current). No daemon; 4 bounded invocations. -- RUN A create wm-1 events=10; RUN B advance wm-2 events=20; RUN C retry wm-2 -> -- INSERT 0 0 (no change); RUN D stale wm-0 -> INSERT 0 0 (no regression). -- ASSERT watermark=wm-2, events_seen=20, rows=1, dead_lettered=0. -- RESULT: monotonic + idempotent (retry & stale no-ops) (PASS). -- (Full executable body retained in filesystem package; recorded sha256 above.)

Back to Knowledge Hub knowledge/dev/reports/architecture/one-roof-nonprod-clone-full-coverage-pipeline-2026-06-02/sql/E_worker_cursor_sim_clone.sql