Skip to content

fix: green the backend pipeline and re-arm CI enforcement - #398

Merged
godamongstmen897 merged 12 commits into
mainfrom
fix/pipeline
Aug 30, 2026
Merged

fix: green the backend pipeline and re-arm CI enforcement#398
godamongstmen897 merged 12 commits into
mainfrom
fix/pipeline

Conversation

@godamongstmen897

Copy link
Copy Markdown
Contributor

Repairs the fallout from merging the 25-PR backlog, and re-arms the CI gate that #397 temporarily lifted.

before after
tsc --noEmit 98 errors 0
npm test 31 failing / 87 suites 1549 passing, 87/87 suites
npm run build passes

The part worth reviewing carefully

Most of this is not "fix the type error" — it is restoring feature code that successive merges silently deleted. Nothing caught it, because each merge reverted the implementation and its tests together, so the suite stayed green about code that no longer existed.

Restored:

Merge damage repaired

  • db.ts had SCHEMA_MANAGER_INDEXES declared four times and insertHistoricalEventBatch three times. Kept the array form and the range-validating overload every caller actually uses.
  • poller.ts referenced two architectures at once — a bare Server and rpcClient. Settled on the retry client, exposing rpcServer so fetchEventsWithRetry applies its own policy rather than nesting retries 5×3.
  • runMigrations is now atomic across pending migrations and reports failures to the schema-manager monitor. Bootstrap failures previously reached neither — they threw straight past the monitor, leaving a half-migrated database.
  • database_writer_pool — the queue's persisted-key cache now clears on reset. That cache describes one database, so it survived a setDb swap and made the pool skip inserts for rows the new database had never seen.

New migration

Migration 8 adds the event_type lookup indexes the topic filter needs. Migration 3 indexed (contract_id, event_type), which cannot serve a bare event_type predicate — event_type is not the leading column.

Test changes, and why they are not cheating

Three expectations were stale rather than wrong. Each now asserts the property the ticket cared about instead of an incidental detail:

  • two index assertions named a specific index, before later migrations gave the planner a better-suited one — now assert the lookup is index-backed rather than a full scan
  • a migration list hardcoded [5, 6, 7] — now derived from getShippedMigrationVersions()

One genuine conflict needed a design call: two suites demanded different things from the same poll. One asserts exactly one debug line per poll; the other greps for a stall-diagnostics line. Two separate lines cannot satisfy both, so a poll now emits one structured diagnostics record carrying both, with the first line bearing a stall window exempt from the throttle.

CI

continue-on-error removed from Type check, Test and Build — the workflow is byte-for-byte its original enforcing form again.

🤖 Generated with Claude Code

godamongstmen897 and others added 12 commits August 30, 2026 15:49
Repairs the fallout from merging the 25-PR backlog and restores the
feature work that successive merges had silently dropped.

Type errors: 98 -> 0. Tests: 1549/1549 across 87 suites. Build clean.

Restored code that merges had deleted (no test or typecheck caught it,
because the corresponding tests were reverted in the same merges):

- indexer_metrics_collector: schema verification hooks (#340), the RPC
  health check with backoff retry (#334), and resetIndexerMetricsCollectorState
- sqlite_vacuum_cleaner: the index accessors (#344) and the opening
  diagnostics boundary of a cleanup cycle
- ledger_range_tracker: schema verification, including migration-gap detection
- indexer_runner: IndexerRunnerFailureMonitor, plus its throttle wiring (#256)
- poller: historical range import (#254), poll diagnostics (#270), and the
  dynamic poll interval
- routes/jobs: the partial-release cache key and its cache-hit path (#116)

Repaired merge damage:

- db.ts: SCHEMA_MANAGER_INDEXES declared four times and
  insertHistoricalEventBatch three; kept the array form and the
  range-validating overload every caller uses
- poller.ts referenced two architectures at once (a bare Server alongside
  rpcClient); settled on the retry client, exposing rpcServer so
  fetchEventsWithRetry applies its own policy instead of nesting retries
- runMigrations is atomic across pending migrations and reports failures
  to the schema-manager monitor; bootstrap failures reached neither before
- database_writer_pool: the queue's persisted-key cache now clears on
  reset. It described one database, so it survived a setDb swap and made
  the pool skip inserts for rows the new database had never seen.

Also adds migration 8 with the event_type lookup indexes the topic filter
needs - migration 3 indexed (contract_id, event_type), which cannot serve
a bare event_type predicate.

Three test expectations were stale rather than wrong, and were updated to
assert the property instead of an incidental detail: index assertions that
named one index before later migrations gave the planner a better one, and
a migration list that hardcoded versions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 30, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@godamongstmen897
godamongstmen897 merged commit b471f0c into main Aug 30, 2026
2 checks passed
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.

2 participants