Skip to content

docs(batch): decide how local development runs jobs once Phase 4 lands (#638) - #746

Merged
athvin merged 2 commits into
mainfrom
issue/638-local-dev-jobs
Nov 7, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/638-local-dev-jobs

Conversation

@athvin

@athvin athvin commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Closes #638

🚧 Claimed by an agent session — 2026-11-07T00:46:35Z.
The claim is this open draft PR: closing it releases the ticket.

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:

A local or in-process executor, an ER_EXECUTOR flag, or any production path
other than er-server exec-task in a Kubernetes Job.

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 is svc/er-api, so after the flip its heartbeats, claim renewals and finish call land on a different er-server process. Fixed before committing.

Where the issue is wrong, and it changes the plan

The issue offers Option 2 as a cheap complement:

seed.mjs produces the rows through the CLI … and the full-stack tier
keeps asserting on rows rather than on execution. Cheap if the tier only
reads rows, which its comment suggests.

The tier does not only read rows. frontend/tests/e2e/grow-your-data.spec.ts
drives the wizard, creates a source named at runtime
(erp${Date.now().toString(36)}), clicks wizard-activate-run, then:

await waitForQuietQueue(page, 780_000);               // 13 minutes
expect(jobs.map((j) => j.kind)).toEqual(["run_all_incremental", "run_all_full", "train"]);
expect(jobs.every((j) => j.state === "succeeded")).toBe(true);

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:

Spec Needs After Phase 4
login-dashboard a succeeded row in last-run-strip Option 2 covers it
see-your-data runs-table contains succeeded Option 2 covers it
fix-your-data GET …/jobs?limit=10 Option 2 covers it
run-the-business jobs/submit refused (409 while suspended) needs no executor
grow-your-data three jobs actually run needs kind

So 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_PROCESS is never assigned anywhere in the tree — every hit
is prose or a comment. scripts/frontend-dev/up.sh:68 starts er-dispatcher as
its 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:

Where Says Actually
.claude/skills/infra-platform/SKILL.md:217 "ER_DISPATCH_IN_PROCESS=1 survives only in local dev (make run)" nothing sets it; make run does not
docs/frontend-testing.md:467 "er-server runs the dispatcher in-process (ER_DISPATCH_IN_PROCESS=1)" up.sh runs er-dispatcher separately
docs/batch-orchestration-design.md:950 "make check-kind runs five phases" six — scripts/check_kind.sh:49 names phase 6, whose guard was fixed in #742

Plan — all landed

Gates

make skills-check (a skill and its generated references are touched) plus
scripts-home-check. No Rust or entities/ change, so rust's detect
classifies this code=false and the compile tier skips; the ungated skills
and workflow pins (S9) jobs still run.

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
athvin marked this pull request as ready for review November 7, 2026 00:53
@athvin
athvin merged commit a4aa56d into main Nov 7, 2026
35 checks passed
@athvin
athvin deleted the issue/638-local-dev-jobs branch November 7, 2026 00:53
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
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.

Decide how local development runs jobs once Phase 4 deletes the legacy arm

2 participants