SunLionet is split into two coordinated agents compiled from one codebase.
This repository’s public release boundary is defined by the release workflows and the default build tags:
sunlionet-inside is built from cmd/inside with build tag inside (default build excludes daemon).sunlionet-outside is built from cmd/outside with build tag outside.The product/repo map is captured in: production-map.md.
Trust boundaries and enforcement points are captured in: security/boundaries.md.
This repo currently ships multiple user/operator-facing surfaces:
cmd/inside, -tags inside, default !daemon)cmd/outside, -tags outside, includes optional relay server mode)android/):
android/app/libs/)website/):
Inside runs on the user device and owns all real-time decisions. It is designed to be lightweight, seizure-resistant, and able to operate during partial or total blackouts.
Inside is implemented as a CLI/runtime that:
Concrete enforcement points live in:
pkg/bundle and pkg/importctlpkg/profile (+ other pkg/*/store.go)pkg/sbctlcmd/inside/runtime_api.go (localhost-only binding + sanitization)cmd/inside/daemon.go (build tag inside && daemon) is a separate autonomous-agent runtime path that integrates additional subsystems (LLM client, relay polling, ledger sync). It is not built by default and is not part of the public release boundary until explicitly hardened and gated.
The Android app does not simply “wrap the Inside CLI”. It embeds a Go agent loop exposed via pkg/mobilebridge and invoked from Kotlin (android/app/src/main/java/com/sunlionet/agent/Bridge.kt).
Concrete responsibilities in the Android/Go combined runtime:
pkg/mobilebridge → pkg/importctl, pkg/profile, pkg/profile.TemplateStorepkg/mobilebridge → pkg/policypkg/mobilebridge → pkg/orchestrator (local-only contract; treated as untrusted advisor)pkg/sbctl (Go) and SingBoxController.kt (Android)Note: android/app/libs/ contains the gomobile artifacts that the APK links against; treat these as release-critical inputs (see production-map.md).
Some subsystems exist as real code but intentionally return “unavailable” in real mode until a real implementation is introduced. This is a deliberate boundary: it prevents accidental reliance on a fake “real” mesh/Signal receiver.
pkg/detector/real, pkg/detector/sim)pkg/policypkg/profile and other pkg/*/store.gopkg/mesh/sim, pkg/signalrx/sim)unavailable (pkg/mesh/real, pkg/signalrx/real)cmd/inside/daemon.go uses pkg/llm)Outside runs in a safer jurisdiction. It continuously generates and tests new seed profiles and distributes bundles to Inside users via a one-way channel.
Outside capabilities
Default data flow is Outside → Inside only:
snb://v2:<base64url(wrapper_json)> via Signal.Inside may optionally send a minimal health report only if the user explicitly enables it. Default remains receive-only.
In the experimental daemon build (inside && daemon), Inside can use an LLM as an advisor only:
profile_id + allowed mutation set + cooldown.