diff --git a/CHANGELOG.md b/CHANGELOG.md
index dff8f16..4e4650b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## 0.47.24 - 2026-11-17
+
+- Let stack sync report a verified, consistent adoption as a read-only no-op with the next rebuild or push previews. Keep explicit adoption guidance for stale source history. Explain why absorb cannot edit pinned history and preserve its patch while naming an existing draft as the destination.
+
## 0.47.23 - 2026-11-16
- Evaluate the latest verified check run per workflow and check name for PR merges. Report superseded runs as informational while preserving blocks for current failures, pending checks, distinct workflows and ambiguous history. Apply the same selection to required checks.
diff --git a/README.md b/README.md
index 6edfb70..4efed3a 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.23`
+Current version: `0.47.24`
`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
diff --git a/VERSION b/VERSION
index cf7b6cd..47d5b03 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.47.23
+0.47.24
diff --git a/docs/index.html b/docs/index.html
index 93ed2ff..fca6763 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1826,7 +1826,7 @@
-
AI-ready Git coordination v0.47.23
+
AI-ready Git coordination v0.47.24
Move at machine 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.
- syncwheel v0.47.23 · MIT · a NestDevLab project
+ syncwheel v0.47.24 · MIT · a NestDevLab project
diff --git a/docs/stack-adoption.md b/docs/stack-adoption.md
index bee05b2..1900f8f 100644
--- a/docs/stack-adoption.md
+++ b/docs/stack-adoption.md
@@ -39,9 +39,25 @@ the entire `BASE..TIP` graph as declared stack history. The source ref advances
locally to the reviewed commit without replay or reconstruction. Adoption
leaves worktree registration and cleanup to their own commands.
-Review a new tip or base through another explicit adoption. `stack sync` and
-`stack absorb` refuse to change an adopted history, and automatic reconciliation
-refuses to rebuild or realign its source branch. If resume finds an undeclared
+Review a new tip or base through another explicit adoption. When the manifest,
+pinned commits and direct source ref still match the adoption, `stack sync`
+succeeds without changing anything: the stack is adopted and has nothing to
+sync. It prints integration rebuild and stack push previews as next steps.
+A missing, symbolic or changed source ref remains a stale adoption and requires
+explicit review of the base and tip. Pending adoption, control recovery and
+promotion operations must still be resolved before synchronization.
+
+`stack absorb` cannot edit pinned adopted history. For a consistent adoption it
+leaves the selected patch intact and names absorption into an existing,
+non-adopted draft, using `-N -m MESSAGE` for a new commit. Select a draft you own
+and keep the printed manifest and path selection. Existing primary ownership and
+staged-path guards still apply: unrelated staged work must be preserved for its
+owner, and can block this follow-up. This refusal is not a request
+to repeat the completed adoption, and does not claim the patch was absorbed.
+A stale adoption retains the explicit base/tip review remedy.
+
+Automatic reconciliation refuses to rebuild or realign the adopted source
+branch. If resume finds an undeclared
integration commit likely owned by the adopted stack, it requests manual review
and preserves the adopted history.
diff --git a/openpack.json b/openpack.json
index d84252e..2dacfb1 100644
--- a/openpack.json
+++ b/openpack.json
@@ -1,7 +1,7 @@
{
"schemaVersion": 2,
"name": "NestDevLab/syncwheel",
- "version": "0.47.23",
+ "version": "0.47.24",
"provides": [
{
"type": "skills",
diff --git a/scripts/syncwheel.py b/scripts/syncwheel.py
index 85e55e7..d39d12c 100755
--- a/scripts/syncwheel.py
+++ b/scripts/syncwheel.py
@@ -118,7 +118,6 @@
from syncwheel_stacks import (
StackLifecycle,
ordinary_empty_draft_close,
- require_stack_absorb_amendable,
stack_closed_payload,
manifest_scope_options,
stack_close_command,
@@ -15817,7 +15816,9 @@ def stack_absorb_preflight(args):
manifest, _ = _manifest_storage.load_manifest(repo_root, path)
if manifest is not None and manifest.get('repository_mode') != 'journal':
stack = require_stack(manifest, args.stack)
- require_stack_absorb_amendable(stack, args)
+ _stack_lifecycle(repo_root).require_stack_absorb_allowed(
+ stack, args, shlex.join(manifest_path_remedy_options(repo_root, path)),
+ )
_stack_lifecycle(repo_root).require_empty_stack_absorb_base(stack)
@@ -15826,7 +15827,31 @@ def command_stack_absorb(args):
manifest, _ = _manifest_storage.load_manifest(repo_root, manifest_path)
if manifest is None:
raise SyncwheelError(f'manifest not found: {manifest_path}')
- return _stack_lifecycle(repo_root).command_stack_absorb(args, manifest, manifest_path)
+ return _stack_lifecycle(repo_root).command_stack_absorb(
+ args, manifest, manifest_path, shlex.join(manifest_path_remedy_options(repo_root, manifest_path)),
+ )
+
+
+def observed_adopted_stack_command(args):
+ if args.func == command_stack_sync:
+ args._stack_sync_selection = resolve_stack_sync_selection(args)
+ root, path = resolve_command_manifest_selection(args)
+ manifest, _ = _manifest_storage.load_manifest(root, path)
+ if not manifest or manifest.get('repository_mode') == 'journal':
+ return None
+ stack = require_stack(manifest, args.stack)
+ if not stack.get('adopted_history'):
+ return None
+ validate_selected_primary_authority_path(root, path)
+ selection = shlex.join(manifest_path_remedy_options(root, path))
+ stack_adoption_preflight(args)
+ refuse_stack_sync_control_recovery(root, path, 'adopted stack command')
+ lifecycle = _stack_lifecycle(root)
+ lifecycle.refuse_pending_stack_sync_promotion(path, selection)
+ if args.func == command_stack_sync:
+ return lifecycle.observe_adopted_stack_sync(args, stack, selection)
+ lifecycle.require_stack_absorb_allowed(stack, args, selection)
+ raise SyncwheelError('adopted stack changed during observation; inspect and retry')
def resolve_stack_absorb_location(repo_root, manifest_path, manifest, stack, args):
@@ -20125,7 +20150,7 @@ def governed_worktree_preflight(args):
return
if args.func in {command_stack_sync, command_stack_absorb}:
if require_stack(manifest, args.stack).get('adopted_history'):
- raise SyncwheelError('adopted history requires explicit stack set --base BASE --adopt-tip TIP')
+ raise SyncwheelError('stack adoption changed after observation; inspect the selected manifest and retry')
if args.func == command_stack_set and (getattr(args, 'base', None) or getattr(args, 'adopt_tip', None)):
# Adoption has an exact plan and never cleans up lanes.
return
@@ -20578,6 +20603,9 @@ def main():
parser.error('unrecognized arguments: ' + ' '.join(extras))
args.specs = [*args.specs, *extras]
args.git_args = passthrough
+ if args.func == command_stack_absorb:
+ args.paths.extend(passthrough)
+ args.git_args = []
# Syncwheel owns the managed branches, so its own child Git processes are
# allowed to rewind them. The guard exists to stop every other caller.
guard_callback = args.func in {
@@ -20587,12 +20615,23 @@ def main():
}
global SYNCWHEEL_OWNS_REF_MOVES, SYNCWHEEL_REF_AUTH_REPO
desk_release = args.func == command_stack_release_desk
+ adopted_metadata = False
readonly_diagnostics = (
args.func == command_worktree_list
or (args.func in {command_status, command_check} and not args.fetch)
or (desk_release and not args.apply)
)
try:
+ if args.func in {command_stack_sync, command_stack_absorb}:
+ adopted_metadata = True
+ observation = _READONLY_DIAGNOSTICS.set(True)
+ try:
+ result = observed_adopted_stack_command(args)
+ finally:
+ _READONLY_DIAGNOSTICS.reset(observation)
+ if result is not None:
+ return result
+ adopted_metadata = False
if desk_release:
args.repo = args.repo or os.environ.get(ENV_REPO)
if readonly_diagnostics or desk_release:
@@ -20682,7 +20721,7 @@ def main():
print(f'error: {exc}', file=sys.stderr)
return 2
finally:
- if not readonly_diagnostics and not desk_release:
+ if not readonly_diagnostics and not desk_release and not adopted_metadata:
if SYNCWHEEL_REF_AUTH_REPO:
clear_ref_authorizations(SYNCWHEEL_REF_AUTH_REPO)
SYNCWHEEL_REF_AUTH_REPO = None
diff --git a/scripts/syncwheel_stacks.py b/scripts/syncwheel_stacks.py
index 150b3fc..2290e83 100644
--- a/scripts/syncwheel_stacks.py
+++ b/scripts/syncwheel_stacks.py
@@ -79,8 +79,6 @@
def require_stack_absorb_amendable(stack, args):
- if stack.get('adopted_history'):
- raise SyncwheelError('adopted history requires explicit stack set --base BASE --adopt-tip TIP')
if args.amend and not stack['commits']:
raise SyncwheelError(
f"stack {stack['id']!r} has no commits to amend; "
@@ -2366,12 +2364,68 @@ def refuse_pending_stack_sync_promotion(self, manifest_path, remedy_selection):
f'syncwheel stack promote {quoted([pending_stack])} {remedy_selection}'
)
+ def consistent_stack_adoption(self, stack, remedy_selection):
+ adopted = validate_stack_adoption(stack)
+ if not adopted:
+ return None
+ root = self.repository.root
+ ref = f"refs/heads/{stack['branch']}"
+ offline = {'GIT_NO_LAZY_FETCH': '1', 'GIT_ALLOW_PROTOCOL': '', 'GIT_OPTIONAL_LOCKS': '0'}
+
+ def observe(*args, allowed=(0,)):
+ result = self.repository.git(root, *args, check=False, env=offline)
+ if result.returncode not in allowed:
+ raise SyncwheelError(
+ f'cannot verify adopted history: Git {args[0]} failed; inspect repository objects before retrying'
+ )
+ return result
+
+ stale = (
+ observe('symbolic-ref', '--quiet', ref, allowed=(0, 1)).returncode == 0
+ or observe('rev-parse', '--verify', '--quiet', ref, allowed=(0, 1)).stdout.strip() != adopted['tip']
+ or any(observe('cat-file', '-t', oid).stdout.strip() != 'commit'
+ for oid in (adopted['base'], adopted['tip']))
+ )
+ if not stale and adopted['tip'] != adopted['base']:
+ parents = observe('rev-list', '--parents', '-n', '1', adopted['tip']).stdout.split()[1:]
+ contained = [parent for parent in parents
+ if observe('merge-base', '--is-ancestor', parent, adopted['base'], allowed=(0, 1)).returncode == 0]
+ stale = contained != [adopted['base']]
+ if stale:
+ raise SyncwheelError(
+ 'adopted history is stale; use explicit '
+ f"syncwheel stack set {quoted([stack['id']])} --base BASE --adopt-tip TIP {remedy_selection}"
+ )
+ return adopted
+
+ def require_stack_absorb_allowed(self, stack, args, remedy_selection):
+ if self.consistent_stack_adoption(stack, remedy_selection):
+ mode = ['--staged'] if args.staged else []
+ paths = ['--', *args.paths] if args.paths else []
+ remedy = quoted(['syncwheel', 'stack', 'absorb', 'DRAFT', *mode, '-N', '-m', 'MESSAGE'])
+ raise SyncwheelError(
+ 'stack is adopted; cannot absorb into its pinned history. Patch remains unchanged. '
+ 'Use an existing non-adopted draft; primary ownership and staged-path guards still apply. '
+ 'Replace DRAFT and MESSAGE in: '
+ f'{remedy} {remedy_selection} {quoted(paths)}'
+ )
+ require_stack_absorb_amendable(stack, args)
+
+ def observe_adopted_stack_sync(self, args, stack, remedy_selection):
+ if not self.consistent_stack_adoption(stack, remedy_selection):
+ return None
+ print(f'{args.stack}: stack is adopted; nothing to sync. Next: int rebuild / push')
+ print(f' syncwheel int rebuild --dry-run {remedy_selection}')
+ print(f' syncwheel stack push {quoted([args.stack])} --dry-run {remedy_selection}')
+ return 0
+
def command_stack_sync(self, args, manifest, manifest_path, remedy_selection):
repo_root = self.repository.root
stack = require_stack(manifest, args.stack)
- if stack.get('adopted_history'):
- raise SyncwheelError('adopted history requires explicit stack set --base BASE --adopt-tip TIP')
self.refuse_pending_stack_sync_promotion(manifest_path, remedy_selection)
+ observed = self.observe_adopted_stack_sync(args, stack, remedy_selection)
+ if observed is not None:
+ return observed
commits = self.repository.rev_list(
repo_root, f"{stack['base']}..{stack['branch']}", offline=True,
)
@@ -2403,10 +2457,10 @@ def require_empty_stack_absorb_base(self, stack):
return base, tip
- def command_stack_absorb(self, args, manifest, manifest_path):
+ def command_stack_absorb(self, args, manifest, manifest_path, remedy_selection=''):
repo_root = self.repository.root
stack = require_stack(manifest, args.stack)
- require_stack_absorb_amendable(stack, args)
+ self.require_stack_absorb_allowed(stack, args, remedy_selection)
empty_start = self.require_empty_stack_absorb_base(stack)
integration_branch = stack.get('integration_branch') or manifest['integration']['branch']
current_branch = self.repository.get_current_branch(repo_root)
diff --git a/tests/test_adopted_stack_sync.py b/tests/test_adopted_stack_sync.py
new file mode 100644
index 0000000..a9d6abf
--- /dev/null
+++ b/tests/test_adopted_stack_sync.py
@@ -0,0 +1,206 @@
+import json
+import os
+import shlex
+import subprocess
+import unittest
+from unittest import mock
+
+import test_stack_adoption_edges as fixtures
+
+
+def files(root):
+ return {
+ str(path.relative_to(root)): (path.lstat().st_mode,
+ os.readlink(path) if path.is_symlink() else path.read_bytes())
+ for path in root.rglob('*') if path.is_file() or path.is_symlink()
+ }
+
+
+def contents(path):
+ return path.read_bytes() if path.exists() else None
+
+
+class AdoptedStackSyncTest(unittest.TestCase):
+ def setUp(self):
+ self.edge = fixtures.StackAdoptionEdgeTest()
+ self.edge.setUp()
+ self.addCleanup(self.edge.doCleanups)
+ self.case = self.edge.case
+ self.f = self.edge.f
+ self.case.apply(self.case.preview())
+ self.cache = self.f.tmp / 'update-cache.json'
+ self.cache.write_text('{"last_checked_epoch": 0}\n')
+ self.env = {'SYNCWHEEL_UPDATE_MODE': 'off', 'SYNCWHEEL_UPDATE_STATE_PATH': str(self.cache)}
+
+ def state(self):
+ result = self.edge.repository_state()
+ result.update(
+ index=(self.f.repo / '.git/index').read_bytes(),
+ control=files(self.f.repo / '.syncwheel'),
+ private_git=files(self.f.repo / '.git/syncwheel'),
+ hooks=files(self.f.repo / '.git/hooks'),
+ cache=self.cache.read_bytes(),
+ ignore=contents(self.f.repo / '.gitignore'),
+ exclude=contents(self.f.repo / '.git/info/exclude'),
+ )
+ return result
+
+ def cli(self, *args, expected=0):
+ return self.f.run_cli(*args, expected=expected, extra_env=self.env)
+
+ def test_consistent_sync_preserves_dirty_primary_and_control_state(self):
+ source = self.f.repo / 'pending.txt'
+ source.write_text('staged contribution\n')
+ self.f.git('add', source.name)
+ source.write_text('staged contribution\nunstaged contribution\n')
+ nonce = self.f.repo / '.git/syncwheel/ref-auth/expired'
+ nonce.parent.mkdir(parents=True, exist_ok=True)
+ nonce.write_text('{')
+ os.utime(nonce, (1, 1))
+ before = self.state()
+
+ result = self.cli('stack', 'sync', 'replay')
+
+ self.assertIn('stack is adopted; nothing to sync. Next: int rebuild / push', result.stdout)
+ self.assertNotIn('stack set', result.stdout + result.stderr)
+ self.assertEqual(self.state(), before)
+
+ def test_empty_adoption_is_consistent(self):
+ args = ['stack', 'set', 'replay', '--base', self.case.tip, '--adopt-tip', self.case.tip]
+ plan = json.loads(self.cli(*args).stdout)
+ self.cli(*args, '--apply', '--plan-digest', plan['planDigest'])
+ self.assertEqual(self.f.read_manifest()['stacks'][0]['commits'], [])
+ before = self.state()
+ self.assertIn('nothing to sync', self.cli('stack', 'sync', 'replay').stdout)
+ self.assertEqual(self.state(), before)
+
+ def test_source_drift_never_reports_noop(self):
+ ref = 'refs/heads/pr/replay'
+ later = self.f.git('commit-tree', self.case.tip + '^{tree}', '-p', self.case.tip, '-m', 'Later work')
+ for kind in ('advanced', 'rewound', 'missing', 'symbolic'):
+ with self.subTest(kind=kind):
+ self.f.git('update-ref', '--no-deref', '-d', ref)
+ if kind == 'symbolic':
+ self.f.git('symbolic-ref', ref, 'refs/heads/main')
+ elif kind != 'missing':
+ self.f.git('update-ref', ref, later if kind == 'advanced' else self.case.new_base)
+ before = self.state()
+ for command in ('sync', 'absorb'):
+ result = self.cli('stack', command, 'replay', expected=2)
+ self.assertIn('adopted history is stale', result.stderr)
+ self.assertIn('stack set replay --base BASE --adopt-tip TIP', result.stderr)
+ self.assertNotIn('nothing to sync', result.stdout)
+ self.assertEqual(self.state(), before)
+
+ def test_printed_staged_remedy_preserves_unrelated_staged_work_on_refusal(self):
+ self.cli('stack', 'create', 'patch', '--draft', '--base', self.case.base,
+ '--integration-branch', 'main')
+ source = self.f.repo / 'pending.txt'
+ source.write_text('staged contribution\n')
+ self.f.git('add', source.name)
+ source.write_text('staged contribution\nunstaged contribution\n')
+ unrelated = self.f.repo / 'unrelated.txt'
+ unrelated.write_text('another staged contribution\n')
+ self.f.git('add', unrelated.name)
+ before = self.state()
+
+ result = self.cli('stack', 'absorb', 'replay', '--staged', '--', 'pending.txt', expected=2)
+
+ self.assertIn('cannot absorb into its pinned history', result.stderr)
+ self.assertNotIn('stack set', result.stderr)
+ self.assertEqual(self.state(), before)
+ remedy = shlex.split(result.stderr.partition('in: ')[2])
+ self.assertEqual(remedy[:3], ['syncwheel', 'stack', 'absorb'])
+ remedy[3] = 'patch'
+ remedy[remedy.index('-m') + 1] = 'Preserve staged contribution'
+ blocked = self.cli(*remedy[1:], expected=2)
+ self.assertIn('primary checkout has unrelated staged paths: unrelated.txt', blocked.stderr)
+ self.assertEqual(self.state(), before)
+
+ def test_printed_staged_remedy_absorbs_selected_patch_when_guard_allows(self):
+ self.cli('stack', 'create', 'patch', '--draft', '--base', self.case.base,
+ '--integration-branch', 'main')
+ source = self.f.repo / 'pending.txt'
+ source.write_text('staged contribution\n')
+ self.f.git('add', source.name)
+ before = self.state()
+ result = self.cli('stack', 'absorb', 'replay', '--staged', '--', source.name, expected=2)
+ self.assertEqual(self.state(), before)
+ remedy = shlex.split(result.stderr.partition('in: ')[2])
+ remedy[3] = 'patch'
+ remedy[remedy.index('-m') + 1] = 'Preserve staged contribution'
+ self.cli(*remedy[1:])
+ draft = next(stack for stack in self.f.read_manifest()['stacks'] if stack['id'] == 'patch')
+ self.assertEqual(self.f.git('show', draft['commits'][0] + ':pending.txt'), 'staged contribution')
+ self.assertEqual(self.f.git('diff', '--cached'), '')
+ self.assertFalse(source.exists())
+ self.assertEqual(self.f.git('rev-parse', 'pr/replay'), self.case.tip)
+
+ def test_printed_unstaged_remedy_keeps_other_paths_out_of_draft(self):
+ self.cli('stack', 'create', 'patch', '--draft', '--base', self.case.base,
+ '--integration-branch', 'main')
+ source = self.f.repo / 'alpha.txt'
+ original = source.read_bytes()
+ source.write_text('selected contribution\n')
+ unrelated = self.f.repo / 'beta.txt'
+ unrelated.write_text('other unstaged contribution\n')
+ before = self.state()
+ result = self.cli('stack', 'absorb', 'replay', '--', source.name, expected=2)
+ self.assertEqual(self.state(), before)
+ remedy = shlex.split(result.stderr.partition('in: ')[2])
+ remedy[3] = 'patch'
+ remedy[remedy.index('-m') + 1] = 'Preserve selected contribution'
+ self.cli(*remedy[1:])
+ draft = next(stack for stack in self.f.read_manifest()['stacks'] if stack['id'] == 'patch')
+ self.assertEqual(self.f.git('show', draft['commits'][0] + ':alpha.txt'), 'selected contribution')
+ self.assertEqual(self.f.git('diff-tree', '--no-commit-id', '--name-only', '-r', draft['commits'][0]),
+ 'alpha.txt')
+ self.assertEqual(source.read_bytes(), original)
+ self.assertEqual(unrelated.read_text(), 'other unstaged contribution\n')
+ self.assertEqual(self.f.git('diff', '--cached'), '')
+ self.assertEqual(self.f.git('rev-parse', 'pr/replay'), self.case.tip)
+
+ def test_failed_side_parent_ancestry_query_does_not_prove_consistency(self):
+ lifecycle = self.edge.module._stack_lifecycle(self.f.repo)
+ stack = self.f.read_manifest()['stacks'][0]
+ original = lifecycle.repository.git
+ parents = self.f.git('rev-list', '--parents', '-n', '1', self.case.tip).split()[1:]
+ side = next(parent for parent in parents if parent != self.case.new_base)
+
+ def failed(root, *args, **kwargs):
+ if args[:3] == ('merge-base', '--is-ancestor', side):
+ return subprocess.CompletedProcess(args, 128, '', 'fixture object read failure')
+ return original(root, *args, **kwargs)
+
+ before = self.state()
+ with mock.patch.object(lifecycle.repository, 'git', side_effect=failed):
+ with self.assertRaisesRegex(self.edge.module.SyncwheelError, 'cannot verify adopted history'):
+ lifecycle.consistent_stack_adoption(stack, '')
+ self.assertEqual(self.state(), before)
+
+ def test_pending_adoption_is_not_reported_as_synced(self):
+ self.case.new_base = self.case.tip
+ self.edge.interrupt(self.case.preview(), 'manifest-updated')
+ before = self.state()
+ result = self.cli('stack', 'sync', 'replay', expected=2)
+ self.assertIn('interrupted stack adoption', result.stderr)
+ self.assertEqual(self.state(), before)
+
+ def test_control_and_promotion_intents_remain_blocking_without_recovery(self):
+ for event, payload, expected in (
+ ('control_manifest_persistence_intent', {'operation_id': 'fixture-control'}, 'control manifest recovery'),
+ ('coordination_publish_intent', {'operation_token': 'fixture-promotion', 'scope': 'promote:replay'}, 'stack promote replay'),
+ ):
+ with self.subTest(event=event):
+ self.edge.module.append_ledger_event(self.f.repo, event, payload, self.case.manifest_path)
+ before = self.state()
+ result = self.cli('stack', 'sync', 'replay', expected=2)
+ self.assertIn(expected, result.stderr)
+ self.assertEqual(self.state(), before)
+ terminal = ('control_manifest_persistence_abandoned' if 'operation_id' in payload
+ else 'coordination_publish_abandoned')
+ self.edge.module.append_ledger_event(self.f.repo, terminal, payload, self.case.manifest_path)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/test_stack_adoption_edges.py b/tests/test_stack_adoption_edges.py
index 3e10d56..4ab3025 100644
--- a/tests/test_stack_adoption_edges.py
+++ b/tests/test_stack_adoption_edges.py
@@ -59,8 +59,8 @@ def repository_state(self):
def test_stack_sync_and_absorb_preserve_adopted_history_and_primary_patch(self):
self.case.apply(self.case.preview())
clean_state = self.repository_state()
- result = self.f.run_cli('stack', 'sync', 'replay', expected=2)
- self.assertIn('adopted history requires explicit stack set', result.stderr)
+ result = self.f.run_cli('stack', 'sync', 'replay')
+ self.assertIn('stack is adopted; nothing to sync', result.stdout)
self.assertEqual(self.repository_state(), clean_state)
source = self.f.repo / 'pending.txt'
@@ -69,7 +69,7 @@ def test_stack_sync_and_absorb_preserve_adopted_history_and_primary_patch(self):
source.write_text('additional working tree change\n')
before = self.repository_state()
result = self.f.run_cli('stack', 'absorb', 'replay', '--staged', expected=2)
- self.assertIn('adopted history requires explicit stack set', result.stderr)
+ self.assertIn('cannot absorb into its pinned history', result.stderr)
self.assertEqual(self.repository_state(), before)
def test_resume_planner_requires_review_for_an_undeclared_adopted_stack_commit(self):