feat(api): kind-scoped deployment resolution

Resolve deployments by (name, kind) via the core per-kind stores / registry.get:
- get_service resolves a service-or-static; get_job a job; get_component returns
  the first kind for a name (the /services|/jobs|/tools/{name} endpoints are the
  unambiguous addresses). _save_deployment stores into the kind store, preferring
  the existing same-named deployment on a partial patch (can't derive kind from a
  partial payload). delete/set-enabled act across a name's kinds.
- All iterate-all loops use registry.all(); lookups use registry.get/named.
- services.py/logs.py resolve the managed deployment and use kind-aware unit names.
- mqtt registry (de)serialization keyed by composite "<kind>/<name>".
API + core suites green (85 + 182).
This commit is contained in:
2026-07-06 02:35:20 -07:00
parent c5cf3a1561
commit 315afe3f5f
8 changed files with 109 additions and 65 deletions

View File

@@ -42,7 +42,7 @@ def _remote_node_summary(hostname: str, remote: object) -> NodeSummary:
def _deployed_to_summaries(registry: object, hostname: str) -> list[DeploymentSummary]:
"""Convert deployed components from a registry into DeploymentSummary list."""
summaries = []
for name, d in registry.deployed.items():
for _kind, name, d in registry.all():
summaries.append(
DeploymentSummary(
id=name,