Repository navigation
Fix: 4 issues (#294, #295, #296, #297) - #482
Merged
OxDev-max merged 2 commits intoOct 23, 2026
Merged
Conversation
Co-authored-by: Simple Agent <agent@simple.dev>
|
@ezikifactt-gif Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
# Conflicts: # package.json # src/claim/claim-settlement.service.ts # src/db/schema.sql # src/metrics/metrics.service.ts # src/oracle/oracle-event.repository.ts # src/oracle/oracle.module.ts # src/oracle/oracle.scheduler.ts # src/services/claimProcessor.ts
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.
Closes #294
Closes #295
Closes #296
Closes #297
Issues
#294 Capture and Version Provider Methodology Metadata for Independence and Evidence
#295 Partition and Index Oracle Readings and Evidence Tables for Sustained Write Volume
#296 Build a Disaster Recovery Restore Drill and Evidence-Store Backup Verification
#297 Auto-Generate Incident Timelines and Postmortems from the Oracle Evidence Ledger
Summary
The four issues are tightly coupled: the methodology registry (#294) and incidents (#297) both need new tables and migrations, and the partitioning work (#295) changes the physical shape of the readings/evidence tables that #294 and #297 write to, so schema.sql and the new migration must land together. The DR drill (#296) depends on migrations applying cleanly from scratch, so it must be tested after the partitioning migration is in place. Keep every migration idempotent and re-runnable so the restore drill can apply them to a fresh instance. Enforce the query-budget policy at the repository layer (throw on missing timestamp predicate) rather than relying only on review. Redact provider payloads in the incident generator before rendering markdown, and make rendering deterministic (stable ordering, no timestamps of render time) so golden-file diffs are meaningful.
Changes
oracle_methodology_versionstable (source_id, version, derivation_description, sampling_universe, revision_policy, expected_latency, known_failure_modes, approved, signoff flags, created_at, superseded_at) with a unique (source_id, version) constraint and no UPDATE path; addoracle_sourcesactivation columns referencing the approved methodology version. Addoracle_consensus_decisionsandoracle_evidencetables that carrymethodology_version_ids(JSONB array) so every decision and evidence record resolves the exact semantics. Defineoracle_readingsandoracle_evidenceas declarative RANGE partitions on observed_at/decided_at (monthly) with the partition key in every primary/unique key, plus covering indexes for (feed, source, observed_at), evidence lookup by decision/payout id, and trust-status by feed. Add anincidentstable andincident_eventslink table (incident_id, event_type, ledger_ref, payload_redacted, occurred_at) for issue Auto-Generate Incident Timelines and Postmortems from the Oracle Evidence Ledger #297. Keep the file idempotent (IF NOT EXISTS) so fresh installs and the restore drill both work. (src/db/schema.sql)004_methodology_partitioning_and_incidents.sqlthat: (a) creates the methodology registry tables and backfills a placeholder 'unapproved' methodology row for every already-registered source so migration of existing sources is explicit and they are blocked from activation until approved; (b) converts the existing non-partitioned oracle readings/evidence tables to partitioned form using the bounded-lock pattern (create new partitioned table, backfill in batches, swap names, re-runnable); (c) creates the covering indexes described in schema.sql; (d) creates the incidents and incident_events tables. Include a documented query-budget note in the header and make every statement idempotent so the restore drill can apply it from scratch. (src/db/migrations/001_idempotency_and_oracle_partitioning.sql)postgres-drillservice to docker-compose.yml (separate from the primary postgres, no persistent volume, disposable) used by the restore-and-verify drill, and document that the drill must never point at the production database. (docker-compose.yml)dr:restore-drill), the partition/index EXPLAIN assertions (test:query-budget), and the incident postmortem golden-file tests so CI and operators can invoke them consistently. (package.json)