@codyswann/lisa 4.34.7 → 4.34.9

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 (104) hide show
  1. package/all/copy-overwrite/scripts/lisa-hooks/block-direct-issue-create.sh +184 -5
  2. package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +11 -5
  3. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  4. package/dist/core/lisa-owned-hash-ledger.js +6 -0
  5. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  6. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  7. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  8. package/dist/core/upstream-evidence-manifest.js +17 -12
  9. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  10. package/package.json +4 -4
  11. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  12. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  13. package/plugins/lisa/.codex-plugin/skills/lisa-drive-pr-to-merge/SKILL.md +141 -1
  14. package/plugins/lisa/.codex-plugin/skills/lisa-git-submit-pr/SKILL.md +2 -0
  15. package/plugins/lisa/.codex-plugin/skills/lisa-repair-intake/SKILL.md +64 -7
  16. package/plugins/lisa/hooks/block-direct-issue-create.sh +184 -5
  17. package/plugins/lisa/hooks/block-managed-file-edits.sh +11 -5
  18. package/plugins/lisa/rules/eager/rejection-detection.md +14 -1
  19. package/plugins/lisa/rules/eager/settled-decisions.md +20 -0
  20. package/plugins/lisa/rules/reference/rejection-detection.md +69 -0
  21. package/plugins/lisa/rules/reference/settled-decisions.md +10 -0
  22. package/plugins/lisa/skills/lisa-drive-pr-to-merge/SKILL.md +141 -1
  23. package/plugins/lisa/skills/lisa-git-submit-pr/SKILL.md +2 -0
  24. package/plugins/lisa/skills/lisa-repair-intake/SKILL.md +64 -7
  25. package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +184 -5
  26. package/plugins/lisa-agy/plugin.json +1 -1
  27. package/plugins/lisa-agy/skills/lisa-drive-pr-to-merge/SKILL.md +141 -1
  28. package/plugins/lisa-agy/skills/lisa-git-submit-pr/SKILL.md +2 -0
  29. package/plugins/lisa-agy/skills/lisa-repair-intake/SKILL.md +64 -7
  30. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  32. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  33. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +184 -5
  37. package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +11 -5
  38. package/plugins/lisa-copilot/rules/eager/rejection-detection.md +14 -1
  39. package/plugins/lisa-copilot/rules/eager/settled-decisions.md +20 -0
  40. package/plugins/lisa-copilot/rules/reference/rejection-detection.md +69 -0
  41. package/plugins/lisa-copilot/rules/reference/settled-decisions.md +10 -0
  42. package/plugins/lisa-copilot/skills/lisa-drive-pr-to-merge/SKILL.md +141 -1
  43. package/plugins/lisa-copilot/skills/lisa-git-submit-pr/SKILL.md +2 -0
  44. package/plugins/lisa-copilot/skills/lisa-repair-intake/SKILL.md +64 -7
  45. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +184 -5
  47. package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +11 -5
  48. package/plugins/lisa-cursor/rules/rejection-detection-reference.mdc +69 -0
  49. package/plugins/lisa-cursor/rules/rejection-detection.mdc +14 -1
  50. package/plugins/lisa-cursor/rules/settled-decisions-reference.mdc +10 -0
  51. package/plugins/lisa-cursor/rules/settled-decisions.mdc +20 -0
  52. package/plugins/lisa-cursor/skills/lisa-drive-pr-to-merge/SKILL.md +141 -1
  53. package/plugins/lisa-cursor/skills/lisa-git-submit-pr/SKILL.md +2 -0
  54. package/plugins/lisa-cursor/skills/lisa-repair-intake/SKILL.md +64 -7
  55. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-expo-agy/plugin.json +1 -1
  58. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  62. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  63. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  67. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  68. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  73. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  78. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-rails-agy/plugin.json +1 -1
  83. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  88. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  92. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  93. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  95. package/plugins/src/base/hooks/block-direct-issue-create.sh +184 -5
  96. package/plugins/src/base/hooks/block-managed-file-edits.sh +11 -5
  97. package/plugins/src/base/rules/eager/rejection-detection.md +14 -1
  98. package/plugins/src/base/rules/eager/settled-decisions.md +20 -0
  99. package/plugins/src/base/rules/reference/rejection-detection.md +69 -0
  100. package/plugins/src/base/rules/reference/settled-decisions.md +10 -0
  101. package/plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md +141 -1
  102. package/plugins/src/base/skills/lisa-git-submit-pr/SKILL.md +2 -0
  103. package/plugins/src/base/skills/lisa-repair-intake/SKILL.md +64 -7
  104. package/typescript/copy-overwrite/scripts/check-skipped-required-checks.mjs +69 -3
@@ -53,3 +53,23 @@ honored.
53
53
  When you take a settled decision, make it auditable in one clause — "auto-merge on, per your standing
54
54
  preference", "scoped app-wide, because the Android finding decides it". That gives the operator the
55
55
  chance to correct it without requiring them to answer first.
