v2.2 task 01: put Route() in a new config/route.go (config.go is at the line limit); note

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 13:16:19 -07:00
co-authored by Claude Fable 5.1
parent 5de096a221
commit 4863e53eb8
2 changed files with 13 additions and 6 deletions
+9 -5
View File
@@ -17,9 +17,14 @@ instances never share a lease and each has its own usage row.
- Copy: `internal/config/config_v22_test.go` (its `TestWakeBroadcasts` belongs to task 02 and
will fail to compile until then — see step 2), `internal/proxy/template_test.go`,
`internal/admin/admin_template_test.go`
- Modify: `internal/config/config.go`, `internal/proxy/proxy.go`, `internal/admin/admin.go`,
`internal/admin/admin_ops.go`, `cmd/crossbar/main.go` (the identity middleware's route→peers
lookup), `docs/implementer-log.md`
- Create: `internal/config/route.go` — the template name pattern and `Route()` live here;
`config.go` is already at the 400-line limit, so add nothing to it beyond what the new file
needs from it (one-line hooks are fine)
- Modify: `internal/config/config.go` (minimal), `internal/proxy/proxy.go`,
`internal/admin/admin.go`, `internal/admin/admin_ops.go`, `cmd/crossbar/main.go` (the identity
middleware's route→peers lookup), `docs/implementer-log.md`. If `proxy.go` would pass 400
lines, move route resolution (`route`, `SplitRoute`, `allowedPath`) into a new
`internal/proxy/route.go`.
## Interfaces
@@ -56,7 +61,7 @@ Rules:
`go test -race -count=1 ./internal/proxy/ ./internal/admin/` for the behaviour, and `go vet
./internal/config/` will fail only on the missing `Addresses` method until task 02: that is
expected and is the one allowed red at the end of this task. Say so in the log row.
- [ ] **3.** `config.go`: the template regex, `Route()`. **4.** `proxy.go` route resolution.
- [ ] **3.** `config/route.go`: the template pattern, `Route()`; the validation in `config.go` accepts template names. **4.** `proxy.go` route resolution.
**5.** `admin.go` / `admin_ops.go`. **6.** `main.go`.
- [ ] **7.** `gofmt -w`; `go test -race -count=1 ./internal/proxy/ ./internal/admin/ ./internal/health/ ./internal/wake/` → `ok`.
- [ ] **8.** Row `v2.2/01-route-templates`; commit (the gate runs green after task 02).
@@ -75,4 +80,3 @@ git commit
## Stop and report if
- Passing needs a change to any earlier given test.
- The 400-line limit forces `proxy.go` apart: say which split you propose before doing it.