Skip to content

Persist reconciliation drift snapshots with trend query#1811

Open
220nightmore-spec wants to merge 1 commit into
QuickLendX:mainfrom
220nightmore-spec:feature/reconciliation-drift-history-1713
Open

Persist reconciliation drift snapshots with trend query#1811
220nightmore-spec wants to merge 1 commit into
QuickLendX:mainfrom
220nightmore-spec:feature/reconciliation-drift-history-1713

Conversation

@220nightmore-spec

Copy link
Copy Markdown

Closes #1713.

Summary

  • add v013_reconciliation_snapshots with durable run_at, checked_count, drift_count, and severity fields plus a run_at index
  • persist a snapshot at the end of each ReconciliationWorker run, including RPC-error reports
  • add ReconciliationWorker.getDriftTrend(limit) with limit clamping and most-recent-first ordering
  • expose the trend via GET /api/v1/admin/monitoring/reconciliation/trend?limit=...
  • add focused Jest coverage for empty trends, persistence, ordering, limit clamping, and severity boundaries

Validation

  • node .\node_modules\jest\bin\jest.js src\tests\reconciliation.test.ts --runInBand --forceExit
  • direct v013 SQLite migration smoke: up creates the table/index, accepts a snapshot row, and down drops the table
  • git diff --check

Notes

  • I attempted the suggested migration dry-run, but the current migration runner fails before this migration with db.get is not a function because the runner adapter calls db.get() on a better-sqlite3 database instance. I left that shared runner behavior unchanged to keep this PR scoped to the reconciliation history feature.
  • Full tsc --noEmit --pretty false is currently blocked by an existing syntax error in src/index.ts; the focused Jest coverage above passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: add a reconciliation drift snapshot history table with trend query for ReconciliationWorker

1 participant