Commit Graph

4780 Commits (wkt/land_plan_provenance)

Author SHA1 Message Date
Gud Boi 9479e3e7f3 Restore the August landing plan and its prompt records
Carry the three missing documents from 5f631e19.
Keep the original plan body and both prompt records intact.
Date the old baseline and flag the superseded instructions to omit
plans and provenance from the landing stack.

Prompt-IO: ai/prompt-io/opencode/20260818T064340Z_09ddcf50_prompt_io.md
2026-11-27 15:25:56 -05:00
Gud Boi 24943e3ee2 Limit IB trade filtering to its startup backlog
The timestamp guard matched live trades against `samplerd`'s 1s row
labels and waited for the next slot before quote fanout. Rounded
timestamps misclassified valid ticks, and steady-state receipt-time
matching was not the existing current-tail sampling contract.

Replace it with a temporary IB startup policy in
`piker.brokers.ib._util.StartupTradeFilter`. Capture local receipt
time when consumption starts; exclude older stamped packets until
the first post-start trade for each symbol. Then stop interpreting
timestamps and apply trades to the current SHM tails before notify.
Unstamped ticks remain admissible without ending the startup check.

Move epoch-unit conversion, catch-up state and diagnostics into the
backend utilities. The generic sampler only conditionally invokes
the helper for IB. Other providers retain receipt-time sampling.

Replace slot-matching tests with coverage for startup exclusion,
equal/half-second boundaries, delayed stamps after catch-up and
invalid/missing stamps. Hold rows ahead of or behind tick time;
require no sampler wait and check both SHM writes at notification
for admitted trades.

This excludes an observed startup prefix; it does not reconcile or
exactly deduplicate overlapping provider history. Keep that fuller
startup handoff separate, without changing `samplerd`'s clock
or introducing a queued writer which can notify before SHM updates.

Regressed-by: 31c0a366 (steady-state sampler timestamp guard)
Found-via: live MNQ/QQQ delay warnings and stalled quote delivery

(this patch was generated in some part by `opencode` using
`gpt-6.1-sol` (`openai`))
2026-11-27 12:42:20 -05:00
Gud Boi 5c16fa066c Skip stale trade ticks in 1s sampler
Queued IB startup trades can arrive after samplerd has advanced
the current 1s bar. Writing them into that bar creates a false
price and volume spike. Compare each stamped trade with the
current bar before updating either SHM buffer. Warn whenever a
next-slot trade must wait for samplerd; skip other mismatches
and leave untimestamped feeds on the receive-time path.

Add focused tests for epoch units, queued trades, and warning
before the next-slot wait. Note that incomplete provider bars
still need a correction path for late trades.

Prompt-IO: ai/prompt-io/codex/20260925T190523Z_c0dae89a_prompt_io.md

(this patch was generated in some part by `codex` using `gpt-6` (`openai`))
2026-11-27 12:42:20 -05:00
Gud Boi 17f2048204 Use `datad` names for quote timestamps and search
Finish the market-data naming cleanup after the datad/brokerd
split. Rename the quote receipt field to `datad_ts` across all
five provider producers, its typed schema, the FSP latency reader
and the commented marketstore schema example. Keep timestamp
values and their existing provider-specific semantics unchanged.

Rename `search_w_brokerd()` to `search_w_datad()` together with its
RPC call site. Correct sampler/search task descriptions, the
dropped-feed log and the shared asyncio-spawn comments to reflect
the current actor roles.

This is a coordinated quote-field/RPC-name rename: restart actors
together rather than mixing old producers with new consumers.
Historical design records retain their original names. Keep this
cleanup separate for replay onto the datad-introduction branch.

(this patch was generated in some part by `opencode` using
`openai/gpt-6-astra` (`openai`))
2026-11-27 11:41:14 -05:00
Gud Boi 036b7ed9fa Test persistent feed reuse across IPC subscriptions
Exercise the canonical endpoint registry and per-feed task lifetime
through real `tractor` contexts, TCP streams, sampling and SHM.
Use a controlled provider/history source and private actors rather
than requiring a live Gateway or production storage.

Cover,
- concurrent requests held across history startup and allocation
  locking, requiring one writer and matching descriptors;
- dated/continuous alias reuse after subscriber detach and reopen,
  preserving SHM tokens without another producer;
- quote fanout to overlapping clients, continued delivery after one
  closes, and persistent writers after every client detaches;
- history prepends and sampled prices visible through parent-side
  SHM attachments;
