@caddis/cli 0.4.96 → 0.4.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +2 -0
  2. package/bundles/antigravity-plugin/plugin.json +1 -1
  3. package/bundles/antigravity-plugin/repo_hygiene.py +134 -20
  4. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_exit.cpython-311.pyc +0 -0
  5. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_file_lock.cpython-311.pyc +0 -0
  6. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_frontmatter.cpython-311.pyc +0 -0
  7. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_redact.cpython-311.pyc +0 -0
  8. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_roadmap.cpython-311.pyc +0 -0
  9. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_rows.cpython-311.pyc +0 -0
  10. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_status.cpython-311.pyc +0 -0
  11. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_tidy.cpython-311.pyc +0 -0
  12. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_todo.cpython-311.pyc +0 -0
  13. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_workstreams.cpython-311.pyc +0 -0
  14. package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc +0 -0
  15. package/bundles/antigravity-plugin/scripts/caddis_fleet.py +31 -21
  16. package/bundles/antigravity-plugin/scripts/caddis_gate.py +18 -1
  17. package/bundles/antigravity-plugin/scripts/caddis_guide.json +2 -2
  18. package/bundles/antigravity-plugin/scripts/caddis_handoff.py +235 -0
  19. package/bundles/antigravity-plugin/scripts/caddis_hub_collect.py +67 -15
  20. package/bundles/antigravity-plugin/scripts/caddis_lanes.py +154 -130
  21. package/bundles/antigravity-plugin/scripts/caddis_review.py +12 -0
  22. package/bundles/antigravity-plugin/scripts/caddis_tidy.py +152 -51
  23. package/bundles/antigravity-plugin/scripts/caddis_todo.py +314 -18
  24. package/bundles/antigravity-plugin/scripts/schemas/hub-collect.schema.json +117 -1
  25. package/bundles/antigravity-plugin/scripts/schemas/hub-plans.schema.json +117 -1
  26. package/bundles/antigravity-plugin/scripts/setup_project_ai.py +60 -2
  27. package/bundles/antigravity-plugin/scripts/templates/coordinator.md +3 -3
  28. package/bundles/antigravity-plugin/skills/coordinate/SKILL.md +4 -1
  29. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +6 -0
  30. package/bundles/antigravity-plugin/skills/handoff/SKILL.md +101 -23
  31. package/bundles/antigravity-plugin/skills/implement/SKILL.md +6 -0
  32. package/bundles/antigravity-plugin/skills/park/SKILL.md +7 -2
  33. package/bundles/antigravity-plugin/skills/pr-merge/SKILL.md +1 -0
  34. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +1 -0
  35. package/bundles/manifest.json +2 -2
  36. package/dist/cli.js +276 -76
  37. package/dist/export/assets/export-B3cUoxL1.js +150 -0
  38. package/dist/export/assets/export-DQss44R1.css +1 -0
  39. package/dist/export/index.html +2 -2
  40. package/dist/ui/assets/Activity-CvEIJlnE.js +6 -0
  41. package/dist/ui/assets/{Guide-Czn5sK0f.js → Guide-BxS9L55s.js} +1 -1
  42. package/dist/ui/assets/Guide-DTd261-c.css +1 -0
  43. package/dist/ui/assets/RoadmapTab-CqlWs7dJ.js +31 -0
  44. package/dist/ui/assets/index-9pdDzLVp.css +1 -0
  45. package/dist/ui/assets/index-DSxeWPax.js +231 -0
  46. package/dist/ui/index.html +2 -2
  47. package/package.json +1 -1
  48. package/dist/export/assets/export-CMtV-slT.css +0 -1
  49. package/dist/export/assets/export-DtlDFN4L.js +0 -150
  50. package/dist/ui/assets/Activity-BDjet2xd.js +0 -6
  51. package/dist/ui/assets/Guide-D-Zy4cUT.css +0 -1
  52. package/dist/ui/assets/RoadmapTab-Bd8geyQx.js +0 -31
  53. package/dist/ui/assets/index-Bd0Z4jR8.css +0 -1
  54. package/dist/ui/assets/index-CmngQ8Mk.js +0 -231
  55. package/dist/ui/assets/time-D00tu2ZP.js +0 -1
@@ -42,14 +42,23 @@ DESIGN (locked, see the plan doc — do not re-litigate here)
42
42
  crash/scratch files at the repo root (`*.stackdump`, `run*.ps1`, `nul`, ...); a `.caddis/` file whose
