@codyswann/lisa 2.292.0 → 2.293.0
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.
- package/all/copy-overwrite/scripts/lisa-work-item.mjs +64 -3
- package/dist/core/upstream-evidence-manifest.js +4 -4
- package/dist/opencode/plugin-templates/parity-safety-net.sh +41 -0
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-parity-safety-net-rules/SKILL.md +16 -11
- package/plugins/lisa/hooks/parity-safety-net.sh +41 -0
- package/plugins/lisa/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-parity-safety-net-rules/SKILL.md +16 -11
- package/plugins/lisa-agy/hooks/parity-safety-net.sh +41 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-parity-safety-net-rules/SKILL.md +16 -11
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/parity-safety-net.sh +41 -0
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-parity-safety-net-rules/SKILL.md +16 -11
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/parity-safety-net.sh +41 -0
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-parity-safety-net-rules/SKILL.md +16 -11
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/parity-safety-net.sh +41 -0
- package/plugins/src/base/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-parity-safety-net-rules/SKILL.md +16 -11
|
@@ -95,7 +95,7 @@ Using the general-purpose agent in Team Lead session, **determine the base branc
|
|
|
95
95
|
- Already on a feature branch with an **open PR** → reuse it. If the PR's base ≠ the resolved base branch, surface the mismatch and re-target only with confirmation — the ticket's environment is the source of truth.
|
|
96
96
|
- Already on a feature branch with **no open PR** → reuse it; its PR base will be the resolved base branch (do not ask the human — the environment determines it).
|
|
97
97
|
- On an **environment / default branch** → check out a feature branch named for this plan (with the work-item ref prefix, per the linkage rules below) **from `origin/<base>`**.
|
|
98
|
-
- **
|
|
98
|
+
- **Sync the feature branch onto the latest `origin/<base>` and resolve any merge conflicts BEFORE starting work.** Both sync lanes are sanctioned in a bound worktree: **rebase** (`git rebase origin/<base>` — the commit hooks validate mid-rebase picks against the rebase head-name, so a work-item binding never wedges a rebase) and **merge** (`git merge origin/<base>` — push validation exempts commits already reachable from the remote default branch, while branch-authored commits stay strictly validated; the exemption needs the local `origin/HEAD` symref, so if a hand-added remote fails push validation on foreign commits, run `git remote set-head origin -a` first). Prefer rebase for a linear history; use merge when rewriting pushed history is undesirable. If a rebase goes wrong before anyone has resolved conflicts, `git rebase --abort` is a safe, allowed recovery; once conflict resolutions exist, the safety net blocks abort to protect them — finish resolving and `git rebase --continue` instead. If the conflicts cannot be resolved cleanly and safely, create a fix task for the agent team (with the conflicting file list and current merge state) and resolve it before implementation begins — never start work on stale or conflicted code.
|
|
99
99
|
4. **The PR targets the resolved base branch** — carry it as `target_branch=<base>` into `lisa-git-submit-pr` (Verify flow). `git-submit-pr` already chooses a closing keyword when the base is the production/default branch and a non-closing reference for a non-terminal environment branch. For a bug fixed on a non-integration environment branch, the current flow is not done until the fix is merged and verified there, then forward cherry-picked down to the integration branch via a linked follow-up.
|
|
100
100
|
|
|
101
101
|
Every Implement run now has a tracker work item. Preserve its canonical identifier for development linkage unconditionally:
|
|
@@ -69,22 +69,27 @@ RULES_FILE="${SAFETY_NET_RULES_FILE:-${CLAUDE_PROJECT_DIR:-$PWD}/.claude/safety-
|
|
|
69
69
|
(`git push origin +main`) is not blocked — upstream 1.0.6 allows it too.
|
|
70
70
|
4. `git reset --hard` / `git reset --merge` while the working tree is **dirty**
|
|
71
71
|
(would discard work). Clean-tree resets are intentionally allowed.
|
|
72
|
-
5. `git
|
|
72
|
+
5. `git rebase --abort` / `git rebase --quit` while the in-progress rebase
|
|
73
|
+
holds human-made conflict resolutions (they would be discarded). A clean or
|
|
74
|
+
untouched rebase state stays abortable — an agent-recoverable wedge; the
|
|
75
|
+
apply backend and a missing `AUTO_MERGE` ref fail closed. Deliberate
|
|
76
|
+
divergence: upstream blocks `rebase --abort` unconditionally.
|
|
77
|
+
6. `git checkout` discards: the `--` pathspec form (with or without a ref),
|
|
73
78
|
`-f`/`--force`, `--pathspec-from-file`, and bare `git checkout .`.
|
|
74
79
|
Branch switching and `-b`/`-B` creation stay allowed.
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
7. `git switch --discard-changes` / `-f`/`--force`.
|
|
81
|
+
8. `git restore` touching the worktree — only `git restore --staged <path>`
|
|
77
82
|
without `--worktree` is allowed (unstaging is safe).
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
9. `git stash drop` / `git stash clear` (push/pop/list/apply stay allowed).
|
|
84
|
+
10. `git clean` with a force flag and no dry-run — `-n`/`--dry-run` anywhere
|
|
85
|
+
makes it a safe preview.
|
|
86
|
+
11. `git branch -D` (or `-d` combined with `-f`, clustered or split);
|
|
82
87
|
safe `-d` and rename `-m` stay allowed.
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
12. `git tag -d`, `git reflog delete`, `git worktree remove --force`.
|
|
89
|
+
13. Deletion via `find … -delete`, `find … -exec rm -rf`, and `xargs … rm -rf`
|
|
85
90
|
(plain non-recursive `rm` on find/xargs output stays allowed).
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
14. Disk destroyers: `dd of=/dev/…`, `mkfs … /dev/…`, `shred`.
|
|
92
|
+
15. Destructive SQL — `DROP DATABASE/SCHEMA/TABLE`, `TRUNCATE TABLE`.
|
|
88
93
|
|
|
89
94
|
Every git guard sees through leading git **global options** (`-C <path>`,
|
|
90
95
|
`-c <k>=<v>`, `--git-dir[=…]`, `--no-pager`, …), so `git -C /path <destructive>`
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
# divergence: upstream blocks unconditionally; Lisa allows clean-tree resets.
|
|
25
25
|
# Residual risk (documented, accepted): the dirty check runs in the hook's
|
|
26
26
|
# cwd at hook time, so a `cd elsewhere && git reset --hard` evades it.
|
|
27
|
+
# - `git rebase --abort`/`--quit` while the in-progress rebase holds
|
|
28
|
+
# human-made conflict resolutions (AUTO_MERGE discriminator; issue #1956).
|
|
29
|
+
# Clean or untouched rebase state stays abortable; the apply backend and a
|
|
30
|
+
# missing AUTO_MERGE ref fail closed. Deliberate divergence: upstream
|
|
31
|
+
# blocks `rebase --abort` unconditionally, which strands agents mid-rebase.
|
|
27
32
|
# - `git checkout` discards (`--`, `-f/--force`, `--pathspec-from-file`,
|
|
28
33
|
# bare `.` — the bare-`.` block exceeds upstream)
|
|
29
34
|
# - `git switch --discard-changes` / `-f/--force`
|
|
@@ -312,6 +317,42 @@ if matches "${GIT_CMD}"'reset\b.*--(hard|merge)\b'; then
|
|
|
312
317
|
fi
|
|
313
318
|
fi
|
|
314
319
|
|
|
320
|
+
# 3b. `git rebase --abort` / `--quit` ONLY while human/agent conflict
|
|
321
|
+
# resolutions exist (issue #1956). `--abort` restores the pre-rebase branch
|
|
322
|
+
# and discards every resolution; `--quit` deletes the rebase bookkeeping
|
|
323
|
+
# (head-name, todo) while stranding a detached HEAD, making recovery
|
|
324
|
+
# ambiguous — both are treated the same, conditionally. A rebase state with
|
|
325
|
+
# nothing human-made in it (a clean-pick wedge, or a conflict stop nobody
|
|
326
|
+
# has touched) is agent-recoverable, so aborting it stays ALLOWED.
|
|
327
|
+
# Discriminator (empirical, git 2.53): diff the worktree/index against the
|
|
328
|
+
# AUTO_MERGE ref (the merge-ort recorded conflicted tree). Abort-safe ⇔
|
|
329
|
+
# worktree diff is quiet AND (the cached diff is quiet OR unmerged index
|
|
330
|
+
# entries exist — an untouched conflict stop has unmerged entries that make
|
|
331
|
+
# the cached diff non-quiet without any human edit). Fail CLOSED on the
|
|
332
|
+
# rebase-apply backend (no AUTO_MERGE contract) and on a missing AUTO_MERGE
|
|
333
|
+
# ref while rebase-merge state exists. Same accepted residual risk as
|
|
334
|
+
# guard 3: the probes run in the hook's cwd at hook time.
|
|
335
|
+
if matches "${GIT_CMD}"'rebase'"${GIT_TOKENS}"'--(abort|quit)([[:space:]]|$)'; then
|
|
336
|
+
rebase_apply_dir="$(git rev-parse --git-path rebase-apply 2>/dev/null || true)"
|
|
337
|
+
rebase_merge_dir="$(git rev-parse --git-path rebase-merge 2>/dev/null || true)"
|
|
338
|
+
if [ -n "$rebase_apply_dir" ] && [ -d "$rebase_apply_dir" ]; then
|
|
339
|
+
block "git rebase --abort/--quit on an apply-backend rebase cannot prove no conflict resolutions would be lost (fail closed; finish or continue the rebase instead)"
|
|
340
|
+
fi
|
|
341
|
+
if [ -n "$rebase_merge_dir" ] && [ -d "$rebase_merge_dir" ]; then
|
|
342
|
+
if ! git rev-parse -q --verify AUTO_MERGE >/dev/null 2>&1; then
|
|
343
|
+
block "git rebase --abort/--quit with an unresolvable AUTO_MERGE ref cannot prove no conflict resolutions would be lost (fail closed)"
|
|
344
|
+
fi
|
|
345
|
+
if ! git diff --quiet AUTO_MERGE 2>/dev/null; then
|
|
346
|
+
block "git rebase --abort/--quit would discard conflict resolutions in the working tree (finish resolving and run git rebase --continue instead)"
|
|
347
|
+
fi
|
|
348
|
+
unmerged_entries="$(git ls-files -u 2>/dev/null || true)"
|
|
349
|
+
if [ -z "$unmerged_entries" ] \
|
|
350
|
+
&& ! git diff --cached --quiet AUTO_MERGE 2>/dev/null; then
|
|
351
|
+
block "git rebase --abort/--quit would discard staged conflict resolutions (finish resolving and run git rebase --continue instead)"
|
|
352
|
+
fi
|
|
353
|
+
fi
|
|
354
|
+
fi
|
|
355
|
+
|
|
315
356
|
# 4. `git checkout` worktree discards: the `--` pathspec form (with or without a
|
|
316
357
|
# ref), `-f/--force`, `--pathspec-from-file`, and bare `git checkout .`.
|
|
317
358
|
# Blocking bare `.` exceeds upstream (which allows any single positional) —
|
|
@@ -95,7 +95,7 @@ Using the general-purpose agent in Team Lead session, **determine the base branc
|
|
|
95
95
|
- Already on a feature branch with an **open PR** → reuse it. If the PR's base ≠ the resolved base branch, surface the mismatch and re-target only with confirmation — the ticket's environment is the source of truth.
|
|
96
96
|
- Already on a feature branch with **no open PR** → reuse it; its PR base will be the resolved base branch (do not ask the human — the environment determines it).
|
|
97
97
|
- On an **environment / default branch** → check out a feature branch named for this plan (with the work-item ref prefix, per the linkage rules below) **from `origin/<base>`**.
|
|
98
|
-
- **
|
|
98
|
+
- **Sync the feature branch onto the latest `origin/<base>` and resolve any merge conflicts BEFORE starting work.** Both sync lanes are sanctioned in a bound worktree: **rebase** (`git rebase origin/<base>` — the commit hooks validate mid-rebase picks against the rebase head-name, so a work-item binding never wedges a rebase) and **merge** (`git merge origin/<base>` — push validation exempts commits already reachable from the remote default branch, while branch-authored commits stay strictly validated; the exemption needs the local `origin/HEAD` symref, so if a hand-added remote fails push validation on foreign commits, run `git remote set-head origin -a` first). Prefer rebase for a linear history; use merge when rewriting pushed history is undesirable. If a rebase goes wrong before anyone has resolved conflicts, `git rebase --abort` is a safe, allowed recovery; once conflict resolutions exist, the safety net blocks abort to protect them — finish resolving and `git rebase --continue` instead. If the conflicts cannot be resolved cleanly and safely, create a fix task for the agent team (with the conflicting file list and current merge state) and resolve it before implementation begins — never start work on stale or conflicted code.
|
|
99
99
|
4. **The PR targets the resolved base branch** — carry it as `target_branch=<base>` into `lisa-git-submit-pr` (Verify flow). `git-submit-pr` already chooses a closing keyword when the base is the production/default branch and a non-closing reference for a non-terminal environment branch. For a bug fixed on a non-integration environment branch, the current flow is not done until the fix is merged and verified there, then forward cherry-picked down to the integration branch via a linked follow-up.
|
|
100
100
|
|
|
101
101
|
Every Implement run now has a tracker work item. Preserve its canonical identifier for development linkage unconditionally:
|
|
@@ -69,22 +69,27 @@ RULES_FILE="${SAFETY_NET_RULES_FILE:-${CLAUDE_PROJECT_DIR:-$PWD}/.claude/safety-
|
|
|
69
69
|
(`git push origin +main`) is not blocked — upstream 1.0.6 allows it too.
|
|
70
70
|
4. `git reset --hard` / `git reset --merge` while the working tree is **dirty**
|
|
71
71
|
(would discard work). Clean-tree resets are intentionally allowed.
|
|
72
|
-
5. `git
|
|
72
|
+
5. `git rebase --abort` / `git rebase --quit` while the in-progress rebase
|
|
73
|
+
holds human-made conflict resolutions (they would be discarded). A clean or
|
|
74
|
+
untouched rebase state stays abortable — an agent-recoverable wedge; the
|
|
75
|
+
apply backend and a missing `AUTO_MERGE` ref fail closed. Deliberate
|
|
76
|
+
divergence: upstream blocks `rebase --abort` unconditionally.
|
|
77
|
+
6. `git checkout` discards: the `--` pathspec form (with or without a ref),
|
|
73
78
|
`-f`/`--force`, `--pathspec-from-file`, and bare `git checkout .`.
|
|
74
79
|
Branch switching and `-b`/`-B` creation stay allowed.
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
7. `git switch --discard-changes` / `-f`/`--force`.
|
|
81
|
+
8. `git restore` touching the worktree — only `git restore --staged <path>`
|
|
77
82
|
without `--worktree` is allowed (unstaging is safe).
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
9. `git stash drop` / `git stash clear` (push/pop/list/apply stay allowed).
|
|
84
|
+
10. `git clean` with a force flag and no dry-run — `-n`/`--dry-run` anywhere
|
|
85
|
+
makes it a safe preview.
|
|
86
|
+
11. `git branch -D` (or `-d` combined with `-f`, clustered or split);
|
|
82
87
|
safe `-d` and rename `-m` stay allowed.
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
12. `git tag -d`, `git reflog delete`, `git worktree remove --force`.
|
|
89
|
+
13. Deletion via `find … -delete`, `find … -exec rm -rf`, and `xargs … rm -rf`
|
|
85
90
|
(plain non-recursive `rm` on find/xargs output stays allowed).
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
14. Disk destroyers: `dd of=/dev/…`, `mkfs … /dev/…`, `shred`.
|
|
92
|
+
15. Destructive SQL — `DROP DATABASE/SCHEMA/TABLE`, `TRUNCATE TABLE`.
|
|
88
93
|
|
|
89
94
|
Every git guard sees through leading git **global options** (`-C <path>`,
|
|
90
95
|
`-c <k>=<v>`, `--git-dir[=…]`, `--no-pager`, …), so `git -C /path <destructive>`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.293.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.293.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.293.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.293.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.293.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
# divergence: upstream blocks unconditionally; Lisa allows clean-tree resets.
|
|
25
25
|
# Residual risk (documented, accepted): the dirty check runs in the hook's
|
|
26
26
|
# cwd at hook time, so a `cd elsewhere && git reset --hard` evades it.
|
|
27
|
+
# - `git rebase --abort`/`--quit` while the in-progress rebase holds
|
|
28
|
+
# human-made conflict resolutions (AUTO_MERGE discriminator; issue #1956).
|
|
29
|
+
# Clean or untouched rebase state stays abortable; the apply backend and a
|
|
30
|
+
# missing AUTO_MERGE ref fail closed. Deliberate divergence: upstream
|
|
31
|
+
# blocks `rebase --abort` unconditionally, which strands agents mid-rebase.
|
|
27
32
|
# - `git checkout` discards (`--`, `-f/--force`, `--pathspec-from-file`,
|
|
28
33
|
# bare `.` — the bare-`.` block exceeds upstream)
|
|
29
34
|
# - `git switch --discard-changes` / `-f/--force`
|
|
@@ -312,6 +317,42 @@ if matches "${GIT_CMD}"'reset\b.*--(hard|merge)\b'; then
|
|
|
312
317
|
fi
|
|
313
318
|
fi
|
|
314
319
|
|
|
320
|
+
# 3b. `git rebase --abort` / `--quit` ONLY while human/agent conflict
|
|
321
|
+
# resolutions exist (issue #1956). `--abort` restores the pre-rebase branch
|
|
322
|
+
# and discards every resolution; `--quit` deletes the rebase bookkeeping
|
|
323
|
+
# (head-name, todo) while stranding a detached HEAD, making recovery
|
|
324
|
+
# ambiguous — both are treated the same, conditionally. A rebase state with
|
|
325
|
+
# nothing human-made in it (a clean-pick wedge, or a conflict stop nobody
|
|
326
|
+
# has touched) is agent-recoverable, so aborting it stays ALLOWED.
|
|
327
|
+
# Discriminator (empirical, git 2.53): diff the worktree/index against the
|
|
328
|
+
# AUTO_MERGE ref (the merge-ort recorded conflicted tree). Abort-safe ⇔
|
|
329
|
+
# worktree diff is quiet AND (the cached diff is quiet OR unmerged index
|
|
330
|
+
# entries exist — an untouched conflict stop has unmerged entries that make
|
|
331
|
+
# the cached diff non-quiet without any human edit). Fail CLOSED on the
|
|
332
|
+
# rebase-apply backend (no AUTO_MERGE contract) and on a missing AUTO_MERGE
|
|
333
|
+
# ref while rebase-merge state exists. Same accepted residual risk as
|
|
334
|
+
# guard 3: the probes run in the hook's cwd at hook time.
|
|
335
|
+
if matches "${GIT_CMD}"'rebase'"${GIT_TOKENS}"'--(abort|quit)([[:space:]]|$)'; then
|
|
336
|
+
rebase_apply_dir="$(git rev-parse --git-path rebase-apply 2>/dev/null || true)"
|
|
337
|
+
rebase_merge_dir="$(git rev-parse --git-path rebase-merge 2>/dev/null || true)"
|
|
338
|
+
if [ -n "$rebase_apply_dir" ] && [ -d "$rebase_apply_dir" ]; then
|
|
339
|
+
block "git rebase --abort/--quit on an apply-backend rebase cannot prove no conflict resolutions would be lost (fail closed; finish or continue the rebase instead)"
|
|
340
|
+
fi
|
|
341
|
+
if [ -n "$rebase_merge_dir" ] && [ -d "$rebase_merge_dir" ]; then
|
|
342
|
+
if ! git rev-parse -q --verify AUTO_MERGE >/dev/null 2>&1; then
|
|
343
|
+
block "git rebase --abort/--quit with an unresolvable AUTO_MERGE ref cannot prove no conflict resolutions would be lost (fail closed)"
|
|
344
|
+
fi
|
|
345
|
+
if ! git diff --quiet AUTO_MERGE 2>/dev/null; then
|
|
346
|
+
block "git rebase --abort/--quit would discard conflict resolutions in the working tree (finish resolving and run git rebase --continue instead)"
|
|
347
|
+
fi
|
|
348
|
+
unmerged_entries="$(git ls-files -u 2>/dev/null || true)"
|
|
349
|
+
if [ -z "$unmerged_entries" ] \
|
|
350
|
+
&& ! git diff --cached --quiet AUTO_MERGE 2>/dev/null; then
|
|
351
|
+
block "git rebase --abort/--quit would discard staged conflict resolutions (finish resolving and run git rebase --continue instead)"
|
|
352
|
+
fi
|
|
353
|
+
fi
|
|
354
|
+
fi
|
|
355
|
+
|
|
315
356
|
# 4. `git checkout` worktree discards: the `--` pathspec form (with or without a
|
|
316
357
|
# ref), `-f/--force`, `--pathspec-from-file`, and bare `git checkout .`.
|
|
317
358
|
# Blocking bare `.` exceeds upstream (which allows any single positional) —
|
|
@@ -95,7 +95,7 @@ Using the general-purpose agent in Team Lead session, **determine the base branc
|
|
|
95
95
|
- Already on a feature branch with an **open PR** → reuse it. If the PR's base ≠ the resolved base branch, surface the mismatch and re-target only with confirmation — the ticket's environment is the source of truth.
|
|
96
96
|
- Already on a feature branch with **no open PR** → reuse it; its PR base will be the resolved base branch (do not ask the human — the environment determines it).
|
|
97
97
|
- On an **environment / default branch** → check out a feature branch named for this plan (with the work-item ref prefix, per the linkage rules below) **from `origin/<base>`**.
|
|
98
|
-
- **
|
|
98
|
+
- **Sync the feature branch onto the latest `origin/<base>` and resolve any merge conflicts BEFORE starting work.** Both sync lanes are sanctioned in a bound worktree: **rebase** (`git rebase origin/<base>` — the commit hooks validate mid-rebase picks against the rebase head-name, so a work-item binding never wedges a rebase) and **merge** (`git merge origin/<base>` — push validation exempts commits already reachable from the remote default branch, while branch-authored commits stay strictly validated; the exemption needs the local `origin/HEAD` symref, so if a hand-added remote fails push validation on foreign commits, run `git remote set-head origin -a` first). Prefer rebase for a linear history; use merge when rewriting pushed history is undesirable. If a rebase goes wrong before anyone has resolved conflicts, `git rebase --abort` is a safe, allowed recovery; once conflict resolutions exist, the safety net blocks abort to protect them — finish resolving and `git rebase --continue` instead. If the conflicts cannot be resolved cleanly and safely, create a fix task for the agent team (with the conflicting file list and current merge state) and resolve it before implementation begins — never start work on stale or conflicted code.
|
|
99
99
|
4. **The PR targets the resolved base branch** — carry it as `target_branch=<base>` into `lisa-git-submit-pr` (Verify flow). `git-submit-pr` already chooses a closing keyword when the base is the production/default branch and a non-closing reference for a non-terminal environment branch. For a bug fixed on a non-integration environment branch, the current flow is not done until the fix is merged and verified there, then forward cherry-picked down to the integration branch via a linked follow-up.
|
|
100
100
|
|
|
101
101
|
Every Implement run now has a tracker work item. Preserve its canonical identifier for development linkage unconditionally:
|