From 8814902999dc50e2006eff92be229616babb325f Mon Sep 17 00:00:00 2001 From: anti Date: Sun, 26 Apr 2026 21:08:44 -0400 Subject: [PATCH] docs(api): clarify fleet_deckies + JSON dual-write happens in engine.deployer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unihost API path delegates to engine.deployer.deploy(), which now writes both decnet-state.json (existing) and the fleet_deckies DB table (added in 646aeec). Comment makes the single-sink design explicit so future maintainers don't add a parallel save_state / upsert_fleet_decky call here. No behavioral change — every fleet-creation path on every host (CLI deploy, this unihost API path, and per-worker SWARM agent deploys) already routes through the engine.deployer single sink. --- decnet/web/router/fleet/api_deploy_deckies.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decnet/web/router/fleet/api_deploy_deckies.py b/decnet/web/router/fleet/api_deploy_deckies.py index 9994981d..1263c672 100644 --- a/decnet/web/router/fleet/api_deploy_deckies.py +++ b/decnet/web/router/fleet/api_deploy_deckies.py @@ -160,6 +160,11 @@ async def api_deploy_deckies(req: DeployIniRequest, admin: dict = Depends(requir } # Unihost path — docker-compose on the master itself. + # NB: the JSON state file (decnet-state.json) and fleet_deckies DB rows + # are both written *inside* _deploy(config) — engine.deployer is the + # single shared sink for every fleet-creation path (CLI deploy, this + # unihost API path, and per-worker SWARM agent deploys). Do not + # duplicate save_state / fleet upserts here. try: if os.environ.get("DECNET_CONTRACT_TEST") != "true": _deploy(config)