Port daemon and offers lifecycle to native Rust engine#96
Merged
Conversation
Move reconcile/cancel phases and cycle entry into greenfloor-engine, delegate inventory/strategy/coin_ops via a Python subprocess bridge, and route greenfloord --once through the native engine binary. Co-authored-by: Cursor <cursoragent@cursor.com>
Use an in-process bridge for embedded cycles, detach during block_on so Dexie mock I/O is not blocked for 20s, and remove duplicate Python dispatch/shim paths. Co-authored-by: Cursor <cursoragent@cursor.com>
Unifies loop and run-once on run_daemon_cycle_once with Rust preamble, inventory/strategy/coin-op planning, honest parallel_markets, and non-zero exit when every selected market fails. Co-authored-by: Cursor <cursoragent@cursor.com>
Wire key allowlist, real coinset websocket-once capture, honest coin-op planning with vault mixed-split execution, ledger writes, and simpler parallel market dispatch so the native cycle matches Python behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Drive inventory/strategy/cancel/coin_ops from the Rust phase table with correct cancel-before-coin_ops ordering, unify daemon entry on the engine binary, and port watchlist/inventory logic with unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Run the cycle in-process via run_daemon_cycle_once, port active-offer counting and sequential strategy execution to Rust, drop duplicate strategy_offer_execution audits, and split coin_ops_execution. Co-authored-by: Cursor <cursoragent@cursor.com>
Split storage sqlite and watchlist modules, tighten engine cycle request typing, and delete obsolete Python dispatch tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Add offer-dispatch unit tests, shared managed post helper, DaemonCycleSummary and request test_controls, fix parallel transient detection, and move watchlist tests out of mod.rs. Co-authored-by: Cursor <cursoragent@cursor.com>
Unify greenfloord --once on the in-process engine path, introduce MarketCycleContext with single config load, port disabled-market and stale-sweep behavior to Rust, align parallel offer dispatch errors, and move websocket-capture coverage to Rust tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the phase enum loop with a direct pipeline using MarketCycleResultState, add typed PyO3 cycle request/response classes, consolidate disabled-market logging and websocket policy, remove dead subprocess entry points, and restore offer-dispatch integration tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Move lock, logging, websocket loop, and offer-dispatch tests to the Rust engine; unify cycle metrics on MarketCycleResultState and use dict JSON at the PyO3 boundary. Co-authored-by: Cursor <cursoragent@cursor.com>
Consolidate phase dispatch, reconcile augmentation, and coinset helpers in Rust; expose typed cycle request/response classes; remove duplicate Python inventory and logging glue. Co-authored-by: Cursor <cursoragent@cursor.com>
Move coin watchlist and dispatch orchestration into the engine, flatten market cycle phases, and slim Python to PyO3 wrappers with matching tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Scope watchlist to per-loop cache, run markets sequentially on one SQLite connection, unify path resolution, drop dead Python glue, and emit JSON cycle summaries from PyO3. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove duplicate reconcile/cycle glue, add typed lock errors and Rust reconcile tests, and fix Dexie 404 handling on the production path. Co-authored-by: Cursor <cursoragent@cursor.com>
Move CLI batch reconcile into reconcile_offers_batch, drop duplicate Python orchestration and watchlist shims, unify build-and-post on in-process PyO3, and remove the native daemon run-once CLI. Co-authored-by: Cursor <cursoragent@cursor.com>
Markets always run sequentially in-process; remove the ignored config flag. Add typed cycle/reconcile/build-post PyO3 types, DexieOfferPayload, shared engine_bridge helpers, Rust coinset WS handler tests, and test updates. Co-authored-by: Cursor <cursoragent@cursor.com>
Move CLI reconcile, long-running loop, and reload handling into the engine, delete Python mirror layers, and use JSON/dict PyO3 contracts instead of hand-maintained wrapper types. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Extract shared Dexie cancel executor, canonicalize reconcile_offer, unify daemon PyO3 on dict/serde boundaries, and delete cycle_runner/offers_lifecycle/watchlist shims. Co-authored-by: Cursor <cursoragent@cursor.com>
Serialize global offer-dispatch test overrides with TestHooksScope so concurrent Rust tests on Linux CI cannot clobber each other's transient/fatal modes. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
greenfloor-engine, withgreenfloordand manager offers commands delegating to native CLI subcommands (daemon,offers-reconcile,offers-status,offers-cancel).run_daemon_cycle_once,run_daemon_loop); delete Python shims (cycle_runner,offers_lifecycle,offer_watchlist, market-cycle stack, strategy dispatch stack).reconcile_offer(break reconcile_phase circular dependency), and tighten cancel CLI (--venue dexieonly; remove dead onchain flags).Test plan
pre-commit run --all-files(ruff, pyright, pytest)pytest tests/— 496 passed, 4 skippedgreenfloor-engine daemon --once+offers-reconcileagainst configured marketMade with Cursor