Skip to content

feat(peer): recover live routes in one connection attempt - #4580

Merged
M4n5ter merged 23 commits into
feat/peer-mesh-reachability-convergencefrom
feat/peer-live-route-recovery
Sep 3, 2026
Merged

feat(peer): recover live routes in one connection attempt#4580
M4n5ter merged 23 commits into
feat/peer-mesh-reachability-convergencefrom
feat/peer-live-route-recovery

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • let one identity-bound native connection attempt consume complete live candidate snapshots instead of timing out and restarting around stale invitation routes
  • start immediate dialing and route observation concurrently, then wake the same reconnect lifecycle when Mesh evidence, native connectivity, or system resume produces a usable path
  • persist and rotate signed reachability leases in direct profiles, owner connection codes, and Guest mounts; copied raw route arrays are no longer a second recovery authority
  • keep Session Guest readiness behind authenticated Host status and transcript catch-up while reusing the established peer connection for the second authorization phase
  • bound peer-keyed recovery history by time, active ownership, and capacity
  • remove the unpublished CLI path that created durable direct profiles from unverified PeerIds and route hints

Closes #4554

Verification

Verified on the complete stacked head after rebasing from main at eacfb46aa7ec93273bf468335f4270bba62d35a5:

  • npm run typecheck

  • npm run lint

  • npm run format:check

  • npm run rebuild

  • npm run test:dist - all workspace tests passed

  • npm run check:renderer-architecture - 71 passed

  • npm run check:release - 192 passed

  • git diff --check

  • cargo fmt --manifest-path native/runtime-host-peer/Cargo.toml -- --check

  • cargo clippy --locked --all-targets --manifest-path native/runtime-host-peer/Cargo.toml -- -D warnings

  • cargo test --locked --manifest-path native/runtime-host-peer/Cargo.toml - 28 passed

  • immutable installed-CLI tarball smoke

  • focused native client and Peer Mesh recovery suites - 27 passed

Review focus

Candidate changes are evidence for one immutable (expected PeerId, deadline) attempt, not permission to restart work or switch identities. TypeScript supplies authenticated candidate snapshots; the native engine remains the sole dial and race authority.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex implemented and verified the change under maintainer direction.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes - described under Summary above
  • No

@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Sep 2, 2026
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch from 3f0185d to 539baaf Compare September 2, 2026 17:29
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch from 539baaf to 9ef4290 Compare September 2, 2026 18:16
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch from 9ef4290 to 658ed0e Compare September 2, 2026 18:47
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch from 658ed0e to 4e89e78 Compare September 2, 2026 19:35
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch from 4e89e78 to ed39a7b Compare September 2, 2026 20:01
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch 2 times, most recently from f11bb7e to 04de5f7 Compare September 2, 2026 21:14
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch 3 times, most recently from 8248280 to 1640d45 Compare September 2, 2026 22:47
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)
Keep persisted Direct targets in the reconnect lifecycle when the first route attempt fails transiently, so later route evidence can revive them without user intervention. Preserve cancellation and permanent-failure boundaries.

Generated-by: Codex (gpt-5.6-sol)
Keep deterministic Direct profile failures out of the retry loop and close the startup callback race that could reactivate a terminal lifecycle.

Generated-by: Codex (gpt-5.6-sol)
Record the confirmed correctness fixes and accepted publisher-boundary simplification for the #4554 review loop.

Generated-by: Codex (gpt-5.6-sol)
@M4n5ter
M4n5ter force-pushed the feat/peer-live-route-recovery branch from 74bb1b3 to b21fdf4 Compare September 2, 2026 23:56
Classify an absent peer endpoint client at the same permanent Direct capability boundary as an unavailable or incompatible native addon.

Generated-by: Codex (gpt-5.6-sol)
Generated-by: Codex (gpt-5.6-sol)

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at exact head cdc82727f889e356802dc992cef5d9d73fc89a82 at the explicit direction of M4n5ter. No technical review was performed as part of this action; M4n5ter requested the approval and accepts responsibility for subsequent handling.


Review notice: This approval was submitted by an automated review agent operated by WAWQAQ and is published at the direction of M4n5ter, who requested this action and is the human accountable for it.

@M4n5ter
M4n5ter merged commit f077232 into main Sep 3, 2026
16 checks passed
@M4n5ter
M4n5ter deleted the feat/peer-live-route-recovery branch September 3, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tracking] Convergent peer reachability and recovery foundation

2 participants