Commit Graph

4782 Commits (762c59d7c77a69e9985ad20cbc5e19713f2c5d60)

Author SHA1 Message Date
Gud Boi 762c59d7c7 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-03 09:43:39 -05:00
Gud Boi a8ecbec3f3 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-03 09:35:27 -05:00
Gud Boi e02a6431e3 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-02 09:17:22 -05:00
Gud Boi ff136ecb84 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-01 18:15:46 -05:00
Gud Boi 6834573276 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-10-31 19:49:25 -04:00
Gud Boi dae575e1b5 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-10-30 18:50:06 -04:00
Gud Boi 63ae23aa4f Adjust to `trio>=0.34.0` invalid `Event` truthy checks 2026-10-30 15:33:39 -04:00
Gud Boi eb0514c3a8 .ib.feed: cache quote channel contexts
Replace the manual `_quote_streams` raw-channel registry with a
symbol-keyed `maybe_open_context()` resource whose lifetime extends to
the final quote consumer.

Give every `open_aio_quote_stream()` caller a lexical child from the
cached `LinkedTaskChannel` broadcaster so concurrent users receive the
same quotes and close independently.

Prompt-IO: ai/prompt-io/opencode/20260813T230744Z_ddac3553_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))

(cherry picked from commit 4af885d90f)
2026-10-28 14:57:52 -04:00
Gud Boi e929fdc2d5 Record chart disconnect E2E qualification handoff
Preserve the manual IB detach, reattach, shared-consumer and startup
cancellation evidence as a historical snapshot for the QA worker.
Specify independent service ownership and deterministic phase gates,
including terminal-order resurrection during second-chart bootstrap.

Keep service continuity distinct from clean chart exit and retain the
unresolved cancellation, debugger, order-correlation and native-crash
findings. The linked Taken tasks own the worker assignments; this
document provides supporting context, not acceptance or executed tests.

(this patch was generated in some part by `opencode` using
`gpt-6.1-sol` (`openai`))
2026-10-21 16:16:52 -04:00
Gud Boi 29752c509c Select legacy AI workflow state paths
Record the legacy workflow backend and ignore its private runtime
state/config paths. Keep existing repository-local commit and test
guidance selected without tracking generated runtime receipts.

(this commit msg was generated in some part by `opencode` using
`gpt-6.1-sol` (`openai`))
2026-10-21 16:16:34 -04:00
Gud Boi a89887e2a4 Pin the qualified modern `tractor` runtime
Select Tractor b64c89f0, including final-result disconnect containment,
through an immutable Git source instead of an absolute editable path.
Require Python 3.13 and permit msgspec >=0.20 for the evaluated stack.

Regenerate the lock offline and retain its existing evaluation delta:
msgspec 0.21.1, Polars/runtime 2.0.0, Git-pinned multiaddr, setproctitle
and removal of Python 3.12 wheel variants. The local `piker_pin` ref
was fast-forwarded separately; publication is not implied by this lock.

Prompt-IO: ai/prompt-io/opencode/20261021T185636Z_eed58566_portable_pin_prompt_io.md

(this patch was generated in some part by `opencode` using
`gpt-6.1-sol` (`openai`))
2026-10-21 16:16:24 -04:00
Gud Boi 5adf77a94b Fix package logger names for daemon startup
Remove only the exact `piker.` prefix before delegating to Tractor's
logger factories; `lstrip()` treated it as a character set and renamed
submodules such as `piker.paper` to `piker.aper`.

Drop stale parent-namespace assertions in service, data, broker and EMS
startup while retaining console setup. Exercise both factories with
service and prefix-sensitive submodule names.

Prompt-IO: ai/prompt-io/opencode/20261019T123725Z_eed58566_logger_compat_prompt_io.md

