Parent
#24 — Spec: One typed seam through which all NAT state flows
What to build
The apply-a-mapping flow in auto-discover is implemented once instead of twice. A single sync_service(target, resolved) primitive absorbs the resolve-port → policy-route → mapping → register steps for both container and local targets (target is an enum parameterizing where the two currently diverge). Both the sync command path and the container-event path call the same primitive; the duplicate service-matching and registration logic between the two entry points is removed. The port-decision step sits behind an internal seam so a later port-authority change can swap it without touching callers. Behavior is unchanged from the operator's perspective.
Acceptance criteria
Blocked by
Parent
#24 — Spec: One typed seam through which all NAT state flows
What to build
The apply-a-mapping flow in auto-discover is implemented once instead of twice. A single
sync_service(target, resolved)primitive absorbs the resolve-port → policy-route → mapping → register steps for both container and local targets (target is an enum parameterizing where the two currently diverge). Both the sync command path and the container-event path call the same primitive; the duplicate service-matching and registration logic between the two entry points is removed. The port-decision step sits behind an internal seam so a later port-authority change can swap it without touching callers. Behavior is unchanged from the operator's perspective.Acceptance criteria
sync_service(target, resolved)primitive handles both container and local targets;sync_docker/sync_localduplication is removedsync_serviceis unit-tested with in-memory natmap and Consul adapters, covering docker and local targets and both entry pointsBlocked by