Skip to content

feat(tools): a merge train that lands queued decoder PRs one at a time - #298

Merged
DrunkOnJava merged 1 commit into
mainfrom
tools/merge-train
Oct 26, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
tools/merge-train

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

With four lanes merging, every open decoder PR went stale on the generated files after each merge: tools/corpus/baseline.tsv, docs/spec-coverage.md, the notes in docs/data/spec-coverage.tsv, the spec-example fixtures, and the ## 7x. letters of new ARCHITECTURE.md sections (the residue lane pre-assigned §7k–§7u while the spec lane took §7k and §7l). Landing them by hand cost a CI cycle each. This commits the train that has been landing them today, so it survives the session that wrote it.

tools/maintainer/train/train.sh <pr>... queues PRs and lands them one at a time:

  • refresh.sh merges main into the branch (no force push), moves a colliding ARCHITECTURE.md section to the next free letter along with every §7x in lines the PR added (arch.py), and resolves conflicts only in generated or tabular files (tsv3.py: cell by cell, and a coverage note both sides rewrote keeps the PR's free text, with main's dropped text posted on the PR). A conflict in a section's state or any other file refuses. It then builds, runs the pinned corpus, refuses any count worse than main's baseline, regenerates the baseline, runs spec_examples (refusing if an example loses closes), rewrites the DXF oracle notes, regenerates the coverage page and pushes.
  • land.sh waits for the Corpus job on the pushed head and zero unresolved threads, then enables squash auto-merge. If main moves under it, DRY=1 refresh.sh decides whether the PR's generated files are still right before anything is re-pushed.

State (queue, log, per-PR evidence) lives in .git/train/; common.sh lists the environment variables that move it. No absolute paths are committed.

Evidence: today's landings and refreshes through these scripts' scratch versions (#247, #252, #261, #262), and an end-to-end DRY=1 refresh.sh 262 through the committed files (own state dir, worktree and target dir): build, corpus run, "vs main: 6 improved row(s), 0 regressions", "DRY: generated files unchanged on current main", exit 0.

docs/maintaining.md's required-check list also gains Corpus (public DWG) and Spec coverage (required since 2026-10-26).

Source provenance: written for this repository; no external source consulted.

Each merge left the other open decoder PRs stale on the generated files: the
corpus baseline, the coverage page and its notes, the spec-example fixtures
and the ARCHITECTURE.md section letters. tools/maintainer/train merges main
into each branch without a force push, renumbers its new section, merges the
coverage table cell by cell, regenerates every generated file from a real
corpus run, refuses any count worse than main's, and turns auto-merge on only
once Corpus is green and no review thread is open. docs/maintaining.md also
lists the two newly required checks.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T13:30:53.461320Z f4372db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 26, 2026 13:15
@DrunkOnJava
DrunkOnJava merged commit aeaadca into main Oct 26, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the tools/merge-train branch October 26, 2026 13:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4372dbf3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/maintainer/train/refresh.sh Resolved
Comment thread tools/maintainer/train/land.sh Resolved
Comment thread tools/maintainer/train/land.sh Resolved
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
…ling it

A timeout or a failing check left auto-merge on, so the abandoned PR could
merge while the train refreshed the next one (#298 review). A branch that
strict up-to-date reports BEHIND now exits 8 for a real refresh instead of
waiting out the deadline.
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
* fix(ci): land.sh hands a PR back when a review thread opens after auto-merge

The ruleset holds a PR with an unresolved thread, and land.sh's wait loop
only watched for merge, DIRTY, a moved main and failing checks, so a thread
the reviewer opened after auto-merge went on (#258, 2026-10-26) stalled the
train until the deadline. The loop now turns auto-merge off and exits 2 on a
positive unresolved count; a failed query counts as none.

* fix(ci): land.sh treats any positive thread count as open, not just 1-99

* fix(ci): land.sh turns auto-merge off on every failed exit after enabling it

A timeout or a failing check left auto-merge on, so the abandoned PR could
merge while the train refreshed the next one (#298 review). A branch that
strict up-to-date reports BEHIND now exits 8 for a real refresh instead of
waiting out the deadline.
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
…he next PR (#338)

A dry refresh, or one that failed after regenerating the baseline or the
coverage page, left those files modified, and git merge --abort does not
touch them; the next checkout then refused (#298 review).
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