Skip to content

fix(ci): drop the sections main already holds when the train resolves a stacked PR's ARCHITECTURE.md - #415

Merged
DrunkOnJava merged 3 commits into
mainfrom
fix/arch-stacked-sections
Oct 27, 2026
Merged

DrunkOnJava merged 3 commits into
mainfrom
fix/arch-stacked-sections

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

tools/maintainer/train/arch.py resolve now drops every ## section on the PR's side of an append conflict that main's file already holds word for word.

A PR stacked on another PR carries the lower PR's ARCHITECTURE.md sections. Once the lower PR squash-lands, merging main into the upper PR conflicts where both sides appended. The resolver kept main's copy and then the PR's, so the section appeared twice and the Spec coverage job's "numbered sections run in order" step failed. This happened to #388 on 2026-10-27: it carried #384's pre-squash §7au, and CI run 40573732934 failed with section 7au where 7av belongs. I removed that duplicate by hand in aa957ef.

The unp, table and R13 stacks are all stacked this way and would hit the same failure as each lower PR lands. The running train has used this resolver since 4:05 PM.

Spec reference

Maintainer tooling only.

Test plan

  • Reproduced in a scratch repository. The base has 7a and 7b. Main appends 7c. The PR appends the same 7c, then its own 7d, which cites §7c. Merging main into the PR conflicts in ARCHITECTURE.md, and arch.py resolve leaves the headings 7a, 7b, 7c, 7d with 7c once. arch.py check passes.
  • A section the PR changed is not dropped: only a whole section, heading to next heading, that main's file holds verbatim is removed.
  • python3 -I -m py_compile.

Source-provenance declaration

By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported. The ODA's public Open Design Specification for .dwg files PDF is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported. This matters because dwg-rs is Apache-2.0 and must remain compatible.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • Public reverse-engineering notes, research papers, or blog posts cited inline;
  • Reading algorithm-description comments (not executable code) in permissively-licensed projects (MIT / Apache / BSD) to resolve spec ambiguities — disclose any such reading in this PR body so it can be recorded in CLEANROOM.md.

See CLEANROOM.md for the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.

I will sign off commits with git commit -s when asked, which adds a
Signed-off-by trailer to the commit message asserting the DCO.

… a stacked PR's ARCHITECTURE.md

A PR stacked on another carries the lower PR's ARCHITECTURE.md sections; once
that PR squash-lands, merging main into the upper one conflicts where both
appended, and arch.py resolve appended main's copy and then the PR's, so the
section came twice and the Spec coverage job's order check failed (#388 had
two §7au on 2026-10-27). resolve now drops each whole section of the PR's side
that main's file already holds word for word.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T20:44:13.003367Z 5a83f58 New commits
ℹ️ 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.

@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: 8df19673a0

ℹ️ 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/arch.py Resolved
…s whole sections

Codex on #415: the substring test dropped a PR section whose text is a prefix
of main's ("Decoded records: 10" against main's "100"). resolve now splits
main's file into whole sections, heading to the next heading, and drops only a
PR section equal to one of them; a differing copy is kept, and the order check
then names the repeated suffix for a person to settle.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 27, 2026 20:49
@DrunkOnJava
DrunkOnJava merged commit c1f9d3b into main Oct 27, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/arch-stacked-sections branch October 27, 2026 20:58
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