- remote startup failure joining its producer while existing feeds
  continue delivering quotes;
- unlinking all history/realtime buffers and index segments when
  the owning actor exits.

Keep four complementary focused cases for missing/empty metadata,
quote-start endpoint mismatch and normal sampler-return cleanup.
Avoid duplicating the actor lifecycle and already-committed IB
resolver tests with another fake chart/subscription framework.

The actor suite does not drive Qt, a live broker, NativeDB or the
samplerd bar clock. Controlled prepends prove quote progress in
that scenario, not the absence of stalls during real disk backfill.

(this patch was generated in some part by `opencode` using
`openai/gpt-6-astra` (`openai`))
2026-11-27 10:37:36 -05:00
Gud Boi 3289c26030 Reuse persistent feeds by resolved market endpoint
A chart could open a dated IB future through search, detach, then
request its continuous alias against the same datad. Lookup by the
request spelling missed the existing feed and tried to allocate a
second history writer on its SHM. Failed startup could leave the
quote producer running without a sampler to drain its channel.

Resolve metadata before allocation and key `_FeedsBus.feeds` only
by canonical, broker-qualified FQME. Recheck under the allocation
lock and return the existing `Flume` without starting another
producer. Require `get_mkt_info()` rather than trying provisional
quote subscriptions to discover endpoint identity.

Split the decision/lifetime from allocation:
- `maybe_allocate_persistent_feed()` resolves/reuses, or opens a
  feed-local `trio` nursery for a new endpoint;
- `allocate_persistent_feed()` starts quote/history children and
  returns the descriptor, writable buffers and sampling inputs;
- the `maybe_` parent publishes and starts back the `Flume`, then
  handles readiness, buffer seeding and the blocking sampler call;
- cancel/join the local children when that operating body exits,
  including normal sampler return and failed history startup.

Preserve startup ordering, explain task/scope ownership, qualify
request-name logging and configure the shared data logger itself.
This is lifetime cleanup, not independent restart supervision.

Human verified the alias reopen fix and found full Binance boots
with/without the patch felt comparable on AC; no latency benchmark
or startup-speedup claim is implied. Regression suites are retained
for a separate test commit.

(this patch was generated in some part by `opencode` using
`openai/gpt-6-astra` (`openai`))
2026-11-27 10:37:36 -05:00
Gud Boi cd1235128d Fix IB metadata lookup without a supplied proxy
`get_mkt_info()` assigned the `open_data_client` factory rather
than calling it when no `MethodProxy` was supplied. Entering that
function with `async with` raised `TypeError`; callers supplying
a proxy took the working `nullcontext()` branch instead.

Instantiate a fresh client context on uncached owned lookups and
retain borrowed-proxy ownership. Document native-name qualification
and annotate the resolver's context/metadata bindings.

Add standalone coverage through the actual decorated resolver,
replacing only client I/O. Check fresh context entry/exit, borrowed
proxy calls, canonical endpoint identity, contract registration and
same-spelling cache hits without further details queries. Unique
request names avoid process-cache collisions between tests.

Keep this backend-path repair independent of feed allocation,
SHM lifetime and alias-registry changes.

(this patch was generated in some part by `opencode` using
`openai/gpt-6-astra` (`openai`))
2026-11-27 10:37:18 -05:00
Gud Boi dce178e0a7 Preserve IB order state through notices and late fills
IB's 10349 TIF-preset notice made `ib_async` synthesize a
`Cancelled` status for an order which subsequently filled. EMS
then discarded its `Order`, recreated `Error(req=None)` for the
separate error callback, and crashed while routing the fill.

Treat 2181 (unsupported SmartRouting opt-out) and 10349 (preset
sets TIF to DAY) as notices: preserve diagnostic callbacks without
manufacturing order failures or relaying them as `BrokerdError`.
Leave actual cancellation handling, including code 202, intact.

Also,
- snapshot `ib_async.Trade` order/status fields and its fill list
  at callback time so queued events cannot observe later state;
- retain canceled/closed dialogs in `DarkBook._closed` while the
  order-ID mapping exists, keeping `Order.symbol` for late-fill
  routing and `Order.account` for commands after a reopen;
- keep late errors out of `_active` and reactivate retained dialogs
  only on a subsequent pending/open status;
- cover cancel/close/error/fill sequences, continued msg handling,
  callback snapshots and notice-vs-cancellation behavior offline.

