Skip to content

test(kind): drive a seven-pod pipeline, and size the cap to the quotas we have - #477

Merged
athvin merged 5 commits into
mainfrom
bm/kind-probe-pipeline
Nov 5, 2026
Merged

athvin merged 5 commits into
mainfrom
bm/kind-probe-pipeline

Conversation

@athvin

@athvin athvin commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Two things the kind probe could not previously say, and one number that was wrong.

The probe only ever ran single-task kinds

All four existing phases drive lake_maintain, so none of them can show the failure mode that splitting a DAG across pods actually introduces: a stage reading what the previous stage's process produced.

In the monolith every stage shared one address space and one DuckDB handle. Under the executor, standardize runs in a container that did not exist when ingest finished, and the only things that cross the boundary are the lake and the task's published output.

That is not a hypothetical class — it is the bug we already hit. seed_lexicon writes a session-local table, which was invisible for as long as one process ran every stage and failed immediately once init and standardize were separate pods.

Phase 5 runs run_all_full and requires:

  • seven live rows for the seven stages, and seven distinct Job objects
  • one launch each (a relaunch is two lake writers)
  • a verified pod_uid on every row — which the integration tier's child-process double cannot produce
  • init publishing a run_plan at mode full
  • standardize pinning two references: the plan, plus the corpus ingest's own pod landed
  • the run ledgered full @ v0001 — which a pipeline whose pods all exited zero without writing anything would pass every other assertion and fail here

It uses its own org. The other four phases depend on lake_maintain settling in seconds against an empty lake, and seeding base_10 into the org they share would quietly change the window phases 2 and 3 are trying to catch.

The assertions were observed failing first

The house rule is that a gate must be seen failing before it is trusted. Eight planted defects, all eight caught with a legible message:

Planted Caught by
a relaunched stage match: launches=2
a row with no verified pod uid reconcile: no verified pod uid
two stages sharing one Job each stage needs its own Job object, got 6
a lost ingest handoff standardize pinned 1 refs, wanted the plan + the landed corpus
init decided the wrong mode {'mode': 'incremental', …}
a stage missing from the DAG the sorted task-id list
a stage failed ('match', 'failed', 'nickname_variants does not exist')
a stage published no output finish: no durable output

What has not happened yet: a green end-to-end local run. The kind image is a ~40-minute cold build and is still going on a memory-pressured laptop. The nightly kind workflow exercises this once Actions billing is restored; I will post the local result on this PR when the build lands. Every assertion above is verified against synthetic ledgers, and the script is syntax-checked.

The vCPU quota was recorded as 8 and is actually 64

Read back from the account rather than assumed — L-1216C47A (On-Demand Standard) and L-34B43A08 (Spot) are both 64.0. The 8 was real when measured and had simply been granted since, which made inFlightCap: 1 and §7.2's "default 1 until the quotas are raised" stale.

inFlightCap is now 3: three L pods land on three 16-vCPU nodes, so 3×16 + 4 for app and system is 52 of 64. Four would need 68 and the fourth node could not provision at all.

The dev namespace quota is recomputed with it, and deliberately not uniformly:

Dimension Worst case at cap 3 Set to
count/jobs.batch 8 + 3×6 per §7.2 = 26 30
limits.cpu 3×12 (L) + app = 38 40
requests.memory 3×14Gi (L) + app = 46Gi 80Gi, already clear
requests.ephemeral-storage 3×400Gi (L spill) = 1200Gi left at 900Gi

