Repository navigation
Conversation
Refract-Protocol#588, Refract-Protocol#589 (premises did not match current code) Refract-Protocol#589: reevaluation-planner.ts and reevaluation.service.ts turned out to have no DB-backed "load all open claims then slice" bug at all — the reevaluation pipeline's claim source is an in-memory AdjudicationLedger Map, not a SQL query, and claim.repository.ts had no "open claims" query of any kind. Rather than force an edit onto files that don't have this problem, added the capability the issue actually asks for as new functionality: a findOpenClaimsBatch(limit) method on ClaimRepository that selects open (non-settled) claims directly in SQL, oldest-first by trigger_detected_at, with the LIMIT applied in the query so no caller ever has to materialize the full open-claims set just to take a bounded slice. This is scoped narrower than literally rewiring the reevaluation pipeline, since that pipeline's real data model doesn't match the issue's premise; it gives any current or future caller a genuinely bounded, deterministic alternative to a full scan. Refract-Protocol#588: loadOracleConfig() was already only called from one-shot places (startup validator, a module factory that runs once per boot, a one-shot CLI script) — not a per-request hot path, so there was no repeated-disk-read problem to fix. Built the caching mechanism anyway so the issue's literal deliverable exists for any future hot-path caller: a new getOracleConfig() in oracle-feed-config.ts that reads and parses once per process and caches the result, plus a test-only resetOracleConfigCache(). Deliberately did NOT rewire any existing call site to use it: oracle-admin.controller.spec.ts creates OracleAdminModule twice in the same file with different ORACLE_FEEDS_JSON values between them, relying on loadOracleConfig() being read fresh each time, so swapping that call site to the cached getter would have broken a currently-passing test for a hot-path problem that doesn't exist here. loadOracleConfig() itself and its existing callers are untouched. Refract-Protocol#587: there was no startup banner anywhere in src/ for sandbox mode, even though CONTRIBUTING.md already documents one ("the app prints a prominent startup banner so it is never mistaken for a real environment") — the docs described behavior the code never implemented. Added it for real in src/main.ts: when isSandboxMode() (reused from src/config/configuration.ts) is true, a short banner describing what sandbox mode actually does here (oracle bootstrap skips the Postgres pool, uses in-memory stores) is written to process.stderr, never stdout, so a CLI script's JSON output on stdout is never contaminated, while the banner still shows up for a human running `npm run dev`. Refract-Protocol#586: CONTRIBUTING.md didn't actually say `npm test` anywhere, and package.json's `test` script is real and working (`test:unit` then test:contracts`), so the issue's literal premise (a stale command pointing at a script that no longer exists) didn't hold. Tightened the vague "Run the test suite before opening a pull request" line to name the actual command and its narrower sub-scripts, removing the ambiguity the issue is fundamentally concerned about. Closes Refract-Protocol#586 Closes Refract-Protocol#587 Closes Refract-Protocol#588 Closes Refract-Protocol#589
|
@Young850 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! 🚀 |
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.
#589: reevaluation-planner.ts and reevaluation.service.ts turned out to have no DB-backed "load all open claims then slice" bug at all — the reevaluation pipeline's claim source is an in-memory AdjudicationLedger Map, not a SQL query, and claim.repository.ts had no "open claims" query of any kind. Rather than force an edit onto files that don't have this problem, added the capability the issue actually asks for as new functionality: a findOpenClaimsBatch(limit) method on ClaimRepository that selects open (non-settled) claims directly in SQL, oldest-first by trigger_detected_at, with the LIMIT applied in the query so no caller ever has to materialize the full open-claims set just to take a bounded slice. This is scoped narrower than literally rewiring the reevaluation pipeline, since that pipeline's real data model doesn't match the issue's premise; it gives any current or future caller a genuinely bounded, deterministic alternative to a full scan.
#588: loadOracleConfig() was already only called from one-shot places (startup validator, a module factory that runs once per boot, a one-shot CLI script) — not a per-request hot path, so there was no repeated-disk-read problem to fix. Built the caching mechanism anyway so the issue's literal deliverable exists for any future hot-path caller: a new getOracleConfig() in oracle-feed-config.ts that reads and parses once per process and caches the result, plus a test-only resetOracleConfigCache(). Deliberately did NOT rewire any existing call site to use it: oracle-admin.controller.spec.ts creates OracleAdminModule twice in the same file with different ORACLE_FEEDS_JSON values between them, relying on loadOracleConfig() being read fresh each time, so swapping that call site to the cached getter would have broken a currently-passing test for a hot-path problem that doesn't exist here. loadOracleConfig() itself and its existing callers are untouched.
#587: there was no startup banner anywhere in src/ for sandbox mode, even though CONTRIBUTING.md already documents one ("the app prints a prominent startup banner so it is never mistaken for a real environment") — the docs described behavior the code never implemented. Added it for real in src/main.ts: when isSandboxMode() (reused from src/config/configuration.ts) is true, a short banner describing what sandbox mode actually does here (oracle bootstrap skips the Postgres pool, uses in-memory stores) is written to process.stderr, never stdout, so a CLI script's JSON output on stdout is never contaminated, while the banner still shows up for a human running
npm run dev.#586: CONTRIBUTING.md didn't actually say
npm testanywhere, and package.json'stestscript is real and working (test:unitthen test:contracts`), so the issue's literal premise (a stale command pointing at a script that no longer exists) didn't hold. Tightened the vague "Run the test suite before opening a pull request" line to name the actual command and its narrower sub-scripts, removing the ambiguity the issue is fundamentally concerned about.Closes #586
Closes #587
Closes #588
Closes #589
Summary
Type of change
Checklist
.envvalues committedNotes for reviewers