Files
LorenEteval_Furious/Furious/Controllers/AGENTS.md
T
2026-09-09 01:28:46 +08:00

40 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Controller guidance
Inherit the root and package guides. This scope preserves controllers as process-lifetime authorities for shared
transitions. Services own execution resources; existing prompts are presentation compatibility paths.
## Shared state authorities
- Controllers own process-lifetime shared state and transition policy. They coordinate injected repositories/services
and publish structured Qt signals. New behavior delegates presentation and execution resources to their owners;
existing host-setting prompts do not justify moving network replies, core processes, or pools into controllers.
- `ConnectionController` is the sole connection state machine. A GUI start remains `Connecting` while one
generation-checked `ConnectionManager` transaction acquires readiness/TUN resources. The selected live profile is
exposed during `Connecting`; successful runtime commit precedes System Proxy setup and `Connected`. Failure resets
the active profile. Disconnect/reconnect cancels the exact in-flight generation and ignores stale completion.
- Preserve state and signal ordering, interaction gating, the exact selected `ServerProfile`, runtime snapshots,
reconnect preference, and rollback after validation, runtime, TUN, System Proxy, cancellation, or unexpected-exit
failure. Worker/native callbacks cross to the controller’s Qt thread before transition.
- The active live profile is not the prepared document used by an already-started runtime. Resolve identity and
generation before changing state or host effects, and preserve typed runtime failures; cancellation and supersession
are not generic connection errors.
- `RoutingController` owns available capability options plus selected/persisted routing. Distinguish a newly
selected repository profile from the active-profile reference and the independent runtime document; changes use
controlled reconnect, not mutation of the running document. User-defined routing labels are semantic data, not
translatable UI literals.
- `SettingsController` is the shared policy path used by Home, Settings, tray, and platform integration. Startup
registration persists only after host success; other preferences may apply immediately or on the next connection.
Preserve each setting's actual application timing instead of imposing one transaction order on all preferences.
- System Proxy helpers currently log some host failures without raising. Controller exception-path tests prove
recovery when an error reaches the controller, not that every OS failure is propagated. Keep desired proxy mode
distinct from observed host state when evolving this boundary.
## Verification and evolution
- Test exact states and signal counts for async success, invalid input, supersession, cancellation, partial
acquisition, System Proxy failure, unexpected exit, routing refresh/reconnect, startup restoration, failed host
settings, missing partial-startup dependencies, and repeated shutdown. If ownership moves deliberately, update
this guide and the affected controller tests instead of keeping a compatibility controller as a second authority.
Start with `tests/test_controllers.py`, `tests/test_connection_startup_async.py`, and the shared-state cases in
`tests/test_qt_interactions.py`.