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

@@ -41,7 +41,7 @@ from castle_core.generators.systemd import (
unit_env_file,
unit_name,
)
from castle_core.manifest import JobSpec, ServiceSpec, manager_for
from castle_core.manifest import JobSpec, ServiceSpec, behavior_for_runner, manager_for
from castle_core.registry import (
REGISTRY_PATH,
Deployment,
@@ -401,7 +401,7 @@ def _build_deployed_service(
env=env,
secret_env_keys=sorted(secret_env),
description=_resolve_description(config, svc),
behavior="daemon",
behavior=behavior_for_runner(run.runner),
stack=stack,
port=port,
health_path=health_path,