56
+
57
+ ## Before you escalate, re-read the instruction file from disk
58
+
59
+ **This rule is delivered at session start; the re-read it demands happens at the escalation
60
+ boundary.** Re-reading at session start would re-read the same moment your context was built from
61
+ and buys nothing.
62
+
63
+ So before you form an escalation, hand a decision back, or re-open a question that may already be
64
+ settled: **open `AGENTS.md` (or `CLAUDE.md`) from disk and read its `## Standing rulings` section.**
65
+ If the file has no such heading, re-read the file.
66
+
67
+ The instruction is to open the file — not to "check whether your context looks complete", because
68
+ **context completeness is not observable from inside.** An instruction file is injected at session
69
+ start and can arrive shortened, and the cut can land on a clean section boundary, where a truncated
70
+ document is indistinguishable from one that never had that section: your copy ends tidily, so you
71
+ conclude you read all of it. Rulings are also written *after* sessions begin — your copy is a
72
+ snapshot of the moment you started, and nothing tells you when it stops being current.
73
+
74
+ This is a **pointer, not a copy**. It stays correct as rulings accumulate, and it survives a
75
+ shortened copy of the file it points at precisely because it does not travel inside that file.
@@ -162,3 +162,72 @@ Naming the decline date, the recurrence date, and the recurrence reference in bo
162
162
  ### Concurrency honesty
163
163
 
164
164
  The search-then-write here is **not** an atomic claim: two truly concurrent runs can each miss the other's in-flight proposal and file a transient duplicate. It therefore guarantees **convergence, not mutual exclusion** — the duplicate is found and closed by the next run's marker search, and because the key is a stable content hash, a duplicate never multiplies. State this rather than implying a lock; a cross-run locking protocol would be disproportionate to the risk.