(this patch was generated in some part by `opencode` using
`gpt-6.1-sol` (`openai`))
2026-10-21 16:07:53 -04:00
Gud Boi eed5856622 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-09-24 20:20:20 -04:00
Gud Boi 441358e2e7 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-09-24 19:09:22 -04:00
Gud Boi de58fa2bd8 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-09-24 14:58:18 -04:00
Gud Boi 1da9b760a3 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-09-23 14:35:21 -04:00
Gud Boi efa72980f8 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-09-17 18:24:17 -04:00
Gud Boi 5eb4fc9d8a 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-09-16 17:12:01 -04:00
Gud Boi 749ca1f09c 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-09-15 13:04:17 -04:00
Gud Boi 224399147d 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-09-15 12:49:53 -04:00
Gud Boi 5b4622fb39 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-09-15 12:49:42 -04:00
Gud Boi 20406210b3 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-09-15 12:47:07 -04:00
Gud Boi 07d8cf5a3d 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-09-15 12:46:20 -04:00
Gud Boi d5b20ce350 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-09-15 12:17:02 -04:00
Gud Boi fadab3d2bc 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-09-01 22:07:22 -04:00
Gud Boi 9115d24da0 Fix string errors in `.ib.broker` relay
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`))
2026-08-28 02:52:12 -04:00
Gud Boi 1606122b45 Add `piker-clearing-expert` skill
Capture EMS/order-control ownership, identifier boundaries, ledger
and position invariants, backend variation, and current known hazards.

Store the canonical bundle under `.agents/skills/` and bridge Claude
discovery through a portable relative link.

Also,
- add architecture, debugging, and test-map references;
- document the provider-neutral source convention;
- ignore the canonical `wkts/` runtime root.

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

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-08-27 23:24:54 -04:00
Gud Boi 7b51927f6b 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-08-27 23:11:43 -04:00
Gud Boi 6ca6ab2a10 Fix Binance USD-M websocket routing
Binance retired its legacy futures websocket and split quote
traffic across `/public` and `/market`. Route `bookTicker` and
`aggTrade` through dedicated URLs, merge both sockets, and accept
the new `st` stream-type field.

Bound connection and first-quote startup so failed or silent
streams raise `DataUnavailable` instead of hanging `datad` and
chart consumers.

Also,
- derive feed mode from resolved `FutesPair` metadata
- keep direct URL subscriptions stable across reconnects
- cover USD-M routes, payloads, and startup timeouts

Prompt-IO: ai/prompt-io/opencode/20260826T222600Z_5f631e19_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-08-26 19:24:37 -04:00
Gud Boi 5f631e1996 Plan repository-wide branch landing order
Audit every retained worktree, branch family, rebased patch, stash,
and unreachable commit against `main`.

Deats,
- factor useful histories into dependency-ordered PR lanes;
- reduce the DPI branch swarm to one five-commit patch set;
- separate runtime, datad, backfill and chart ownership work;
- record deferred patches and post-landing stale-ref cleanup;
- attach Prompt-IO provenance for the generated audit plan.

Prompt-IO: ai/prompt-io/opencode/20260818T064340Z_09ddcf50_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-08-18 12:47:30 -04:00
Gud Boi 09ddcf5055 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-08-17 19:55:26 -04:00
Gud Boi 335190a4e3 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-08-17 19:11:03 -04:00
Gud Boi b738c9f4f7 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-08-17 19:09:46 -04:00
Gud Boi 711666f9c8 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-08-17 19:08:28 -04:00
Gud Boi 78982d8280 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-08-17 19:08:02 -04:00
Gud Boi f65df6a138 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-08-14 19:03:11 -04:00
Gud Boi 2aa66c2cf6 Fix IB `MethodProxy` response routing
`open_client_proxy()` broadcast its one-slot linked channel to an
always-running status relay and an idle method receiver. Status
traffic advanced only the relay, so the first lazy contract lookup
for an uncached order raised `Lagged` before receiving its
response.

Give `relay_client_proxy_messages()` sole receive ownership. Route
tagged responses from concurrent caller tasks into their per-`mid`
slots while each proxy context retains its own channel and relay.

Deats,
- log stale responses with their original method name;
- warn when unresolved-request metadata exceeds its bounded limit;
- drop late responses after caller cancellation;
- preserve the reconnect design note and message-case rationale;
- accept clean channel EOF during proxy teardown;
- cover idle status, concurrency, cancellation and EOF paths.

Prompt-IO: ai/prompt-io/opencode/20260811T205826Z_06d5ea5d_prompt_io.md

(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
2026-08-11 18:46:23 -04:00
Gud Boi 06d5ea5dc0 Fix sparse IB history prepends in `ShmArray`
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`))
2026-08-05 19:40:07 -04:00
Gud Boi f0f3c80657 Simplify `store` series and SHM discovery
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`))
2026-08-01 00:34:55 -04:00
Gud Boi 74ea2152f9 Expose storage state through `piker store`
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`))
2026-07-31 17:26:11 -04:00
Gud Boi 0846cbd4a4 Repair IB startup gaps in `ShmArray`
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`))
2026-07-29 16:46:52 -04:00
Gud Boi ad6c560f6b Guard `ldshm` from invalid SHM snapshots
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`))
2026-07-29 15:07:50 -04:00
Gud Boi d359b1cbfb Repair first-slot OHLC sentinels in `NativeDB`
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`))
2026-07-29 13:30:51 -04:00
Gud Boi ce33deb6b9 Use IB UTC syntax for history `endDateTime`
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`))
2026-07-28 23:44:15 -04:00
Gud Boi 922a5df88d Add `xonsh` backfill qualification workflow
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`))
2026-07-28 19:41:55 -04:00
Gud Boi d7d537d531 Add raw OHLCV audit to `NativeDB`
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`))
2026-07-28 19:38:50 -04:00
Gud Boi 1f30917047 Repair legacy timestamps in `NativeDB` merges
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`))
2026-07-28 19:37:15 -04:00
Gud Boi ed85721cfd Clean test-owned SHM leaks in `pytest`
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`))
2026-07-27 18:09:03 -04:00
Gud Boi 19c6d98e6d Normalize provider OHLCV for `NativeDB`
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`))
2026-07-27 18:08:33 -04:00
Gud Boi 689df816d6 Drop redundant `NativeDB` writer locks
`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`))
2026-07-27 16:58:00 -04:00