Settings control pattern (p1-xxxsvc + xxxctl + GUI)¶
This file defines the standard settings architecture for P1Start control domains.
1. Why this pattern exists¶
Without a standard pattern, settings drift into ad-hoc paths:
GUI-only toggles with no shell/operator equivalent
CLI tools that bypass GUI-visible state
Daemons and apps disagreeing about current policy
The platform standard avoids this by unifying behavior across all domains.
2. Required components¶
Each settings domain should implement:
Service daemon:
p1-<domain>svc.elfCLI tool:
<domain>ctl.elfGUI panel: Settings integration for common users
RegCube keys: canonical persisted state
All four are part of one contract.
3. Responsibility split¶
Component |
Responsibility |
|---|---|
|
Owns control-plane behavior, validation, policy transitions, status updates |
|
Operator/scripting interface to inspect/update state and trigger actions |
Settings GUI |
User-facing controls mapped to the same keys/service operations |
RegCube |
Persisted source of truth for defaults, overrides, and status |
Rule: GUI and CLI should converge on the same behavior and outcomes.
4. Contract checklist for a new domain¶
When adding a domain (network, time, display, sound, power, etc.):
Define key namespace under
HIVE_LOCAL_MACHINE/<domain>/...Define service readiness + control IPC wire(s)
Implement daemon load/apply logic from RegCube at startup
Implement CLI read/write/status actions
Implement Settings panel that uses the same key/service paths
Add
last_apply_status-style diagnostics key(s)Document contract in
newdocs/
5. Current domain status¶
Domain |
Daemon |
CLI |
GUI |
Notes |
|---|---|---|---|---|
Time |
|
|
Present |
SNTP + timezone/region policy |
Display |
|
|
Present |
Resolution/refresh/scale/brightness policy; apply updates compositor logical workspace immediately |
Networking |
|
|
Partial |
Contract still maturing |
Game runtime |
|
|
In progress |
Engine governance + lifecycle |
Input / keyboard |
|
|
Planned Settings tile |
Locale + RegCube deferred — |
6. Anti-patterns (do not add)¶
Persisting settings only in process-local globals
GUI state not mirrored to RegCube
CLI bypassing daemon policy logic
Multiple sources of truth for the same domain state