165
+
166
+ ## Automation-reversal memory (repair-side — a human undoing a transition this flow made)
167
+
168
+ Both sections above remember something a **human or QA did to work**: claim-time memory reads an item bounced backward through the review lanes; proposal-time memory reads a proposal closed as *not planned*. This third section remembers something a human did **to the flow itself** — an automated repair moved an item's lifecycle role, and a human moved it straight back.
169
+
170
+ Every loop that writes a lifecycle role as a **repair** rather than as a claim consults this section before re-making a transition. `lisa-repair-intake` is the first consumer and the skill this contract was written from.
171
+
172
+ The failure it exists to stop is not forgetfulness, it is **inversion**. A loop with a state-only recurrence brake reads the human's revert as *changed state*, and changed state is normally a reason to look again — so the correction becomes the trigger. That inverts the assumption every operator brings to an unattended fleet: the more promptly a reviewer undoes a wrong transition, the sooner it comes back. A mechanism in which human correction is indistinguishable from new state converts your best reviewers into the loop's most reliable trigger.
173
+
174
+ ### Why this is a third classification, not a wider `rejection-reclaim`
175
+
176
+ `rejection-reclaim` is anchored on the **ready** lane — an item that reached a `review`/`done`-ward lane and is now back in `$READY`. A reversed repair lands in the **blocked** lane instead: automation moved `$BLOCKED → $READY`, and a human moved it back to `$BLOCKED`. Widening `rejection-reclaim` to cover that would fire it on a lane it was never written for, and its response is wrong for this case anyway — reflecting on rejection evidence and handing it into a re-implementation is what you do when the work was rejected, not when a human said *stop doing that*. The two are **orthogonal** and are **never merged into `rejection-reclaim`**: one teaches a re-implementation, the other withdraws a decision.
177
+
178
+ ### Seam — before any lifecycle write, not at claim
179
+
180
+ Detection runs at the **top of the repair walk for each candidate item, BEFORE the loop writes any lifecycle role**. The reasoning is the claim-time seam's: a write overwrites the current lane, and the signal depends on reading the current lane against history. Detection is a pure read — idempotent, headless-safe, no side effects.
181
+
182
+ ### Classification
183
+
184
+ Detection is a pure read of the item's transition history **and its authorship** (via the vendor access layers). It returns exactly one:
185
+
186
+ | Classification | Condition |
187
+ |---|---|
188
+ | `automation-reversal` | History shows a lifecycle role change **authored by** this flow, and a later **backward** move of that same role **authored by** a human, with no automation move after it. |
189
+ | `no-reversal` | History shows no such pair — the flow made no prior transition, or its transition still stands, or the later move was itself automation. |
190
+ | `unknown` | The vendor history query failed, was inconclusive, or **did not expose authorship**. |
191
+
192
+ ### Authorship is the whole signal — a backward move alone proves nothing
193
+
194
+ The state-only reading is what fails today, so a backward move is **not** sufficient: an item can return to `$BLOCKED` because a genuine new blocker appeared, which is the world moving on and is a legitimate reason to look again. What distinguishes a correction is **who moved it, and against what**. Read authorship from the same history surfaces:
195
+
196
+ - **GitHub** — timeline `LabeledEvent` / `UnlabeledEvent` nodes carry an `actor`; read them through `lisa-github-read-issue`'s Label-Event History surface.
197
+ - **JIRA** — `lisa-atlassian-access operation: changelog key:<K>`; each changelog entry carries an `author` alongside its `from`/`to` status items.
198
+ - **Linear** — `lisa-linear-access operation: history id:<ID>`; each history node carries an `actor` alongside `fromState` / `toState`.
199
+
200
+ An actor is **this flow** when it is the configured automation identity, or when the flow's own marker note (`[lisa-repair-intake]`) sits at that transition's timestamp. Any other actor is a human. Where the surface does not expose an actor at all, the result is `unknown` — never an assumed human.
201
+
202
+ **A marker and a transition on the same item say nothing until you know their order.** A hold label, a comment and a lane move routinely coexist on a reversed item, and co-occurrence reads equally well in both directions — a label applied *before* a transition guards it, the same label applied *after* records that the transition was undone. Sourcing the facts, attributing them correctly and reading the artifact all pass cleanly on an invented sequence; only ordering disconfirms it. Compare timestamps explicitly and treat an unorderable pair as `unknown`.
203
+
204
+ ### Lane names are configuration here too
205
+
206
+ The lanes compared ALWAYS come from `.lisa.config.json` — `github.labels.build.blocked` and `github.labels.build.ready` on GitHub, the JIRA status and Linear state equivalents — resolved per `config-resolution` against the `src/sync/registry.ts` `BUILD_LABEL_DEFAULTS` (`blocked: status:blocked`) fallback. **Never hardcode** a lane string; a project that renames its blocked lane must still detect reversals.
207
+
208
+ ### Never block the sweep
209
+
210
+ `unknown` is a first-class result here exactly as it is at claim time, but the safe direction is the opposite one and must be stated so it is not "simplified" later. At claim time an unreadable history degrades to *implement the item anyway*, because reflection is a bonus. Here an unreadable history degrades to **neither a reversal nor a clearance**: the item is evaluated by the loop's normal rules, unchanged, and the run **never blocks the sweep** on a failed detection. `unknown` must not be read as "no reversal, proceed to re-attempt" any more than as "reversal, suppress" — it removes the signal, it does not supply one.
211
+
212
+ ### Learning-loop exclusion
213
+
214
+ The same learning-loop exclusion applies, for the same reason and by the same markers: an item carrying `[lisa-learning-drop]`, `[lisa-learning-pr]`, `[lisa-learning-upstream-handoff]` or the `learning:needs-triage` label is never classified `automation-reversal`, no matter how it moved. The flow must not remember being corrected about its own learning artifacts.
215
+
216
+ ### The rule — a reversal raises the bar, it never resets the clock
217
+
218
+ On `automation-reversal`:
219
+
220
+ 1. **Do not re-apply the classification that was reversed.** The reversal is the strongest available evidence that the classification was wrong, and re-deriving it from the same facts reaches the same wrong answer.
221
+ 2. **Leave the item where the human put it** and ensure the `human_needed` marker is present. A decision that was overturned needs a person, not another cycle.
222
+ 3. **Name it in the run record** — the reversed transition, and the classification that produced it. A suppression nobody can see is indistinguishable from a loop that found nothing.
223
+ 4. **Re-attempt only on evidence that postdates the reversal** — a blocker state change, or a human comment supplying what was missing. This mirrors the re-proposal rule the proposal half already enforces: the memory is durable, not permanent, and new evidence reopens it. Cite that evidence in the run record.
224
+
225
+ A changed lifecycle role is therefore **no longer sufficient on its own** to warrant a fresh attempt. The consuming loop's recurrence brake must be able to tell "the state changed because the world moved" from "the state changed because a human undid me", which means carrying **authorship and an overturn bit**, not state alone.
226
+
227
+ ### The fix is signed per path — do not apply one sign globally
228
+
229
+ This is the trap in implementing this section, and it will not be caught in review because the wrong version reads as tightening.
230
+
231
+ On a **repair-transition** path, human activity must **stop** being a warrant to re-attempt — that is this whole contract. On a **staleness** path, a human comment is counted as forward progress and *suppresses* action, which means an objecting comment already protects the item. That protection is correct and a global "human activity no longer counts" switches it off while everyone believes a hole was closed.
232
+
233
+ So: apply the inversion **only** where the loop is deciding whether to re-make a transition. Leave every keep-alive and staleness reading exactly as it is. Any consumer of this section states which of its paths are signed which way.
@@ -27,3 +27,13 @@ Asking after the research answered the question is also a violation. When gather
27
27
  ## Reporting
28
28
 
29
29
  Record settled decisions in a short clause, such as "auto-merge on, per standing preference" or "scoped app-wide, because the Android finding decides it." This gives the operator a chance to correct the decision without requiring an avoidable question first.
