For a ~1000x perf gain says ol' claudy, our boi who wrote this entire
patch! Bo
Introduce `GapAnnotations` in `.ui._annotate` for batch-rendering gap
rects/arrows instead of individual `QGraphicsItem` instances. Uses
upstream's `pyqtgraph.Qt.internals.PrimitiveArray` for rects and
a `QPainterPath` for arrows. This API-replicates our prior annotator's
in view shape-graphics but now using (what we're dubbing)
"single-array-multiple-graphics" tech much like our `.ui._curve`
extensions to `pg` B)
Impl deats,
- batch draw ~1000 gaps in single paint call vs 1000 items
- arrows render in scene coords to maintain pixel size on zoom
- add vectorized timestamp-to-index lookup for repositioning
- cache bounding rect, rebuild on `reposition()` calls
- match `SelectRect` + `ArrowItem` visual style/colors
- skip reposition when timeframe doesn't match gap's period
Other,
- fix typo in `LevelMarker` docstring: "graphich" -> "graphic"
- reflow docstring in `qgo_draw_markers()` to 67 char limit
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
NOTE, this reversion was discovered as needed by @goodboy after
extensively manually testing the new zoom-by-font-size feats introduced
alongside macOS support.
Use class-body `if _friggin_macos:` branching to
conditionally define `size_to_values()` for both
`PriceAxis` and `DynamicDateAxis` — macOS gets the
new `_updateWidth()`/`_updateHeight()` + geometry
recalc path, other platforms fall back to the
original `setWidth()`/`setHeight()` calls.
Deats,
- add `platform` import and module-level
`_friggin_macos: bool` flag.
- `PriceAxis.size_to_values()`: macOS branch calls
`_updateWidth()` + `updateGeometry()`; else branch
uses `self.setWidth(self.typical_br.width())`.
- `DynamicDateAxis.size_to_values()`: macOS branch
calls `_updateHeight()` + `updateGeometry()`; else
uses `self.setHeight(self.typical_br.height() + 1)`.
- reorder imports: `platform` before `typing`.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Refine zoom methods in `MainWindow` and font helpers
in `_style` to return `px_size` up the call chain and
log detailed zoom state on each change.
Deats,
- make `_set_qfont_px_size()` return `self.px_size`.
- make `configure_to_dpi()` and `_config_fonts_to_screen()`
return the new `px_size` up through the call chain.
- add `font_size` to `log.info()` in `zoom_in()`,
`zoom_out()`, and `reset_zoom()` alongside
`zoom_step` and `zoom_level(%)`.
- reformat `has_ctrl`/`_has_shift` bitwise checks and
key-match tuples to multiline style.
- comment out `Shift` modifier requirement for zoom
hotkeys (now `Ctrl`-only).
- comment out unused `mn_dpi` and `dpi` locals.
Also,
- convert all single-line docstrings to `'''` multiline
style across zoom and font methods.
- rewrap `configure_to_dpi()` docstring to 67 chars.
- move `from . import _style` to module-level import
in `_window.py`.
- drop unused `screen` binding in `boundingRect()`.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Again a patch (vibed) from our very own @dnks
(just a commit msg reworking using his new `/commit-msg` skill added by
@goodboy B)
Deats,
- add `Axis.update_fonts()` to recalculate tick font, text offset,
bounding rect and `pyqtgraph`'s internal text-width/height tracking
after a zoom change; store `_typical_max_str` at init for later reuse.
- rework `PriceAxis.size_to_values()` and
`DynamicDateAxis.size_to_values()` to use pyqtgraph's
`_updateWidth()`/`_updateHeight()` with `updateGeometry()` instead of
raw `setWidth()`/ `setHeight()` so auto-expand constraints are
respected.
- fix `GlobalZoomEventFilter` to mask out `KeypadModifier` and
explicitly require both Ctrl+Shift, letting plain Ctrl+Plus/Minus pass
through to chart zoom.
- add `_update_chart_axes()` to walk all plot-item axes during
`_apply_zoom()` and call `splits.resize_sidepanes()` to sync subplot
widths.
(this commit msg, and likely patch, was generated in some part by
[`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Add `Ctrl+Shift+Plus/Minus/0` shortcuts for zooming all
UI widget font sizes via a `GlobalZoomEventFilter`
installed at the `QApplication` level.
Deats,
- `.ui._window`: add `GlobalZoomEventFilter` event
filter class and `MainWindow.zoom_in/out/reset_zoom()`
methods that reconfigure `DpiAwareFont` with a
`zoom_level` multiplier then propagate to all child
widgets.
- `.ui._style`: extend `DpiAwareFont.configure_to_dpi()`
and `_config_fonts_to_screen()` to accept a
`zoom_level` float multiplier; cast `px_size` to `int`.
- `.ui._forms`: add `update_fonts()` to `Edit`,
`Selection`, `FieldsForm` and `FillStatusBar` for
stylesheet regen.
- `.ui._label`: add `FormatLabel.update_font()` method.
- `.ui._position`: add `SettingsPane.update_fonts()`.
- `.ui._search`: add `update_fonts()` to `CompleterView`
and `SearchWidget`.
- `.ui._exec`: install the zoom filter on window show.
- `.ui.qt`: import `QObject` from `PyQt6`.
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Note since it's actually `xonsh` code run with either,
- most pedantically: `xonsh ./snippets/calc_ppi.xsh`
- or relying on how shebang: `./snippets/calc_ppi.xsh`
* an sheboom.
For wtv reason on nixos importing `pyqtgraph` first is causing `numpy`
to fail import?? No idea, but likely something to do with recent
`flake.nix`'s ld-lib-linking with `<nixpkgs>` marlarky?
- set `QT_USE_PHYSICAL_DPI='1'` env var for Qt6 high-DPI
* we likely want to do this in `piker.ui` as well!
- move `pxr` calc from widget to per-screen in loop.
- add `unscaled_size` calc using `pxr * size`.
- switch from `.availableGeometry()` to `.geometry()` for full
bounds.
- shorten output labels, add `!r` repr formatting
- add Qt6 DPI rounding policy TODO with doc links
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
A one-day MNQ schedule reply can start in the next session,
leaving the gap's earlier trading hours uncovered. Widen
`Client.history_schedule()` lookbacks up to 31 days, keeping the
requested end fixed and sharing one timeout across attempts.
Preserve unknown coverage when widening cannot cover the range.
Share `SECONDS_PER_DAY` between query and reservation arithmetic,
with one explanation of elapsed versus calendar/session days.
Replay the captured MNQ replies through the allocator: reserve
51,824 candidate slots while excluding the maintenance closure.
Cover bounded retries and timeout cancellation, and document the
query contract. This does not repair existing SHM or parquet.
Prompt-IO: ai/prompt-io/codex/20260924T232405Z_441358e2_schedule_coverage_prompt_io.md
(this patch was generated in some part by `codex` using
`gpt-6` (`openai`))
Interrupted backfill can leave stored observations separated by
missing trading time. Query dated IB sessions before prepending
stored history and reserve synthetic samples only during covered
open sessions. Keep venue closures compressed and preserve the
indexes of already published rows.
Deats,
- Add `Client.history_schedule()` with UTC coverage, extended hours,
bounded duration, timeout, and rejection of ambiguous DST times.
- Keep schedule normalization in `venues` and allocation in
`.tsp._reserve`, with the project AGPL headers.
- Expose schedule and synthetic-range queries through `datad.ib`.
- Bound reservations by available SHM capacity and inspect only the
newest 32 gaps by default via `newest_gaps`. Zero disables
queries; leave unknown and oversized ranges unresolved.
- Record synthetic ranges separately from OHLCV. Automatic storage
writes retain provider observations; placeholders copy close.
- Group the new tests under `tests/providers`.
- Cover request formatting, DST, failure and capacity cases, plus
real SHM/NativeDB startup placement with a fake provider.
- Document a common CLI/chart segment-repair interface and defer
coordinated insertion, repair execution, and reader integration.
Validation: 55 targeted tests passed in the working tree; live IB
schedule coverage remains unqualified. After the module moves,
33 affected tests passed again; the local review follow-up passed
18 affected cases, including four new request-budget cases.
The commit runner repeats
lint and isolated regression checks against this exact boundary.
Prompt-IO: ai/prompt-io/codex/20260924T185456Z_1da9b760_schedule_prompt_io.md
(this patch was generated in some part by `codex` using
`gpt-6` (`openai`))
Extract `_copy_close_to_null_rows()` with explicit mutation
bounds, searchable close-copy comments, and preserved activity
fields. Type and document `maybe_fill_null_segments()` including
its distinction from packed timestamp-gap repair.
Disable relative epoch tolerance when validating synthetic
stamps: an overfull reservation must not duplicate the right
boundary. Cover modern epochs, typed empty replies, packed gaps,
and unchanged rejected inputs.
Prompt-IO: ai/prompt-io/codex/20260924T165757Z_1da9b760_prompt_io.md
(this patch was generated in some part by `codex` using
`gpt-6` (`openai`))
Complete HMDS no-data replies without silently retrying a day
older. Let `open_history_client()` classify the original request
and leave frame stepping to `start_backfill()`.
Distinguish `request_end_dt` from `oldest_shm_dt` so the first
frame after an empty interval retains its unwritten end bar.
Inline the storage time cutoff and drop the unused two-direction
`diff_history()` helper. Explain both dates and filtering rules.
Add request-boundary tests and real SHM/NativeDB regressions:
all 2,004 supplied bars survive, while the closure stays empty.
Prompt-IO: ai/prompt-io/codex/20260923T164656Z_efa72980_prompt_io.md
(this patch was generated in some part by `codex` using
`gpt-6` (`openai`))
- preserve dirty main-tree work while transferring branch ownership
- hold provider, FQME, timeframe, and symptom fixed while debugging
- capture read-only baselines before disposable live runs
- turn each reproduced failure into deterministic coverage
- qualify interruption and restart behavior after the normal lifecycle
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Lay out a correctness-first path from deterministic regressions
through normalized gap detection, structured backfill completion,
and crash-safe `NativeDB` persistence.
Deats,
- separate checker, storage, provider, and annotation gates
- record confirmed current defects and data invariants
- define commit boundaries and timeout-wrapped verification
Prompt-IO: ai/prompt-io/opencode/20260721T215055Z_c6ec3d41_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Override `NonShittyWrapper._setTimer()` to compute packet silence
in seconds from integer epoch nanoseconds, avoiding upstream's
`datetime` subtraction error after `tcpDataArrived()`. Delegate
pre-traffic datetime and sentinel handling upstream.
Preserve the packet timestamp on expiry and clear the timer before
`timeoutEvent` emission so listeners can safely rearm it. Add three
offline regressions under `tests/providers/` for rescheduling, single
expiry, datetime and sentinel states, disabling, and reentrant
listener rearming. Document the wrapper overrides on the class.
This fixes an explicitly armed packet-idle timer; heartbeat, default
arming, and reconnect behavior are outside this change.
Prompt-IO: ai/prompt-io/opencode/20260924_ib_idle_timer.md
(this patch was generated in some part by `opencode` using
`gpt-6-astra` (`openai`))
Propagate the authoritative `disconnectedEvent` as a
`ConnectionError` so proxy callers and trade consumers fail loudly
instead of waiting on a dead socket. Preserve the last `apiError`
text as the reason without treating numeric farm/order errors as
socket failures.
Deats,
- Disconnect the one-shot callback before sending the exception.
- Raise when `recv_trade_updates()` loses its socket, and relay
disconnect exceptions through both Trio-side consumers.
- Exercise real `eventkit` error/disconnect callbacks and preserve
the supplied commission fill while testing bridge termination.
- Record the aborted integration stage as historical provenance;
its test passes do not validate this post-abort boundary.
Prompt-IO: ai/prompt-io/opencode/20260916_ib_connectivity_integration.md
(this patch was generated in some part by `opencode` using
`gpt-6-astra` (`openai`))
Keep each commission callback's exact `Fill` paired with its
report, so overlapping executions on one contract cannot borrow
each other's fees. Cache positions by account and `conId`, queue
commissioned fills by execution ID until a position arrives, and
accept zero commissions. Reject mismatched execution/report IDs.
Keep `Execution.execId` authoritative when flattening ledger
entries; an empty commission ID must not erase a valid fill. Add
regressions for empty commission IDs, reversed fee arrival, and
positions arriving before or after overlapping executions.
The human live-tested fills and reports the accounting fix works.
Exact-boundary automated checks remain pending; the earlier nine
passes covered the mixed working tree. Included Prompt-IO logs
retain whole-session context, including separate roaming work.
Prompt-IO: ai/prompt-io/opencode/20260916T194052Z_749ca1f0_prompt_io.md
(this patch was generated in some part by `opencode` using
`gpt-6-astra` (`openai`))
Normalize structured and raw IB errors without indexing strings as
message dictionaries.
Deats,
- match each error form before request-id handling;
- parse `[code N]` and `[Errno N]` prefixes without crashing;
- cover raw errors through `deliver_trade_events()`.
Prompt-IO: ai/prompt-io/opencode/20260828T063126Z_1606122b_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
IB returns trading samples, not one row per wall-clock period.
Converting elapsed time to a physical prepend offset left 42,720
zero rows in NVDA's 60s buffer even though both valid margins
shared the same timestamp.
Use the actual earliest provider sample as the NativeDB boundary.
After reverse retrieval, prepend older stored rows directly beside
it.
Deats,
- start reverse insertion at the current first index;
- update `ShmArray._first` after every provider prepend;
- trim provider/NativeDB overlap by its timestamp;
- publish the final storage prepend to chart and FSP consumers;
- derive the source `time` field from `ohlc_key_map`;
- cover the full lifecycle with a real multi-frame `ShmArray`.
Prompt-IO: ai/prompt-io/opencode/20260805T195001Z_f0f3c806_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Make `store ls` show every NativeDB FQME and its available sample
periods by default. Keep `store series` as the detailed view of
each exact sub-series, including its period, size and path. Share
the same optional FQME filter and numerically ordered payload.
Use `store shm` as the canonical volatile-buffer ep and make its
default operation a read-only report. Enter the prior persistence
workflow only through `--write-parquet`, require that flag before
`--reload-parquet-to-shm`. Reject read-only formatting options in
repair mode instead of silently ignoring them.
Also,
- update the qualification docs, debug helper and harness refs;
- cover no-flag listings, command help and SHM mode validation;
- retain exact generation and object-name selection for stale SHM.
Prompt-IO: ai/prompt-io/opencode/20260801T015321Z_74ea2152_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Make bare storage groups and eps render help, so the CLI is
discoverable without memorizing `Typer` option conventions. Add
read-only `series` and `shm` eps for durable `NativeDB` series and
live history buffers, with `Rich`-table or `JSON` output.
Deats,
- preserve exact `(fqme, period)` identities for `NativeDB`
series;
- parse exact `(generation, fqme, kind)` names for SHM buffers;
- reconstruct provider dtypes when attaching to live buffers;
- tolerate buffers disappearing between discovery and attach.
Also,
- report expected and observed cadence separately, plus invalid
rows, ordering defects and ranked gaps;
- add exact `ldshm --shm-name` selection and keep disabled write
and reload paths from reading undefined state or entering `pdb`;
- document the triage layers and cover help, identity parsing,
read-only diagnostics, dtype selection and `ldshm` flow.
Prompt-IO: ai/prompt-io/opencode/20260731T165215Z_0846cbd4_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Keep reverse history and stored SHM layout aligned so sparse IB
frames do not expose permanent zero-time reservations.
Deats,
- omit inclusive query endpoints from SHM but retain full storage
- serialize and bound farm resets, blanks, and cancellations
- run the final null sweep after reverse retrieval completes
- require valid timestamp boundaries for synthetic gap rows
- cover the live QQQ 653-row failure and reset interleavings
Prompt-IO: ai/prompt-io/opencode/20260729T204046Z_ad6c560f_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Do not pass unpublished or corrupt timestamp rows into dedupe,
`NativeDB` replacement writes, or live SHM reload.
Deats,
- infer cadence from finite positive observed steps
- choose the smaller observed step when frequency ties
- skip invalid or degenerate snapshots as a whole
- cover the QQQ zero-slot failure with mutation-failing spies
Prompt-IO: ai/prompt-io/opencode/20260729T185406Z_d359b1cb_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Filter known zero-initialized epoch slots before persisted history
hydrates SHM or merges with a fresh provider frame.
Deats,
- reindex the repaired read view for same-session chart publication
- treat sentinel-only files as empty history for fresh backfill
- reject new first-slot sentinels but preserve modern zero-price bars
- classify raw sentinel evidence separately in `store audit`
Prompt-IO: ai/prompt-io/opencode/20260729T041723Z_ce33deb6_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Serialize aware reverse-fill boundaries as `YYYYMMDD-HH:MM:SS`
before handing them to `ib_async`.
This avoids Gateway error 10314 from its trailing-`UTC` format and
drops the unfinished EST comparison breakpoint from `Client.bars()`.
Prompt-IO: ai/prompt-io/opencode/20260729T034106Z_922a5df8_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Drive known-bad, fresh, restart and append checks from a private
disposable NativeDB root.
Deats,
- bind child config and imports to the marked worktree root
- preserve checksum-matched reports, snapshots and case metadata
- compare timestamp coverage, seam values and persisted structure
- document manual chart runs, gap triage and the expansion matrix
Prompt-IO: ai/prompt-io/opencode/20260728T003247Z_ed85721c_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Inspect Parquet bytes directly without opening storage or normalizing
malformed evidence.
Deats,
- report canonical schema, timestamp, index and finite-value state
- retain exact cadence aggregates with bounded endpoint details
- snapshot bytes before parsing and clean up partial copy failures
- reject unsafe FQMEs, links, collisions and non-regular sources
Prompt-IO: ai/prompt-io/opencode/20260728T005034Z_ed85721c_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Keep incoming provider frames strict while dropping non-positive rows
from persisted history before merge validation.
This lets known-bad MNQ history repair itself on the next valid IB
frame without losing valid old bars or publishing noncanonical indexes.
Prompt-IO: ai/prompt-io/opencode/20260728T232718Z_ed85721c_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Track successful `create=True` calls through Tractor's
current-process factory instead of scanning `/dev/shm` or trusting
the attachment cache.
- cooperate with normal actor unlink and restore token-cache state
- verify POSIX object identity before fallback cleanup
- fail after cleaning exact surviving segments
- reproduce the pre-`current_actor()` allocation leak
Prompt-IO: ai/prompt-io/opencode/20260727T215906Z_689df816_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Require positive, increasing timestamp bounds before querying a SHM
gap or applying synthetic fallback. Defer unbounded edge runs
without entering the debugger or rewriting their rows, and continue
checking later segments.
Cover leading, trailing and entirely null frames with provider,
debugger and notification calls forbidden; assert the complete
frame stays unchanged.
(this patch was generated in some part by `Codex` using
`GPT-6` (`OpenAI`))
IB history frames omit the derived `index` and append `count`.
Normalize provider data to durable names, order, and dtypes before
merge, and reject fractional epoch truncation.
Also,
- map canonical storage fields into provider-specific SHM on reload
- select Polars columns by name instead of position
- exercise first-start and restart through actor, SHM, and Parquet
Prompt-IO: ai/prompt-io/opencode/20260727T212454Z_689df816_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
`datad`'s persistent feed task already owns each series writer.
The actor-local and file locks duplicated this SC contract and left
`.parquet.lock` sidecars that upstream indexed as data.
- preserve validated temp writes, `fsync()`, and atomic replacement
- keep exact-suffix indexing for legacy lock and temp sidecars
- prove full and incremental writes create no lock artifacts
Prompt-IO: ai/prompt-io/opencode/20260727T204711Z_84a6d47b_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
- merge provider deltas without dropping unaffected history
- validate reopened temp parquet before atomic replacement
- serialize writers with actor-local and cancellable file locks
- publish cache only after disk replacement
- persist full startup/backfill frames before SHM publication
- bound sampler notifications and avoid MarketStore duplicates
Prompt-IO: ai/prompt-io/opencode/20260722T024134Z_3a4f6737_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
- keep positive missing-history gaps distinct from ordering faults
- return duplicate and reversed timestamp rows as structured data
- warn before normalization removes the original ordering evidence
Prompt-IO: ai/prompt-io/opencode/20260722T024133Z_3a4f6737_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
- recompute datetime and delta cols after final timestamp ordering
- detect only positive sample-step gaps
- document inclusive null grouping with an updated visual map
- check all small null layouts against an independent test oracle
- honor selected null cols and reject discontinuous frame indexes
- share exact null grouping across NumPy and Polars
Prompt-IO: ai/prompt-io/opencode/20260722T001357Z_16f3cd6f_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Pre the (datad|brokerd)-split this was done by `brokerd`'s
daemon fixture, so ALSO `get_console_log()` the provider
backend's mod subtree (eg. `piker.brokers.ib.*`) in
`_setup_persistent_datad()`; without it all backend records
emitted in the `datad` actor fall through to the stdlib's
bare (non-colorized) `logging.lastResort` handler.
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Follow-up to the lazy order-req qualify: pre-qualify (and
cache) contracts for ALL already-open pps and orders during
`open_trade_dialog()` startup so live submissions NEVER pay
a first-request qualification delay; the warmup runs before
the order handler task starts so early reqs just buffer in
the ems IPC stream. Any brand-new mkt still lazily
qualifies on its first submission.
Deats,
- factor the `Client` lookup-table writes out of
`.symbols.get_mkt_info()` into a new `cache_contract()`
helper which now ALSO keys `_contracts` by `mkt.fqme`
(read by the fill-time pp-update path in
`emit_pp_update()`) alongside `mkt.bs_fqme` (read by
`Client.submit_limit()`); resolves the old "post-split
mktmap lookup" TODO.
- explicitly `cache_contract()` in
`handle_order_requests()` since the lifo-cache may
deliver a hit (body skipped) when another acct/client
already qualified the fqme.
- filter `None` entries (ambiguous contracts) from
`qualifyContractsAsync()` results in
`Client.find_contracts()` before any attr access + raise
a better "use a (more) venue-qualified fqme" error msg.
- relay ALL (non-cancel) errors from the aio method-relay
task to the `trio`-side caller instead of crashing the
whole proxy/dialog; critical post-`datad`-split where eg.
qualification failures are expected to be caught
per-request by order/warmup code.
- handle inline `('event', ...)` api-farm status msgs in
`MethodProxy._run_method()` at info-level instead of the
"UNKNOWN IB MSG" warning.
- only `log.setLevel()` in `open_trade_dialog()`;
attaching a handler via `get_console_log()` double-prints
every record since the daemon fixture already enables the
console handler on the parent subsys logger.
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Post (datad|brokerd)-split the trading actor's
`Client._contracts` cache is never warmed by in-proc
feed setup (that now happens in the `datad.ib` sibling)
so ALL live submissions failed with "no live feed?" at
`Client.submit_limit()`; `brokerd` must be able to
submit orders without any feed registered in its own
subactor.
Deats,
- thread the acct `proxies` table into
`handle_order_requests()` and, on a `_contracts`
cache-miss for the req's fqme, lazily run the same
`get_mkt_info(fqme, proxy=...)` symbology ep the
feed-side uses; it writes the `mkt.bs_fqme` key
`submit_limit()` looks up (and warms `_cons2mkts`
which the position-audit path also needs) on exactly
the same aio `Client` instance.
- guard `submit_limit()` w/ a try/except ->
`BrokerdError` relay so a single bad submission
degrades to an EMS error msg instead of crashing the
dialog (and causing the `TrioTaskExited` teardown
storm seen in testing).
- fix the (non-f-string..) raise msg in
`Client.submit_limit()` and doc the new lazy-qualify
contract; the bug was foretold by the TODO in
`.symbols.get_mkt_info()` B)
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prompt-IO: ai/prompt-io/claude/20260610T213549Z_f084e899_prompt_io.md
Commit the AI-authored design doc driving this branch's
7-commit `brokerd` -> (`datad` + `brokerd`) split; all
prior commits' `Prompt-IO:` entries reference its
stages so this makes those refs resolvable in-repo for
PR review.
Also,
- add the doc's own prompt-io entry pair (scope: docs)
incl. a 4-item implementation-deviation log vs. the
plan as written.
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prompt-IO: ai/prompt-io/claude/20260610T173309Z_f15f8178_prompt_io.md
Caps-sec tightening now that `brokerd` is trading-only: NO
`piker.data.*` (feed) mods are RPC-enabled in the (live,
credentialed) trading actor anymore.
Deats,
- drop `_data_mods` for a minimal `_brokerd_service_mods`
(just `piker.brokers._daemon`); dedup-compose with the
backend's set in `spawn_brokerd()`.
- `broker_init()` reads the backend's `_brokerd_mods`
(fallback: `__enable_modules__` for flat backends).
- fail fast in `spawn_brokerd()` via `validate.get_eps()`
when a backend offers NO live order-ctl eps (eg.
`kucoin`, `deribit`) -> tells the caller to use
paper-mode instead of booting a dead actor; analogous
warning in `datad_init()` for datad-ep-less backends.
- offset `ib`'s default `client_id` per daemon-kind in
`load_aio_clients()`: post-split BOTH `datad.ib` and
`brokerd.ib` connect to the same gw/tws endpoint and the
shared default (6116 + linear retry incrs) would collide
and burn the full conn-timeout retry cycle; datad gets
+16, ad-hoc (test/cli) actors +32.
- drop the import-cleanup leftovers (`exceptiongroup`,
`_FeedsBus` type-only import) and the now-resolved
"expose datad" TODO in `.cli`.
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prompt-IO: ai/prompt-io/claude/20260610T171344Z_eee19de0_prompt_io.md
The topology flip: all data-feed consumers now route to the
new `datad.<broker>` sibling daemon; `brokerd` becomes
trading-only and is ONLY ever booted lazily by `emsd`'s
`open_brokerd_dialog()` (see prior commit). Chart-only and
paper sessions run with zero (live, credentialed) `brokerd`
procs B)
Deats,
- `open_feed()` -> `maybe_spawn_datad()` (NB: imported
relative-direct from `._daemon` to dodge a partial-init
cycle via `piker.service`); flip the `open_feed_bus()`
actor-name assert to `'datad'`; comment sweep.
- slim `_setup_persistent_brokerd()` to a trading-only
fixture: console logging + pinned-open ctx; the feed-bus
alloc moves to `_setup_persistent_datad()` and backend
`open_trade_dialog()` ctxs own their own task trees.
(the `piker ledger` ad-hoc actor enters this same slimmed
fixture - exactly what it needs.)
- repoint data-flavoured spawn sites to `maybe_spawn_datad`:
`.ui._app` symbol-search (+ rename
`install_brokerd_search` -> `install_datad_search`),
`.brokers.core.symbol_search()`, `.brokers.cli`
`brokercheck`/`record`, legacy kivy `.ui.cli` +
`option_chain`'s `wait_for_actor()`.
- invert `tests.test_services` expectations: feed/EMS-paper
flows must spawn `datad.kraken` and `paperboi.kraken`
with an explicit negative assert that NO `brokerd.kraken`
service task exists.
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prompt-IO: ai/prompt-io/claude/20260610T171259Z_59d5d9a6_prompt_io.md