From a5bc7015fc39637facd7f37e6667bd849b0579f9 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Mon, 16 Nov 2026 20:09:01 +0000 Subject: [PATCH 1/2] fix: preserve empty stack bases when absorbing primary work --- CHANGELOG.md | 4 + README.md | 24 ++-- VERSION | 2 +- docs/ai-agents.md | 7 +- docs/index.html | 4 +- openpack.json | 2 +- scripts/syncwheel.py | 198 ++++++++++++++++++++++------- scripts/syncwheel_stacks.py | 48 ++++++- skills/syncwheel/SKILL.md | 5 + tests/test_dirty_primary_remedy.py | 196 ++++++++++++++++++++++++++++ tests/test_managed_ref_guard.py | 7 +- tests/test_syncwheel.py | 8 +- 12 files changed, 434 insertions(+), 71 deletions(-) create mode 100644 tests/test_dirty_primary_remedy.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5036a3be..14348b6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.47.18 - 2026-11-16 + +- Name path-scoped stack absorb with a new commit for uncommitted primary changes, reserving capture-integration for existing unowned commits. Refuse default amend on an empty stack before changing its base, metadata or worktrees. An empty recipe whose branch has moved from the base also refuses a new-commit absorb, preserving its undeclared history. + ## 0.47.17 - 2026-11-16 - Let stack sync update selected manifest metadata while unrelated primary product files are unstaged. Preserve product bytes, indexes, ignore files and unrelated refs; require explicit recovery for pending operations instead of starting promotion recovery or worktree cleanup. diff --git a/README.md b/README.md index 2fc554ca..d462193b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Keep many long-lived pull requests clean, rebuildable, and publishable from one manifest. -Current version: `0.47.17` +Current version: `0.47.18` `syncwheel` is a small CLI and workflow model for maintainers who carry several PR branches against an upstream repository and need those branches to stay @@ -515,8 +515,9 @@ warnings for unfinished lanes when stderr is a TTY; `NO_COLOR` removes ANSI color and JSON output remains free of ANSI sequences. When an occupied primary checkout stops a mutating command, Syncwheel names -manifest-derived capture and queue commands in the error. Capture committed -primary work with `syncwheel stack capture-integration HEAD`, or leave +manifest-derived recovery commands in the error. For uncommitted tracked changes, +use `syncwheel stack absorb -N -m "message"` after identifying +their owning stack. Capture already committed, unowned primary work with `syncwheel stack capture-integration HEAD`, or leave another agent's primary checkout unchanged and use `syncwheel worktree open --into `. Capacity and expired-lane diagnostics name the corresponding `syncwheel stack add ..` @@ -1115,18 +1116,22 @@ missing, it refuses and names the owner. ### 3. Absorb integration-first work into stacks -When the main checkout is on the integration branch, you can make and test -changes there first, then assign those changes to the PR stack that owns them: +When uncommitted changes already exist on the integration checkout, transfer +them to their owning stack before continuing: ```bash -python3 scripts/syncwheel.py stack absorb feature-a path/to/file.ts -python3 scripts/syncwheel.py stack absorb feature-a --staged +python3 scripts/syncwheel.py stack absorb feature-a path/to/file.ts -N -m "Add feature work" +python3 scripts/syncwheel.py stack absorb feature-a --staged -N -m "Add staged feature work" ``` By default, `stack absorb` amends the stack branch tip, refreshes that stack's manifest commits, and reverse-applies the absorbed patch from the integration checkout. Pass `--no-amend -m "message"` when the absorbed change should become -a new stack commit. Use `--staged` after `git add -p` when one file contains +a new stack commit. An empty stack requires this option: default amend is refused +so its base commit cannot be amended. If an empty recipe has a branch that has +already moved away from its base, absorb refuses: preserve that history for +explicit classification and use a fresh draft for the patch. `capture-integration` assigns existing +commits; it does not capture dirty working-tree bytes. Use `--staged` after `git add -p` when one file contains changes for multiple PR stacks. Example: two files belong to `feature-a`, one file belongs to `feature-b`, and @@ -1305,7 +1310,8 @@ Bounded metadata operations can preserve those changes in place: setting authori on an untracked personal manifest, setting or clearing the private PR merge policy, closing an empty non-coordinated draft with the default reason or `--reason closed`, without forcing or deleting its branch, and -archiving a non-coordinated stack through its exact plan. Existing index conflicts, +archiving a non-coordinated stack through its exact plan, and stack sync without +pending recovery. Existing index conflicts, unrelated staged paths and a dirty shared control manifest still stop them. Archive keeps the required recovery refs; close retains the source branch by default. diff --git a/VERSION b/VERSION index 43107aab..be481122 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.47.17 +0.47.18 diff --git a/docs/ai-agents.md b/docs/ai-agents.md index bcbdb8b9..48d59d0b 100644 --- a/docs/ai-agents.md +++ b/docs/ai-agents.md @@ -211,14 +211,17 @@ active-active channel must use the coordination remote. exact current projected tip, and the lane records that commit as its base - product-changing mutations stop on unrelated dirty primary files. Personal authority updates, private PR policy set/clear, empty non-coordinated draft close with its default - reason or `closed` and without force or branch deletion, and non-coordinated archive - may proceed while preserving those + reason or `closed` and without force or branch deletion, non-coordinated archive + and stack sync without pending recovery may proceed while preserving those files. Index conflicts, unrelated staged paths and a dirty shared control manifest still stop these operations. Pending control recovery requires its explicit remedy - metadata saves do not normalize ignore files or force-stage authority changes; use explicit tracking configuration when exclusions need updating - read-only diagnostics remain usable when the primary is dirty; treat their yellow dirty-primary warning as foreign work, not permission to repair it +- for uncommitted tracked primary changes, identify their owning stack and use + `syncwheel stack absorb -N -m "message"`. Default amend refuses + an empty stack; it must not amend the base commit - use `syncwheel stack capture-integration HEAD` only for already committed primary work named by a refusal; do not create a new primary commit to use it - use `syncwheel hooks remove --disable --reason "..." --apply` only as a deliberate, diff --git a/docs/index.html b/docs/index.html index a951910f..a7eab148 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1826,7 +1826,7 @@
- AI-ready Git coordination v0.47.17 + AI-ready Git coordination v0.47.18

Move atmachine speed.Stay in control.

Syncwheel coordinates every Git lane used by humans, AI agents, CI and delivery systems—without sacrificing review, safety or recovery.

@@ -2602,7 +2602,7 @@

Your first verified plan in minutes.