Repository navigation
docs(batch): decide how local development runs jobs once Phase 4 lands (#638) - #746
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 7, 2026 00:53
7 of 11 tasks
athvin
pushed a commit
that referenced
this pull request
Nov 7, 2026
#746 established that the flag is assigned nowhere in the tree — every occurrence was prose or a comment. So the 53-line `in_process_dispatcher` spawn in `main.rs`, and the 20-line join that waited for it, were unreachable: `dsn.filter(|_| env_flag("ER_DISPATCH_IN_PROCESS"))` could not yield `Some`. `env_flag` goes with it, having had no other caller. That makes this a deletion of dead code rather than a change of behaviour, which is why it does not wait on the rest of Phase 4. The prose is the part that was actively misleading, because several documents described the flag as live: - `main.rs`'s own comment claimed `scripts/frontend-dev/env.sh` was "the only thing that sets this". It was not; nothing was. - `er-obs`'s `Role::Api` was documented as "the control-plane API (and, under `ER_DISPATCH_IN_PROCESS`, a dispatcher beside it)". - `deployment-web-api.yaml` said the flag "is gone from this pod", implying it exists elsewhere. - `docs/parity-roadmap.md` described the local stack as one process draining the queue under the flag — which also made the half-up state it mentions sound unreachable, when `up.sh` has two processes and checks for exactly it. - `images.yml` explained a deleted ECR repo with "the in-process dispatcher runs the pipeline itself". - `scripts/frontend-dev/{env,up}.sh` both described the flag as something Phase 4 *would* delete. **`batch-orchestration-design.md`'s §dispatcher paragraph is rewritten**, and it is the one that mattered most: it was the design doc's own account of what the dispatcher IS, and it still described claiming, marking `running`, reconciling in `spawn_blocking` and running the kind in-process under `ER_DISPATCH_IN_PROCESS=1` inside the merged `web-api` pod. None of that has been true since §6.7 split the Deployment and Phase 3 moved the work into pods. It now describes claim-and-plan, the per-attempt Jobs, and the four things a settle emits — including the `entity.write_back` events added in #770. `docs/research-runner-startup.md` keeps its historical claim deliberately: it is a measurement record and says so ("left standing because the measurements that follow were taken under it"). Only its own correction block is extended. `make check` green. Refs #645
athvin
pushed a commit
that referenced
this pull request
Nov 7, 2026
#746 established that the flag is assigned nowhere in the tree — every occurrence was prose or a comment. So the 53-line `in_process_dispatcher` spawn in `main.rs`, and the 20-line join that waited for it, were unreachable: `dsn.filter(|_| env_flag("ER_DISPATCH_IN_PROCESS"))` could not yield `Some`. `env_flag` goes with it, having had no other caller. That makes this a deletion of dead code rather than a change of behaviour, which is why it does not wait on the rest of Phase 4. The prose is the part that was actively misleading, because several documents described the flag as live: - `main.rs`'s own comment claimed `scripts/frontend-dev/env.sh` was "the only thing that sets this". It was not; nothing was. - `er-obs`'s `Role::Api` was documented as "the control-plane API (and, under `ER_DISPATCH_IN_PROCESS`, a dispatcher beside it)". - `deployment-web-api.yaml` said the flag "is gone from this pod", implying it exists elsewhere. - `docs/parity-roadmap.md` described the local stack as one process draining the queue under the flag — which also made the half-up state it mentions sound unreachable, when `up.sh` has two processes and checks for exactly it. - `images.yml` explained a deleted ECR repo with "the in-process dispatcher runs the pipeline itself". - `scripts/frontend-dev/{env,up}.sh` both described the flag as something Phase 4 *would* delete. **`batch-orchestration-design.md`'s §dispatcher paragraph is rewritten**, and it is the one that mattered most: it was the design doc's own account of what the dispatcher IS, and it still described claiming, marking `running`, reconciling in `spawn_blocking` and running the kind in-process under `ER_DISPATCH_IN_PROCESS=1` inside the merged `web-api` pod. None of that has been true since §6.7 split the Deployment and Phase 3 moved the work into pods. It now describes claim-and-plan, the per-attempt Jobs, and the four things a settle emits — including the `entity.write_back` events added in #770. `docs/research-runner-startup.md` keeps its historical claim deliberately: it is a measurement record and says so ("left standing because the measurements that follow were taken under it"). Only its own correction block is extended. `make check` green. Refs #645
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.
Closes #638
This is a decision ticket, so the work is establishing which option the tree
actually permits and recording it where #645 can act on it. Every claim below is
probed, not inherited from the issue — and one of the issue's own premises does
not survive.
The decision
Option 1 adopted — local dev points at kind for anything needing job
execution. Option 2 adopted, but narrower than the issue assumes.
Option 3 rejected, on §13's own words:
Correction made while writing this
I first described the kind probe's sixth phase as org bookkeeping, inferring it from a comment at
scripts/check_kind.sh:49. Reading the phase itself, it is a blue/green colour cutover under an in-flight attempt — a task pod's only route to the control plane issvc/er-api, so after the flip its heartbeats, claim renewals and finish call land on a differenter-serverprocess. Fixed before committing.Where the issue is wrong, and it changes the plan
The issue offers Option 2 as a cheap complement:
The tier does not only read rows.
frontend/tests/e2e/grow-your-data.spec.tsdrives the wizard, creates a source named at runtime
(
erp${Date.now().toString(36)}), clickswizard-activate-run, then:That is three jobs executed end to end. No seeded row can satisfy it, because
the source does not exist until the spec creates it.
Split across the five full-stack specs, measured rather than assumed:
login-dashboardsucceededrow inlast-run-stripsee-your-dataruns-tablecontainssucceededfix-your-dataGET …/jobs?limit=10run-the-businessjobs/submitrefused (409 while suspended)grow-your-dataSo Option 2 covers four of five; the fifth is the whole difficulty and the issue
treats it as absent.
What is already true, contradicting three documents
ER_DISPATCH_IN_PROCESSis never assigned anywhere in the tree — every hitis prose or a comment.
scripts/frontend-dev/up.sh:68startser-dispatcherasits own host process. So local dev already runs the Phase-4 topology, and what
Phase 4 removes from local dev is not the flag but the executor's only
identity. Three places still say otherwise:
.claude/skills/infra-platform/SKILL.md:217ER_DISPATCH_IN_PROCESS=1survives only in local dev (make run)"make rundoes notdocs/frontend-testing.md:467er-serverruns the dispatcher in-process (ER_DISPATCH_IN_PROCESS=1)"up.shrunser-dispatcherseparatelydocs/batch-orchestration-design.md:950make check-kindruns five phases"scripts/check_kind.sh:49names phase 6, whose guard was fixed in #742Plan — all landed
docs/batch-orchestration-design.md— record the Decide how local development runs jobs once Phase 4 deletes the legacy arm #638 decision next to Phase 4: Option 1 adopted, Option 2 scoped to the four row-only specs, Option 3 rejected per §13, with thegrow-your-dataevidence.five phases→ six, and themake run … loses ER_DISPATCH_IN_PROCESS in Phase 4clause, which implies local dev uses it today.docs/frontend-testing.md— fix the in-process claim at :467, and record which full-stack specs survive against the host stack after Phase 4 and which needs a cluster..claude/skills/infra-platform/SKILL.md— fix the staleER_DISPATCH_IN_PROCESSclaim.grow-your-data's executor so Phase 4 is not silently widened, and comment on Phase 4 — delete the legacy in-process dispatch arm #645 that Decide how local development runs jobs once Phase 4 deletes the legacy arm #638 is resolved. → grow-your-data needs an executor after Phase 4 — the one full-stack spec row-seeding cannot cover #747 filed; Phase 4 — delete the legacy in-process dispatch arm #645 commented.Gates
make skills-check(a skill and its generated references are touched) plusscripts-home-check. No Rust orentities/change, sorust'sdetectclassifies this
code=falseand the compile tier skips; the ungatedskillsand
workflow pins (S9)jobs still run.