Skip to content

fix(station-host): remove vault_cards host_shim::wait, complete UpdateHold wiring, and burn down small-ledger gaps - #10458

Merged
zanwei merged 1 commit into
mainfrom
feat/pion-wait-sweep-and-last-small-ledgers
Dec 6, 2026
Merged

zanwei merged 1 commit into
mainfrom
feat/pion-wait-sweep-and-last-small-ledgers

Conversation

@CommaBot

@CommaBot CommaBot commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

1. Eliminate background host_shim::wait & complete UpdateHold hardening

  • vault_cards.pion: Replaced host_shim::wait(ms) in reask_in's SQLite busy-retry loop with a private Channel[Unit]::recv_timeout loop (25 ms cancel-polling slices) so background vault-card retries never pop/discard events from host_sessions's main completion queue and abort promptly on CancelToken. Added real-SQLite busy-retry & cancellation test in host_sessions/src/vault_cards_wait_test.pion.
  • updates_door.pion: Switched UpdatesDoor's on_update_holds_cleared callback (and coalescable wake) to non-blocking try_send via a matching counting semaphore (slots : Channel[Int]), preventing hold-release callbacks from blocking caller threads when the updates queue is full, while keeping Hup and ReleaseOut reliably delivered. Added unit test in host_upkeep/src/updates_door_holds_test.pion.
  • UpdateHold wiring across move & handover paths:
    • host_upkeep/src/handover_in.pion: HandIns acquires UpdateHold per coming handover id on handover.begin (idempotent on retries) and releases on handover.show, unconditionally on HandIns::drop (even if drop fails, preventing permanent update lockout), and via release_all_update_holds() on peers-thread shutdown.
    • host_upkeep/src/handover_out.pion: hand_over and settle_outs acquire UpdateHold and release unconditionally across all normal and error/early-return paths.
    • host_sessions/src/move.pion & move_told.pion: MoveHandle acquires UpdateHold across Go, Back, Asked turns, the peer request dispatch loop (move.pion, aligned with Node station.ts:777), retire.* spawned workers, and MoveHandle::peer_tool (both told and direct spawned paths, acquired before spawn and released on completion/error; redundant ask_step hold removed). Added MoveHandle peer_tool hold lifecycle test in host_sessions/src/move_test.pion and failed-drop release assertion in host_upkeep/tests/contract/src/handover.pion.
    • Note on retire: Pion keeps station retirement execution switched off (RETIRE_OFF, matching Node RETIRE_STARTS = false), so no active retiring/taking state exists to hold.

2. Burn down remaining small-ledger deferred_gap entries

  • station/test/feedback-replies.test.ts -> ported_new: Extracted private feedback_reply_run (called directly by production feedback_reply_tool) and added host_sessions/src/feedback_replies_parity_test.pion verifying real-SQLite feedback_session, trimmed payload/wording, argument validation, 404 feedback_not_found, offline refusal, and station_tools() having only feedback_send and feedback_reply.
  • station/test/awake-waits-index.test.ts -> partial: Added host_sessions/src/awake_autoarchive_parity_test.pion exercising production builders_legacy::recovery_step & awake_step (genuine forward-cursor resumable batching without cursor reset, trigger-abort rollback, concurrent SQLite writer ahead of cursor without cursor reset, 3-seed x 250-mutation oracle agreement, and session_recover_waits PRIMARY KEY EXPLAIN QUERY PLAN); honestly lists station_store session_awake_deadlines triggers, recursive-trigger replacement/ignored writes, and mid-backfill updates to already-visited keys in missing_assertions.
  • station/test/autoarchive-unread-bounded.test.ts -> partial: Added real-SQLite test in host_sessions/src/awake_autoarchive_parity_test.pion exercising builders_requested::said_step (<= 64 slice bound across 5001 messages) and builders_legacy::said_step (changed-away & ignored duplicate keys); honestly keeps autoarchive_pass_with_hooks unreadForArchive gating in missing_assertions.
  • Remaining deferred_gap entries were audited and honestly retained as deferred_gap where they depend on unmigrated production features or multi-station/live-WS harnesses.

Verification

  • pionc fmt --check pion/station-host — PASS
  • pionc check --json pion/station-host — PASS (0 diagnostics)
  • pionc check --json pion/station-host/host_upkeep/tests/contract — PASS (0 diagnostics)
  • pionc test --json --filter "UpdatesDoor" pion/station-host/host_upkeep — PASS
  • pionc test --json --filter "MoveHandle peer_tool|vault_cards reask_in|awake-waits-index|autoarchive-unread-bounded|feedback-replies" pion/station-host/host_sessions — all 5 PASS
  • python3 pion/station-host/scripts/parity_audit.py --self-test — PASS (0 ledger errors)
  • sh scripts/undone.sh origin/main HEAD — PASS
  • sh scripts/check.sh push origin/main..HEAD — PASS

Model: Gemini 4 Neon. Test frameworks: pionc test, parity_audit.py --self-test, scripts/check.sh push.

@CommaBot
CommaBot force-pushed the feat/pion-wait-sweep-and-last-small-ledgers branch from a8163e8 to 859b755 Compare December 6, 2026 00:47
…eHold wiring, and burn down small-ledger gaps
@CommaBot
CommaBot force-pushed the feat/pion-wait-sweep-and-last-small-ledgers branch from 859b755 to b224969 Compare December 6, 2026 00:54
@zanwei
zanwei enabled auto-merge (squash) December 6, 2026 00:58
@zanwei
zanwei merged commit d9f24d3 into main Dec 6, 2026
107 checks passed
@zanwei
zanwei deleted the feat/pion-wait-sweep-and-last-small-ledgers branch December 6, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants