Repository navigation
fix(kind): phase 6's guard refused the very success it was checking for - #742
Merged
Merged
Conversation
The kind probe's fifth distinct cause, and the second time this one assertion
has been wrong. Phases 1-5 now pass; phase 6 reached "traffic moved blue ->
green with a task in flight" and then failed with
AssertionError: reconcile_schema: the cutover was visible to the attempt
(termination_reason='Completed', error_detail=None)
A PROBE BUG, NOT A PRODUCT FAILURE. The guard was
`assert t["termination_reason"] is None`, resting on a comment that said "a
succeeded task carries no reason at all". That is false. `exec-task` posts its
verdict with `termination_reason: None`, and then the executor's pod watch
annotates the already-succeeded row with the POD's terminated reason —
`record_evidence`, whose SQL is guarded `state IN ('succeeded','skipped')` —
and Kubernetes' reason for a container that exits 0 is the literal
"Completed". So the guard failed the phase for succeeding.
It is also a RACE, which is why `== "Completed"` would be flaky rather than
correct: the annotation lands after the verdict, so a read legitimately sees
either value. Both mean undisrupted.
The fix is an ALLOWLIST of undisrupted values — `(None, "Completed")` — not a
denylist of today's failure reasons. A denylist would silently accept any
reason added to exec_task.rs later, which is the defect where an omission
reads as permission. Plus an `exit_code in (None, 0)` assertion, so
"Completed" is corroborated by the pod's exit status rather than trusted: that
reason is the pod's, and a succeeded row carrying a nonzero exit is incoherent
however it got there.
Verified against the real failed row (state succeeded, live, launches 1,
termination_reason 'Completed') — accepted on both sides of the annotation
race.
WHY THE FIXTURE TEST DID NOT CATCH THIS. `kind-assertions-test.sh` extracts
the real block rather than copying it, which is right, but its `row()` default
was `termination_reason: None` — it modelled the moment before annotation and
never the steady state. So it green-lit a guard the live ledger could not
satisfy, which is the same shape as the full-stack tier findings: the fixture
asserted the probe's belief rather than the system's behaviour. The default
now models the ANNOTATED row, with the unannotated shape kept as its own case
so the race is covered in both directions, plus cases refusing an unknown
future reason and a nonzero exit.
Mutation-tested: reverting to `is None`, widening the allowlist to accept
everything, and dropping the exit_code corroboration are each caught.
Two findings recorded while here, neither needing a change:
- `allocatable` is 4000m, not the ~2000m every CPU sum in this probe and in
values-kind.yaml assumes — the public-repo switch moved `ubuntu-latest` to
4 vCPU. Phase 6 needed 450m with 2750m free, so CPU has stopped being the
constraint and the 100m/250m request trims made for the 2-vCPU ceiling are
now merely conservative. The `log_cpu_budget` line added for exactly this
purpose is what reported it.
- The OTel export errors filling the log are expected: kind runs no collector,
and they are not the failure.
The success line no longer claims "no control_plane_unreachable" — the reason
the FIRST version of this guard wrongly keyed on, and one a running attempt
cannot reach. A green line asserting the wrong thing is how that version
survived review.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
5 tasks done
athvin
pushed a commit
that referenced
this pull request
Nov 7, 2026
Closes #638, which is a decision rather than an implementation. Records it beside Phase 4, where #645 can act on it. Option 1 adopted: anything needing real job execution points at kind, and `make run` plus the host dev stack keep the API-only work they already do. Option 3 is refused on §13's own words — "a local or in-process executor, an `ER_EXECUTOR` flag, or any production path other than `er-server exec-task` in a Kubernetes Job" — so promoting `FakePodApi` or the observer's `Scripted` is not available. Two things the tree said that the ticket did not. The blocker was never the flag. `ER_DISPATCH_IN_PROCESS` is assigned NOWHERE — every occurrence is prose or a comment — and up.sh already starts `er-dispatcher` as its own host process, so local dev already runs Phase 4's topology. What the phase actually removes locally is the executor's only route to a `PodApi`: `executor::from_env`'s third `return (None, None)` needs `KubeApi::in_cluster`. Three documents still claimed otherwise and are fixed here — the infra-platform skill ("survives only in local dev (`make run`)"), frontend-testing.md ("er-server runs the dispatcher in-process"), and this file's own "`make run` … loses `ER_DISPATCH_IN_PROCESS` in Phase 4". And Option 2 is narrower than the ticket assumes. It offers CLI-seeded rows as cheap "if the tier only reads rows, which its comment suggests". It does not: `grow-your-data.spec.ts` creates a source named at runtime, clicks `wizard-activate-run`, waits out `waitForQuietQueue(page, 780_000)` and asserts `["run_all_incremental", "run_all_full", "train"]` are all `succeeded`. There is no row to pre-seed for a source that does not exist until the spec makes it. Seeding covers four of the five full-stack specs — three read rows and `run-the-business` asserts a 409 refusal — and the fifth needs a cluster. That is sized as its own ticket rather than folded into the Phase 4 deletion, since the engine-side handoff it exercises is already covered by the kind probe's pipeline phase as seven pods; what is at stake is the UI journey. Also corrects the kind probe's phase count, which this file had at five. There are six, and the sixth is not bookkeeping: it flips `svc/er-api` between colours under an in-flight attempt, proving a serving-path deploy does not fail paying work. Its guard was fixed in #742 after it refused the very success it was checking for. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
added a commit
that referenced
this pull request
Nov 7, 2026
#638) (#746) * wip: claim #638 — decide how local dev runs jobs after Phase 4 * docs(batch): decide how local development runs jobs once Phase 4 lands Closes #638, which is a decision rather than an implementation. Records it beside Phase 4, where #645 can act on it. Option 1 adopted: anything needing real job execution points at kind, and `make run` plus the host dev stack keep the API-only work they already do. Option 3 is refused on §13's own words — "a local or in-process executor, an `ER_EXECUTOR` flag, or any production path other than `er-server exec-task` in a Kubernetes Job" — so promoting `FakePodApi` or the observer's `Scripted` is not available. Two things the tree said that the ticket did not. The blocker was never the flag. `ER_DISPATCH_IN_PROCESS` is assigned NOWHERE — every occurrence is prose or a comment — and up.sh already starts `er-dispatcher` as its own host process, so local dev already runs Phase 4's topology. What the phase actually removes locally is the executor's only route to a `PodApi`: `executor::from_env`'s third `return (None, None)` needs `KubeApi::in_cluster`. Three documents still claimed otherwise and are fixed here — the infra-platform skill ("survives only in local dev (`make run`)"), frontend-testing.md ("er-server runs the dispatcher in-process"), and this file's own "`make run` … loses `ER_DISPATCH_IN_PROCESS` in Phase 4". And Option 2 is narrower than the ticket assumes. It offers CLI-seeded rows as cheap "if the tier only reads rows, which its comment suggests". It does not: `grow-your-data.spec.ts` creates a source named at runtime, clicks `wizard-activate-run`, waits out `waitForQuietQueue(page, 780_000)` and asserts `["run_all_incremental", "run_all_full", "train"]` are all `succeeded`. There is no row to pre-seed for a source that does not exist until the spec makes it. Seeding covers four of the five full-stack specs — three read rows and `run-the-business` asserts a 409 refusal — and the fifth needs a cluster. That is sized as its own ticket rather than folded into the Phase 4 deletion, since the engine-side handoff it exercises is already covered by the kind probe's pipeline phase as seven pods; what is at stake is the UI journey. Also corrects the kind probe's phase count, which this file had at five. There are six, and the sixth is not bookkeeping: it flips `svc/er-api` between colours under an in-flight attempt, proving a serving-path deploy does not fail paying work. Its guard was fixed in #742 after it refused the very success it was checking for. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[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.
Finishes the last open item from #740/#741. The kind probe's fifth distinct cause — and the second time this one assertion has been wrong.
Phases 1–5 now pass. Phase 6 reached
traffic moved blue -> green with a task in flightand then failed:A probe bug, not a product failure
The guard was
assert t["termination_reason"] is None, resting on a comment that said "a succeeded task carries no reason at all." That is false, and the source settles it:exec-taskposts its verdict withtermination_reason: None(exec_task.rs:466/490/518).record_evidence, whose SQL is guardedstate IN ('succeeded','skipped').Completed.So the guard failed the phase for succeeding.
Completedappears nowhere in the Rust source, which is what made it worth tracing rather than assuming.It is also a race, which is why
== "Completed"would be flaky rather than correct: the annotation lands after the verdict, so a read legitimately sees either value. Both mean undisrupted.The fix
An allowlist of undisrupted values —
(None, "Completed")— not a denylist of today's failure reasons. A denylist would silently accept any reason added toexec_task.rslater, which is the defect where an omission reads as permission.Plus
exit_code in (None, 0), soCompletedis corroborated by the pod's exit status rather than trusted — that reason is the pod's, and a succeeded row carrying a nonzero exit is incoherent however it got there. Confirmedexit_codeis on theTaskInstanceschema inopenapi.jsonbefore asserting on it; asserting a field I had not verified exists is exactly how the previous guard broke.Verified against the real failed row (
state=succeeded, live, launches=1, termination_reason='Completed') — accepted on both sides of the annotation race.Why the fixture test did not catch it
kind-assertions-test.shextracts the real block rather than copying it, which is right. But itsrow()default wastermination_reason: None— it modelled the moment before annotation and never the steady state. So it green-lit a guard the live ledger could not satisfy: the fixture asserted the probe's belief rather than the system's behaviour.The default now models the annotated row, with the unannotated shape kept as its own case so the race is covered both ways, plus new cases refusing an unknown future reason and a nonzero exit.
Mutation-tested — each caught:
is None(the shipped bug)Completedcaseexit_codecorroborationProven before merge, not after
kind.yml's probe isif: github.event_name != 'pull_request', so a PR cannot run it — which is how five causes reachedmainone at a time. I dispatched it on this branch instead: run 42270118048. The PR's ownassertionsjob covers the cheap half in ~1s.Two findings recorded, neither needing a change
allocatableis 4000m, not the ~2000m every CPU sum in this probe and invalues-kind.yamlassumes. The public-repo switch movedubuntu-latestto 4 vCPU. Phase 6 needed 450m with 2750m free, so CPU has stopped being the constraint that forced the api/dispatcher requests down to 100m/250m. Thelog_cpu_budgetline added for exactly this purpose is what reported it. Worth a follow-up to revisit those trims and the budget table, but nothing here depends on it.The success line no longer claims "no
control_plane_unreachable": that is the reason the first version of this guard wrongly keyed on, and one a running attempt cannot reach. A green line asserting the wrong thing is how that version survived review.🤖 Generated with Claude Code