diff --git a/.taken/current.org b/.taken/current.org index 7220d816..15db02cb 100644 --- a/.taken/current.org +++ b/.taken/current.org @@ -491,3 +491,161 @@ tests passed. Production endpoints still use the legacy protocol. - [ ] Propose a reviewable commit plan for each qualified implementation. +* TODO Qualify chart disconnect and reattach with independent service ownership +:PROPERTIES: +:ID: piker-chart-disconnect-reattach-e2e +:CREATED: [2026-10-20] +:CARRIED: 0 +:REPO: /home/goodboy/repos/piker +:CATEGORY: piker.testing +:AI_HARNESS: opencode +:TAKEN_APPEND_OP: piker-chart-disconnect-reattach-e2e-20261020-v2 +:TAKEN_APPEND_REQUEST: 5963b29d2e6372c8864831fdee8945a3e064f5084d9abf0331f92c0b5171647c +:END: +Build process-isolated chart journeys that distinguish surviving shared +services and consumers from clean chart exit. Preserve original errors +and deterministic phase evidence; do not declare a journey green merely +because another chart remains usable. + +Next action: reconcile the current testing and evaluation branches and +their actual Piker/Tractor imports, then implement a suite-owned pikerd +with independent chart processes. No implementation has started for this +handoff as of this entry; source/state inspection is recorded below. + +Context: +Human-directed assignment to e2e_qa_mngr from proj_super. The source +handoff describes proposed tests, not existing runnable nodes: +[[file:/home/goodboy/repos/piker/wkts/ib_downstream_pin_eval/ai/plans/20261019-chart-disconnect-e2e-handoff.md][Chart disconnect and reattach specification and manual evidence]] + +Existing foundations, inspected 2026-10-20: +- wkt/live_chart_qtractor at 4ab49082: structured lifecycle 1a2d4893, + prerequisite fixes 5c17419c, opt-in Kraken reproducer 4ab49082. + Application/test work is committed; only local workflow configuration + remains dirty. Use this as the initial working candidate, not proof + that the evaluation fixes are integrated. +- wkt/human_iface_e2e at aadfd1cf is clean and supplies the headless + QApplication isolation foundation. +- wkt/replay_provider_e2e at 06fee700 is clean. Its real feed/control + fixture has acknowledged sequence barriers. The observed disconnect + races justify narrow controlled input, not a replay-first rewrite. +- wkt/ib_downstream_pin_eval remains at eed58566 with dirty dependency, + logger, daemon and EMS compatibility changes. +- wkt/ib_disconnect_integration at c0dae89a contains committed IB + disconnect work; its provenance/tooling state remains dirty. +- Tractor wkt/ctx_final_return_disconnect in address_logging_levels is + at 0553fcf8 with dirty final-Return guard and regression changes. + Read them as candidate evidence, not an already-landed fix. + +Reuse tests/ui/conftest.py, the Qtractor lifecycle regression, +tests/conftest.py open_test_pikerd and owned config propagation, and +the replay branch's acknowledged feed controls where applicable. +[[file:/home/goodboy/repos/piker/wkts/live_chart_qtractor/tests/ui/test_live_chart.py][Committed live-chart reproducer]] +[[file:/home/goodboy/repos/piker/wkts/replay_provider_e2e/plans/opencode/live-backend-chart-e2e-review.md][Live-provider-first roadmap]] + +The current sanitized live_chart_qtractor interpreter resolves Piker +from that worktree but Tractor from its py313 site-packages; installed +Trio is 0.32.0 and PyQt6 is 6.10.1. This is not the manual evaluation's +Tractor checkout or PyQt6 6.11.0 environment. Resolve exact versions and +module paths again before any comparison. Inspect the duplicate pytest +--ll registration blocker before selecting the evaluation environment. + +Concerns and authority: +This assignment does not authorize commits, history changes, live IB +connections, any orders, or attachment to the human's running daemon. +Order journeys may be designed and implemented as gated tests; do not +execute them without explicit authorization. Live-provider qualification +requires explicit selection and applicable human permission. + +The existing Kraken run reached history and paper EMS but readiness +preceded rt_linked.mode, Qt reported abstract paint calls, and teardown +left a paperboi child. That exact orphan was subsequently stopped by +human-authorized SIGINT. Guest completion did not prove descendant exit. + +Manual IB trials demonstrate daemon/survivor continuity, not clean exit. +Cancellation-only groups, DebugRequestError, hard-reaping and SIGSEGV +remain unresolved. Do not suppress any of these to make E2E green. + +Canonical native-crash investigation, separate from this test assignment: +[[id:piker-qt6-chart-teardown-sigsegv][Diagnose Qt6 chart teardown SIGSEGV with native backtraces]] +[[file:../ai/diagnostics/20261019-chart-253598/README.md][SIP wrapper access during PyQt atexit: diagnostics and limits]] +The core locates the native fault; it does not establish the underlying +ownership cause. This task records exit evidence without claiming repair. +Coordinate order replay/cancellation assertions with +[[id:piker-typed-clearing-migration][Strict typed clearing migration]]; +do not duplicate its protocol migration or infer it has landed. + +Execution: +- [ ] Reconcile source revisions and dirty work before integrating; record + the selected branch, reused fixtures, and exact runtime imports. +- [ ] Own registrar/pikerd A independently of chart processes B and C; + give each chart its own QApplication and Tractor root. Separate discovery + from listener addresses, use a test-unique registry and loopback port + zero, and assert actual chart listeners are nonzero and distinct. +- [ ] Isolate config, storage, settings and account state before imports + in every child; never reuse human ports 6116/3333 or human accounts. +- [ ] Provide an external observation/control channel and owned process + handles that outlive charts. Capture actor UUID/name/PID/listeners, + child relations and exact SHM ownership including unpublished child SHM. +- [ ] Establish readiness after feed/history attachment, bound views, + FSP streams, search handlers and EMS entry. Race waits against original + process/session failure, not only timeouts. +- [ ] Implement same-market alternating departures: ready B/C, close B, + prove the SAME C consumes a post-close quote/FSP update, reopen B, + close C, prove replacement B survives, then close/reopen the last chart. + Add the distinct-market variant to prove sibling-feed independence. +- [ ] Implement last-consumer repeated reattachment to the SAME A and + service/client generations. Compare actual window close, structured + shutdown, root-only SIGINT and terminal-equivalent process-group SIGINT + as separate variants, with PID/PGID ownership recorded before signaling. +- [ ] Drive actual search results with QtBot in the chart worker; compare + visible versus normally dismissed results before detach and reattach. +- [ ] Gate startup cancellation with entered/release acknowledgements at + early acquisition, FSP child bootstrap before imports/registration, + history publication and FSP stream establishment. Hold only C's work, + retain B's progress, permit unwind, and prove a new C can start afterward. +- [ ] Repeat gated startup aborts with no other consumer. Include debug + mode during FSP imports; retain the original interruption independently + from a secondary local-actor IPC stdio-lock DebugRequestError. +- [ ] Implement separately selected order continuity journeys for Piker + paper EMS, IB paper-account broker-routed limits, and EMS-held dark + orders. Execution remains blocked pending explicit order authorization. + Include multi-expiry market-specific dialogs and cancellation of both + order types after reattach. + +Verification: +- [ ] Report service survival and chart exit as separate outcomes even + when either fails. Collect survivor evidence after departure errors, + then aggregate originals rather than hiding them behind cleanup. +- [ ] Prove fresh service RPCs and post-action provider data in the same + survivor, including FSP consumption. Deterministic inputs need a matched + sequence; live quotes need not change price. Sampler ticks alone fail. +- [ ] Assert stable service/provider generations, owned child exit and + SHM lifetime according to its actual owner. Shared cached feed SHM may + remain with A; endpoint closure alone does not prove PID exit. +- [ ] Fail clean-exit checks for SIGSEGV/abort, stuck children, hard reap, + unexpected debugger entry and cancellation-only application errors. + Do not blanket-suppress TransportClosed or mixed exception groups. +- [ ] Preserve baseline/fixed results, stdout/stderr, return codes, + source versions, phase acknowledgements, actor/RPC/context identities, + cancellation provenance, and available fault-handler/core evidence. +- [ ] For authorized order qualification, verify canonical OID/reqid + continuity, idempotent replay, market routing, working-order counts, + position continuity and terminal cancellation. Repeated status messages + alone do not prove duplicate orders. Cover reqid 5042-style error replies + with oid=None and the unsubmitted-order-None cancellation symptom. +- [ ] Run each selected tier headlessly with bounded ownership-scoped + cleanup. Preserve fresh-process fixture isolation; no broad process + killing, SHM cleanup, or human-daemon access. + +Handback: +Return results to source piker, task piker-chart-disconnect-reattach-e2e: +- Selected implementation branch, exact source revisions and reused + fixtures, including any unintegrated prerequisites. +- Exact implemented runnable test node IDs and synchronization gates; + distinguish proposed names from implemented nodes. +- Baseline/fixed results with service survival and chart/process exit + reported independently, including unresolved failures. +- Remaining coverage gaps, required public/live-IB qualification and + order authorization, linked to the separate native-crash concern. +Use guarded store updates for evidence. Preserve all human-owned task +and checkbox states; passing tests and commits are not acceptance.