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:
@@ -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
|
- 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`,
|
will fail to compile until then — see step 2), `internal/proxy/template_test.go`,
|
||||||
`internal/admin/admin_template_test.go`
|
`internal/admin/admin_template_test.go`
|
||||||
- Modify: `internal/config/config.go`, `internal/proxy/proxy.go`, `internal/admin/admin.go`,
|
- Create: `internal/config/route.go` — the template name pattern and `Route()` live here;
|
||||||
`internal/admin/admin_ops.go`, `cmd/crossbar/main.go` (the identity middleware's route→peers
|
`config.go` is already at the 400-line limit, so add nothing to it beyond what the new file
|
||||||
lookup), `docs/implementer-log.md`
|
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
|
## Interfaces
|
||||||
|
|
||||||
@@ -56,7 +61,7 @@ Rules:
|
|||||||
`go test -race -count=1 ./internal/proxy/ ./internal/admin/` for the behaviour, and `go vet
|
`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
|
./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.
|
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`.
|
**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`.
|
- [ ] **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).
|
- [ ] **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
|
## Stop and report if
|
||||||
|
|
||||||
- Passing needs a change to any earlier given test.
|
- 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.
|
|
||||||
|
|||||||
@@ -27,4 +27,7 @@ intended reasons.
|
|||||||
|
|
||||||
## Changes during the run
|
## Changes during the run
|
||||||
|
|
||||||
(none yet)
|
- 2026-09-25, task 01, first session: ten minutes circling the line budget — `config.go` was
|
||||||
|
already at 401 lines and the task named no new file for the package. Owner fault: the task now
|
||||||
|
creates `internal/config/route.go` (and allows `internal/proxy/route.go`). Session stopped and
|
||||||
|
restarted on a clean tree.
|
||||||
|
|||||||
Reference in New Issue
Block a user