From 635b16bcca2dadea3ba55373d9e9a735cd5015b2 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 25 Sep 2026 03:21:45 -0700 Subject: [PATCH] v1 plan: gofmt the given test files (gate walks docs/ too); note the finding Co-Authored-By: Claude Fable 5.1 --- docs/plans/v1/README.md | 8 ++++++++ docs/plans/v1/_files/internal/admin/admin_test.go | 6 +++--- docs/plans/v1/_files/internal/choose/choose_test.go | 8 ++++---- docs/plans/v1/_files/internal/proxy/proxy_test.go | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/plans/v1/README.md b/docs/plans/v1/README.md index 0365496..aa00e99 100644 --- a/docs/plans/v1/README.md +++ b/docs/plans/v1/README.md @@ -59,3 +59,11 @@ tools/run-plan.sh docs/plans/v1 # from a clean checkout on master requests are being recorded. 5. Every `.(` type assertion in `internal/` is the two-value form or on a value we constructed. 6. Findings under "Reviews" in `docs/implementer-log.md`, by fault (model / task / test). + +## Changes during the run + +- 2026-09-25, task 01, first attempt: three given test files under `_files/` were not `gofmt`-clean, + and the gate's `gofmt -l .` walks every file, so the gate failed on files the implementer may + not edit. Ornith diagnosed it (gofmt on its own code was clean) and did not touch them. + Owner's fault (the compile check ran `go vet`, not `gofmt`, on the given files). Fixed by + formatting the given files; the plan checklist now includes `gofmt -l docs/` before handover. diff --git a/docs/plans/v1/_files/internal/admin/admin_test.go b/docs/plans/v1/_files/internal/admin/admin_test.go index f85cc4d..5c4be9f 100644 --- a/docs/plans/v1/_files/internal/admin/admin_test.go +++ b/docs/plans/v1/_files/internal/admin/admin_test.go @@ -25,9 +25,9 @@ type fakeHosts struct { } func (f *fakeHosts) All() map[string]health.Status { return f.st } -func (f *fakeHosts) Healthy(n string) bool { return f.st[n].Healthy } -func (f *fakeHosts) Draining(n string) bool { return f.draining[n] } -func (f *fakeHosts) SetDraining(n string, on bool) { f.draining[n] = on } +func (f *fakeHosts) Healthy(n string) bool { return f.st[n].Healthy } +func (f *fakeHosts) Draining(n string) bool { return f.draining[n] } +func (f *fakeHosts) SetDraining(n string, on bool) { f.draining[n] = on } func (f *fakeHosts) Choose(c []string, model string) (string, bool) { for _, h := range c { if f.st[h].Healthy && !f.draining[h] { diff --git a/docs/plans/v1/_files/internal/choose/choose_test.go b/docs/plans/v1/_files/internal/choose/choose_test.go index 1af398e..691b381 100644 --- a/docs/plans/v1/_files/internal/choose/choose_test.go +++ b/docs/plans/v1/_files/internal/choose/choose_test.go @@ -60,10 +60,10 @@ func TestFallsBackToCapableHost(t *testing.T) { func TestSkipsUnhealthyDrainingUnknownAndFull(t *testing.T) { info := infoFor(map[string]choose.Info{ - "down": {Healthy: false, Loaded: true, CanServe: true, Free: 9, Weight: 9}, - "drain": {Healthy: true, Draining: true, Loaded: true, CanServe: true, Free: 9, Weight: 9}, - "full": {Healthy: true, Loaded: true, CanServe: true, Free: 0, Weight: 9, Queued: 0}, - "ok": {Healthy: true, Loaded: true, CanServe: true, Free: 1, Weight: 1}, + "down": {Healthy: false, Loaded: true, CanServe: true, Free: 9, Weight: 9}, + "drain": {Healthy: true, Draining: true, Loaded: true, CanServe: true, Free: 9, Weight: 9}, + "full": {Healthy: true, Loaded: true, CanServe: true, Free: 0, Weight: 9, Queued: 0}, + "ok": {Healthy: true, Loaded: true, CanServe: true, Free: 1, Weight: 1}, }) got, ok := choose.Best([]string{"down", "drain", "missing", "full", "ok"}, info) if !ok || got != "ok" { diff --git a/docs/plans/v1/_files/internal/proxy/proxy_test.go b/docs/plans/v1/_files/internal/proxy/proxy_test.go index cf33fcc..f467b05 100644 --- a/docs/plans/v1/_files/internal/proxy/proxy_test.go +++ b/docs/plans/v1/_files/internal/proxy/proxy_test.go @@ -290,7 +290,7 @@ func TestUnhealthyHostReleasesAndMoves(t *testing.T) { func TestAccountingRowsFromUsageAndTimings(t *testing.T) { alpha, beta := newUpstream(t, "alpha"), newUpstream(t, "beta") r := newRig(t, twoHosts, alpha, beta) - drain(r.post("/r/v1/chat/completions", conversation(1, 1))) // non-streamed + drain(r.post("/r/v1/chat/completions", conversation(1, 1))) // non-streamed drain(r.post("/r/v1/chat/completions", strings.Replace(conversation(1, 2), `"stream":false`, `"stream":true`, 1))) // streamed deadline := time.Now().Add(2 * time.Second) var rows []store.UsageRow