Repository navigation
fix(ingest): pin queued jobs to immutable deliveries - #1006
Merged
Merged
Conversation
athvin
force-pushed
the
issue/1002-immutable-deliveries
branch
from
November 9, 2026 04:15
bee181d to
4960480
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1002
What
Pin accepted CSV deliveries to immutable files and their queued ingestion jobs. A later delivery cannot replace an earlier job’s input; retrying ingestion resets that run’s rows and receipts before replay.
Why
Two accepted deliveries currently overwrite the same source.csv, while both jobs resolve the latest file. This can lose incremental Salesforce data after its cursor advances, and prevents trustworthy provenance for E9 previews (#993). Selected as a prerequisite of the highest-priority active epic #514.
Proof
make checkandmake check-e2epassed on004b7c0bdf46b17daa851c1eca0123a6e7307a00, including real Postgres/DuckLake ordering, publication recovery, scope/mapping/integrity checks and both control-task and ingest retries. The overwrite and duplicate-ingest regressions were each observed failing before their fixes.Fresh-context house review found no instrumentation, tier or reuse candidates. CI run passed; all 15 required contexts were satisfied on the exact head, detect succeeded, and no merge bus was active.
Risk & rollback
Accepted files remain available for replay. Old jobs without immutable pins refuse and need the original input re-delivered; operator runs without a delivery identity retain the legacy drop-directory convention. Drain pinned jobs or stop dispatch before rolling back to an older binary.
Post-merge ledger
Closed by: agent · session
Codex:01a1be1b-0c92-7703-a4c2-25cb2c999baaonMac· 2026-11-09T06:08:58Zmainis green with this change on it — merged ase694f967b6fd770d23ffdecdaa045d94821aa5c2at 2026-11-09T04:38:56Z; ancestry and both publication/replay code paths verified on origin/main. Rust 42562984992 succeeded; frontend, infra and devcontainer also succeeded.images— 42562984995 succeeded for the merge SHA. Deploy 42563371500 failed on the pre-existing Fix non-root runtime access after adding the RDS CA bundle #1004 fault; both environments’ migration-pod logs confirm OpenSSL config Permission denied. Runtime verification is now complete on the repaired descendant, recorded below.deploy— 42567188752 attempt 2 succeeded. Repair fix(images): preserve non-root access to the RDS CA bundle #1005 (ab349d1e3204eeb076a0ec8035c8522c36e8018a) contains this merge. Both er-api services select green; prodweb-api-green-7bdb7f4bb9-rqcm9and current devweb-api-green-5b5f6f5656-nj9n5are 2/2 ready with zero restarts and match the repaired image pins. Their er-server processes emitted listening at 05:25:58.716270Z and 05:36:31.689613Z respectively on 2026-11-09. The earlier dev pod also emitted listening at 05:30:15.345608Z before replacement.the push-only surface no pull request can pre-test — the minimum 30-minute watch elapsed. Descendant cac010d contains this merge and repair ab349d1 (ancestry verified); Rust 42569224982 attempt 2, frontend 42569224990, images 42569224957 and deploy 42569644176 attempt 2 succeeded. Latest kind 42455973323, frontend-experiments 42457706859 and cluster-objects 42539710868 passed. Scheduled drift 42570659369 is knowingly red: prod lacks Cloudflare auth (Restore Cloudflare authentication in the scheduled Terraform drift workflow #1030), and dev/core failed provider downloads (existing ci: no retry around GitHub release CDN downloads — a partial 504 outage fails the whole rust gate #849). These paths are outside this PR; current drift status is not claimed green.
the board card — Pin accepted deliveries to immutable inputs before queued ingestion #1002 closed automatically at 2026-11-09T04:38:57Z and its P0 card reached Done; no manual Done edit.
follow-ups — no implementation work deferred from Pin accepted deliveries to immutable inputs before queued ingestion #1002. Provider provenance/preview work remains in parent E9: Materialize merge previews and persist approval #993; the independent runtime repair is Fix non-root runtime access after adding the RDS CA bundle #1004 / fix(images): preserve non-root access to the RDS CA bundle #1005.
what was learned is written down — connector reference §3.1 documents manifests, exact input resolution, mapping changes, replay, retention, legacy jobs and rollback. The already-declared §9.1 pre-image queries are now wired into the ingest stage.
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Files expected
er-cli/src/lib.rs(wire the declared §9.1 ingest pre-image),er-server/src/{delivery,lib,runctx,s3_ingest}.rs, relevantdags/{tasks,control,plans}paths, existing import/extract/run-context tests, and engine/control-plane references. Use entity declarations for any persistence change if investigation shows one is needed.Discoveries
Post-merge watch starts at 2026-11-09T04:38:56Z (30-minute minimum ends 05:08:56Z); it also requires completed main/image checks and actual repaired deployment evidence.
The §9.1 pre-image SQL was already declared/generated but had no caller. The real stage retry appended A twice.
stage_ingestnow atomically removes this run’s rows/receipts before replay, while #957 (landed via #1003 and included by rebase) owns atomic per-delivery appends. Retry logs:/tmp/immutable-ingest-retry-{red,green}.log.The source mapping fingerprint must retain
IndexMapcolumn order because ingestion hashes values in that order. Legacy queued delivery ids cannot prove which bytes they accepted; they now refuse rather than silently reading latest. The separate Docker runtime repair is owned by PR #1005 and still blocks the deployment ledger on #999.Measurements
Files