fix(agent): strip TOML array-of-tables routes too #485
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!485
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/route-entries-array-of-tables"
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?
Follow-up to #482, found by validating the shipped strip against real inputs instead of trusting synthetic fixtures.
The bug
stripManagedRoutesassertedcfg["routes"].([]any). TOML's array-of-tables formdecodes to
[]map[string]any, so the assertion failed, the function returned early, and the strip was a silent no-op on every config using that syntax.driftportwas left unprotected while the code reported success — the exact failure mode this feature exists to prevent, hiding inside the fix for it.The inline form (
routes = [{...}]) and plain string arrays both decode to[]any, which is why every synthetic fixture passed.How it surfaced
I fetched the actual wrangler config of all 22 enabled one-box apps and ran the strip over each.
driftportreported "nothing stripped" while its config plainly declared the hostname. That harness is included (realcfg_validation_test.go), self-skipping unlessFG_REALCFG_DIRis set, with a comment on how to build the corpus.Result after the fix
lazer.latchflow.iowhile losinglatchflow.io+www— selectivity proven on a real configfabforgedeclaresbeta.fab.forgegraf.comwhile the split ownsfab.forgegraf.com;playtrekandomnidat-applikewise declare beta/console subdomains;forgegraph's match is the explanatory comment #479 left behindnamewas touchedRegression tests added for both real-world TOML shapes. Needs an agent release (0.1.62) to reach the fleet; until then array-of-tables apps stay covered by the reconcile.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CMpzX1b6swjezEptw3T71f