Symptom

A Server.LLM node created with swarmEnabled=true and a costScoreSource pointing at a DataPoint/Calculation never bid on any Swarm.Work. The work sat OPEN forever with no error anywhere. Reading the node back showed costScore: -1.0, advertisedAt: 0, and — even though the POST body included sources: [<solarCost>, <daylight>]sources: []. Pressing the node’s ADVERTISE action once fixed it immediately: costScore became a real number and the node started winning auctions. Nothing in the create path did the equivalent of pressing that button, and nothing persisted the sources wiring the client had posted.

Root cause

Two independent defects that compounded:

1. costScore starts at -1 and nothing folds it at create time. SwarmAdvert.effectiveCost returns the stored costScore whenever costScoreSource != null, and that field defaults to -1. SwarmAdvert.isAccepting then rejects any effectiveCost < 0. The only code path that ever recomputes costScore from the wired source is ServerLLMProcessor.republishAdvert, invoked solely by an explicit ADVERTISE action or by the source itself firing dispatchExecute. Node creation triggered neither.

2. sources were silently dropped on every Server.LLM create. ServerNodeManager.update() runs newly-created child metadata through NodeMetaData.resolveCreatedChildWiring(), whose job is to stop a node from auto- or explicitly-observing a non-data-emitting Project/Server parent (a Project dropped under a Server, or any node dropped under a Project, must not treat that parent as a source). The check for this was nodeType is KrillApp.Server || parentType is KrillApp.Server. Since every Server.LLM (like Server.Pin / Server.SerialDevice) is a child of an actual Server node in the tree, parentType is KrillApp.Server was true for every LLM node, all the time — not just when the client tried to name the Server itself as a source. When true, the old code called clearedWiring(), which wipes all of sources/invocationTriggers unconditionally, not just a reference to the parent. So an LLM’s costScoreSource/acceptWindowSource wake-wiring — which has nothing to do with observing the Server parent — was nuked on every single creation.

Fix

Prevention