43
43
  `type:` belongs to another folder; a plan `status: current` with no commit for 14 days. The first is
44
44
  repo-wide and so never appears under `--commit-range`; the other two follow the range like any file.
45
- - `--only <plan> [<plan> ...]` limits a run to those top-level plans: nothing else is moved or
46
- stamped. `/implement` closes the plan it finished with it, so another session's finished work
47
- is never swept into this PR.
45
+ - `--only <path> [<path> ...]` limits a run to those top-level plans, prompts and parking-lot
46
+ items: nothing else is moved or stamped. `/implement` closes the plan it finished with it, and
47
+ `/handoff` the artifacts this session closed, so another session's finished work is never swept in.
48
+ - `--apply` needs a scope (2026-11-07: a handoff's bare `--apply` moved and staged 5 committed items
49
+ of other sessions): `--only <path>...` for this session's artifacts, or `--all` for an owner's
50
+ explicit sweep. A bare `--apply` exits 1 and changes nothing. The dry run needs no scope.
51
+ - Under `--all` a file with uncommitted changes never moves. Under `--only` a named file moves even with
52
+ an uncommitted edit (its own status flip), and its working copy is staged at the new path.
53
+ - `--apply` refuses when the index already holds staged changes (other than a named file's), so its own
54
+ staged moves are alone there; it stages each status flip with its rename; it never plain-renames a tracked file when
55
+ `git mv` fails. It prints one `STAGED:` line per move and a pathspec `git commit` line to commit them.
48
56
 
49
57
  Usage:
50
58
  python scripts/caddis_tidy.py # report only (default = dry-run)
51
- python scripts/caddis_tidy.py --apply # actually move terminal-status artifacts
52
59
  python scripts/caddis_tidy.py --apply --only .caddis/plans/<plan>.md # close this plan only
60
+ python scripts/caddis_tidy.py --apply --only .caddis/parking-lot/<item>.md .caddis/prompts/<p>.md
61
+ python scripts/caddis_tidy.py --apply --all # owner sweep: move every terminal-status artifact
53
62
  python scripts/caddis_tidy.py --check # conformance check; exit 1 on a violation
54
63
  python scripts/caddis_tidy.py --repo-root <p> # scan a different repo (default: cwd)
55
64
  python scripts/caddis_tidy.py --commit-range origin/main..HEAD # also read parking trailers
@@ -366,8 +375,10 @@ class Report:
366
375
  tracker_done_open: list[tuple[Path, str]] = field(default_factory=list)
367
376
  # --commit-range only: repo-relative posix paths the range changed.
368
377
  in_range: set[str] | None = None
369
- # --only only: named plans that did not move, with the reason.
378
+ # --only only: named files that did not move, with the reason.
370
379
  not_moved: list[tuple[Path, str]] = field(default_factory=list)
380
+ # --apply only: moves `git mv` staged, as (old path, new path). Each waits in the index for a commit.
381
+ staged: list[tuple[Path, Path]] = field(default_factory=list)
371
382
  # --apply only: files left alone because git shows uncommitted changes in them (another
372
383
  # session's edit in a shared checkout). Neither moved nor rewritten; not an error.
373
384
  dirty_skipped: list[Path] = field(default_factory=list)
@@ -404,7 +415,7 @@ def _is_git_repo(repo_root: Path) -> bool:
404
415
 
405
416
 
406
417
  def _run_git_mv(repo_root: Path, src: Path, dst: Path) -> bool:
407
- """Returns True on success. Degrades to plain move (caller's job) on any failure."""
418
+ """Returns True on success. On a failure the caller decides: a plain rename only for an untracked file."""
408
419
  try:
409
420
  result = subprocess.run(
410
421
  ["git", "mv", "--", str(src), str(dst)],
@@ -448,19 +459,51 @@ def _dirty_paths(repo_root: Path) -> set[str] | None:
448
459
  return dirty
449
460
 
450
461
 
451
- def _move_one(repo_root: Path, src: Path, report: Report) -> None:
452
- """One named `git mv` into the sibling `done/`; a plain rename when git cannot (no repo, or
453
- an untracked file). Only called once every destination is known to be free."""
462
+ def _is_tracked(repo_root: Path, path: Path) -> bool:
463
+ """True when git tracks `path`, or when git cannot say (fail closed: never plain-rename then)."""
464
+ try:
465
+ rel_path = path.relative_to(repo_root).as_posix()
466
+ except ValueError:
467
+ return True
468
+ done = _git_run(repo_root, "ls-files", "--error-unmatch", "--", rel_path)
469
+ if done is None or done.returncode == 0:
470
+ return True
471
+ return b"did not match" not in (done.stderr or b"")
472
+
473
+
474
+ def _move_one(repo_root: Path, src: Path, report: Report, restage: bool = False) -> None:
475
+ """One named `git mv` into the sibling `done/`; a plain rename only for a file git does not
476
+ track (no repo, or an untracked file). A tracked file whose `git mv` failed (for example a peer
477
+ holds `index.lock`) stays where it is, with an error: a plain rename would leave a tracked
478
+ delete that a commit of all changes records, and the file would drop out of history.
479
+ `restage` also stages the moved file's content (tidy rewrote its status before the move), so the
480
+ index copy in `done/` holds the new status. Only called once every destination is known to be free."""
454
481
  dst = _destination(src)
455
482
  dst.parent.mkdir(parents=True, exist_ok=True)
456
- moved_via_git = False
457
- if _is_git_repo(repo_root):
458
- moved_via_git = _run_git_mv(repo_root, src, dst)
459
- if not moved_via_git:
483
+ if _is_git_repo(repo_root) and _is_tracked(repo_root, src):
484
+ if not _run_git_mv(repo_root, src, dst):
485
+ report.errors.append(f"git mv failed for tracked {src.relative_to(repo_root).as_posix()}: "
486
+ "left in place (run again when no other git command runs)")
487
+ return
488
+ if restage:
489
+ added = _git_run(repo_root, "add", "--", dst.relative_to(repo_root).as_posix())
490
+ if added is None or added.returncode != 0:
491
+ report.errors.append(f"moved, but the status flip of {dst.relative_to(repo_root).as_posix()} "
492
+ "is not staged: git add it by name before you commit")
493
+ report.staged.append((src, dst))
494
+ else:
460
495
  src.rename(dst)
461
496
  report.moved.append(src)
462
497
 
463
498
 
499
+ def _staged_paths(repo_root: Path) -> list[str] | None:
500
+ """Repo-relative paths the index holds as staged changes; None when git cannot say."""
501
+ done = _git_run(repo_root, "diff", "--cached", "--name-only", "-z")
502
+ if done is None or done.returncode != 0:
503
+ return None
504
+ return [p for p in done.stdout.decode("utf-8", "replace").split("\0") if p]
505
+
506
+
464
507
  @dataclass
465
508
  class Resolution:
466
509
  """One parking-lot trailer from one commit in the range."""
@@ -661,19 +704,23 @@ def dirty_paths(root: Path, paths: set[str]) -> list[str]:
661
704
  return sorted(dirty)
662
705
 
663
706
 
664
- def _only_targets(root: Path, only: list[str]) -> tuple[set[Path], list[str]]:
665
- """The resolved `--only` plans, and a message for each name that is not a top-level plan."""
666
- plans = (root / ".caddis" / "plans").resolve()
667
- targets: set[Path] = set()
707
+ def _only_targets(root: Path, only: list[str]) -> tuple[dict[Path, str], list[str]]:
708
+ """The resolved `--only` files with their kind, and a message for each name that is not a
709
+ top-level file of `.caddis/plans/`, `.caddis/prompts/` or `.caddis/parking-lot/` (a `done/`
710
+ subfolder, another folder and a path outside the repo are all refused)."""
711
+ homes = {(root / ".caddis" / kind).resolve(): kind for kind in _KINDS}
712
+ targets: dict[Path, str] = {}
668
713
  problems: list[str] = []
669
714
  for name in only:
670
715
  path = Path(name)
671
716
  path = (path if path.is_absolute() else root / path).resolve()
672
- if (path.parent != plans or path.suffix != ".md" or path.name.lower() == "readme.md"
717
+ kind = homes.get(path.parent)
718
+ if (kind is None or path.suffix != ".md" or path.name.lower() == "readme.md"
673
719
  or not path.is_file()):
674
- problems.append(f"--only {name}: not a top-level plan file in .caddis/plans/")
720
+ problems.append(f"--only {name}: not a top-level file in .caddis/plans/, .caddis/prompts/ "
721
+ "or .caddis/parking-lot/")
675
722
  else:
676
- targets.add(path)
723
+ targets[path] = kind
677
724
  return targets, problems
678
725
 
679
726
 
@@ -856,7 +903,8 @@ def tidy(repo_root: Path, apply: bool = False, check: bool = False,
856
903
 
857
904
  Nothing is written until the whole set is known and every destination is free. One existing
858
905
  `done/<name>` (or an unreadable commit range) leaves every file exactly as it was. `only`
859
- names the plans this run may touch; nothing else is moved or stamped.
906
+ names the plans, prompts and parking-lot items this run may touch; nothing else is moved or
907
+ stamped, and no commit trailer is read.
860
908
  """
861
909
  report = Report()
862
910
  if commit_range is not None:
@@ -878,19 +926,22 @@ def tidy(repo_root: Path, apply: bool = False, check: bool = False,
878
926
  f"{', '.join(dirty)}; commit them first")
879
927
  only_set: set[Path] | None = None
880
928
  if only is not None:
881
- only_set, problems = _only_targets(repo_root, only)
882
- if problems or not only_set:
883
- report.errors.extend(problems or ["--only names no plan"])
929
+ only_kinds, problems = _only_targets(repo_root, only)
930
+ if problems or not only_kinds:
931
+ report.errors.extend(problems or ["--only names no file"])
884
932
  report.refused = True
885
933
  return report
886
- kinds = ("plans",) # --only names plans: prompts and parking-lot items stay put
934
+ only_set = set(only_kinds)
935
+ kinds = tuple(k for k in _KINDS if k in only_kinds.values()) # only the named files' folders
887
936
  moves: list[Path] = []
937
+ named: list[tuple[str, Item]] = [] # --only: the named files this run read, with their kind
888
938
  rewrites: dict[Path, str] = {} # applied before the moves, so a failed move leaves a
889
939
  # finished status at the top level, where the next run moves it by status alone
890
940
  for kind in kinds:
891
941
  items = scan(repo_root / ".caddis" / kind)
892
942
  if only_set is not None:
893
943
  items = [item for item in items if item.path.resolve() in only_set]
944
+ named.extend((kind, item) for item in items)
894
945
  for item in items:
895
946
  if kind == PARKING_LOT_DIR:
896
947
  _check_parking_lot_item(item, report)
@@ -941,7 +992,7 @@ def tidy(repo_root: Path, apply: bool = False, check: bool = False,
941
992
  continue
942
993
  if item.phases_all_done:
943
994
  report.stale_suspects.append(item.path)
944
- if commit_range is not None and PARKING_LOT_DIR in kinds:
995
+ if commit_range is not None and PARKING_LOT_DIR in kinds and only_set is None:
945
996
  _plan_parked(repo_root, commit_range, report, moves, rewrites)
946
997
  if check:
947
998
  _check_wider(repo_root, report)
@@ -951,14 +1002,18 @@ def tidy(repo_root: Path, apply: bool = False, check: bool = False,
951
1002
  planned = {src.resolve() for src in moves}
952
1003
  # A plan held for open Tracker rows is already reported (exit 2); it is not a failed request.
953
1004
  held = {p.resolve() for p, _ in report.open_rows_held}
954
- for item in items: # kinds is ("plans",) here, so `items` is the named plans
1005
+ for kind, item in named:
955
1006
  if item.path.resolve() not in planned and item.path.resolve() not in held:
956
- why = ("no frontmatter status" if classify_status(item.status) == "none" else
957
- f"status {item.status} and the Tracker is not all done")
1007
+ if classify_status(item.status, kind) == "none":
1008
+ why = "no frontmatter status"
1009
+ elif kind == "plans":
1010
+ why = f"status {item.status} and the Tracker is not all done"
1011
+ else:
1012
+ why = f"status {item.status} is not finished"
958
1013
  report.not_moved.append((item.path, why))
959
- seen = {item.path.resolve() for item in items}
1014
+ seen = {item.path.resolve() for _, item in named}
960
1015
  for path in sorted(only_set - seen):
961
- report.not_moved.append((path, "not a plan this run reads"))
1016
+ report.not_moved.append((path, "not a file this run reads"))
962
1017
 
963
1018
  report.collisions.extend(src for src in moves if _collides(src))
964
1019
  if not apply:
@@ -969,33 +1024,56 @@ def tidy(repo_root: Path, apply: bool = False, check: bool = False,
969
1024
  # Past this point only an I/O failure can stop the run. Every step is safe to repeat: a
970
1025
  # written status or stamp that did not move yet is moved by status on the next run, and a
971
1026
  # note already present is not appended again.
972
- # Never move, stage or rewrite a file with uncommitted changes to tracked content: in a shared checkout
973
- # that is another session's edit, and a `git mv` stages it for whoever commits next (2026-10-15,
974
- # serve-sight). A status that tidy itself wrote is such a change too, so that plan moves on a later run,
975
- # after the status write is committed.
976
- if _is_git_repo(repo_root):
1027
+ # A file with uncommitted changes to tracked content: under `--all` it is never moved, staged or rewritten.
1028
+ # In a shared checkout that is another session's edit, and a `git mv` stages it for whoever commits next
1029
+ # (2026-10-15, serve-sight). Under `--only` the caller owns each named file, and its uncommitted edit is
1030
+ # usually the status flip that finished it, so a named file moves anyway and its working copy is staged at
1031
+ # the new path (2026-11-08). This check runs before tidy writes anything, so a status that tidy itself
1032
+ # writes below does not count: that plan moves in this run, its new content staged with the rename.
1033
+ named_dirty: set[Path] = set()
1034
+ if _is_git_repo(repo_root) and (moves or rewrites):
1035
+ root_abs = repo_root.resolve()
1036
+
1037
+ def _rel(path: Path) -> str | None:
1038
+ try:
1039
+ return path.resolve().relative_to(root_abs).as_posix()
1040
+ except ValueError:
1041
+ return None
1042
+
1043
+ # Owned: a file `--only` names that this run moves. A named file that stays (a held plan) is not.
1044
+ owned = {_rel(p) for p in moves} if only_set is not None else set()
1045
+ # Tidy's staged moves must be alone in the index: a staged change of this or another session would
1046
+ # go into the same next commit (2026-11-07). Only a named file that this run moves may already be staged.
1047
+ staged = _staged_paths(repo_root)
1048
+ if staged is None:
1049
+ return report.refuse("git could not list the staged changes; nothing was moved")
1050
+ staged = [path for path in staged if path not in owned]
1051
+ if staged:
1052
+ return report.refuse("the index already holds staged changes: " + ", ".join(staged[:10])
1053
+ + (" ..." if len(staged) > 10 else "")
1054
+ + "; commit or unstage them first. Nothing was moved.")
977
1055
  dirty = _dirty_paths(repo_root)
978
1056
  if dirty is None:
979
1057
  report.dirty_check_failed = "git status could not be read"
980
1058
  return report
981
1059
 
982
- def _is_dirty(path: Path) -> bool:
983
- try:
984
- rel_path = path.relative_to(repo_root).as_posix()
985
- except ValueError:
986
- return True # cannot place it in the repo: fail closed, leave it alone
987
- return rel_path in dirty
988
-
989
1060
  for path in sorted({*moves, *rewrites}, key=str):
990
- if _is_dirty(path) and path not in report.dirty_skipped:
991
- report.dirty_skipped.append(path)
1061
+ rel_path = _rel(path)
1062
+ if rel_path is None: # cannot place it in the repo: fail closed, leave it alone
1063
+ if path not in report.dirty_skipped:
1064
+ report.dirty_skipped.append(path)
1065
+ elif rel_path in dirty:
1066
+ if rel_path in owned:
1067
+ named_dirty.add(path)
1068
+ elif path not in report.dirty_skipped:
1069
+ report.dirty_skipped.append(path)
992
1070
  moves = [src for src in moves if src not in report.dirty_skipped]
993
1071
  rewrites = {path: text for path, text in rewrites.items() if path not in report.dirty_skipped}
994
1072
  try:
995
1073
  for path, text in rewrites.items():
996
1074
  atomic_write(path, text)
997
1075
  for src in moves:
998
- _move_one(repo_root, src, report)
1076
+ _move_one(repo_root, src, report, restage=src in rewrites or src in named_dirty)
999
1077
  except (OSError, ValueError) as exc:
1000
1078
  report.errors.append(f"stopped part-way, run again to finish: {exc}")
1001
1079
  return report
@@ -1009,14 +1087,17 @@ def nudge_line(repo_root: Path) -> str | None:
1009
1087
  except Exception:
1010
1088
  return None
1011
1089
  if report.collisions:
1012
- # /handoff cannot move anything while this stands, so do not send people there.
1090
+ # Nothing can move while this stands, so do not send people to --apply.
1013
1091
  return (f"[caddis] tidy is blocked by {len(report.collisions)} done/ name collision(s) "
1014
1092
  "— run scripts/caddis_tidy.py to see them")
1015
1093
  n = len(report.would_move)
1016
1094
  if not n:
1017
1095
  return None
1018
1096
  plural = "artifact" if n == 1 else "artifacts"
1019
- return f"[caddis] {n} finished {plural} awaiting tidy — /handoff moves them"
1097
+ # Never send people to /handoff for these: that invited a repo-wide sweep of other sessions' items
1098
+ # (2026-11-07). Each session closes its own; the owner may sweep.
1099
+ return (f"[caddis] {n} finished {plural} awaiting tidy — close your own with "
1100
+ "scripts/caddis_tidy.py --apply --only <path> (owner sweep: --all)")
1020
1101
 
1021
1102
 
1022
1103
  # ── prune: old local state on fixed ages (R2 Phase 11) ──────────────────────────────────────────
@@ -1262,9 +1343,11 @@ def main(argv: list[str] | None = None) -> int:
1262
1343
  help="also read Resolves-Parked / Partly-Resolves-Parked trailers in these "
1263
1344
  "commits only, e.g. origin/main..HEAD (default: read no trailers); "
1264
1345
  "with --check, check only the files this range changed")
1265
- ap.add_argument("--only", nargs="+", default=None, metavar="PLAN",
1266
- help="touch only these top-level plans (.caddis/plans/<name>.md); nothing "
1267
- "else is moved or stamped")
1346
+ ap.add_argument("--only", nargs="+", default=None, metavar="PATH",
1347
+ help="touch only these top-level files of .caddis/plans/, .caddis/prompts/ or "
1348
+ ".caddis/parking-lot/ (this session's artifacts); nothing else is moved or stamped")
1349
+ ap.add_argument("--all", action="store_true",
1350
+ help="with --apply: move every finished artifact in the repo (an owner's explicit sweep)")
1268
1351
  ap.add_argument("--prune", action="store_true",
1269
1352
  help="list old local state under .caddis/ (with --apply: delete it)")
1270
1353
  ap.add_argument("--temp", action="store_true",
@@ -1288,6 +1371,8 @@ def main(argv: list[str] | None = None) -> int:
1288
1371
  repo_root = Path(args.repo_root).resolve()
1289
1372
  if args.json and not args.hygiene:
1290
1373
  ap.error("--json only works together with --hygiene")
1374
+ if args.all and (args.hygiene or args.prune):
1375
+ ap.error("--all is for the mover (--apply), not --hygiene or --prune")
1291
1376
  if args.hygiene:
1292
1377
  if args.check or args.commit_range or args.only or args.prune or args.temp or args.verbose:
1293
1378
  ap.error("--hygiene runs alone: not with --check, --commit-range, --only, --prune, --temp or --verbose")
@@ -1317,6 +1402,12 @@ def main(argv: list[str] | None = None) -> int:
1317
1402
  return 1 if (code or temp_part.errors) else 0
1318
1403
  if args.only and args.check:
1319
1404
  ap.error("--only is for --apply (or its dry run), not --check")
1405
+ if args.all and args.only:
1406
+ ap.error("--all and --only exclude each other: --only names this session's artifacts, --all sweeps all")
1407
+ if args.apply and not args.only and not args.all:
1408
+ # 2026-11-07: a bare --apply moved and staged 5 committed items that other sessions owned.
1409
+ print("ERROR: --apply needs --only <path>... (this session's artifacts) or --all (owner sweep)")
1410
+ return 1
1320
1411
  report = tidy(repo_root, apply=args.apply, check=args.check, commit_range=args.commit_range,
1321
1412
  only=args.only)
1322
1413
  if report.refused:
@@ -1343,6 +1434,16 @@ def main(argv: list[str] | None = None) -> int:
1343
1434
  label = "moved" if args.apply else "would move"
1344
1435
  for p in moved_or_would:
1345
1436
  print(f" {label}: {rel(p)}")
1437
+ for old, new in report.staged:
1438
+ print(f" STAGED: {rel(old)} -> {rel(new)}")
1439
+ if report.staged:
1440
+ def arg(p: Path) -> str:
1441
+ return f'"{rel(p)}"' if " " in rel(p) else rel(p)
1442
+
1443
+ paths = " ".join(f"{arg(old)} {arg(new)}" for old, new in report.staged)
1444
+ print(" These moves are staged, not committed. Commit them, and only them, with:")
1445
+ print(f' git commit -m "chore(tidy): move finished artifacts to done/" -- {paths}')
1446
+ print(" Or undo each move with: git mv <new> <old>")
1346
1447
  for p, rows in report.open_rows_held:
1347
1448
  print(f" held (open Tracker rows): {rel(p)}: rows {', '.join(rows)}")
1348
1449
  for p in report.dirty_skipped: