Skip to content

Patch queue: patches.py absorb for direct edits to vendored files, and a check that says what to run (builds on #147) - #148

Merged
LNPANDY merged 2 commits into
LNPANDY:mainfrom
v0lumehi:patches-absorb
Oct 28, 2026
Merged

LNPANDY merged 2 commits into
LNPANDY:mainfrom
v0lumehi:patches-absorb

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #147 (this branch is patch-queue-fix plus one commit; the diff shows only #147's commit until it merges, then rebase). #147 is what restores main's red patches.py check after #139; this PR adds nothing to the series and touches no patch.

What changes

  • patches.py absorb [paths...] [--into <patch>]. It compares the vendored files (working tree or already committed) with pin + series and folds each difference into the patch that already touches the file (the last one if several do), keeping the header. It then runs check. Use it when you edited a vendored file directly.
    • A new file goes to a patch only if one patch touches files in its nearest folder. Otherwise it stops, writes nothing, and asks for --into <patch>.
    • Shader chain paths are refused. Generated indexes are left to apply.
  • Better failure message. check now prints, per file, docs/x.md differs from pin+patches: run python3 scripts/patches.py absorb docs/x.md and commit patches/. The pr-scope and tests CI jobs add the same as an error annotation. patches/README.md and CONTRIBUTING.md are updated.
  • Tests: 10 new cases in scripts/tests/test_patches.py on the fixture repo (owned file, committed edit, last owner, new file next to a patched one, --into, ambiguity, paths filter, deletion, no-op, chain refusal). They do not use the real series.

Verified (on the #147 base)

  • python3 scripts/patches.py check passes (18 patches); python3 -m unittest discover scripts/tests passes (34 tests).
  • Dry bump to seedds main: 14 clean, 0 landed, 4 conflicts (0001, 0002, 0009, 0013), the same conflicts as on main.

Fix, merge when green and after #147. It touches the sync mechanism, so @LNPANDY please have a look.

Copilot AI 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.

🟡 Changes recommended

Absorb lacks pre-write checks for already-satisfied replayed patches and empty amended commits, allowing it to modify patch files and leave the patch queue invalid.

3 open issues
What changed in this PR

This PR restores patch-queue coverage of the documentation updates from #139 and adds absorb to fold direct vendored-file edits into existing patches.

Changes:

  • Refreshes the probe and fork-documentation patches to reproduce the current docs.
  • Adds absorb with patch ownership selection, path filtering, safety checks, and fixture tests.
  • Updates contributor guidance and CI errors with recovery commands.
File Description
scripts/​tests/​test_patches.py Adds absorb scenarios and updates failure-message expectations.
scripts/​patches.py Implements absorb and actionable check diagnostics.
patches/​README.md Documents absorbing direct vendored-file edits.
patches/​0015-fork-docs.patch Records the updated launcher feasibility milestone.
patches/​0014-ios-probe.patch Incorporates the device probe results and remaining limitations.
CONTRIBUTING.md Adds absorb to the contribution workflow.
.github/​workflows/​tests.yml Adds patch-queue recovery guidance to CI errors.
.github/​workflows/​pr-scope.yml Adds recovery guidance when vendored-tree validation fails.

Review effort: Balanced

Comment thread scripts/patches.py Resolved
Comment thread scripts/patches.py Resolved
Comment thread scripts/patches.py Resolved
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

@v0lumehi v0lumehi changed the title Patch queue: fold #139's docs into the series, and patches.py absorb for direct edits to vendored files Patch queue: patches.py absorb for direct edits to vendored files, and a check that says what to run (builds on #147) Oct 28, 2026
@v0lumehi
v0lumehi requested a balanced review from Copilot October 28, 2026 16:28
@LNPANDY

LNPANDY commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Merged #147 just now (it was green and fixes the same red check), so main's patches.py check passes again: 18 patches on 062cd06, and it also drops patch 0019 — the prune feature was revoked in 0506db0 (the owner keeps every extracted version), and the migration had brought it back.

Please rebase #148 onto main. What is still worth landing from it: patches.py absorb (the tool is the real improvement — hand edits become patch edits instead of a red check), the per-file failure message with the exact command, the 10 new tests, and your better placement of docs/probe-dlopen.md in 0014 rather than 0015. Expect a conflict in patches/0015-fork-docs.patch (both of us refreshed it) and in series; resolve by taking your placement and keeping 0019 out.

Note for the rebase: 0015 now ends with docs/launcher-c-plan.md (route C plan, absorbed) — keep it.

Copilot AI 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.

🟡 Changes recommended

Reverting a patch’s last change can overwrite it with an empty file and break the patch series, while the suggested recovery command omits files beyond the first six.

4 open issues

Review effort: Balanced

Comment thread scripts/patches.py Resolved
…t says what to run

absorb [paths] [--into patch] folds the difference between the vendored files
and pin + series into the patch that touches each file, then runs check.
check names the command per file; the CI jobs, patches/README.md and
CONTRIBUTING.md say the same.
@v0lumehi

Copy link
Copy Markdown
Collaborator Author

Rebased onto main (#147 in), 0014 keeps docs/probe-dlopen.md, 0015 keeps docs/launcher-c-plan.md, 0019 stays out. The four review findings are fixed in 49715da, each with a test; the PR now holds only the tool, tests and notes.

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.

3 participants