Repository navigation
refactor(server): unblock Phase 4's two structural obstacles - #611
Merged
Merged
Conversation
Neither of these is one of the open decisions in Phase 4. Both are work the
design already specified and that has to happen before the legacy arm can be
deleted at all.
## 1. `dispatch_coverage.rs` blocked its own premise
Phase 1 said this file would be rewritten to scan `dag_for`. It was not, and
the textual scan it kept made it an obstacle to Phase 4: the test hard-asserted
that `lake_maintain` has a `match` arm in `dispatcher.rs` as its own self-check,
so deleting the legacy arms would fail the file that exists to prove kinds are
routed. The deletion could not be done without first rewriting the thing
guarding it.
Split in two, because there are two destinations and they retire at different
times:
- **The DAG half is permanent and registry-backed.** Every enqueueable kind
must `JobKind::parse` and assemble a non-empty graph through `dags::dag_for`.
A missing kind is now a `None`, not a missing line of text.
- **The legacy half stays textual by necessity** — the arms are string literals
and two are async pre-branches — but covers exactly `LEGACY_ARM_KINDS` and
RETIRES ITSELF: when Phase 4 empties that list the test stands down instead
of failing. Its self-checks use members of that same list, so they go away
with it rather than outliving it.
A third test keeps the list honest: it may name only kinds the product actually
enqueues, so a stale entry cannot make Phase 4 look larger than it is.
Observed failing before being trusted, four ways:
deleted a real arm (renamed dispatcher.rs's "profile" arm) -> CAUGHT,
"these kinds are NOT on the executor allowlist … ["profile"]"
a legacy kind with no arm -> CAUGHT
a stale entry naming a non-enqueueable kind -> CAUGHT
LEGACY_ARM_KINDS emptied (Phase 4's exit) -> stands down
## 2. The new arm depended on the legacy arm's classifier
`dags/tasks.rs::engine_error` ran engine failure strings through
`pg::FailureClass::classify` and mapped the result onto `er_errors`. So
new-arm code depended on a type the legacy arm owns, and `classify` could not
be deleted while the new arm called it.
§6.5 says the two taxonomies "collapse into the latter at the executor
boundary". `engine_error` IS that boundary, so the substring rules now live
there and produce an `ErrorClass` directly. The rules are carried over
unchanged.
Proven behaviour-preserving rather than assumed: a temporary differential test
compared the new classifier against the old mapping across 29 strings —
every case from the old table plus capitalisation variants, empty input, and
messages that satisfy two arms at once ("open lake AND config:",
"param: and timed out") — and they agree everywhere. The 14-case table moved
here from `pg_job_retry.rs` rather than being deleted with the rules: the
message shapes are what the assertion is really about, and they outlive
whichever type classifies them. A second test pins the property that table
protects — only `transient_io` is retryable, so a precondition or a panic
never is.
Scope, precisely: this removes the NEW DAG ARM's dependency. `classify` still
has callers in `reporter.rs`, `dispatcher.rs`, `pg_job_retry.rs` (all legacy,
all deleted in Phase 4) and in `lib.rs`'s `dispatch_pg` — the injected-runner
test helper, which is already named on Phase 4's decision list and is not
touched here.
`make check` green.
Co-Authored-By: Claude Fable 5 <[email protected]>
athvin
force-pushed
the
bm/phase4-unblock
branch
from
November 5, 2026 19:47
2a939bf to
41c2eb3
Compare
This was referenced Nov 6, 2026
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.
Neither of these is one of the open decisions in Phase 4. Both are work the design already specified, and both have to happen before the legacy arm can be deleted at all.
1.
dispatch_coverage.rsblocked its own premisePhase 1 said this file would be rewritten to scan
dag_for. It was not — and the textual scan it kept made it an obstacle to Phase 4. The test hard-asserted thatlake_maintainhas amatcharm indispatcher.rsas its own self-check, so deleting the legacy arms would have failed the very file that exists to prove kinds are routed. The deletion could not be done without first rewriting the thing guarding it.Split in two, because there are two destinations and they retire at different times:
JobKind::parseand assemble a non-empty graph viadags::dag_for. A missing kind is now aNone, not a missing line of text.dispatch_once) but covers exactlyLEGACY_ARM_KINDSand retires itself: when Phase 4 empties that list the test stands down rather than failing. Its self-checks draw from that same list, so they go away with it instead of outliving it.A third test keeps the list honest — it may name only kinds the product actually enqueues, so a stale entry can't make Phase 4 look larger than it is.
Observed failing before being trusted
dispatcher.rs's"profile"arm)LEGACY_ARM_KINDSemptied — Phase 4's exitThat last row is the one that matters: it demonstrates the deletion this file used to block now passes through it cleanly.
2. The new arm depended on the legacy arm's classifier
dags/tasks.rs::engine_errorran engine failure strings throughpg::FailureClass::classifyand mapped the result ontoer_errors. So new-arm code depended on a type the legacy arm owns, andclassifycould not be deleted while the new arm called it.§6.5 says the two taxonomies "collapse into the latter at the executor boundary".
engine_erroris that boundary, so the substring rules live there now and produce anErrorClassdirectly. The rules are carried over unchanged.Proven behaviour-preserving, not assumed
A temporary differential test compared the new classifier against the old mapping across 29 strings — every case from the old table, plus capitalisation variants, empty input, and messages that satisfy two arms at once (
"open lake AND config:","param: and timed out"). They agree everywhere.The 14-case table moved here from
pg_job_retry.rsrather than being deleted with the rules: the message shapes are what the assertion is really about, and they outlive whichever type does the classifying. A second test pins the property that table protects — onlytransient_iois retryable, so a precondition or a panic never is. Guessing "retryable" on an unrecognised failure is how a real bug becomes three identical pod launches.Scope, precisely
This removes the new DAG arm's dependency.
classifystill has callers inreporter.rs,dispatcher.rsandpg_job_retry.rs— all legacy, all deleted in Phase 4 — and inlib.rs'sdispatch_pg, the injected-runner test helper that is already named on Phase 4's decision list and is not touched here.make checkgreen.🤖 Generated with Claude Code