feat: per-unit daemon log trail — rebalance summaries, skip reasons, order/fill lines#227
Merged
Merged
Conversation
…rs, fills Make the daemon log tell each unit's story so "why hasn't alloc1-kraken traded since genesis?" is answerable by grepping logs/daemon.log, while an idle steady-state tick still adds zero per-unit INFO lines. - PortfolioRunner: one INFO rebalance-summary per evaluated tick (unit / asof / legs / submitted / round_up / skipped / on_target — the four counters partition the universe); elevate round_up/skip leg decisions to pinned INFO lines carrying the LegDecision.reason; INFO on each accepted order (cid/side/qty/symbol/px/venue_id) and WARN on a refused leg. Plain submits stay summary-only (no double INFO). Idle ticks are gated before rebalance() runs, so they emit nothing. - OrderFillSync: optional unit_name; INFO per applied fill (cid / signed qty / price / fee / fee_asset-or-quote), prefixed unit= when known, threaded from service_factory for a single-unit slice. - StrategySupervisor: INFO on unit start/stop, ERROR (logger.exception) when a unit's step raises, DEBUG on a no-new-bar tick. Verified on today's real dccd bars via a scratch daemon (fresh empty books, port 8099): both units' genesis rebalance summaries, skip lines with full reasons, submit lines and their matching fills — one fill cross-checked to the store (cid/qty/price exact) — and an idle tick adding only the heartbeat.
ArthurBernard
force-pushed
the
feat/daemon-unit-event-logs
branch
from
July 14, 2026 13:05
6ce711e to
f2b26b0
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.
Summary
daemon-loggingplan (docs: plan daemon-logging #225): the log now tells each unit's story — one grep-stable INFO summary per evaluated rebalance (unit=… asof=… legs/submitted/round_up/skipped/on_target), round-up/skip decisions with their fullLegDecision.reason, order submits (cid/side/qty/px/venue id) at INFO and refusals at WARN, one line per applied fill, unit start/stop/step-error transitions.Why
LogEvents (two sinks:daemon.logvs the SSE dashboard feed); step errors log-with-traceback then re-raise.Changes
portfolio_runner.py: rebalance summary (counters partition the universe), INFO skip/round-up reasons, INFO submits / WARN refusals;_prepare_deltareturns(delta, action).order_fill_sync.py: additiveunit_name; one INFO per applied fill (cid, signed qty, price, fee, fee asset with quote fallback).service_factory.py: threads the unit name into each unit's fill sync.supervisor.py: unit started/stopped INFO, step errors vialogger.exception(re-raised), idle ticks at DEBUG.Changelog
Added under [Unreleased]: per-unit daemon log trail — a unit's inactivity is now explained by the log.
Test plan
python -m pytest— 1501 passed, 1 skipped, cov 96.29%ruff check+ruff format --checkgreenlegs=14 submitted=3 round_up=2 skipped=9, krakenlegs=13 submitted=5 round_up=1 skipped=7), full skip reason (LTC/USDT below 0.5×min_notional), submit+fill pair cidalloc1-binance-BTC/USDT-0cross-checked exact against the scratch book; idle tick added zero per-unit lines; live daemon untouched