30
+
31
+ ## Re-read the instruction file from disk before escalating
32
+
33
+ This rule is delivered at session start; the re-read it requires happens at the escalation boundary. Re-reading at session start would re-read the same moment the context was built from.
34
+
35
+ Before forming an escalation, handing a decision back, or re-opening a question that may already be settled, open `AGENTS.md` (or `CLAUDE.md`) from disk and read its `## Standing rulings` section. If the file has no such heading, re-read the file.
36
+
37
+ The instruction is to open the file rather than to assess the context, because context completeness is not observable from inside. An instruction file is injected at session start and can arrive shortened, and a cut landing on a section boundary is indistinguishable from a document that never carried that section. Rulings are also written after sessions begin, so an injected copy is a snapshot of the moment the session started.
38
+
39
+ This is a pointer, not a copy. It stays correct as rulings accumulate and survives a shortened copy of the file it points at, because it does not travel inside that file.
@@ -41,6 +41,11 @@ merges" loop. Other skills delegate here instead of re-implementing it. Runs
41
41
  green, open, un-merged PR is the *success* outcome of this mode, not a hang.
42
42
  Used by learning-persistence flows whose low-confidence PRs must wait for a
43
43
  human (`lisa-persist-learning`).
44
+
45
+ **`auto_merge` is caller-time and nothing re-reads it.** That is what the hold
46
+ label (section 0) exists for: the same behaviour, raisable by anyone at any
47
+ point while the loop runs. Both routes land in `awaiting-human`; they differ
48
+ only in who can take them and when.
44
49
  - `on_blocker=<fix|report>` — what to do when a blocker needs code or review work.
45
50
  Default `fix`.
46
51
  - **`fix`** (the full loop): resolve conflicts, fix failing checks, address +
@@ -97,9 +102,115 @@ gh pr edit <pr> --add-label "lisa:babysitter-on-duty"
97
102
  closed, or a hard block handed to a human. A crashed session that never
98
103
  releases is why the TTL exists; do not rely on it as the normal release path.
99
104
 