A ceiling on cpu or jobs costs nothing until it is used; ephemeral storage is EBS that gets billed monthly. So a namespace admits two concurrent L pods and refuses the third — which arrives as a capacity FailedCreate, costing a wait rather than a launch (§7.2's own backstop). Raising it wants a decision, not a default, so the arithmetic sits beside the value.

Also

  • Risks 1 and 4 in §12 are resolved and say so. Risk 4 keeps the one part that is not proven: no JWKS rotation has happened under a running er-api, so UNKNOWN_KID_FETCH_FLOOR and REFRESH_AFTER are unit-tested and not exercised live.
  • Phase 3's acceptance now distinguishes the two probes. Kind proves the handoff and cannot prove the class boundary — one node, no Karpenter, every class identical in values-kind.yaml. "Three Jobs on two node classes" stays a dev-cluster claim, and nothing here should be read as covering it.
  • §10's trace_context gap is closed; the doc's "None at both enqueue sites" was stale.
  • Workflow budget 90 → 120 minutes. A ~40-minute cold build plus seven sequential pods against a 30-minute wait would have been cancelled just before the most interesting assertion. The generated required-checks.md tracks that timeout, hence its diff.
  • Failure is now legible: phase 5 waits for any terminal state, dumps the live ledger in sequence order with each stage's error_class/error_detail, and then requires success. wait_state … succeeded would have aborted on failed having printed nothing.

Note on CI: every workflow currently fails at job startup with "The job was not started because recent account payments have failed or your spending limit needs to be increased", so this cannot go green until Actions billing is restored.

🤖 Generated with Claude Code

bmoore813 and others added 5 commits November 4, 2026 18:55
`runs.mode` carries an enumeration — `er_schema::model::RUN_MODES`,
declared on the registry's `enum_map` and repeated in the entity's own
description as "(full, incremental, correction_pass, ...)". The
correction pass wrote `correct`, which was never a member of it.

Nothing enforced the enumeration at write time, so the row was accepted
and the value simply sat there, undeclared, in a constrained column. The
one function that maps a run's mode to a rebuild reason
(`er_versions::rebuild_reason_for`) compares against
`MODE_CORRECTION_PASS` and so could never match it — it has no
production caller today, which is the only reason this stayed latent
rather than becoming a wrong answer.

It also became visible: the DAG path's `init` publishes
`MODE_CORRECTION_PASS` in its run plan, so the plan and the row it
describes disagreed on one string.

The job KIND is still `correct` — that is a different vocabulary and is
untouched. Only the ledger's mode moves.

The lake e2e asserted `mode == "correct"`, which is how an undeclared
value in an enumerated column stayed invisible for as long as the writer
produced it; it now asserts the declared constant. No golden pins the
value, so nothing else moves.

Co-Authored-By: Claude Fable 5 <[email protected]>
…s we have

Two things the probe could not previously say, and one number that was wrong.

## The probe only ever ran single-task kinds

All four phases drove `lake_maintain`, so none of them could show the failure
mode that splitting a DAG across pods actually introduces: a stage reading what
the PREVIOUS STAGE'S PROCESS produced. In the monolith every stage shared one
address space and one DuckDB handle. Under the executor, `standardize` runs in
a container that did not exist when `ingest` finished, and the only things that
cross the boundary are the lake and the task's published output.

That is not a hypothetical class. `seed_lexicon` writes a SESSION-LOCAL table,
which was invisible for as long as one process ran every stage and failed
immediately once `init` and `standardize` were separate pods.

Phase 5 runs `run_all_full` on kind and requires: seven live rows for the seven
stages, seven DISTINCT Job objects, one launch each, a verified `pod_uid` on
every row, `init` publishing a `run_plan` at mode `full`, `standardize` pinning
two references (the plan plus the corpus ingest's own pod landed), and the run
ledgered `full @ v0001` — the last of which a pipeline whose pods all exited
zero without writing anything would fail.

It uses its OWN org. The other four phases depend on `lake_maintain` settling
in seconds against an empty lake, and seeding base_10 into the org they share
would quietly change the window phases 2 and 3 try to catch.

The assertions were mutation-tested before the probe ever ran: eight planted
defects (a relaunched stage, a missing pod uid, two stages sharing one Job, a
lost ingest handoff, the wrong mode, a missing stage, a failed stage, a stage
with no output) and all eight are caught with a legible message. The house rule
is that a gate must be observed failing before it is trusted.

## The vCPU quota was recorded as 8 and is 64

Read back from the account rather than assumed — `L-1216C47A` (On-Demand
Standard) and `L-34B43A08` (Spot) are both 64.0. The 8 was real when it was
measured and had simply been granted since, which made `inFlightCap: 1` and
§7.2's "default 1 until the quotas are raised" stale.

`inFlightCap` is now 3: three L pods land on three 16-vCPU nodes, so 3x16 plus
4 for app and system is 52 of 64, while four would need 68 and the fourth node
could not provision at all.

The dev namespace quota is recomputed with it, and NOT uniformly:

  count/jobs.batch              8 + 3x6 per §7.2        = 26  -> 30
  limits.cpu                    3x12 (L) + app          = 38  -> 40
  requests.memory               3x14Gi (L) + app        = 46Gi -> 80Gi already clear
  requests.ephemeral-storage    3x400Gi (L spill)       = 1200Gi -> LEFT at 900Gi

A ceiling on cpu or jobs costs nothing until used; ephemeral storage is EBS that
gets billed monthly. So the namespace admits two concurrent L pods and refuses
the third, which arrives as a capacity `FailedCreate` and costs a wait rather
than a launch — §7.2's backstop behaving as designed. Raising it wants a
decision, not a default, so the arithmetic is recorded beside the value.

## Also

Risks 1 and 4 in §12 are resolved and say so. Risk 4 keeps the one part that
is NOT proven: no JWKS rotation has happened under a running `er-api`, so
`UNKNOWN_KID_FETCH_FLOOR` and `REFRESH_AFTER` are unit-tested and not
exercised live.

The workflow's budget goes 90 -> 120 minutes. A ~40 minute cold image build
plus seven sequential pods against a 30 minute wait would have been cancelled
just before the most interesting assertion. The generated required-checks
reference tracks that timeout, hence its diff.

Phase 3's acceptance now distinguishes the two probes explicitly: kind proves
the handoff, and cannot prove the class boundary — one node, no Karpenter,
every class identical in values-kind.yaml. "Three Jobs on two node classes"
stays a dev-cluster claim.

Co-Authored-By: Claude Fable 5 <[email protected]>
The operability section still said `jobs.trace_context` "is `None` at both
enqueue sites". It is not: the authenticating layer puts
`forwarded_traceparent(parts)` on the `Principal` and enqueue threads it
through, so a job carries the traceparent of the request that asked for it. The
one remaining `None` in the tree is a `Job` struct literal in a test fixture.

Co-Authored-By: Claude Fable 5 <[email protected]>
`wait_state … succeeded` aborts the moment a job settles `failed`, which in a
seven-stage pipeline throws away the only thing worth knowing: which stage
failed, and with what `error_detail`. Phase 5 now waits for any terminal state,
dumps the live ledger in sequence order, and then requires success.

Co-Authored-By: Claude Fable 5 <[email protected]>
The pipeline's closing assertion reads a DATASET-scoped route that opens the
lake in the API process, so `503 lake: …` is a real and distinguishable
outcome. Going through `api` would have spent five retries on it and then died
under `set -e" having printed nothing — the response body is the whole
diagnosis. Fetch it directly, check the code, print the body.

Co-Authored-By: Claude Fable 5 <[email protected]>
@athvin
athvin merged commit 93079fb into main Nov 5, 2026
36 checks passed
@athvin

athvin commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

The probe is green on a real cluster — all five phases

Run locally against a freshly built image on kind. ALL PHASES PASS.

phase 1 ok: both rows succeeded as real pods
phase 2 ok: adopted, one launch per attempt
phase 3 ok: canceled, no managed Job survives
phase 4 ok: 401
phase 5 ok: seven stages, seven Jobs, one launch each
phase 5 ok: the run is ledgered full @ v0001 — the pods wrote the lake

The pipeline's ledger, and it is not a vacuous pass — seven distinct Job objects and seven distinct pod UIDs:

stage state Job object pod uid class
init succeeded er-t-a56be2a684beaa8c6adf-l1 7b5992fc… M
ingest succeeded er-t-21293f34fdad52be8ee3-l1 70b6f2f4… M
standardize succeeded er-t-53edb784b6f74642e102-l1 8eb435ba… M
match succeeded er-t-1c888f6998bd04cf827f-l1 2443eccf… M
reconcile succeeded er-t-315a50462e3748326689-l1 03fd0407… M
assemble succeeded er-t-1e4f311d4370f4057fff-l1 f166b442… M
finish succeeded er-t-088a108c6f133c5679d3-l1 02b9d3fb… M

And the run row proves the lake was really written rather than seven pods exiting zero:

{ "mode": "full", "model_version": "v0001", "status": "succeeded",
  "auto_merged_pairs": 18, "started_at": "…11:36:09", "ended_at": "…11:36:24" }

18 auto-merged pairs out of base_10 — entities were actually resolved across the pod boundary.


Getting there found two real bugs in the harness itself (new commit)

Neither is in the pipeline; both made the probe report on something other than the code under test, which is worse than failing.

1. The probe was running a two-day-old binary

kind_env.sh pushes localhost:5001/er-api:kind. That tag is mutable, and the node's containerd already held a layer under the same name — so under IfNotPresent it reported "already present on machine" and never re-pulled. The new image sat in the registry ignored while every pod ran the old binary and every log line said success.

The symptom was unrecognisable as staleness: web-api's startup probe failed 404 on /readyz and crash-looped, which reads as a chart bug. What identified it is that readyz returns 200 or 503 and never 404 — a bare 404 means no route matched, so the binary was not the one built.

Fixed by pinning the release to the pushed digest. A node cannot satisfy er-api@sha256:… from a differently-digested layer, so it must pull. The chart already supported it (images.api.digest — the promote-by-digest path production uses), so kind now exercises that path too.

--atomic goes with it. Atomic rolls back on timeout, which here meant: spend 40 minutes building an image, miss the 5-minute wait because the host was swapping, and silently restore the previous revision. That is literally what happened — helm history showed Rollback to 1. A failed upgrade that stays failed is honest and leaves the pods readable.

2. Phases 1–4 were probing a route that no longer exists

Every job route is dataset-scoped — /v1/orgs/{org}/datasets/{ds}/jobs — with no org-level alias. The probe still used the org-level path, so the datasets route switchover broke phases 1–4 and nothing noticed, because the only thing that would have is the nightly kind workflow, which billing has blocked.

Again a bare 404 with an empty body, indistinguishable at a glance from a missing org. All six call sites now build their path through one jobs_path helper, so the next rename moves one line instead of eight.

So the existing four phases were already red against main before this PR added a fifth. They are green now.

CI note unchanged: every workflow still fails at job startup on Actions billing, so this cannot go green here until that is restored. The run above is the local evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants