feat(traffic): reconcile one-box hostnames back onto the router every tick #458
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!458
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/onebox-hostname-reconcile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the domain-steal path the agent-side strip (#428 / agent 0.1.57) deliberately leaves open: a production deploy of an app whose wrangler config declares its own domains re-attaches them to the app worker — the config
namematches the target, so the override strip does not fire — and one-box silently stops routing while still reporting weights. This is live-relevant today: habitplay's wrangler.jsonc declares habitplay.io+www, so its next production deploy would steal both back fromhabit-app-router.Mechanism:
tickTrafficLifecyclesnow ends each sweep (at most every 5 min) by re-assertinghostnames → routerfor every enabled split inidle/baking/failedwhose state settled ≥2 min ago (draining/shifting are excluded — the shift machinery owns the binding mid-flight). A foreign attachment is moved back via delete-then-ensure with restore-on-failure (therebindHostnamescontract, so a CF hiccup can't leave a hostname dark), and a hostname attached to nothing — how habitplay.io went down — is re-created. Moves land astraffic.hostnames_reconciledevents; failures astraffic.reconcile_failed, retried next sweep. One CF listing per workspace per sweep.6 new tests (3 router-level, 3 tick-level); 16/16 lifecycle + 41/41 router suites green; tsc clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CMpzX1b6swjezEptw3T71f
Preview environment is live: https://pr-458-forgegraph.forgegraf.com
Deployed
e10d723cwith the beta stage's environment. It redeploys on every push and is destroyed when this PR closes.