Repository navigation
fix(kind): the probe still called the pre-datasets job routes - #622
Merged
Merged
Conversation
Every job route became dataset-scoped when the datasets work landed
(2026-11-04). The kind probe was never migrated, so it has been calling routes
that do not exist — `POST /v1/orgs/{org}/jobs` and four more. There is no
org-level jobs route in the router at all; the only shapes are
`/v1/orgs/{org}/datasets/{ds}/jobs...`.
The probe's phase 5 had already been migrated for its `/runs` read, which is
why this looked partial rather than obviously stale.
Seven call sites, rewritten through `DS="default"` so the slug has one source
of truth: the five `${ORG}` job paths, phase 5's `${PORG}` job POST, and phase
5's `/runs` literal. `create_org` creates that dataset synchronously — "the
org's one dataset exists from its first moment" — so there is nothing to wait
for. Verified mechanically rather than by eye: every `/v1/` path the probe
asks for, normalised to the router's placeholder form, resolves to a declared
route, including `/v1/internal/attempts/{attempt_id}`.
**Why nothing caught it for two days.** kind.yml is nightly and deliberately
not a required check, and its 11-03 and 11-04 runs were `steps_sum=0`
no-starts from the Actions outage — so the first run that could report this was
2026-11-05, and that one was initially misread.
**A correction, in the same change.** When the probe's startup gate moved from
`/healthz` to `/readyz` earlier today, the comment claimed the literal gate was
"the likely cause" of that phase-1 failure. It was not. The api() diagnostics
added in the same breath are what produced the real answer on the next run:
check_kind: POST /v1/orgs/kindacme/jobs gave up after 5 tries — HTTP 404:
A 404 is the API answering, not a readiness problem. Waiting on a static
literal was a genuine bug and the fix stands on its own, but it was not this
bug, and the comment is corrected rather than left to become a premise. The
diagnostics are the part that earned their keep: the same failure previously
surfaced as a bare JSONDecodeError naming neither the request nor the status.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
pushed a commit
that referenced
this pull request
Nov 5, 2026
#622 fixed the probe calling `POST /v1/orgs/{org}/jobs`, a route that stopped existing when the datasets work made every job route dataset-scoped on 2026-11-04. That PR noted the gate belonged here, in the file this PR introduces, rather than duplicated alongside the fix. This is it. The bug was as cheap to detect as bugs get — a path that is right there in the router, or is not — and it survived two days because every instrument that could have caught it was the wrong shape: kind.yml is nightly and not a required check, two of its three runs were `steps_sum=0` outage no-starts, and the one that did report surfaced a 404 as a bare JSONDecodeError naming neither the request nor the status. So: extract every `/v1` path the probe calls, normalise its shell interpolations to the router's placeholder form, and require each one to be a route `er-server` actually declares. No cluster, no network, ~instant. Three properties that keep it from passing on nothing: - **`SUBST` is explicit and unmapped variables FAIL.** A silent fallback would turn an interpolation nobody taught it about into a false pass, which is the failure mode this whole file exists to prevent. - **Fewer than 20 routes parsed exits 2** — if the router's declaration shape changes, that is a broken extraction, not a clean bill of health. - **Zero probe call sites found exits 2.** The probe cannot be calling nothing. Observed failing against the real bug rather than a contrived one: regressing that one path back to its pre-datasets form gives FAIL the probe calls /v1/orgs/${ORG}/jobs, which normalises to /v1/orgs/{org}/jobs — no such route in er-server. It will 404. and the clean tree reports `(checked 8 probe paths against 114 routes)`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
pushed a commit
that referenced
this pull request
Nov 6, 2026
#622 fixed the probe calling `POST /v1/orgs/{org}/jobs`, a route that stopped existing when the datasets work made every job route dataset-scoped on 2026-11-04. That PR noted the gate belonged here, in the file this PR introduces, rather than duplicated alongside the fix. This is it. The bug was as cheap to detect as bugs get — a path that is right there in the router, or is not — and it survived two days because every instrument that could have caught it was the wrong shape: kind.yml is nightly and not a required check, two of its three runs were `steps_sum=0` outage no-starts, and the one that did report surfaced a 404 as a bare JSONDecodeError naming neither the request nor the status. So: extract every `/v1` path the probe calls, normalise its shell interpolations to the router's placeholder form, and require each one to be a route `er-server` actually declares. No cluster, no network, ~instant. Three properties that keep it from passing on nothing: - **`SUBST` is explicit and unmapped variables FAIL.** A silent fallback would turn an interpolation nobody taught it about into a false pass, which is the failure mode this whole file exists to prevent. - **Fewer than 20 routes parsed exits 2** — if the router's declaration shape changes, that is a broken extraction, not a clean bill of health. - **Zero probe call sites found exits 2.** The probe cannot be calling nothing. Observed failing against the real bug rather than a contrived one: regressing that one path back to its pre-datasets form gives FAIL the probe calls /v1/orgs/${ORG}/jobs, which normalises to /v1/orgs/{org}/jobs — no such route in er-server. It will 404. and the clean tree reports `(checked 8 probe paths against 114 routes)`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
added a commit
that referenced
this pull request
Nov 6, 2026
… left out) (#610) * test(kind): prove a task pod survives a colour cutover (the half PR13 left out) PR13 (#541) shipped the legibility half of "task pods survive a cutover" — the `er.dupezero.com/image-digest` annotation that makes a mid-deploy run legible — but not the proof half. This is the assertion the plan actually asked for. A task pod's ONLY route to the control plane is `svc/er-api` (`ER_SERVER_URL` in the task template is `http://er-api.<ns>.svc.cluster.local:8000`), so a cutover moves its heartbeats, claim renewals and finish call onto a different er-server process than the one that launched it. If that were visible to a running attempt, a deploy would fail paying work: a data-path failure caused by a serving-path deploy. Phase 6 flips `color.active` with a task in `running` and asserts the attempt did not notice: settles succeeded, `launches == 1`, and no termination_reason. `exec-task` has TWO unreachability windows, and getting the assertion right meant reading which one this phase can actually reach: step 1, work order 6 ticks x 10s = 60s, then control_plane_unreachable, exit 3, charged to the launch budget. A task already running is PAST this; a sibling that launches after the flip is not. heartbeat thread posts every 30s, fences after 3 consecutive transport misses (~90s). Step 6 then refuses to post a verdict and writes `fenced` — the work completed and the result is discarded, which is the expensive one. So the assertion is `termination_reason is None`, not a single named reason. Asserting only `!= "control_plane_unreachable"` would have been decoration: it is unreachable in the window this phase creates, so the guard could not have fired no matter what the cutover did. `is None` covers fenced, sigterm, stale_start, structural_mismatch and control_plane_unreachable together, and a succeeded task carries no reason — every writer of the field in er-server (`skipped`, `control_error`, `config`, `heartbeat_timeout`, `no_terminal_record`, `DeadlineExceeded`, `build_skew`) is a failure path. Distinct from phase 2 in what it exercises. The dispatcher is not coloured and does not restart here, so adoption is not involved; what is proved is that the attempt's callback path is stateless across the two pods. Three things done so the phase cannot pass having proved nothing: - **It refuses a pre-colour chart.** An empty `er.dupezero.com/color` selector on `svc/er-api` fails the phase outright, rather than flipping nothing and asserting a task succeeded. Observed firing against the stale local kind release, which is still on a pre-PR9 chart. - **It asserts the selector actually moved** after the flip, so a no-op upgrade is a failure rather than a pass. - **`termination_reason` is read by subscript, not `.get()`**, so a renamed or dropped field raises KeyError instead of passing on a `None` that only means "no such key". It restores the release afterwards (flip back, then retire — the reverse order would blackhole the Service for the length of the scale-down), so the probe stays re-runnable and a later `kind_env.sh up` does not inherit a surprising active colour. Note the probe's own port-forward is unaffected and that is not a gap: `kubectl port-forward svc/...` resolves to one pod when the stream opens and does not re-resolve, so its reads keep landing on the old colour — which still runs, because retiring it is the deploy's third phase. Both colours read the same Postgres. The flip is proved by the selector assertion, not by where curl lands. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(kind): mutation-test the probe's assertions on every PR that touches them Phase 6 was nearly shipped with an assertion that could not fail, and the two-hour nightly run would have reported green. This makes that class of mistake catchable in about a second. The assertion was `termination_reason != "control_plane_unreachable"` on a task caught in `running`. Reading exec_task.rs afterwards: that reason is written at exactly ONE site, the step-1 work-order loop, which a running task has already passed. The reachable mid-run failure is `fenced`, from the heartbeat thread after three missed posts. So the guard's precondition could not hold. Why a per-PR test rather than trusting the nightly: **an assertion that can no longer fail makes the probe GREENER, not redder**, so the nightly cannot detect its own neutering. And the probe is the least-exercised correctness-critical code here — a cluster, an image build and two hours, once a day. `scripts/ci/kind-assertions-test.sh`, following the `tf-helpers-test.sh` / `merge-bus-test.sh` pattern: - Every embedded assertion block must compile. Cheap coverage for the phases this does not mutate, whose syntax errors would otherwise surface two hours in, after five phases of real work. - Ten mutants of the phase 6 ledger — `fenced`, `control_plane_unreachable`, `sigterm`, `stale_start`, a relaunch, a non-succeeded state, a missing field, an empty live set, and one bad row among good ones. Each must be REFUSED; a mutant that still exits 0 is an assertion that cannot discriminate. - The three bash guards must still be present (textual, deliberately: proving those work costs a cluster, but proving nobody deleted them is free). - Exits 2 if it finds fewer than two blocks to examine — rename detection, so a changed heredoc shape cannot read as a pass. The blocks are EXTRACTED from check_kind.sh, never transcribed; a copy would be a second source of truth, and the drift would show up as this test passing against code the probe no longer runs. **The test was mutation-tested itself**, which is what found the one real gap. Narrowing the assertion back to the unreachable reason, deleting a bash guard, and breaking the heredoc shape were all caught. Deleting the `"termination_reason" in t` guard was NOT: the subscript beside it raises KeyError anyway, so it is a behaviourally equivalent mutant and no exit code can distinguish it. What that guard actually buys is the diagnosis — a named AssertionError about the ledger shape instead of a bare KeyError traceback surfacing two hours into a nightly. So that case now asserts the message, not just the refusal, and the mutant is caught. Wiring: a `pull_request` trigger with a `paths:` filter, plus a new `assertions` job; `probe` gains `if: github.event_name != 'pull_request'` so the 2h run never fires on a PR. The `paths:` filter is safe ONLY because nothing in this workflow is a required status check — on rust.yml or frontend.yml the same filter would leave a required context permanently unreported, which is why those use a `detect` job instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(kind): check the probe's routes against the router, per-PR #622 fixed the probe calling `POST /v1/orgs/{org}/jobs`, a route that stopped existing when the datasets work made every job route dataset-scoped on 2026-11-04. That PR noted the gate belonged here, in the file this PR introduces, rather than duplicated alongside the fix. This is it. The bug was as cheap to detect as bugs get — a path that is right there in the router, or is not — and it survived two days because every instrument that could have caught it was the wrong shape: kind.yml is nightly and not a required check, two of its three runs were `steps_sum=0` outage no-starts, and the one that did report surfaced a 404 as a bare JSONDecodeError naming neither the request nor the status. So: extract every `/v1` path the probe calls, normalise its shell interpolations to the router's placeholder form, and require each one to be a route `er-server` actually declares. No cluster, no network, ~instant. Three properties that keep it from passing on nothing: - **`SUBST` is explicit and unmapped variables FAIL.** A silent fallback would turn an interpolation nobody taught it about into a false pass, which is the failure mode this whole file exists to prevent. - **Fewer than 20 routes parsed exits 2** — if the router's declaration shape changes, that is a broken extraction, not a clean bill of health. - **Zero probe call sites found exits 2.** The probe cannot be calling nothing. Observed failing against the real bug rather than a contrived one: regressing that one path back to its pre-datasets form gives FAIL the probe calls /v1/orgs/${ORG}/jobs, which normalises to /v1/orgs/{org}/jobs — no such route in er-server. It will 404. and the clean tree reports `(checked 8 probe paths against 114 routes)`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(kind): phase 6 needs three pods the CPU budget never counted #624 made a task pod schedulable by dropping the executor classes from a full CPU to 250m, against a steady state of 1.55 on a 2-vCPU runner. That is sufficient for phases 1 to 5, which add exactly one pod. It is not sufficient for phase 6, which is the only phase that adds three: the idle colour's web-api scaled to replicas: 1 for the cutover a task pod caught mid-attempt, by design er-schema-migrate a PRE-UPGRADE hook, so every `helm upgrade` re-fires it — including the `color.active` flip that happens while the task is in flight At the old numbers that peaks at 2.15 of ~2.0, and the pod that loses is whichever asks last. The symptom would have been a five-minute `helm --wait` timeout or a 420s wait on a job whose pod never started — the same misattribution that made #624 take three runs to find, since a Pending pod reports as a timeout about a job rather than as a scheduling refusal. Three changes, none of which raises the ceiling by guesswork: `values-kind.yaml` trims the api and dispatcher CPU REQUESTS to 100m. That is the lever rather than the executor classes because three pods carry it during phase 6 and only one carries a class. Requests only — the limits stay at the chart's `cpu: "1"`, so a 100m er-server still bursts to a full core and `ensure_schema` is untouched. Verified by rendering the profile: requests 100m, limits 1, memory limits intact. Steady state 1.25, phase 6 peak 1.70. `check_kind.sh` gains a `cpu_budget` helper and asserts the 450m phase 6 needs BEFORE the phase runs, so an over-committed node fails with both figures in one sentence instead of as a timeout several minutes later. It also logs the budget unconditionally rather than only on failure: #624 added that diagnostic under `if: failure()`, which means a green run never records allocatable CPU — and the budget is precisely the number that has to be re-derived every time this moves. Tested against a live kind cluster, where it reproduced the `cpu 1550m` that `kubectl describe node` reports. `kind-assertions-test.sh` adds the preflight to its list of textual guards. Deleting that assertion does not make phase 6 fail; it makes phase 6 fail later and about something else, so its removal is invisible to every other check here. Observed failing against a mutant, with the substitution count asserted so a regex that matched nothing could not pass. er-db-migrate is deliberately absent from the sums: it is guarded by `web.enabled`, off in this profile. Checked by rendering, not assumed. --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
athvin
pushed a commit
that referenced
this pull request
Nov 8, 2026
…tory The header's premise — never observed failing, so not trusted — went stale: the probe failed four times for four distinct causes (#614, #622, #624, #610) and has now passed twice on main (2026-11-07 nightly 42348330935, 2026-11-08 dispatch 42447724542, all six phases both times). The decision stands, restated on cost grounds: the in-job release-image build is the wrong price for a PR gate and the per-PR assertions job covers the cheap half. The timeout comment gains the measured end-to-end timings (28m42s, 33m51s of the 120 budget) that settle #655's step 2 without a raise.
athvin
added a commit
that referenced
this pull request
Nov 8, 2026
…tory (#655) * wip: claim #655 — first green kind probe run * docs(kind): restate the probe's not-required decision on observed history The header's premise — never observed failing, so not trusted — went stale: the probe failed four times for four distinct causes (#614, #622, #624, #610) and has now passed twice on main (2026-11-07 nightly 42348330935, 2026-11-08 dispatch 42447724542, all six phases both times). The decision stands, restated on cost grounds: the in-job release-image build is the wrong price for a PR gate and the per-PR assertions job covers the cheap half. The timeout comment gains the measured end-to-end timings (28m42s, 33m51s of the 120 budget) that settle #655's step 2 without a raise. --------- Co-authored-by: bmoore813 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every job route became dataset-scoped when the datasets work landed (2026-11-04). The kind probe was never migrated, so it has been calling routes that do not exist. There is no org-level jobs route in the router at all:
The probe's phase 5 had already been migrated for its
/runsread, which is why this looked partial rather than obviously stale.The fix
Seven call sites, rewritten through
DS="default"so the slug has one source of truth: the five${ORG}job paths, phase 5's${PORG}job POST, and phase 5's/runsliteral.create_orgcreates that dataset synchronously — "the org's one dataset exists from its first moment" — so there is nothing to wait for.Verified mechanically rather than by eye. Every
/v1/path the probe asks for, normalised to the router's placeholder form:Why nothing caught it for two days
kind.ymlis nightly and deliberately not a required check, and its 11-03 and 11-04 runs weresteps_sum=0no-starts from the Actions outage. So the first run that could report this was 2026-11-05 — and that one was initially misread, which is the other half of this PR.A correction, in the same change
When the probe's startup gate moved from
/healthzto/readyzearlier today (#614), the comment claimed the literal gate was "the likely cause" of that phase-1 failure. It was not. Theapi()diagnostics added in the same breath are what produced the real answer on the very next run:A 404 is the API answering, not a readiness problem. Waiting on a static literal was a genuine bug and that fix stands on its own — but it was not this bug, and the comment is corrected rather than left to become a premise.
The diagnostics are the part that earned their keep. The same failure previously surfaced as a bare
JSONDecodeErrornaming neither the request nor the status; three hours later it named both.Follow-on
A gate belongs here: the probe's
/v1/paths should be checked against the router's declared routes, which is the mechanical check run above by hand. That goes inscripts/ci/kind-assertions-test.sh, which #610 introduces — so it lands there once this and #610 are both in, rather than duplicating the file.This unblocks #610's phase-6 verification: the probe cannot reach phase 6 while phase 1 404s.
🤖 Generated with Claude Code