fix(replication): reconcile archived DBH records into serving - #3
Open
phibkro wants to merge 2 commits into
Open
fix(replication): reconcile archived DBH records into serving#3phibkro wants to merge 2 commits into
phibkro wants to merge 2 commits into
Conversation
phibkro
force-pushed
the
agent/f1-close-dbh-serving
branch
from
July 22, 2026 18:11
72f5509 to
0705927
Compare
phibkro
added a commit
that referenced
this pull request
Jul 22, 2026
The suite proved falsifiers #1/#3 (query gate serves zero fixture rows even with seeds present) but never exercised migration 0006 — a destructive DELETE shipped with zero coverage. Add assertions that apply 0006 against the already-ingested DB: fixture course_versions go from >0 to 0, and a re-fetched GET /v1/courses deep-equals the pre-cleanup response (removing the seeds changes NOTHING served, and the migration touches no published course version). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
F1 closure: DBH evidence reaches serving
Root cause: the R3 worker archived and parsed DBH responses but discarded the parsed records; NTNU reconciliation therefore published with empty DBH inputs, and the fixture-fed manual script was the only non-empty path.
This branch:
JSON.stringify(raw)bytes under the content-addressed DBH evidence namespace so servedsource_record.raw_payloadcan be hash-traced;ingest:official-curriculumscript from the serving path while keeping fixture construction test-only.Experience / verification
curl -X POST -H "Authorization: Bearer $RUN_TOKEN" https://<ingest-host>/v1/runs/fullcurl https://<api-host>/v1/programmescurl "https://<api-host>/v1/planner/baseline?programmeVersionId=<served-id>"source_record.raw_payload; it matches an R2 object atevidence/dbh/table-<id>/sha256/<hash>.json, and itsobserved_atequals the run'sretrievedAt.packages/source-dbh/fixtures/*andpackages/source-ntnu/fixtures/*plus the retired script imports, repeat the trigger and GETs, and observe the same live DBH-provenanced serving path.Checks:
bun run check:types,bun run validate,bun test apps/ingest-worker/src/replicate-dbh.test.ts, andbun test.Real: the code path uses live DBH/NTNU fetches and R2/D1 bindings; no Cloudflare deployment or advisor gate was run (per instruction).