Repository navigation
QT desk: the risk check and the approve gate (C9, desk.proto 1.3.0) - #133
Merged
Merged
Conversation
Vendor desk.proto 1.3.0 from trade-ngin 7ec6076e (GetDeskRisk) and
regenerate the stubs (grpcio-tools 1.84.0); versions.py says desk=1.3.0.
API: DeskClient.get_desk_risk returns the engine's risk report of the day's
qt book as a camelCase dict (unset optional readings are None) or raises
DeskRiskUnavailable. The desk state and the override approval page carry it
as "risk" ({"unavailable": reason} when the call fails, None before the
first book). PublishDesk refuses (409), before it writes a row or calls the
engine, while a save is still running, while the check cannot be read (fail
closed), while the report is of an older save than the latest done one, and
while the desk's positions breach a risk limit without an approved override.
The model's book, no book and an approved override pass; the fallback
publish and the engine are unchanged.
Frontend: RiskReport shows the badge, the limit that bound, the breaches, the
configured limits against the stored book and the moved symbols (risk vs
trading rule). Approve is closed by riskBreachReason; on a breach the desk
panel points to the existing override request form. The approval page shows
the report too.
dominickdupuy
requested review from
colerottenberg,
jrile018,
patrickbott,
raohemdutt and
ry2009
as code owners
October 14, 2026 11:41
Each setting was a card (label, running line, input) in a two-column grid, a long wall for a strategy's config. Now each section is a collapsible table of rows (setting, running, pending, new value), opened when it holds pending or edited values or matches the filter; a filter box narrows by dotted path; a version's raw changes fold away in the history.
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.
Implements the AlgoLens side of contract C9 (trade-ngin PR #204, commit 7ec6076e, desk.proto 1.3.0
GetDeskRisk).Vendoring
proto/algogators/desk.proto1.3.0, byte-identical to trade-ngin@7ec6076e;SOURCEupdated; stubs regenerated with grpcio-tools 1.84.0;versions.pysaysdesk=1.3.0.API
DeskAgentPort.get_desk_risk/DeskClient.get_desk_risk: a read, not a command. Returns the report as a camelCase dict (stateno_book|model|desk|override,auditId,withinLimits,approvedOverride,breaches,m,bindingTerm,overLimitAfterRounding,overLimitByHold,refused,symbols,grossLeverage/netLeverage/marginCushion/equityToMargin(None when unset, via HasField),limits) or raisesDeskRiskUnavailable(<status name>).GetDeskStateandLookupApprovalcarryrisk: the report,{"unavailable": reason}, or null before the first book. Both now take the agent.Approve gate in
PublishDesk, before the row and the engine call. 409 when:deskand the report'sauditIdis not the latest done save;desk, not within limits, no approved override.The model book, no book and an approved override pass. A published day is left to the existing C3 refusal. The fallback/system publish paths and the engine are unchanged.
Frontend
domain/qt/desk.ts: DeskRisk types,riskBreachReason(part ofapproveBlockedReason, after the lock and cutoff checks), and pure helpers for the report (badge, binding line, limits vs readings, moved symbols), with unit tests.components/qt/RiskReport.tsx(theme-aware), rendered under Asked-vs-given on the desk panel and on the approval page.Tests