Sunlionet

SunLionet: Core Control Plane Architecture

This document maps core control-plane modules to the current codebase. Where a module is not implemented (or exists only in a non-release build), it is labeled explicitly.

1. Detector Subsystem

The Detector subsystem provides monitoring of network health and censorship signals.

Detection Methods

2. Policy Engine (Deterministic)

The Policy Engine ranks candidates deterministically and produces a safe fallback decision path when optional orchestrators are unavailable.

Health Scoring and Ranking

Implemented in the release build:

LLM-based decisioning exists in a non-release runtime path (cmd/inside with build tag daemon) and is not part of the current public release boundary.

3. Secure Local Store

The Secure Store ensures that configuration state is encrypted at rest on disk. Runtime event streams are separate and are intentionally bounded/sanitized.

Storage Architecture

Components

4. Integration with SUNLIONETd Supervisor (legacy name during transition)

Conceptual (non-release): the supervisor/daemon architecture described below reflects an earlier or experimental control loop (see cmd/inside/daemon.go) and is not the default release runtime.

The supervisor loop orchestrates the pipeline:

  1. Detector emits an event to the EventChan.
  2. The Supervisor appends the event to the ring buffer.
  3. The Policy Engine evaluates the events and ranks profiles.
  4. If a deterministic rule applies, an ActionSwitchProfile is generated.
  5. If ambiguous, the LLM Advisor is invoked with the ranked candidate list.
  6. The Supervisor generates a new JSON configuration and calls ApplyAndReload on the sbctl (sing-box controller) for a seamless atomic config reload.