diff --git a/docs/plans/v1/05-proxy.md b/docs/plans/v1/05-proxy.md index 414e5a3..b35361f 100644 --- a/docs/plans/v1/05-proxy.md +++ b/docs/plans/v1/05-proxy.md @@ -53,7 +53,11 @@ func (h *Hosts) SetDraining(name string, on bool) // Chooser adapts config, health and limiter to lease.Chooser using choose.Best: // Info{Healthy, Draining: false (the lease table already filtered), Loaded: model in Loaded, -// CanServe: cfg.Serves, Free: lim.FreeSlots(host), Queued: lim.Queued(host, model), Weight}. +// CanServe: cfg.Serves, Free: free slots FOR THIS MODEL on this host = +// cfg.Hosts[host].Models[model].Parallel - lim.InFlight(host, model) (never below 0; 0 when the +// host does not list the model), Queued: lim.Queued(host, model), Weight}. +// (Corrected 2026-09-25: an earlier version said lim.FreeSlots(host), which sums every model's +// slots and let a host win on slots the requested model cannot use.) func Chooser(cfg *config.Config, h *health.Table, l *limiter.Limiter) lease.Chooser func New(cfg *config.Config, h Health, leases *lease.Table, lim *limiter.Limiter, rec Recorder, log *slog.Logger) *Handler diff --git a/docs/plans/v1/08-smoke-readme.md b/docs/plans/v1/08-smoke-readme.md index c1334c4..7d45502 100644 --- a/docs/plans/v1/08-smoke-readme.md +++ b/docs/plans/v1/08-smoke-readme.md @@ -30,6 +30,13 @@ check failed and crossbar's log. A failure is a defect in tasks 01–07 **or in code only when a rule from an earlier task was broken; if the script's expectation contradicts a task rule, stop and report which. +- [ ] **1b. One known owner finding to fix before the smoke can pass.** `proxy.Chooser` + (task 05, `internal/proxy/hosts.go`) computes `Free` with `lim.FreeSlots(host)`, which sums the + slots of *every* model on the host; the rule now reads: `Free` = free slots **for the requested + model** = `cfg.Hosts[host].Models[model].Parallel - lim.InFlight(host, model)`, floored at 0, + and 0 when the host does not list the model. Make that change (only that), run + `go test -race -count=1 ./internal/proxy/` (must stay `ok`), then re-run `make smoke`. This is + the one code change this task makes; record it in Deviations as an owner-directed fix. - [ ] **2. Update `README.md`.** Keep the seven v0 sections; change: the intro (leases, not "first healthy host"); `## Configure` gets `db`, `lease_idle`, `retention`, `queue_max` in the table and the new `example.toml`; `## Point clients at it` adds the `X-Crossbar-Route` header @@ -40,7 +47,7 @@ task rule, stop and report which. - [ ] **3. Run the gate.** `make gate`. **4. Log and commit.** Row `v1/08-smoke-readme`, with the smoke line in Notes. ```sh -git add tools/smoke.sh cmd/fakeupstream/main.go README.md docs/implementer-log.md +git add tools/smoke.sh cmd/fakeupstream/main.go internal/proxy README.md docs/implementer-log.md git commit ``` diff --git a/docs/plans/v1/README.md b/docs/plans/v1/README.md index 7e64d12..1b52265 100644 --- a/docs/plans/v1/README.md +++ b/docs/plans/v1/README.md @@ -119,3 +119,9 @@ tools/run-plan.sh docs/plans/v1 # from a clean checkout on master "does not fail the gate", but `go vet ./...` compiles `main.go`, whose two-argument `admin.Handler` call no longer matches — the gate does fail. Ornith noticed while reading. Task fault (mine): step 5 now allows the one-call edit to `main.go`. +- 2026-09-25, task 08, first session: smoke check 1 sent conversation A to alpha, not beta. Cause: + my task 05 rule `Free: lim.FreeSlots(host)` sums a host's slots across all its models, so + alpha's six `small-9b` slots outscored beta's two `ornith` slots for an `ornith` request. The + smoke's expectation (per-model slots) is the right semantics. Task fault (mine): task 05's rule + is corrected and task 08 gained step 1b, the one code change allowed in it. Ornith had + diagnosed the summing correctly before it was stopped.