Repository navigation
Phase 5 (E): records-ready webhook + records_status column - #745
Merged
neuromechanist merged 2 commits intoJun 11, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
Contributor
Author
|
Sonnet /review-pr addressed: /webhooks/records-ready faithfully mirrors /archive-ready's auth+validation (token+timingSafeEqual, strict status, 0-rows->404, parse->400); migration 0041 structurally correct, sorts after 0040, no fts/embed interaction; idempotent; tests sound. Addressed Issue 1 (Important): the 'pending' enum value is reserved (Phase 5 writes only ready/failed via the callback, exactly like archive_status 0036) — clarified the migration comment so the schema is honest rather than implying pending is written. |
neuromechanist
merged commit Jun 11, 2026
acbfd40
into
feature/issue-736-epic-publish-robustness
1 check passed
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR745Version: 🤖 Updated on each push. |
This was referenced Jun 11, 2026
This branch was previously deployed
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.
Summary
Phase 5 (E) of epic #736, the nemar-cli half: the
records-readywebhook receiver +records_statusobservability column. Pairs with nemarDatasets/.github#42 (which dispatchesgenerate-recordson publish + POSTs the callback). Together they close the last "didn't run" gap from the nm000111 report — records.json 404'd for every dataset because the workflow was never dispatched and had no callback.0041_dataset_records_columns.sql—records_status TEXT CHECK (records_status IN ('pending','ready','failed')),records_checked_at TEXT,idx_datasets_records_status. Mirrors the archive columns (0036); plain ADD COLUMN, not indatasets_fts/embed-dirty.POST /webhooks/records-readyinwebhooks.ts— line-for-line mirror of/archive-ready:X-Webhook-Token(NEMAR_WEBHOOK_TOKEN) auth, strictstatus(ready|failed),UPDATE datasets SET records_status=?, records_checked_at=datetime('now'), 404 on 0 rows, 400 on bad body. No retry (records generation is light; unlike Phase 3 archive retry). records.json is served from S3 directly (loadRecords), so this column is observability-only.Closes #742
Part of epic #736
Test plan
bun test backend/test/records-status-migration.test.ts— 4 tests, real in-memory SQLite (all migrations applied), no mocks: migration 0041 adds the columns NULL-by-default; the CHECK accepts pending/ready/failed+NULL and rejects others;idx_datasets_records_statusexists; the records-ready UPDATE flips status + stamps checked_at and changes 0 rows for an unknown dataset. Typecheck (tsc --noEmit) clean; Biome clean; the migration-chain test (archive-status) still green with 0041 applied.Deploy ordering: this receiver must be on prod before the .github callback matters; the .github success callback is best-effort (non-fatal) precisely so the two can land independently. The migration + webhook deploy at epic finalization (epic -> dev -> main,
d1 migrations apply).