piker/ai/prompt-io/codex/20260925T190523Z_c0dae89a_p...

46 lines
1.6 KiB
Markdown

---
model: gpt-6
service: codex
session: sampler_tick_time_guard
timestamp: 2026-09-25T19:05:23Z
git_ref: c0dae89a
scope: code
substantive: true
raw_file: 20260925T190523Z_c0dae89a_prompt_io.raw.md
---
## Prompt
The user observed an oversized MNQ 1s bar just after boot and asked
to keep queued startup trades out of a different timestamped bar.
After direct chart and separate pikerd restarts showed no new spike,
the user requested the fix on a separate branch based on
`ib_connectivity_harden`, followed by `$commit-plan`.
## Response summary
Normalize provider trade timestamps and compare them with the
sampler's current 1s bar. Wait briefly for a one-step-ahead tick,
warn that its price update is delayed, skip other timestamp
mismatches, and preserve behavior for feeds without tick
timestamps. Note the remaining late-bar correction race and add
focused sampler tests.
## Files changed
- `piker/data/_sampling.py` — guard writes by tick and bar time.
- `tests/test_sampling_tick_times.py` — exercise startup backlog and
next-step behavior.
## Human edits
The human identified the oversized MNQ boot bar, proposed a sampler
startup race, directed the timestamp check, and live-tested the fix
in both direct-chart and separate-pikerd setups. The human chose to
isolate this fix from the ongoing segment-repair review on a branch
based on `ib_connectivity_harden`. During local tuicr review, the
human required a warning before each next-slot wait because chart
price latency matters, and called out the race between incomplete
history bars and late trade ticks. The agent applied the edits and
added a TODO for IB and provider-neutral bar reconciliation.