Sequence Kraken parity and the IB recovery handoff

Queue the IB ledger fallback before a single Kraken provider review.
Keep account configuration, token renewal and early cancellation as
three verification targets. Preserve the observed Gateway restart and
real paper E2E setup for a separate dialog after parity lands.

(this patch was generated in some part by `Codex` using
`GPT-6` (`OpenAI`))
wkt/federated_project_stores
Gud Boi 2026-11-27 18:28:07 -05:00
parent ec676678c5
commit 2017dee687
1 changed files with 142 additions and 0 deletions

View File

@ -885,6 +885,115 @@ scoped patch and regression results to this task before commit-planning
an implementation. The evidence addition itself is ready for a scoped an implementation. The evidence addition itself is ready for a scoped
commit plan; task acceptance markers remain human-owned. commit plan; task acceptance markers remain human-owned.
**** Paper Gateway restart observed on 2026-11-27
At 15:30 Toronto time the running =land_ib_startup_volume= chart
session lost quotes and the IB trade-event stream. Sanitized host log
times (UTC) from the paper Gateway container:
- 20:30:00.516 IBC detected the "Restart in progress" dialog.
- 20:30:02.245 The launcher found an authentic autorestart file.
- 20:30:06.481 IBC reported "Login has completed".
This confirms a Gateway application restart. Its trigger and client
resubscription after login remain unverified. On the piker side the
proxy raised peer closure, the trade receiver raised socket disconnect,
and quote and history owners unwound alongside competing PDB requests.
Exercise an outstanding proxy call, an already-open quote consumer
and an active paper trade dialog across socket loss and restoration.
Check a bounded error for the call and fresh quote and trade events
on the original consumers without restarting pikerd or replaying orders.
The installed Tractor pin was =8fe574c1=. Compare any bridge failure
against that revision before importing archived Tractor changes.
Offline reproducer on =wkt/land_ib_disconnect_regression@88608f12=:
[[file:../../land_ib_disconnect_regression/tests/test_ib_gateway_restart.py::224][Gateway restart regression]].
With Tractor =8fe574c1=, the continuous-session control delivered both
generations. Replacing the simulated IB peer raised peer closure and
the trade-event socket error. The original consumers did not complete
second-generation delivery. The targeted run had 15 passes and this
one failure. It exercises backend entry points with an in-memory EMS
peer and a temporary account directory; live recovery remains open.
***** Real paper Gateway E2E before implementing recovery
Use the =dockering/ib= Compose recipe with a dedicated paper session.
Record the actual image digest, Gateway version and selected paper API
port. Start pikerd, a chart and its IB paper trade dialog, then verify
delivery on each before restarting the Gateway application inside the
container. Use the same chart and EMS stream throughout. Correlate the
Gateway restart and login with socket loss and API readiness. Require
a fresh post-login quote and a distinct post-login paper order status
on the original consumers. Bound each wait and record pending lookup
outcome, daemon identity and any duplicate submission or event.
Arrange a controlled paper order event explicitly for the run. A quiet
market or missing broker event leaves delivery unqualified.
Capture the failing baseline before using this suite to qualify a fix.
****** New-dialog handoff after INUSE parity lands on upstream main
Resume in a separate dialog once the parity landing stack is on
upstream main. The landing dialog handles the IB ledger fallback first,
then Kraken provider parity in one review. At handoff, record the landed main SHA and compare it with
the regression worktree before moving any local changes.
The simulated regression is committed at =e11d7af2= in
=wkt/land_ib_disconnect_regression=. Inspect that worktree first.
The real test and supervisor tests are untracked alongside the
Gateway helper in =piker/service/_ib_gateway.py=. Local changes
also cover =piker/service/_ahab.py= and =dockering/ib/README.rst=.
Four supervisor cases passed offline. The paper API answered a
read-only check at =10.6.0.8:4002=. The live chart, EMS and restart
sequence still needs its first run.
[[file:../../land_ib_disconnect_regression/tests/test_ib_paper_gateway_e2e.py][Interactive paper Gateway test]]
******* First run on the existing paper instance
- Coordinate the interruption with the operator. Daily charts use
this Gateway too, including clients using different API IDs.
- On the Gateway host, configure the effective =dockering/ib/ibc.ini=
with =CommandServerPort=7462=, =BindAddress=127.0.0.1= and an empty
=ControlFrom=. Confirm the intended daily =AutoRestartTime= first.
IBC can persist the test restart time in Gateway settings.
- Reload the paper Compose service once to apply the config. Verify
the listener is on loopback with =ss -ltn= and send =EXIT= as a
harmless command check. Run a host-local watcher that emits only
Docker UTC timestamps and the IBC restart-dialog and login markers.
Raw JVM startup lines can include credentials.
- On the tester, use the dedicated paper config and pikerd. Create
a regular marker file and set =PIKER_IB_PAPER_LOG= to its path.
Transfer just the two marker lines there during the manual run.
Start the interactive pytest with a visible display and =-s= when
QQQ is receiving ticks. Generate the baseline paper status.
- Once pytest reports its baseline, send =RESTART= over the host's
loopback IBC socket. Leave Compose and the original clients up.
After login and API readiness, generate a distinct paper status.
Verify the intended daily restart time afterward.
- Return the image digest, IBC/Gateway versions, piker and Tractor
revisions, restart/login times, daemon UID and delivery outcomes
to this item. Distinguish a quiet market or missing paper event
from a disconnected consumer. Capture this baseline before a fix.
******* Options for recurring jobs over the existing WireGuard mesh
- Operator on the host is the first qualification path. The paper API
already has its own route. The Gateway host normally has no sshd.
- A host-local runner can accept an outbound job and perform the
loopback restart and filtered marker delivery.
- For tester-driven jobs, start a temporary sshd on the tester's WG
address. A helper on the Gateway host initiates outbound SSH. Bind
the reverse forward to tester loopback and target Gateway loopback
port 7462. Restrict the test key to the intended forward and marker
receiver, deliver markers to pytest, and close both ends at job
exit. Arrange who starts the outbound helper.
- Direct IBC over WG is another option. Bind to the Gateway WG IP,
limit =ControlFrom= and firewall access to the test peer, and
arrange marker delivery separately. This grants standing restart
access while the listener is enabled.
- Decide on automation after the first baseline. Prefer a separate
paper login and Gateway instance for recurring restart jobs.
*** Chart lifecycle, E2E and order-bootstrap ownership *** Chart lifecycle, E2E and order-bootstrap ownership
:PROPERTIES: :PROPERTIES:
:ID: piker-workstream-chart-lifecycle :ID: piker-workstream-chart-lifecycle
@ -1283,6 +1392,39 @@ Their URLs, unresolved checklists, rationale and original checked
markers remain intact. Existing store IB search, profiling, lint and markers remain intact. Existing store IB search, profiling, lint and
portable-skill tasks remain canonical. portable-skill tasks remain canonical.
**** Kraken provider parity for the upstream main landing
Review against landing base =88608f12= and =kraken_stale_ws_token=
at =8299c658=. Select behavior by hunk. The intervening UI commit
=8cefc1bd= and IB ledger commit =170c95da= have separate owners.
- [ ] Account configuration (=ebc5bbd4=). Port the sample config and
authenticated startup checks together. Verify a matched key
description and account alias yields the expected Kraken EMS account.
Exercise missing account table, mismatched alias and missing
source fiat. Report configuration errors before private startup.
Preserve public market data without credentials.
- [ ] Private WS authentication (=5387538b=, =709269fc= and the
subscription hunks of =8299c658=). Share the current token between
subscriptions and order control. On invalid session, refresh and
resend outstanding subscriptions with a bounded retry. In the
source, renewal enters the debugger and resumes the receive loop;
timeout can yield without all acknowledgements. Check both private
subscriptions acknowledge, a repeated rejection exits cleanly,
and order control uses the new token. Exclude token values from
logs and avoid replaying order submissions.
- [ ] Early edit/cancel (=e1cd3fd9= and the order-tracking hunks of
=8299c658=). Track pending intent separately from Kraken txids.
The source inserts the local reqid into the txid map while waiting
and pauses on an early edit. Exercise edit then cancel before ack,
the eventual exchange ack and a duplicate update. Require one
cancel for the intended Kraken txid, cleared pending state and an
unaffected second order. Check normal acknowledged edit/cancel too.
Use one Kraken worktree and one review after the IB ledger fallback.
Qualify all three behaviors offline against the current EMS protocol.
Record results and residual differences before claiming Kraken parity.
*** Gap overlays, rendering and display portability *** Gap overlays, rendering and display portability
:PROPERTIES: :PROPERTIES:
:ID: piker-workstream-gap-display :ID: piker-workstream-gap-display