105
+ ### The hold gate — a stop anyone can raise
106
+
107
+ Section 0 owns this skill's two PR labels: the lease it **writes** to declare
108
+ ownership, and the hold it **reads** to be told to stop. Same mechanism, pointed
109
+ at different things — a lease is a claim, a hold is a decision.
110
+
111
+ **The label** is `lisa:hold` by default, overridable per project at
112
+ `github.labels.merge.hold`, resolved local-over-global like every other
113
+ configured name. Resolve it ONCE at startup and reuse the resolved string; a
114
+ name re-resolved each iteration can change identity mid-loop for no reason a
115
+ reader could reconstruct afterwards.
116
+
117
+ ```bash
118
+ HOLD_LABEL=$(
119
+ jq -r 'first(.github.labels.merge.hold | strings)' \
120
+ .lisa.config.local.json .lisa.config.json 2>/dev/null | head -n1
121
+ )
122
+ HOLD_LABEL="${HOLD_LABEL:-lisa:hold}"
123
+ ```
124
+
125
+ **What it means:** exactly `auto_merge=false`, for as long as it is present. Not
126
+ a new concept and not a new terminal state — the same disarm, the same
127
+ fail-closed re-read, the same `awaiting-human` landing. The only new surface is
128
+ one label read.
129
+
130
+ **Why it exists.** `auto_merge` is decided by the caller at invocation, and
131
+ nothing re-reads it, so the only person who can stop the merge is the person who
132
+ started it. Anyone else — a reviewer who opens the PR while the loop is driving
133
+ it, someone holding a PR another session armed — has no lever and loses the
134
+ race. Measured (#3558): four explicit `gh pr merge --disable-auto` calls were
135
+ each followed by a re-arm 7–25 seconds later, and the PR merged two seconds
136
+ after its final check went green. **The hold did not fail; it lost a race.** A
137
+ signal the loop itself reads cannot be raced, because the loop is what reads it.
138
+
139
+ #### Evaluate it in two places, and re-read it every iteration
140
+
141
+ - **Before arming** (section 1) — a PR already carrying the label is never armed.
142
+ - **On every watch-loop iteration** (section 2), before acting on any blocker.
143
+
144
+ Re-reading is the entire point. A check that runs once at startup is a
145
+ caller-time signal wearing a loop's clothing and fixes nothing, because the case
146
+ that matters is a label applied **after** the loop is already running. If you
147
+ are changing this and it is convenient to read the label once, you have
148
+ reintroduced the defect.
149
+
150
+ ```bash
151
+ gh pr view <pr> --json labels --jq "[.labels[].name] | index(\"$HOLD_LABEL\") != null"
152
+ ```
153
+
154
+ **Match the resolved name exactly — never a prefix.** `lisa:babysitter-on-duty`
155
+ is a label this skill applies to itself and shares the `lisa:` prefix; a
156
+ prefix match would make the loop stop on its own lease, which is a deadlock
157
+ that looks like a human decision.
158
+
159
+ #### When held
160
+
161
+ 1. Run the existing `auto_merge=false` disarm (section 1) — disable the latch
162
+ once and prove with the fail-closed re-read that it took.
163
+ 2. Return `awaiting-human:held` (section 4).
164
+ 3. **Do not remove the label.** Removing a human's signal is unrecoverable from
165
+ inside the loop; leaving a stale one costs a cycle and is visible. Only
166
+ whoever applied it takes it off, and a later invocation then resumes normally.
167
+
168
+ Do not keep polling while held. Held is terminal for this run, not a pause to
169
+ wait out — the loop has been told a human is looking, and continuing to drive is
170
+ the behaviour the label exists to stop.
171
+
172
+ **The disarm is once and terminal: never re-arm the latch afterwards, and never
173
+ resume driving in the same run.** This is what keeps a hold compatible with the
174
+ armed-across-fix-pushes rule in section 1, which otherwise forbids disarming on
175
+ the `auto_merge=true` path. That rule exists to prevent a *race* — disarm, then
176
+ re-arm, repeatedly, while still driving — and a hold does neither half of it: it
177
+ turns the latch off exactly once and then stops. A hold that re-armed, or that
178
+ kept driving afterwards, would be the race that rule names, wearing a label.
179
+
180
+ #### When the read fails
181
+
182
+ **Fail toward hold.** The asymmetry decides it: a false hold costs one cycle and
183
+ is visible in a terminal report someone can act on, while a false no-hold merges
184
+ past a human's objection and cannot be undone. Where the two errors are
185
+ unequal, take the recoverable one.
186
+
187
+ But a read that keeps failing must not become a silent deadlock, so the failure
188
+ is **reported as its own outcome** rather than dressed up as a decision:
189
+
190
+ - retry the read once;
191
+ - if it still fails, disarm as above and return **`awaiting-human:hold-unknown`**,
192
+ naming the error.
193
+
194
+ `awaiting-human:held` and `awaiting-human:hold-unknown` are different facts and
195
+ an operator needs to know which: the first says *a human stopped this*, the
196
+ second says *I could not tell whether a human stopped this.* Collapsing them
197
+ would hide a broken permission behind a human decision, and nobody would ever
198
+ look.
199
+
200
+ **A PR with no hold label is driven exactly as it is today.** This gate adds a
201
+ stop; it does not add a block. If the label is absent and the read succeeded,
202
+ nothing about the run changes.
203
+
100
204
  ## 1. Enable auto-merge
101
205
 
102
- **Gate: only when `auto_merge=true` (the default).** When `auto_merge=false`,
206
+ **Gate: the hold label is absent (section 0's hold gate), and `auto_merge=true`
207
+ (the default).** Evaluate the hold gate BEFORE anything in this section,
208
+ including the arm gate below and the direct-merge capability fallback: a held PR
209
+ is not armed, not merged directly, and not driven — it disarms once and returns
210
+ `awaiting-human:held`. Checking after arming would authorise the merge the label
211
+ exists to prevent, which is the same ordering error the arm gate itself fixes.
212
+
213
+ When `auto_merge=false`,
103
214
  skip the enable step and its capability fallback — do not enable auto-merge,
104
215
  and do **not** use the capability fallback below: on a repo that disallows
105
216
  auto-merge, an `auto_merge=false` PR must stay OPEN for human triage, never be
@@ -357,6 +468,12 @@ Poll the live state each iteration:
357
468
  gh pr view <pr> --json state,mergeStateStatus,mergeable,reviewDecision,statusCheckRollup,headRefName,baseRefName
358
469
  ```
359
470
 
471
+ **Re-read the hold label on every iteration, before handling any blocker**
472
+ (section 0's hold gate). It is polled separately from the line above rather than
473
+ folded into it, because `labels` is not part of the blocker state: the hold is a
474
+ question about whether to keep going at all, asked before the blocker questions,
475
+ and a run that answers it once at startup has not implemented it.
476
+
360
477
  Handle every blocker class; after any fix, re-poll and continue. Do not stop while
361
478
  the PR is still open and progress is possible. On each iteration, refresh the
362
479
  babysitter lease if its last stamp is older than ~30 minutes (section 0).
@@ -393,6 +510,13 @@ and return per the input contract above. That includes (f): adjudicating a pendi
393
510
  auto-fix PR (merging, closing, or deleting its branch) is destructive work, not
394
511
  diagnosis — return its classification (`blocked:pending-auto-fix`) instead.
395
512
 
513
+ **The hold gate binds in report mode too**, and it binds first: a held PR
514
+ returns `awaiting-human:held` without arming, without the mechanical step (a)
515
+ nudge, and without an `update-branch`. Hold is not a blocker classification and
516
+ never returns as one — `blocked:*` says *this PR cannot proceed yet*, while a
517
+ hold says *someone asked me not to proceed*, and reporting the second as the
518
+ first would file a human's decision as a defect for something else to clear.
519
+
396
520
  The arm gate binds in report mode too, and this is the mode where forgetting it
397
521
  does the most damage: a diagnose-only run that arms the latch has not diagnosed
398
522
  anything, it has authorised a merge. Under a vacuous review context, report mode
@@ -938,6 +1062,22 @@ Loop until one of:
938
1062
  merge but nobody reviewed it: the review tool says it skips public
939
1063
  repositories, and that will not change on its own. Merge it yourself or ask
940
1064
  for a human review."*
1065
+ - **`awaiting-human:held`** → success, and the only terminal state a person can
1066
+ cause on purpose from outside the run. The hold label (section 0) was present,
1067
+ the latch was disarmed once and the re-read proved it, and the label was left
1068
+ in place. Report the PR URL, the resolved label name, and that removing the
1069
+ label lets a later invocation resume — for example: *"PR #123 is on hold:
1070
+ someone added the `lisa:hold` label, so I stopped instead of merging it.
1071
+ Remove that label when you want it to continue."* Not a stall and not a
1072
+ failure: a human asked for the PR to stop, and it stopped.
1073
+ - **`awaiting-human:hold-unknown`** → the hold label could not be read (twice),
1074
+ so whether a human asked for a stop is **unknown**. The latch is disarmed and
1075
+ the PR sits OPEN, on the fail-toward-hold rule in section 0. Report the read
1076
+ error verbatim. This is deliberately NOT reported as `awaiting-human:held`:
1077
+ that would file a broken permission or a rate limit as a human decision, and
1078
+ the one thing nobody would then do is investigate it. Usually a missing
1079
+ `issues: read` / label-read permission, which is fixable and invisible from
1080
+ the merge outcome alone.
941
1081
  - **`CLOSED`** → report (PR was closed without merge).
942
1082
  - **Hard block needing a human**: an unresolvable conflict, a failing check that
943
1083
  needs design input, or genuine unresolved human objection (not a bot gate). Stop
@@ -48,6 +48,8 @@ Recognized optional hints:
48
48
 
49
49
  This delegation is now load-bearing rather than a convenience: it is the only path that arms auto-merge, so skipping it leaves the PR open rather than quietly merging it. Reporting submission as complete without invoking it is a failed submit, not a partial one — say so instead of implying the PR is on its way to merged.
50
50
 
51
+ **The hold label needs no check here, and adding one would be dead code.** `drive-pr-to-merge` evaluates its hold gate before it arms anything, so a PR created with the label already on it is never armed — by the delegation, not by a second check in this skill. That guarantee used to require one: while step 5 armed the latch at creation, a hold that covered only the loop left the creation-time arm wide open, which is why CodySwannGT/lisa#3558 asked for a check in both places. Step 5 no longer arms, so there is nothing here for a label to gate. If you are adding one because the ticket says to, re-read step 5 first.
52
+
51
53
  ### Native Development Linkage
52
54
 
53
55
  Add provider-appropriate linkage to the PR title and/or body without changing the status lifecycle:
@@ -186,7 +186,9 @@ rule — never hardcode status/label strings. The relevant repair roles:
186
186
 
187
187
  In addition to the lifecycle roles above, the build lifecycle defines the **`human_needed` marker** — an additive label (`jira.labels.human_needed` / `github.labels.build.human_needed` / `linear.labels.build.human_needed`, default `Human Needed` / `human-needed`) that rides alongside `blocked` when the block needs human-only input no agent or retry can supply (see `config-resolution` "Build markers"). repair-intake's interaction with the marker is asymmetric and is the whole point of the distinction below:
188
188
 
189
- - The blocks repair-intake **itself writes** are the auto-recoverable kind — it files a build-ready fix ticket and moves the item `blocked` *blocked by that ticket*, expecting the next cycle to self-heal. Those are **not** `human_needed`; if such an item arrives already carrying a stale `human_needed` marker, repair-intake **clears** it (the block is no longer waiting on a human).
189
+ - The blocks repair-intake **itself writes** are the auto-recoverable kind — it files a build-ready fix ticket and moves the item `blocked` *blocked by that ticket*, expecting the next cycle to self-heal. Those are **not** `human_needed`; if such an item arrives carrying a `human_needed` marker **this skill applied on an earlier cycle**, repair-intake **clears** it (the block is no longer waiting on a human).
190
+ - **Never remove a `human_needed` marker this skill did not apply.** "Stale" is a judgment about the block's kind, not about who applied the marker or when — so without this rule an operator's deliberate hold, applied *after* correcting a wrong transition, is indistinguishable from a leftover the sweep is designed to clear, and gets swept. Establish provenance from the label event's actor (`rejection-detection` **Automation-reversal memory** reads the same surfaces); if provenance is not readable, **leave the marker in place**. Removing a human's hold is unrecoverable within the loop; leaving a stale one costs a cycle and is visible.
191
+ - The marker is consulted **before **any** repair transition**, not only before Class C. Class C's hard stop is the strictest reading of it, but a marker that is honoured on one classification path and ignored on the other three is not a guard — and Class A, dependency clearing, is exactly the path an operator reverting a wrongly-cleared blocker is trying to protect. Match it robustly (hyphen/underscore, case-insensitive, label set and note prose) wherever it is read.
190
192
  - The blocks the **vendor agent** writes when repair-intake re-dispatches it (its pre-flight gate) carry `human_needed` already — the agent owns that marker. repair-intake leaves it in place.
191
193
 
192
194
  Resolve with the standard role-read pattern (local overrides global, default fallback):
@@ -305,6 +307,16 @@ Apply per candidate. Continue through the ordered list until every candidate ins
305
307
  native close/archive/complete, re-dispatch, or refreshed note), be recorded read-only, or be
306
308
  recorded under Errors. Do not stop after the first write; the cap is the batch boundary.
307
309
 
310
+ **Before any lifecycle write on a candidate, classify it for `automation-reversal`** per
311
+ `rejection-detection` **Automation-reversal memory** — a role change this skill made that a human
312
+ then moved back. This runs once per candidate at the top of the walk, ahead of the branches below,
313
+ because it wraps every repair path rather than belonging to one: a reversed rollup reconciliation
314
+ involves no dependency link at all, and a reversed Class-B re-check is the same shape as a reversed
315
+ Class-A clearing. Detection is a pure read and `unknown` **never blocks the sweep** — an item whose
316
+ history or authorship cannot be read is judged by the normal rules below, treated as neither a
317
+ reversal nor a clearance. A candidate classified `automation-reversal` skips the branches below and
318
+ is handled per Loop prevention.
319
+
308
320
  ### Build `claimed` (stalled in-progress) → diagnose blocker, else resume in place
309
321
 
310
322
  **First check for an already-merged PR — this check is NOT gated on staleness.** Read the item's
@@ -478,9 +490,13 @@ re-issued against an unchanged conflicting head.
478
490
  new fix ticket (vendor-native: JIRA issue link `is blocked by`; GitHub/Linear `Blocked by:` line
479
491
  + label). Post a `[lisa-repair-intake]` note naming what it is blocked by and why. This block is
480
492
  **auto-recoverable** — the fix ticket will build and close on its own — so do **not** add the
481
- `human_needed` marker, and if the item already carries a stale `human_needed` label, remove it
482
- here (it is no longer waiting on a human). The `human_needed` marker is reserved for blocks a
483
- human must clear; this one a later cycle clears automatically.
493
+ `human_needed` marker, and if the item carries a `human_needed` label **this skill applied on an
494
+ earlier cycle**, remove it here (it is no longer waiting on a human). The `human_needed` marker
495
+ is reserved for blocks a human must clear; this one a later cycle clears automatically.
496
+ **A marker this skill did not apply is never removed here** — see the marker's provenance rule
497
+ above. The block's kind says the *block* self-heals; it says nothing about why a human put a
498
+ hold on the item, and an operator's hold applied after correcting a wrong transition looks
499
+ identical to a leftover unless provenance is checked.
484
500
  3. **Record it** as a repair write. Do **not** dispatch the vendor agent for this item this cycle.
485
501
 
486
502
  The item now sits in `blocked`; once the fix ticket reaches a terminal state, the **Build
@@ -1026,6 +1042,14 @@ layer, and test ancestry against the remote.
1026
1042
  "no PR found" is `no-pr` and stays blocking.
1027
1043
  - **Human override** — an explicit human statement on this item that the dependency is satisfied
1028
1044
  clears it and outranks a failed containment check. Name it in the run record.
1045
+ - **Human hold** — the override runs in both directions. `human_needed` is checked here as well as
1046
+ in Class C: an item carrying it is left `blocked` and recorded `skipped: human_needed`, without
1047
+ running the containment check. Class A is the path an operator reverting a wrongly-cleared
1048
+ blocker is protecting, so a marker honoured only on Class C is not honoured where it is most
1049
+ often meant. Match it robustly (hyphen/underscore, case-insensitive, label set and note prose).
1050
+ Symmetrically, an explicit human statement that the dependency is **not** satisfied keeps the
1051
+ item blocked and outranks a *passing* containment check — the contract has an input channel for
1052
+ "you may now proceed" and it needs one for "your reasoning was wrong".
1029
1053
 
1030
1054
  **A lifecycle status name is never the test.** `done`, `on-stg`, `on-dev` and `code-review` are
1031
1055
  labels that correlate with containment in a single-trunk workflow and come apart from it in a
@@ -1139,12 +1163,33 @@ cron tick.
1139
1163
  self-block** (so a human filling in one of several missing sections changes the fingerprint and
1140
1164
  triggers a re-check next cycle, rather than being suppressed as a no-op), terminal/open state,
1141
1165
  rollup child tally, and a timestamp.
1166
+ - The fingerprint also carries **authorship and an overturn bit**: the actor class of the most
1167
+ recent lifecycle role change (`automation` / `human` / `unknown`), and whether that change
1168
+ **reversed** a transition this skill made — the `automation-reversal` classification from
1169
+ `rejection-detection` **Automation-reversal memory**. Without these the fingerprint records only
1170
+ *what* the state is, never *who* set it or *whether the last automated decision was overturned*,
1171
+ and those are the only fields that separate "the world moved on" from "a human told me I was
1172
+ wrong".
1142
1173
  - Before writing a note or re-attempting a `blocked` item, compute the current fingerprint. If
1143
1174
  an identical fingerprint was already posted within the **backoff window**, skip the item
1144
1175
  silently (record as `still_blocked` / `active`, no write).
1145
1176
  - Backoff window default = `stale_after` (2h). `force=true` bypasses backoff for a manual run.
1146
- - A *changed* fingerprint (new blocker state, new answers, new verdict) always warrants a fresh
1147
- note + re-attempt — backoff suppresses only no-op repeats.
1177
+ - A *changed* fingerprint (new blocker state, new answers, new verdict) warrants a fresh note +
1178
+ re-attempt — backoff suppresses only no-op repeats.
1179
+ - **A change whose only cause is a human overturn is not a warrant.** Where the overturn bit is
1180
+ set and no evidence postdates the reversal, the changed fingerprint is **not on its own a
1181
+ warrant** to re-attempt: do not re-apply the reversed classification, leave the item where the
1182
+ human put it, ensure `human_needed`, and record the outcome naming the **reversed transition**
1183
+ and the classification that produced it. Re-attempt only on evidence postdating the reversal —
1184
+ a blocker state change or a human comment supplying what was missing — cited in the run record.
1185
+ Without this qualifier the revert *itself* changes the fingerprint and releases backoff, so the
1186
+ faster a reviewer corrects a wrong transition, the sooner it returns.
1187
+ - **This inversion is signed per path.** It applies to the paths that decide whether to re-make a
1188
+ lifecycle transition — Class A/B/C/D clearing and rollup reconciliation. It does **not** touch
1189
+ the staleness model: there a human comment counts as forward progress and resets the staleness
1190
+ clock, so an objecting comment already makes the item look active and this skill leaves it
1191
+ alone. That reading is protective; a single global "human activity no longer counts" would
1192
+ switch it off while reading like a tightening.
1148
1193
 
1149
1194
  ## Lifecycle ownership guard
1150
1195
 
@@ -1261,6 +1306,12 @@ Report outcomes in these buckets:
1261
1306
  - `normalized_ready` — GitHub issues missing official lifecycle labels that were classified and
1262
1307
  given the configured PRD/build `ready` label so normal intake can claim them.
1263
1308
  - `still_blocked` — examined and intentionally left `blocked`, with the active reason.
1309
+ - `reversal_suppressed` — a repair this skill previously made was reversed by a human, so the
1310
+ classification was **not** re-applied. Name the **reversed transition** (role, direction, and
1311
+ when), the classification that produced it, and that the item now carries `human_needed`. This
1312
+ bucket is never merged into `still_blocked`: "I declined to act because I was overruled" and "I
1313
+ examined it and the blocker stands" are different facts about the loop, and only the first tells
1314
+ an operator their correction was received.
1264
1315
  - `active` — skipped because current work is not stale (or within backoff).
1265
1316
  - `errors` — items that failed evaluation, with the error.
1266
1317
 
@@ -1280,7 +1331,7 @@ to each item* — the two never merge in the one-line summary.
1280
1331
  | Nothing actionable — the idle case (walk step 5): examined N, all active or in backoff — including a fix ticket suppressed by a prior decline (`rejection-detection` **Proposal rejection memory**), which the summary names in its suppression count | `nothing-needed` |
1281
1332
  | Repairs applied **and confirmed** this cycle — `resumed` / `resynced` / `recovered` / `unblocked` / `closed_out` / `rolled_up` / `relinked` / `normalized_ready` | `change-proved` |
1282
1333
  | Repair produced new work for a human to pick up — e.g. an unmergeable PR or failed deploy filed as a **build-ready fix ticket** and left `blocked` | `candidate-proposed` |
1283
- | A repair reached an autonomy boundary needing a human (a protected-deploy approval before it can proceed) | `approval-requested` |
1334
+ | A repair reached an autonomy boundary needing a human (a protected-deploy approval before it can proceed), **or a repair this loop previously made was reversed by a human** and is therefore suppressed and escalated to `human_needed` (`reversal_suppressed`) rather than re-attempted | `approval-requested` |
1284
1335
  | The loop itself could not run — the queue is unreadable, tracker credentials are revoked, or an open-and-closed rejection-memory / blocker-marker search is unreadable and therefore must not fall through to `nothing-needed` | `recovery-required` |
1285
1336
  | The runbook's **Retirement condition** tripped | `policy-obsolete` — **never reached by design for this loop** (see Retirement evaluation below) |
1286
1337
 
@@ -1343,6 +1394,12 @@ stuck work accumulates), or interleaved on a longer cadence.
1343
1394
  do."
1344
1395
  - Never re-dispatch a `blocked` build item unless every parsed blocker is cleared (conservative
1345
1396
  dependency clearing).
1397
+ - Never re-make a transition a human reversed. Classify every candidate for `automation-reversal`
1398
+ before any lifecycle write (`rejection-detection`), and on a hit leave the item where the human
1399
+ put it with `human_needed`, naming the reversed transition in the run record. Re-attempt only on
1400
+ evidence postdating the reversal.
1401
+ - Never remove a `human_needed` marker this skill did not apply, and consult the marker before
1402
+ **any** repair transition rather than only before Class C.
1346
1403
  - Repair every materially actionable candidate inside the `max_candidates` cap; default cap is 100.
1347
1404
  - Default GitHub `intake_mode` is `both` when both PRD and build namespaces exist.
1348
1405
  - Honor the backoff window — never re-post an identical `[lisa-repair-intake]` note within it
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.34.7",
3
+ "version": "4.34.9",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"