feat(l1): add auditable replay for historical L0 rows (#541) - #650
Open
RerankerGuo wants to merge 1 commit into
Open
feat(l1): add auditable replay for historical L0 rows (#541)#650RerankerGuo wants to merge 1 commit into
RerankerGuo wants to merge 1 commit into
Conversation
Add an authenticated Gateway admin endpoint for bounded L1 replay with dry-run support, original L0 lineage, exact-batch idempotency, and persisted replay receipts. Query SQLite and TCVDB directly by session and recorded-at range while leaving the live L1 checkpoint cursor unchanged. Test: npm test (70 passed)\nTest: npm run build:plugin\nTest: git diff --check
Collaborator
|
Thank you for your interest and contributions! We will review your code and get back to you as soon as possible! |
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
Closes #541.
Adds a supported Gateway admin API for replaying historical L0 rows that were skipped after an earlier L1 extraction failure and are now behind
last_l1_cursor.What changed
POST /admin/replay-l1with requiredsession_keyand optional inclusivefrom,to,limit, anddry_runcontrols.source_message_idslineage..metadata/l1-replay-receipts.jsonlfor completed, failed, and idempotently skipped replay attempts.last_l1_cursorunchanged. Historical replay uses an independent receipt ledger rather than moving the online scheduler cursor backward and accidentally reprocessing unrelated rows.API example
The admin route is unavailable when
TDAI_GATEWAY_API_KEYis not configured; this prevents an unauthenticated caller from triggering LLM calls and persistent memory writes.Design decisions
checkpoint_cursor_beforeandcheckpoint_cursor_afterso operators can verify this invariant.limitdefaults to 100 and is capped at 500.Verification
npm test— 70/70 tests passednpm run build:plugingit diff --checkFocused replay tests cover:
Impact
.metadata/