Repository navigation
Conversation
This was referenced Oct 9, 2026
Open
This was referenced Oct 9, 2026
Collaborator
Author
|
@coderabbitai full review |
This was referenced Oct 9, 2026
Open
Open
Contributor
✅ Action performedFull review finished. |
This was referenced Oct 9, 2026
Open
Open
Collaborator
Author
JuaniRios
force-pushed
the
rai-2998-event-lines
branch
from
October 10, 2026 00:18
45fb360 to
b3a7815
Compare
JuaniRios
force-pushed
the
rai-2998-alert-kind
branch
from
October 10, 2026 01:15
fbd6bef to
94cbce9
Compare
JuaniRios
force-pushed
the
rai-2998-event-lines
branch
2 times, most recently
from
October 10, 2026 01:58
675357a to
f87b405
Compare
JuaniRios
force-pushed
the
rai-2998-alert-kind
branch
from
October 10, 2026 01:58
94cbce9 to
93e82b9
Compare
JuaniRios
force-pushed
the
rai-2998-event-lines
branch
from
October 10, 2026 02:39
f87b405 to
703b653
Compare
JuaniRios
force-pushed
the
rai-2998-alert-kind
branch
2 times, most recently
from
October 10, 2026 03:14
2d7244c to
86403e8
Compare
JuaniRios
force-pushed
the
rai-2998-event-lines
branch
from
October 10, 2026 03:14
703b653 to
6421f57
Compare
… committed events
JuaniRios
force-pushed
the
rai-2998-event-lines
branch
from
October 10, 2026 04:11
6421f57 to
e0ddd8c
Compare
JuaniRios
force-pushed
the
rai-2998-alert-kind
branch
from
October 10, 2026 04:11
86403e8 to
7320f93
Compare
This was referenced Oct 10, 2026
Open
This branch has not been deployed
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.

Part of RAI-3104.
The bot now writes
liq_trade,liq_transfer, andliq_eventlog lines from committed events, each with a stableevent_id. Item 5 of the RAI-2998 stack, the part that #1695 left out.Live effect: new INFO lines on three new targets. Dashboard broadcast and trade delivery are unchanged · Risk: low to medium (one extra SQLite read per trade event inside the commit's reactor dispatch, and more log volume) · Ships: with the next bot release, but not before the merge condition below
Merge condition
Switch
st0x-event-sorceryandsqlite-esinCargo.tomlback to a released tag before merge. Both pin a git rev of ST0x-Technology/event-sorcery#64 for now, cause that's whereReactor::react_committedlives and it isn't released yet. Order: merge event-sorcery#64, release it (v0.3.2 or whatever it gets), bump the tag here, then merge this. Plus the same conditions as the stack below.Why
The board (item 6b) needs real trade and transfer rows from the bot instead of the exporter's
liquidity-tradesandliquidity-transferslogs. Each line needs an id that doesn't change across restarts, so a duplicate is harmless. The id is<aggregate type>:<aggregate id>:<sequence>, and the sequence comes from the event store.Writing lines from
evolve()would re-log everything on every replay. TheReactortrait dropped the sequence, so that needed event-sorcery#64 first.What
Broadcasteroverridesreact_committed.reactandreact_committedsharehandle(event, Option<Committed>). Lines only get written with a commit, so replay, hydration, view rebuilds, and the handoff retry path write nothing.src/dashboard/event_lines.rs:liq_trade: one line per terminal trade. Fieldsevent_id,id,occurred_at,venue,direction,symbol,shares,status,error,price(Trade.pricefrom feat: carry the fill price on the dashboard trade [RAI-3101] #1693), andusd(shares * price). A venue correction (SourceAttributed) writes the trade again with the new venue.liq_transfer: one line per status change. Fieldsevent_id,kind,id,symbol,direction,amount,status,started_at, andusd. Equity is valued at the symbol's mark when the event commits (empty with no live mark). USDC is valued at its amount. The last status per transfer is kept in memory to skip events that don't change it.liq_event: one line per committed trade or transfer event. Fieldsevent_id,parent(tradeortransfer),venueorkind,id,sequence,step, andpayload.stepandpayloadhave the same shape as the/liquidity-read/.../eventsendpoints, and those now share the helpers."".DOMAIN_TARGETSand in thedocs/observability.mdtargets table, plus a section with the full contract.Decisions
payloadis a JSON string, not a nested object (tracinghas no stable nested fields). 6b'sdetail.jshas toJSON.parseit.signatureandrawvalues are redacted at any depth inpayload. Some events persist a signed mint authorization or a signed tx before it's delivered or broadcast, and those shouldn't sit in Cloud Logging. Tested on the real events.Positionevents get noliq_event: they belong to no trade or transfer.occurred_attoliq_tradeeven though the plan didn't list it. The exporter used it as the row time, and a caught-up onchain fill would otherwise show the catch-up time.Known gaps (honest list)
dashboardwith theevent_id), loses the line for good.Broadcasterwrite no lines:send_commandand the operator paths with their own store (CLI manual transfers, fails, reconciles,clear-pending-burn, and the hedge release). Those events still reach theeventstable and the event endpoints. Fixing that means routing them through the conductor's stores, so it's a follow-up, not this PR.Broadcaster. Stage 6 retires the dashboard, so it must move them out first.Proof
liq_eventandliq_tradewithOnChainTrade:<id>:1. Then a restart (new store, viewrebuild_all,load_entity) writes nothing, and the next command writes:2. Also a failed counter trade, a USDC bridge, a source correction, aPositionevent (no line), andreactwithout a commit (no line).cargo nextest run -p st0x-hedge -p st0x-config --all-features: 5350 of 5351 pass. The one failure is the known anvil timing flake inapi::tests(a_signed_burn_that_fails_to_record_releases_its_nonce), and it passes alone. Clippy, fmt, and pre-commit are clean.docs/cqrs.mddoesn't mentionreact_committedyet). I left that for the tag bump, since the upstream docs cover it.log_format = "json"and t0.devops#792, which this PR doesn't flip.