v1 plan: gofmt the given test files (gate walks docs/ too); note the finding
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -59,3 +59,11 @@ tools/run-plan.sh docs/plans/v1 # from a clean checkout on master
|
|||||||
requests are being recorded.
|
requests are being recorded.
|
||||||
5. Every `.(` type assertion in `internal/` is the two-value form or on a value we constructed.
|
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).
|
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.
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ type fakeHosts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *fakeHosts) All() map[string]health.Status { return f.st }
|
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) Healthy(n string) bool { return f.st[n].Healthy }
|
||||||
func (f *fakeHosts) Draining(n string) bool { return f.draining[n] }
|
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) SetDraining(n string, on bool) { f.draining[n] = on }
|
||||||
func (f *fakeHosts) Choose(c []string, model string) (string, bool) {
|
func (f *fakeHosts) Choose(c []string, model string) (string, bool) {
|
||||||
for _, h := range c {
|
for _, h := range c {
|
||||||
if f.st[h].Healthy && !f.draining[h] {
|
if f.st[h].Healthy && !f.draining[h] {
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ func TestFallsBackToCapableHost(t *testing.T) {
|
|||||||
|
|
||||||
func TestSkipsUnhealthyDrainingUnknownAndFull(t *testing.T) {
|
func TestSkipsUnhealthyDrainingUnknownAndFull(t *testing.T) {
|
||||||
info := infoFor(map[string]choose.Info{
|
info := infoFor(map[string]choose.Info{
|
||||||
"down": {Healthy: false, Loaded: true, CanServe: true, Free: 9, Weight: 9},
|
"down": {Healthy: false, Loaded: true, CanServe: true, Free: 9, Weight: 9},
|
||||||
"drain": {Healthy: true, Draining: true, 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},
|
"full": {Healthy: true, Loaded: true, CanServe: true, Free: 0, Weight: 9, Queued: 0},
|
||||||
"ok": {Healthy: true, Loaded: true, CanServe: true, Free: 1, Weight: 1},
|
"ok": {Healthy: true, Loaded: true, CanServe: true, Free: 1, Weight: 1},
|
||||||
})
|
})
|
||||||
got, ok := choose.Best([]string{"down", "drain", "missing", "full", "ok"}, info)
|
got, ok := choose.Best([]string{"down", "drain", "missing", "full", "ok"}, info)
|
||||||
if !ok || got != "ok" {
|
if !ok || got != "ok" {
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ func TestUnhealthyHostReleasesAndMoves(t *testing.T) {
|
|||||||
func TestAccountingRowsFromUsageAndTimings(t *testing.T) {
|
func TestAccountingRowsFromUsageAndTimings(t *testing.T) {
|
||||||
alpha, beta := newUpstream(t, "alpha"), newUpstream(t, "beta")
|
alpha, beta := newUpstream(t, "alpha"), newUpstream(t, "beta")
|
||||||
r := newRig(t, twoHosts, alpha, 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
|
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)
|
deadline := time.Now().Add(2 * time.Second)
|
||||||
var rows []store.UsageRow
|
var rows []store.UsageRow
|
||||||
|
|||||||
Reference in New Issue
Block a user