Skip to content

fix(engine): a correction pass records the mode RUN_MODES declares - #473

Closed
athvin wants to merge 0 commit into
mainfrom
bm/run-mode-declared
Closed

athvin wants to merge 0 commit into
mainfrom
bm/run-mode-declared

Conversation

@athvin

@athvin athvin commented Nov 4, 2026

Copy link
Copy Markdown
Owner

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.

Why it stayed invisible

Three things had to line up:

  1. No runtime enforcement. The enum_map declares the vocabulary for the registry and the generated DDL; it does not become a check constraint, so the write succeeded.
  2. No consumer. er_versions::rebuild_reason_for compares a run's mode against MODE_CORRECTION_PASS and so could never match correct — but it has no production caller today. That is the only reason this was latent rather than a wrong answer waiting to be read.
  3. The test pinned the bug. lake_e2e asserted mode == "correct", so the assertion agreed with the writer for as long as the writer was wrong. It now asserts the declared constant.

It also recently 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.

Scope

The job kind is still correct — a different vocabulary, and untouched. Only the ledger's mode moves. I checked the fixtures: no golden pins the value, so nothing else changes.

Verified

make check green, and the 44-test lake_e2e suite green against a real DuckLake — including the assertion that now requires the declared mode.

Note on CI: every workflow is currently failing 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. It is verified locally in the meantime.

🤖 Generated with Claude Code

athvin pushed a commit that referenced this pull request Nov 5, 2026
`skipped` is only trustworthy when the job that decided to skip SUCCEEDED.

Every expensive job is gated on `needs.detect.outputs.*`. When a `detect` job
FAILS, its dependents report `skipped` — and branch protection accepts `skipped`
as satisfied. So a PR can show all twelve required contexts satisfied with not
one of them having run.

Found on #473 while looking for a merge-bus candidate: two Rust files changed,
all three detect jobs failed in the Actions-minutes outage, all 12 required
contexts `skipped`, `mergeStateStatus` CLEAN. It was mergeable — by hand or by
the bus — with nothing compiled or tested. A scan of every open PR found it was
the only one left in that state; the others had been pushed to since.

This is the same "a false skip is the worst failure mode available" that the
`grep -c`-not-`grep -q` rule exists for, reached by a different route: there the
detect job lies, here it dies. It also defeats the aggregator gates, since
`test` and `DuckLake + extensions e2e` gate on `needs.detect.outputs.code ==
'true'` and an empty output skips the gate before its fail-closed `case` can run.

Requiring the detect contexts in protection is not the fix — three jobs under
two names, and a required context that legitimately does not report blocks every
PR forever. Checking it at the point of use is cheap and precise, so the bus now
reads the candidate's check-runs and refuses one whose detect jobs concluded
`failure`, naming the remedy ("re-run CI before batching").

Simulator covers it as `detect-died`: the unverified candidate is skipped with
its reason, the genuinely-verified members still ride, and the unverified one is
never merged. Mutation-tested by deleting the check. Suite now 67 assertions.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin athvin closed this Nov 5, 2026
@athvin
athvin force-pushed the bm/run-mode-declared branch from fbd4daa to 1b144ba Compare November 5, 2026 11:49
athvin added a commit that referenced this pull request Nov 5, 2026
…ing (#490)

`skipped` is only trustworthy when the job that decided to skip SUCCEEDED.

Every expensive job is gated on `needs.detect.outputs.*`. When a `detect` job
FAILS, its dependents report `skipped` — and branch protection accepts `skipped`
as satisfied. So a PR can show all twelve required contexts satisfied with not
one of them having run.

Found on #473 while looking for a merge-bus candidate: two Rust files changed,
all three detect jobs failed in the Actions-minutes outage, all 12 required
contexts `skipped`, `mergeStateStatus` CLEAN. It was mergeable — by hand or by
the bus — with nothing compiled or tested. A scan of every open PR found it was
the only one left in that state; the others had been pushed to since.

This is the same "a false skip is the worst failure mode available" that the
`grep -c`-not-`grep -q` rule exists for, reached by a different route: there the
detect job lies, here it dies. It also defeats the aggregator gates, since
`test` and `DuckLake + extensions e2e` gate on `needs.detect.outputs.code ==
'true'` and an empty output skips the gate before its fail-closed `case` can run.

Requiring the detect contexts in protection is not the fix — three jobs under
two names, and a required context that legitimately does not report blocks every
PR forever. Checking it at the point of use is cheap and precise, so the bus now
reads the candidate's check-runs and refuses one whose detect jobs concluded
`failure`, naming the remedy ("re-run CI before batching").

Simulator covers it as `detect-died`: the unverified candidate is skipped with
its reason, the genuinely-verified members still ride, and the unverified one is
never merged. Mutation-tested by deleting the check. Suite now 67 assertions.

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin deleted the bm/run-mode-declared branch November 5, 2026 20:08
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.

1 participant