Explain the `ib_async.wrapper.Wrapper.error()` state mutations
apart from EMS request retention; name the retained request fields
needed by client routing and reopened dialogs.

Human-tested live/dark fills and order cancellation on an IB paper
Gateway. Exact-tree offline checks are retained in the commit plan.

(this patch was generated in some part by `opencode` using
`gpt-6.1-sol` (`openai`))
2026-11-27 09:21:25 -05:00
Gud Boi 55a09d51fb Fix `SymbologyCache.search()` key matching
RapidFuzz treated `mktmaps` values as fuzzy choices and called
`len()` on `MktPair` structs during paper-ledger persistence.

Search string keys explicitly and resolve each match back to its
struct so native market-ID aliases survive legacy FQME
qualification.

Also,
- cover alias preservation and the paper-ledger TOML round trip.

Prompt-IO: ai/prompt-io/opencode/20260828T013057Z_6ca6ab2a_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-27 08:53:47 -05:00
Gud Boi 4166fd06f8 Add `piker-fsp-expert` skill
Document FSP lifecycle, SHM publication, backfill ordering,
causal signal-processing semantics, and deterministic tests.
Record research directions separately from implementation and
expose the package through the relative Claude skill symlink.

(this commit msg was generated in some part by `codex` using
`gpt-6` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi 1cefb7268c Honor M4 renderer cache invalidation
Preserve the renderer's `reset_cache` result when publishing
rebuilt paths so zoom changes invalidate Qt's cached graphics.
Retain the earlier live-debug provenance for cadence, negative
volume, repaint suppression, and downsample cache repair.

Prompt-IO: ai/prompt-io/opencode/20260903T232525Z_fadab3d2_prompt_io.md

(this commit msg was generated in some part by `codex` using
`gpt-6` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi 0c90559728 Skip unchanged realtime FSP redraws
Cache destination bounds and timestamp/value bytes on `Viz`.
Skip identical quote-driven refreshes, including stable NaNs,
while changed samples and forced history repairs still redraw.
Add a regression covering each invalidation path.

(this commit msg was generated in some part by `codex` using
`gpt-6` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi b148bfe1ad Clamp negative provider volume before FSP updates
Clamp negative trade sizes and cumulative bar volume in sampling,
and sanitize history and realtime volume in `tina_vwap()` and
`dolla_vlm()`. Provider resets must not create negative outliers
that hide the derived curve. Cover the history and tick paths.

(this commit msg was generated in some part by `codex` using
`gpt-6` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi e9cda430a8 Fix FSP history and sample synchronization
Bootstrap FSP output and timestamps from one source snapshot,
validate the history schema, and compare absolute SHM bounds.
Subscribe before bootstrap, replay history revisions, filter
foreign sampler notices, and append each destination step once.
Close replaced generators before signaling completion.

Use declared `Flume` sample periods so market-closure gaps cannot
be mistaken for the realtime cadence. Cover bounds, snapshot
isolation, backfill routing, sample steps, and targeted redraws.

(this commit msg was generated in some part by `codex` using
`gpt-6` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi 60a82a47fd Formalize `FspStream` and fix builtin call contracts
Export `FeedQuote` and `Tick`, describe historical and realtime
FSP yields, and preserve callable parameters through `@fsp`.
Align builtin history arrays and emit named realtime updates.

Keep the staged Tuicr review fixes. Let Numba specialize `ema()`
lazily so omitted defaults work alongside explicit arguments,
retaining nopython/nogil compilation and single-sample seeding.
Cover builtin yields and EMA argument forms with regressions.

Prompt-IO: ai/prompt-io/opencode/20260908T020619Z_fadab3d2_prompt_io.md
Prompt-IO: ai/prompt-io/codex/20260915T155229Z_fadab3d2_prompt_io.md

(this patch was generated in some part by `codex` using
`gpt-6` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi c32b1695ba Target FSP history graphics by SHM token
Replace whole-linked-chart refreshes after FSP history rebuilds
with updates selected by normalized destination `NDToken` identity.

Clear each matching `Viz` formatter and max/min cache, redraw
its path, then rescale only the affected view. This keeps primary
and foreign market curves stable while near-term history is
backfilled.

Record the concrete piker `PlotItem`, `ChartView`, `Axis`, and
`YAxisLabel` relationships used by the redraw path.

Prompt-IO: ai/prompt-io/opencode/20260828T195032Z_9115d24d_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 17:18:37 -05:00
Gud Boi e187c50081 Plan `pytest-qt` chart UI audit layers
Distill the gap-overlay E2E findings into a staged audit plan for
the full PyQtGraph iface. Keep Qt and graphics real while replacing
feeds, services and provider search with deterministic seams.

Deats,
- define the headless PyQt6 env and pytest-qt fixture ownership;
- layer primitive, input, SHM, full-window and actor checks;
- guard window SIGINT, provider search and overlapping symbol boot;
- require signal/postcondition waits and lifecycle leak assertions;
- split reviewable PRs before distilling a repo-local UI skill.

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 2987d17202 Test gap dialogs through a real `tractor` actor
Schema checks do not exercise ctx discovery, directional decoding,
stream setup, request correlation or endpoint-finally cleanup.

Boot an isolated child actor around `remote_gap_overlays()` and
drive it through `AnnotClient`. Cancel one published request, leave
its reply queued and prove the next request discards that stale
msg.

Also,
- verify generated request IDs and remote-owner cleanup;
- document automated coverage and broker-backed manual boundaries.

Prompt-IO: ai/prompt-io/opencode/20260817T222036Z_f65df6a1_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 81373f6a2e Fix focused gap routing in `ChartView`
The keyboard loop treated every display not owning the focused
history chart as a realtime target. One `Ctrl+G` could therefore
toggle unrelated cached symbols.

Match the focused chart explicitly before selecting its timeframe.
Factor startup registration and toggle routing into testable
helpers, and use scoped PyQt6 enums throughout the input path.

Deats,
- preserve independent 60s startup layers per display;
- toggle only the focused 1s or 60s chart;
- drive the production event relay with a real `QKeyEvent`.

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 6e458e4d46 Fix Qt indexing in `GapAnnotations.reposition()`
`prepareGeometryChange()` ran after the gap rects and arrow specs
were mutated. Qt could retain the item's old scene index even
though `boundingRect()` returned its new prepended-history
position.

Invalidate cached bounds and notify Qt before changing any
geometry. Cover both scene lookup positions with a real offscreen
item.

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 47e82b8cac Fix `PlotItem` cleanup in `GapOverlayMngr`
`PlotItem.addItem()` records overlays outside the Qt scene. Direct
scene removal leaves stale plot refs and range bookkeeping behind.

Track each annotation's owning plot and remove it through the same
API used for insertion. Exclude pixel-sized arrows from data
bounds.

Deats,
- centralize replacement, hiding and owner teardown;
- retain scene removal as a defensive fallback;
- cover real Qt registries and duplicate-FQME chart identity.

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 772c581cb1 Own gap overlays in chart-local `GapOverlayMngr`
Detect positive timestamp gaps from chart OHLCV SHM with one
vectorized pass. Route local UI and remote callers through one
`GapOverlayMngr` renderer, and key each layer by owner, chart,
FQME and timeframe so remote ctx teardown cannot remove local
graphics.

Deats,
- add tagged `SetGapOverlay` requests and typed
  `GapOverlay` responses;
- keep `remote_annotate()` intact and serve its typed dialog from
  a dedicated `remote_gap_overlays()` Tractor ctx;
- admit `SetGapOverlay`, `GapOverlay`, `list[str]` and `None` in
  the Tractor payload spec, then strictly narrow requests to
  `SetGapOverlay` and replies to `GapOverlay`;
- serialize shared-stream dialogs and correlate request IDs so
  stale replies cannot skew later exchanges;
- rename `AnnotCtl` / `open_annot_ctl()` to `AnnotClient` /
  `open_annot_client()` across storage and annotation callers;
- enable 60s history overlays at startup and toggle the focused
  1s or 60s chart directly with `Ctrl+G`;
- guard redraws by chart, FQME and timeframe; tolerate empty
  arrays and out-of-range lookups; update rect and arrow geometry;
- cover detector geometry, msgpack roundtrips, schema rejection,
  typed stale-FQME errors and renamed storage seams;
- document ownership, refresh, stack landing and live
  qualification.

Prompt-IO: ai/prompt-io/opencode/20260814T032716Z_2aa66c2c_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 31670417f0 Preserve gap-annotation profiling handoff
Track the untracked Claude session note with its benchmark, client
bottleneck, and follow-up optimization sketch intact.

(this commit msg was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-11-14 16:04:10 -05:00
Gud Boi 8b726bc533 Pin `pg` at latest official `0.14.0` release
Keep in masked GH sources lines for easy hackin against upstream
`master` branch when needed as well!
2026-11-14 16:04:10 -05:00
Gud Boi d5b6da1949 Add batch-submit API for gap annotations
Introduce `AnnotCtl.add_batch()` and `serve_rc_annots()` batch
handler to submit 1000s of gaps in single IPC msg instead of
per-annot round-trips. Server builds `GapAnnotations` from specs
and handles vectorized timestamp-to-index lookups.

Deats,
- add `'cmd': 'batch'` handler in `serve_rc_annots()`
- vectorized timestamp lookup via `np.searchsorted()` + masking
- build `gap_specs: list[dict]` from rect+arrow specs client-side
- create single `GapAnnotations` item for all gaps server-side
- handle `GapAnnotations.reposition()` in redraw handler
- add profiling to batch path for perf measurement
- support optional individual arrows for A/B comparison

Also,
- refactor `markup_gaps()` to collect specs + single batch call
- add `no_qt_updates()` context mgr for batch render ops
- add profiling to annotation teardown path
- add `GapAnnotations` case to `rm_annot()` match block

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-11-14 16:04:10 -05:00
Gud Boi a03884196c Add a `GapAnnotations` path-renderer
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
2026-11-14 16:04:10 -05:00
Gud Boi 2946435999 Bump to latest official `pyqtgraph` release 2026-11-14 16:04:10 -05:00
Tyler Goodlet a7c5dc2f2b Uhh ok, apparently this osenv var is just idiotic?
See https://www.pikers.dev/pikers/piker/issues/50#issuecomment-1041 for
deatz.
2026-11-14 15:41:51 -05:00
Gud Boi 379f757832 Gate `size_to_values()` on macOS in `_axes.py`
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
2026-11-14 15:41:51 -05:00
Gud Boi bcca507462 Improve styling and logging for UI font-size zoom
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
2026-11-14 15:41:51 -05:00
di1ara 7ff028ad78 improve ui zoom defaults 2026-11-14 15:41:51 -05:00
Gud Boi a440f47254 Fix chart axis scaling on UI zoom level change
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
2026-11-14 15:41:51 -05:00
Gud Boi a31a014d4d Add global UI font-size zoom scaling (from @dnks)
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
2026-11-14 15:41:51 -05:00
Tyler Goodlet f367d72a3f Add `.xsh` script mentioned in gitea #50
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.
2026-11-14 15:41:51 -05:00
Tyler Goodlet 8b7b444737 Reorder imports in `qt_screen_info.py` ??
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?
2026-11-14 15:41:51 -05:00
Tyler Goodlet 3c30af9b23 Add some Qt DPI extras to `qt_screen_info.py`
- 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
2026-11-14 15:41:51 -05:00
Tyler Goodlet 312bf66ed9 Re-fmt and `.info()` the `.configure_to_dpi()` DPI calcs for now 2026-11-14 15:41:51 -05:00
di1ara 73633ce129 fixed spacing 2026-11-14 15:41:51 -05:00
di1ara 38d7aa1acd fixed pytest test for dpi font auto calculation 2026-11-14 15:41:51 -05:00
di1ara 8904b15e9a added pytest, moved dependencies 2026-11-14 15:41:51 -05:00
di1ara 7e6f29397c fix DpiAwareFont default size calculation 2026-11-14 15:41:51 -05:00
Gud Boi 84292898ac Retry incomplete IB schedule coverage
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`))
2026-11-13 17:30:25 -05:00
Gud Boi 81e8ba3ca8 Use IB schedules to reserve missing SHM history
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`))
2026-11-13 17:30:24 -05:00
Gud Boi 430a7591a9 Factor and bound synthetic SHM null repair
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`))
2026-11-13 17:29:30 -05:00
Gud Boi f106caf59c Preserve IB history request bounds on no data
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`))
2026-11-13 17:29:28 -05:00
Gud Boi 315bfcdf5a Plan known-FQME backfill qualification
- 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`))
2026-11-13 17:25:55 -05:00
Gud Boi 5fc15b6610 Plan gap-checker and backfiller repairs
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`))
2026-11-13 17:25:55 -05:00
Gud Boi 5f75a37923 Fix IB idle timer arithmetic for packet nanoseconds
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`))
2026-11-13 17:17:58 -05:00
Gud Boi 350e2ccd4a Raise on IB socket disconnects in proxy and trades
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`))
2026-11-13 17:17:58 -05:00
Gud Boi 2347ad6198 Fix IB fill accounting by execution identity
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`))
2026-11-13 17:17:57 -05:00