Archive the authoring component on order events - #87
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📜 Recent review details🧰 Additional context used🧠 Learnings (2)📚 Learning: 2026-04-14T06:47:01.283ZApplied to files:
📚 Learning: 2026-07-28T20:08:24.163ZApplied to files:
🔇 Additional comments (8)
WalkthroughChangesThe PR adds optional Order author archive plumbing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Seven separate components place orders on one shared venue account. An archived
order_eventsrow currently cannot say which of them authored the order:account_selectoris derived broker-side from the selected account label, so it isidentical across all of them by construction, and the client order id format is fully
spent at 36 characters.
This adds an optional, caller-declared author identity and archives it as a first-class
read key.
Changes
orderAuthoris an optional member on bothCreateOrderPayloadSchemaandCallPayloadSchema, so the typedCreateOrderpath and theAction.CallcreateOrderpath (used for funding passive orders) both accept it.OrderTelemetryContext, so both paths and both theirsuccess and failure archive branches carry it from one insertion point.
order_author LowCardinality(String) DEFAULT ''onorder_events, via aCREATEplus an idempotentALTER ... ADD COLUMN IF NOT EXISTS, following theclient_withdrawal_idcolumn added in 0.2.32.order_eventsandfill_eventsare now documented as schemacomments, including that
fill_indexis not a stable identifier.Shape notes
The author travels as a declared payload field, matching
orderIntentandpassivePlacementOutcome. gRPC metadata was not used: that channel is reserved forcredential and account routing.
It is resolved only from the caller context, deliberately skipping the
firstString(record, info, ...)fallback chain thatclientOrderIduses. The author iscaller-declared and never echoed by the venue, so a venue-side fallback could only
introduce noise.
It is archive-only and is never forwarded into the venue order params. There is a test
asserting exactly that.
Reviewer notes
""whenabsent, so this can land ahead of any caller.
order_author = '': avenue push has no caller context and the broker holds no order-id-to-author map. The
author is therefore present on the create-time row only, and attribution should join
back to that row by
order_id.ALTERstill has to be applied to the target database; merging this does notapply it.
existing comment in
rows.tsenumerating those has been updated.Checks
bun test— 477 passed, 0 failedbun run build:ts(tsc) — cleanbun run lint(biome) — clean, warnings are pre-existingSummary by CodeRabbit
New Features
Bug Fixes