Repository navigation
Server P2b: compile a live configuration from books and start live from it - #141
Merged
Merged
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 14
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…om it - configuration::assemble_from_repository reads books, reference pins, the latest stored pricing config and fresh curve recipes at one cutoff and builds a ConfigurationDocument; convex-config gains `compile`. - convex-config validates, stages and activates against the capabilities the server composes for the document's mode and quote sources. - The live profile can plan the stored active configuration (CONVEX_CONFIGURATION_ID) instead of a plan file. - Live runtime: a new checkpoint starts no earlier than now and the selected activation; tick and expiry cutoffs never move backwards when the wall clock steps back. - Seed SHOWCASE-USD uses MarketQuote Mid. - application_path: compiled live configuration prices posted quotes and restarts fresh; engine tests for compile pins and refusals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sujitn
force-pushed
the
server-p2b-compiled-plan
branch
from
October 22, 2026 20:42
dd35e09 to
ccdc525
Compare
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.
Third of the smaller P2 PRs, stacked on #139. A live runtime can now be planned from stored books and inputs instead of a hand-written plan file.
Owner decisions (2026-10-22):
convex-configagainst a stopped database; the server plans the active configuration at boot. In-process restart moves to the admin activation route (P8).SHOWCASE-USDusesMarketQuote{Mid}.<pricing config>-v<version>.What it adds
configuration::assemble_from_repository(engine,configuration/compile.rs). It reads at one cutoff (as_of,known_at):as_ofand recorded byknown_at, at most 256 instruments, deduplicated;applies_tomust match every instrument. Its id and version are the configuration identity, as the runtime already requires (configs.get_version);resolve_curves, so recipe revisions and their dependencies are pinned and must be fresh at the cutoff;Everything else comes from a
PlanSelectionJSON with no defaults. The output is aConfigurationDocumentthat the existing validate/stage/activate use cases take unchanged.convex-config DB compile SELECTIONprints that document.validate,stageandactivatenow check a document against the capabilities the server would compose for it: its mode and its quote sources. Before, they always used replay capabilities, so a live document could not pass.liveprofile from the active configuration.CONVEX_CONFIGURATION_ID(orconfiguration_idin TOML) is the alternative toruntime_plan, and exactly one is required. Composition opens storage, reads the active configuration, plans it, and applies the same mode and build checks as a plan file. The stored assembly does not change, so a restart of the same activation plans the same digest and restores its checkpoint.Engine fix: a new Live checkpoint starts at the current time. It used to start at the plan's
as_of/known_at. For a compiled plan that is the compile cutoff, which is earlier than the activation, soActiveConfiguration::capturerefused it ("active configuration is later than information cutoff") and startup failed withRecoveryConflict. Live already values every tick at wall-clock time, so the start moves forward to the latest of the plan cutoff, the current time and the selected activation'sactivated_at. Live reads the wall clock on every tick, and a checkpoint cutoff must never go backwards. So each tick and each data expiry now also clamps to the checkpoint cutoff, as Replay already does with source and receipt times. Before, a tick after the clock stepped back was refused, and on the stream path that stopped the runtime. Replay and Captured are unchanged.Seed:
SHOWCASE-USDv1 uses{"MarketQuote": {"side": "Mid"}}inseed.jsonandmake_seed.py. Price-by-ID never readspricing_spec, and the existing price-by-ID test still getsSHOWCASE-USD@1,D.OIS@1,P.SOFR@1and its price.Tests
application_path::compiled_live_configuration_prices_posted_quotes_and_restarts_freshreplaces the ignored live test. It runs over the real composition, the realconvex-configbinary and HTTP:PUTthe book, post fresh Valid revisions of D.OIS and P.SOFR (the seed's dated Demo curves cannot pass fixture validation);SHOWCASE-USD-v1, the instrument and the curve versions;livefromconfiguration_id, post an image (202), wait for ready, and check results carry the runtime id;convex-engine/tests/configuration_compile.rs:config.rs: Live needs exactly one plan source;configuration_idis refused outside Live.Known limits
convex-core-inputscan import one.max_age_ms(at most a day) live valuations report the curve stale until a new configuration is activated. The showcase slice (P2b-2) has to handle this.now, and the next lookup atnowcan miss a record written just before such a step. In 1 of 30 runs this made the P6 testbook_snapshot_ingest_resolves_external_identifiersreturn 422. The new live test uses a monotonic timestamp floor that includes the server-stamped book time. Monotonicrecorded_atin the reference repository is a follow-up.Verification (WSL)
cargo test --locked -p convex-engine --no-fail-fast: all binaries pass, includingconfiguration_compileandruntime.cargo test --locked -p convex-server --no-fail-fast: all binaries pass, 0 failed.cargo clippy --locked -p convex-engine -p convex-server --all-targets -- -D warnings: clean.cargo fmt --all --check: clean.python3 tools/assurance/check.py:"status": "passed".application_pathstress, 30 runs in a row with a realtime-clock monitor alongside: 30/30 pass.Testis red on main until Bump redb to 4.4: fix integrity failure after compaction (main CI red since #136) #140 (redb 4.4) merges.Next
P2b-2, the showcase on the live profile:
🤖 Generated with Claude Code