Derive program behavior from deployments; stop persisting it

behavior (tool/daemon/frontend) is now a derived display label computed
from a program's deployments — path->tool, static->frontend, process->daemon
(behavior_for_runner). load_config populates it so every reader gets the live
value; _spec_to_yaml_dict excludes it so it is never written to disk.
_summary_from_service derives it from the runner instead of hardcoding daemon.
Fixtures gain path/python deployments so tool/daemon behaviors derive.
This commit is contained in:
2026-07-01 08:46:54 -07:00
parent fa65ae3d1c
commit 00e8d58c6a
6 changed files with 65 additions and 18 deletions

View File

@@ -31,14 +31,25 @@ def castle_root(tmp_path: Path) -> Generator[Path, None, None]:
"programs": {
"test-tool": {
"description": "Test tool",
"behavior": "tool",
},
"test-daemon": {
"description": "Test daemon program",
"behavior": "daemon",
},
},
"services": {
# A path deployment — its `path` runner makes test-tool's behavior
# derive as "tool" (behavior is derived from deployments, not stored).
"test-tool": {
"program": "test-tool",
"run": {"runner": "path"},
},
# A process deployment — its systemd-managed runner makes test-daemon's
# behavior derive as "daemon".
"test-daemon": {
"program": "test-daemon",
"run": {"runner": "python", "program": "test-daemon"},
"manage": {"systemd": {}},
},
"test-svc": {
"program": "test-svc-comp",
"description": "Test service",