The simulator API handlers AddNode and UpdateNode only logged that a node
"will be synced to registry on next periodic sync" — they held a
registryBridge field but had no RegistryNodeAdapter to pass to
SyncToRegistry, so new nodes waited up to 30s for the periodic ticker
before reaching the fleet registry.
Wire the missing half:
- SimulatorHandler gains a registryAdapter (simulator.RegistryNodeAdapter)
field threaded into NewSimulatorHandler.
- AddNode calls registryBridge.SyncToRegistry(adapter) right after
CreateVirtualNode succeeds; UpdateNode does the same after
UpdateNodePosition succeeds. Both run outside the handler lock.
- main.go adds fleetRegistryAdapter (adapts *fleet.Registry to the
simulator interface, converting fleet.NodeRecord <-> simulator.NodeRecord),
shared by the immediate syncs and the 30s periodic ticker (which stays
as a safety net).
New table-driven TestImmediateSyncOnAddAndUpdate covers both the wired and
nil-adapter no-op paths.
Co-Authored-By: Claude <noreply@anthropic.com>