Skip to content

feat(runtime-host): reconcile peer Mesh transit - #4144

Merged
M4n5ter merged 11 commits into
feat/runtime-host-peer-transitfrom
feat/runtime-host-peer-transit-reconciliation
Aug 29, 2026
Merged

feat(runtime-host): reconcile peer Mesh transit#4144
M4n5ter merged 11 commits into
feat/runtime-host-peer-transitfrom
feat/runtime-host-peer-transit-reconciliation

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 29, 2026

Copy link
Copy Markdown
Member
English

Summary

Persist one selected Peer Mesh as the local transit desired state and reconcile it into the native Relay v2 policy. Signed route records scope transit capability to that Mesh, while membership removal or Mesh closure withdraws access and reservations automatically.

This PR is stacked on #4142.

Refs #3842

Verification

  • cargo test --manifest-path native/runtime-host-peer/Cargo.toml --locked --all-targets --all-features
  • cargo clippy --manifest-path native/runtime-host-peer/Cargo.toml --locked --all-targets --all-features -- -D warnings
  • npm --workspace @maka/runtime-host run typecheck
  • npm --workspace @maka/runtime-host run build
  • focused Runtime Host peer native, listener, and Mesh suites: 17 passed

AI use

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

Tool(s) and scope: OpenAI Codex assisted with implementation, tests, and validation.

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
中文

概要

将一个选定的 Peer Mesh 持久化为本机 transit desired state,并将其协调为 native Relay v2 策略。签名路由记录将 transit 能力限定在该 Mesh 内;成员被移除或 Mesh 关闭时,访问权限与 reservation 会自动撤销。

本 PR stack 在 #4142 之上。

Refs #3842

验证

  • cargo test --manifest-path native/runtime-host-peer/Cargo.toml --locked --all-targets --all-features
  • cargo clippy --manifest-path native/runtime-host-peer/Cargo.toml --locked --all-targets --all-features -- -D warnings
  • npm --workspace @maka/runtime-host run typecheck
  • npm --workspace @maka/runtime-host run build
  • Runtime Host peer native、listener 与 Mesh 聚焦测试:17 项通过

AI 使用

  • 没有生成式工具作出实质贡献
  • 生成式工具作出了实质贡献

工具与范围:OpenAI Codex 协助实现、测试与验证。

检查清单

  • 测试覆盖本次变更,且在没有修复时会失败
  • lint、format、typecheck 与受影响测试均在本地通过

本 PR 是否改变行为?

  • 是——已在概要中说明

@M4n5ter
M4n5ter force-pushed the feat/runtime-host-peer-transit-reconciliation branch from 4ee83d8 to 3624e0d Compare August 29, 2026 08:51
@M4n5ter
M4n5ter force-pushed the feat/runtime-host-peer-transit-reconciliation branch from 3624e0d to 45ecbe9 Compare August 29, 2026 11:00
@M4n5ter
M4n5ter marked this pull request as ready for review August 29, 2026 11:37
@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Aug 29, 2026
@M4n5ter
M4n5ter force-pushed the feat/runtime-host-peer-transit-reconciliation branch from 45ecbe9 to a4e24cc Compare August 29, 2026 11:40

@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.

I reviewed exact head a4e24ccb4b014474ff0daf1b1e5e5a74c04ec69e against its stacked base 99fc779aedf69035dcad1e5170c78df6a549e07b.

The selected Mesh remains durable desired state, signed route records scope transit capability to active shared membership, native relay admission stays closed to the configured roster, and membership removal or Mesh closure withdraws routes, reservations, active connections, and pending transit attempts. Native retries resolve current relay addresses rather than persisting stale endpoints.

The Runtime Host build passed; its compiled test suite passed 1,357 tests with 9 platform/environment skips, the 18 focused peer tests passed, and Biome, Rust formatting, and git diff --check passed. Exact-head hosted CI, admission quality, Windows recovery, package validation, and native platform builds are green.

This approval is scoped to the stacked base. Current main has an independent Mesh-status change that conflicts in peer-mesh/node.ts; the stack must preserve that active-membership filter when it is rebased before landing.


Automated review notice: This comment was posted by an automated review agent operated by WAWQAQ. It is not an independent human review and does not replace one.

@M4n5ter
M4n5ter force-pushed the feat/runtime-host-peer-transit-reconciliation branch from a4e24cc to 6cf2723 Compare August 29, 2026 13:44
M4n5ter added 11 commits August 29, 2026 21:54
Persist one selected Mesh as transit desired state, advertise that scoped capability in signed routes, and reconcile native provider and reservation policy as membership changes.

Refs #3842

Generated-by: OpenAI Codex
Require a transit route's peer to remain a current member of the advertised Mesh. Accept an identical roster already committed by concurrent reconciliation so invitation joins remain idempotent.

Generated-by: OpenAI Codex <codex@openai.com>
Derive trusted relay identities from one canonical relay-address set and admit the full bounded Mesh roster. Native reservation and circuit limits continue to cap actual resource use.

Generated-by: OpenAI Codex <codex@openai.com>
Carry relay candidates with their signed peer identity, bound the desired policy before native reconciliation, and keep automatic relay ownership independent. Treat a durable transit selection as desired state while convergence retries.
Reuse the canonical relay candidate normalization when resolving application routes so signed hints cannot substitute or poison relay identities.
Resolve application transit by reconciled relay identities instead of signed address strings, and derive reservation demand from the canonical transit address set.
Treat policy replacement as an in-flight boundary by aborting pending application connections that still reference a removed relay.
Keep cancellation, timeout, and transit revocation triggers distinct while routing their resource cleanup through one lifecycle owner.
Route native open failures through the same pending-connect cleanup owner used by cancellation, timeout, and transit policy replacement.
Resolve relay addresses from the current native policy on every retry. Preserve viable direct and relay paths when one transit candidate is revoked.

Generated-by: OpenAI Codex
Assert the active-membership status contract after closing a transit Mesh instead of expecting an inactive record that the Host no longer projects.

Generated-by: OpenAI Codex
@M4n5ter
M4n5ter force-pushed the feat/runtime-host-peer-transit-reconciliation branch from 6cf2723 to d4f9923 Compare August 29, 2026 13:54
@M4n5ter
M4n5ter merged commit 555a62c into main Aug 29, 2026
15 of 18 checks passed
@M4n5ter
M4n5ter deleted the feat/runtime-host-peer-transit-reconciliation branch August 29, 2026 14:20
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.

2 participants