Issue #1102: drive.nika: a rebase conflict confined to generated lowered files regenerates them with lower-std instead of escalating

Open and answer this issue on GitHub.

ready · opened 2026-10-31 · updated 2026-10-31 · 0 comments

Where it comes from

The owner asked for this on 2026-10-31. Two drivers share one checkout: the main lane (docs/briefs) and the bug lane (docs/briefs/bugs). When both lanes change a tools/*.nika file that is lowered into the same generated file, every rebase in drive_push conflicts there.

On 2026-10-31 it happened twice in one evening, both times in crates/nikaia-std/src/tools/lowered/check_facts.rs (the one-line CheckFacts::empty()):

  1. The bug lane escalated with ESCALATE drive: push rejected, rebase conflicted in .../lowered/check_facts.rs, rebase aborted.
  2. After that, the main lane escalated the same way after SUITE 29c2d8d9 green.

Each time the supervisor resolved it by hand. The fix was the union of the field initializers, in the field order of check_facts.nika, and the suite’s lower-std step confirmed the result. A generated file is never merged by hand, though (CLAUDE.md: the lowered files are written by the lowering, and a change to one .nika changes one file). The correct resolution is mechanical: take either side, then regenerate the file from the merged .nika sources.

To build

  1. In drive_push, when git pull --rebase stops on a conflict, list the unmerged paths. Only when all of them are generated lowered files (crates/nikaia-std/src/tools/lowered/*.rs and the index lowered.rs) and the .nika sources merged cleanly:
    • resolve each one with either side;
    • run the repository’s lower-std regeneration (the same command the gate’s lower-std step checks) with the driver’s interpreter;
    • git add exactly those files and git rebase --continue.

    Repeat this for each commit the rebase replays.

  2. Any other conflicted path, a failed regeneration, or a .nika conflict keeps today’s path: git rebase --abort, then escalate (push rejected, rebase conflicted in ...).
  3. A rebase resolved this way changed tested commits, so it does not push on the old green. Print SUITE <sha8> rebased with regenerated lowered files and test the new HEAD again in the suite worktree before pushing. Alternatively, run only the cheap steps (build, lower-std, fmt, clippy) if the brief decides that is enough; state which, and why.
  4. --dry-run shows the regeneration step. Add a Nikaia test with fake commands, as the existing drive tests are written. Update the header comment of drive.nika.

Rules: only scripts/drive.nika and its tests. Never reset, stash, checkout . or restore . in the shared checkout.

Back to Open Issues