Skip to content

feat(core): reconcile controller policies and report effective commits - #414

Merged
greenhat616 merged 1 commit into
mainfrom
feat/core-control-channel
Sep 10, 2026
Merged

greenhat616 merged 1 commit into
mainfrom
feat/core-control-channel

Conversation

@greenhat616

@greenhat616 greenhat616 commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Each reconcile now carries immutable IPC/HTTP preferences and can report the committed effective configuration. Prefer IPC, IPC-only and HTTP-only settings are part of operation identity; policies that resolve to the same configuration preserve the current instance while updating the desired policy for future restarts.

subscribe_config_commits() provides owned snapshots with coalescing notification semantics. The manager executes no consumer callbacks in its transaction and exposes no publication guards. Current running state remains authoritative through effective_config().

Unix services use a separate group-restricted controller directory, authorize recreated sockets before readiness, and clean endpoints during shutdown and orphan recovery. Hosts without IPC authorization retain HTTP fallback; Windows service IPC remains disabled pending cross-user pipe validation. Keeping HTTP forces a hard switch when listeners would conflict.

Validation:

  • Core-manager library: 107 passed, 1 ignored; channel integration: 2 passed.
  • Service-runtime: 87 passed; new real mihomo/clash-rs channel-switch tests: 2 passed.
  • Complete core-manager regression initially failed dropping_live_manager_releases_runtime_ownership with No such file or directory; its manager_orchestration target passed all 20 tests on serial rerun. The previous macOS version-probe test passed this round. The first full run is not presented as green.
  • Formatting and downstream application Clippy/checks passed with existing warnings retained.

Companion application: libnyanpasu/clash-nyanpasu#5227. The utils gitlink pins the accompanying Backoff equality review commit; merge that dependency first.

Draft release gates: rc.4 is not published. Linux/Windows validation and privileged Unix daemon → ordinary GUI user REST/WS and unauthorized-user tests remain outstanding. Application merge requires the corresponding service release and a released runtime revision.

Backoff equality dependency: libnyanpasu/nyanpasu-utils#185.

@semanticdiff-com

semanticdiff-com Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/nyanpasu-core-manager/src/config/clash.rs  47% smaller
  crates/nyanpasu-core-manager/src/manager/apply.rs  43% smaller
  crates/nyanpasu-core-manager/src/manager/switching.rs  41% smaller
  crates/nyanpasu-core-manager/src/manager/mod.rs  12% smaller
  crates/nyanpasu-core-manager/src/lib.rs  12% smaller
  crates/nyanpasu-service-runtime/src/server/routing/core/mod.rs  12% smaller
  crates/nyanpasu-core-manager/src/control/mod.rs  9% smaller
  crates/nyanpasu-core-manager/src/manager/quarantine.rs  6% smaller
  crates/nyanpasu-service-runtime/src/server/mod.rs  4% smaller
  crates/nyanpasu-core-manager/src/config/mihomo.rs  2% smaller
  crates/nyanpasu-core-manager/src/runtime/process.rs  1% smaller
  Cargo.lock Unsupported file format
  crates/nyanpasu-core-manager/src/config/mod.rs Unsupported file format
  crates/nyanpasu-core-manager/src/controller_access.rs  0% smaller
  crates/nyanpasu-core-manager/src/manager/publish.rs  0% smaller
  crates/nyanpasu-core-manager/src/snapshot.rs  0% smaller
  crates/nyanpasu-core-manager/src/spec.rs  0% smaller
  crates/nyanpasu-core-manager/tests/common/mod.rs  0% smaller
  crates/nyanpasu-core-manager/tests/control_channel.rs  0% smaller
  crates/nyanpasu-service-runtime/Cargo.toml Unsupported file format
  crates/nyanpasu-service-runtime/src/server/controller_access.rs  0% smaller
  crates/nyanpasu-service-runtime/src/server/manager_bridge.rs Unsupported file format
  crates/nyanpasu-service-runtime/src/server/routing/core/v2.rs  0% smaller
  crates/nyanpasu-service-runtime/src/server/routing/tests.rs  0% smaller
  crates/nyanpasu-utils  0% smaller
  nyanpasu_ipc/src/api/contract.rs  0% smaller
  nyanpasu_ipc/src/api/core/v2.rs  0% smaller
  nyanpasu_service/Cargo.toml Unsupported file format

Freeze IPC preferences in each reconcile request and include them in
operation identity. Classify actual controller changes separately from
process options so equivalent policies preserve the running instance while
future restarts retain the latest desired policy.

Expose effective configuration through an authoritative query and owned,
coalescing commit subscriptions. Consumers cannot execute inside the core
transaction or retain a publication guard. Authorize service sockets before
readiness and clean endpoints with their epochs; unsupported hosts keep HTTP.

Advance the service protocol to rc.4 for request-level settings and private
effective snapshots.
@greenhat616
greenhat616 force-pushed the feat/core-control-channel branch from 3a003e0 to d1deb66 Compare September 8, 2026 19:06
@greenhat616 greenhat616 changed the title feat(core): apply controller settings with effective snapshots feat(core): reconcile controller policies and report effective commits Sep 8, 2026
@greenhat616
greenhat616 marked this pull request as ready for review September 10, 2026 08:04
Copilot AI lite review requested due to automatic review settings September 10, 2026 08:04
@greenhat616
greenhat616 merged commit 3cf9658 into main Sep 10, 2026
11 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants