@codyswann/lisa 4.34.18 → 4.34.20

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 (88) hide show
  1. package/all/copy-overwrite/scripts/check-npm-publish-landed.mjs +4 -0
  2. package/all/copy-overwrite/scripts/lib/kill-marks.mjs +6 -6
  3. package/all/copy-overwrite/scripts/lisa-hooks/block-direct-issue-create.sh +22 -1
  4. package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +58 -0
  5. package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +37 -2
  6. package/all/copy-overwrite/scripts/lisa-run-gates.mjs +6 -2
  7. package/all/copy-overwrite/scripts/lisa-work-item.mjs +1 -5
  8. package/dist/cli/doctor-worktree-work-at-risk.d.ts.map +1 -1
  9. package/dist/cli/doctor-worktree-work-at-risk.js +5 -2
  10. package/dist/cli/doctor-worktree-work-at-risk.js.map +1 -1
  11. package/dist/cli/worktree-prune-policy.d.ts.map +1 -1
  12. package/dist/cli/worktree-prune-policy.js +2 -1
  13. package/dist/cli/worktree-prune-policy.js.map +1 -1
  14. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  15. package/dist/core/lisa-owned-hash-ledger.js +18 -0
  16. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  17. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  18. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  19. package/dist/core/upstream-evidence-manifest.js +14 -11
  20. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  21. package/dist/opencode/plugin-templates/parity-safety-net.sh +37 -2
  22. package/dist/strategies/package-lisa.js +2 -2
  23. package/package.json +9 -9
  24. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa/hooks/block-direct-issue-create.sh +22 -1
  27. package/plugins/lisa/hooks/block-managed-file-edits.sh +58 -0
  28. package/plugins/lisa/hooks/parity-safety-net.sh +37 -2
  29. package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +22 -1
  30. package/plugins/lisa-agy/hooks/parity-safety-net.sh +37 -2
  31. package/plugins/lisa-agy/plugin.json +1 -1
  32. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  35. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +22 -1
  39. package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +58 -0
  40. package/plugins/lisa-copilot/hooks/parity-safety-net.sh +37 -2
  41. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +22 -1
  43. package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +58 -0
  44. package/plugins/lisa-cursor/hooks/parity-safety-net.sh +37 -2
  45. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  47. package/plugins/lisa-expo-agy/plugin.json +1 -1
  48. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  53. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  58. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  63. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  67. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  68. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-rails-agy/plugin.json +1 -1
  73. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  78. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  83. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/src/base/hooks/block-direct-issue-create.sh +22 -1
  86. package/plugins/src/base/hooks/block-managed-file-edits.sh +58 -0
  87. package/plugins/src/base/hooks/parity-safety-net.sh +37 -2
  88. package/scripts/check-plugins-sync.sh +6 -2
@@ -162,6 +162,37 @@ describes yours:
162
162
  EOF
163
163
  )"
164
164
 
165
+ # How to preserve uncommitted work before an operation that would discard it.
166
+ #
167
+ # This is appended to the reasons that refuse a discarding operation, and its
168
+ # whole point is what it does NOT say (issue #3722). The obvious advice is
169
+ # "stash it first", and on a single-checkout repository that is fine. Here it
170
+ # is the most dangerous thing an agent can be told: the stash is ONE STACK PER
171
+ # CLONE, shared by every worktree, so with concurrent agents a sibling's push
172
+ # can shift your entry and a sibling's pop can consume it. `lint-staged` pushes
173
+ # one on every commit too, so agent and tooling entries interleave.
174
+ #
175
+ # A remedy fires at the exact moment an agent is holding the work most worth
176
+ # protecting, and a guard's own output reads as authoritative — so pointing it
177
+ # at shared mutable state there is worse than the refusal it accompanies.
178
+ #
179
+ # The patch file is per-worktree: `mktemp` names it, so nothing has to invent a
180
+ # filename, and it lives in this agent's own TMPDIR where no sibling can reach
181
+ # it. Untracked files are unaffected by both refused operations, so `git diff`
182
+ # captures everything at risk.
183
+ PRESERVE_GUIDANCE="$(
184
+ cat <<'EOF'
185
+ Preserve the work first, per-worktree:
186
+
187
+ git diff [-- <path>] > "$(mktemp "${TMPDIR:-/tmp}/lisa-preserve-XXXXXX.patch")"
188
+
189
+ and restore it later with `git apply <that file>`.
190
+
191
+ Do NOT reach for `git stash`. One stash stack is shared by every worktree of a
192
+ clone, so a concurrently running agent can consume the entry you just pushed.
193
+ EOF
194
+ )"
195
+
165
196
  # block() prints the reason to stderr (surfaced to the model) and exits 2 so the
166
197
  # Bash tool call is denied. $1 = human-readable reason for the block.
167
198
  #
@@ -1574,7 +1605,9 @@ done <<<"$push_segments"
1574
1605
  if matches "${GIT_CMD}"'reset\b.*--(hard|merge)\b'; then
1575
1606
  if git rev-parse --is-inside-work-tree >/dev/null 2>&1 \
1576
1607
  && [ -n "$(git status --porcelain 2>/dev/null)" ]; then
1577
- block "git reset --hard/--merge on a dirty working tree would discard uncommitted changes (stash or commit first)"
1608
+ block "git reset --hard/--merge on a dirty working tree would discard uncommitted changes (commit first, or preserve as below)" "$PRESERVE_GUIDANCE
1609
+
1610
+ $DESTRUCTIVE_GUIDANCE"
1578
1611
  fi
1579
1612
  fi
1580
1613
 
@@ -1624,7 +1657,9 @@ if matches "${GIT_CHECKOUT}${GIT_TOKENS}"'--([[:space:]]|$)' \
1624
1657
  || matches "${GIT_CHECKOUT}${GIT_TOKENS}"'(-[[:alnum:]]*f[[:alnum:]]*|--force)([[:space:]]|=|$)' \
1625
1658
  || matches "${GIT_CHECKOUT}"'[[:space:]][^;&|]*--pathspec-from-file' \
1626
1659
  || matches "${GIT_CHECKOUT}"'[[:space:]]+\.(/)?([[:space:]]|$)'; then
1627
- block "git checkout discarding local changes (--, -f/--force, --pathspec-from-file, or bare .) — use git stash to preserve work first"
1660
+ block "git checkout discarding local changes (--, -f/--force, --pathspec-from-file, or bare .)" "$PRESERVE_GUIDANCE
1661
+
1662
+ $DESTRUCTIVE_GUIDANCE"
1628
1663
  fi
1629
1664
 
1630
1665
  # 5. `git switch` discards: `--discard-changes` and its `-f/--force` aliases.
@@ -24,7 +24,9 @@ cd "$ROOT_DIR"
24
24
 
25
25
  if [ -n "$(git status --porcelain -- plugins/ 2>/dev/null)" ]; then
26
26
  echo "✗ plugins/ has uncommitted changes before the sync check could run." >&2
27
- echo " Commit or stash them, then re-run: bun run check:plugins" >&2
27
+ echo " Commit them, then re-run: bun run check:plugins" >&2
28
+ echo " (To set them aside instead, save a patch under your own TMPDIR — not" >&2
29
+ echo " the stash, which is one stack shared by every worktree of a clone.)" >&2
28
30
  exit 1
29
31
  fi
30
32
 
@@ -57,7 +59,9 @@ if [ -f "$MATERIALIZED_MANIFEST" ]; then
57
59
  echo " These are generated by 'bun run build:plugins'. Rebuilding would" >&2
58
60
  echo " overwrite them, so the check refuses rather than discarding an edit" >&2
59
61
  echo " and reporting a clean tree. Edit the canonical source instead, or" >&2
60
- echo " stash, then re-run: bun run check:plugins" >&2
62
+ echo " save a patch under your own TMPDIR — not the stash, which is one" >&2
63
+ echo " stack shared by every worktree of a clone — then re-run:" >&2
64
+ echo " bun run check:plugins" >&2
61
65
  exit 1
62
66
  fi
63
67
  fi