@codyswann/lisa 4.96.2 → 4.97.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.
Files changed (175) hide show
  1. package/README.md +7 -0
  2. package/all/copy-overwrite/scripts/lisa-audit.mjs +59 -0
  3. package/all/copy-overwrite/scripts/lisa-gates.mjs +30 -13
  4. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
  5. package/dist/cli/doctor-readiness-audit-allowlist.d.ts +19 -2
  6. package/dist/cli/doctor-readiness-audit-allowlist.d.ts.map +1 -1
  7. package/dist/cli/doctor-readiness-audit-allowlist.js +70 -17
  8. package/dist/cli/doctor-readiness-audit-allowlist.js.map +1 -1
  9. package/dist/cli/doctor-readiness-audit-scope.d.ts +24 -0
  10. package/dist/cli/doctor-readiness-audit-scope.d.ts.map +1 -0
  11. package/dist/cli/doctor-readiness-audit-scope.js +165 -0
  12. package/dist/cli/doctor-readiness-audit-scope.js.map +1 -0
  13. package/dist/cli/doctor-readiness-supply-chain-scan.js +1 -1
  14. package/dist/cli/doctor-readiness-supply-chain-scan.js.map +1 -1
  15. package/dist/cli/doctor-readiness-supply-chain.d.ts.map +1 -1
  16. package/dist/cli/doctor-readiness-supply-chain.js +4 -2
  17. package/dist/cli/doctor-readiness-supply-chain.js.map +1 -1
  18. package/dist/core/audit-capture.d.ts +31 -0
  19. package/dist/core/audit-capture.d.ts.map +1 -0
  20. package/dist/core/audit-capture.js +82 -0
  21. package/dist/core/audit-capture.js.map +1 -0
  22. package/dist/core/audit-exclusions.d.ts +32 -0
  23. package/dist/core/audit-exclusions.d.ts.map +1 -0
  24. package/dist/core/audit-exclusions.js +109 -0
  25. package/dist/core/audit-exclusions.js.map +1 -0
  26. package/dist/core/audit-field-names.d.ts +32 -0
  27. package/dist/core/audit-field-names.d.ts.map +1 -0
  28. package/dist/core/audit-field-names.js +107 -0
  29. package/dist/core/audit-field-names.js.map +1 -0
  30. package/dist/core/audit-lockfile.d.ts +9 -0
  31. package/dist/core/audit-lockfile.d.ts.map +1 -0
  32. package/dist/core/audit-lockfile.js +197 -0
  33. package/dist/core/audit-lockfile.js.map +1 -0
  34. package/dist/core/audit-manager.d.ts +8 -0
  35. package/dist/core/audit-manager.d.ts.map +1 -0
  36. package/dist/core/audit-manager.js +94 -0
  37. package/dist/core/audit-manager.js.map +1 -0
  38. package/dist/core/audit-matcher.d.ts +10 -0
  39. package/dist/core/audit-matcher.d.ts.map +1 -0
  40. package/dist/core/audit-matcher.js +103 -0
  41. package/dist/core/audit-matcher.js.map +1 -0
  42. package/dist/core/audit-report.d.ts +9 -0
  43. package/dist/core/audit-report.d.ts.map +1 -0
  44. package/dist/core/audit-report.js +132 -0
  45. package/dist/core/audit-report.js.map +1 -0
  46. package/dist/core/audit-types.d.ts +31 -0
  47. package/dist/core/audit-types.d.ts.map +1 -0
  48. package/dist/core/audit-types.js +2 -0
  49. package/dist/core/audit-types.js.map +1 -0
  50. package/dist/core/audit.d.ts +25 -0
  51. package/dist/core/audit.d.ts.map +1 -0
  52. package/dist/core/audit.js +53 -0
  53. package/dist/core/audit.js.map +1 -0
  54. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  55. package/dist/core/lisa-owned-hash-ledger.js +40 -0
  56. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  57. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  58. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  59. package/dist/core/upstream-evidence-manifest.js +89 -14
  60. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  61. package/package.json +11 -6
  62. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  64. package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +1 -1
  65. package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +12 -1
  66. package/plugins/lisa/.codex-plugin/skills/lisa-track/SKILL.md +25 -2
  67. package/plugins/lisa/rules/eager/security-audit-handling.md +2 -2
  68. package/plugins/lisa/rules/reference/rejection-detection.md +2 -2
  69. package/plugins/lisa/rules/reference/security-audit-handling.md +9 -0
  70. package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +1 -1
  71. package/plugins/lisa/skills/lisa-implement/SKILL.md +12 -1
  72. package/plugins/lisa/skills/lisa-track/SKILL.md +25 -2
  73. package/plugins/lisa-agy/plugin.json +1 -1
  74. package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +1 -1
  75. package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +12 -1
  76. package/plugins/lisa-agy/skills/lisa-track/SKILL.md +25 -2
  77. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  79. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  80. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  84. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-copilot/rules/eager/security-audit-handling.md +2 -2
  86. package/plugins/lisa-copilot/rules/reference/rejection-detection.md +2 -2
  87. package/plugins/lisa-copilot/rules/reference/security-audit-handling.md +9 -0
  88. package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +1 -1
  89. package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +12 -1
  90. package/plugins/lisa-copilot/skills/lisa-track/SKILL.md +25 -2
  91. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-cursor/rules/rejection-detection-reference.mdc +2 -2
  93. package/plugins/lisa-cursor/rules/security-audit-handling-reference.mdc +9 -0
  94. package/plugins/lisa-cursor/rules/security-audit-handling.mdc +2 -2
  95. package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +1 -1
  96. package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +12 -1
  97. package/plugins/lisa-cursor/skills/lisa-track/SKILL.md +25 -2
  98. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  100. package/plugins/lisa-devin/rules/eager/security-audit-handling.md +2 -2
  101. package/plugins/lisa-devin/rules/reference/rejection-detection.md +2 -2
  102. package/plugins/lisa-devin/rules/reference/security-audit-handling.md +9 -0
  103. package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +1 -1
  104. package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +12 -1
  105. package/plugins/lisa-devin/skills/lisa-track/SKILL.md +25 -2
  106. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  108. package/plugins/lisa-expo-agy/plugin.json +1 -1
  109. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  110. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  113. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  115. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  116. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  120. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  121. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  122. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  123. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  125. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  127. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  128. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  129. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  130. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  131. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  132. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  134. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  135. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  136. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  137. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  138. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  139. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  141. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  142. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  143. package/plugins/lisa-rails-agy/plugin.json +1 -1
  144. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  145. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  146. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  148. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  149. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  150. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  151. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  152. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  153. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  154. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  155. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  156. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  157. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  158. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  159. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  160. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  161. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  162. package/plugins/src/base/rules/eager/security-audit-handling.md +2 -2
  163. package/plugins/src/base/rules/reference/rejection-detection.md +2 -2
  164. package/plugins/src/base/rules/reference/security-audit-handling.md +9 -0
  165. package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +1 -1
  166. package/plugins/src/base/skills/lisa-implement/SKILL.md +12 -1
  167. package/plugins/src/base/skills/lisa-track/SKILL.md +25 -2
  168. package/scripts/lisa-audit.mjs +59 -0
  169. package/scripts/lisa-ci-failure-redispatch.mjs +30 -12
  170. package/scripts/lisa-ci-rework-route.mjs +380 -0
  171. package/scripts/two-channel-couplings.json +2 -2
  172. package/typescript/copy-contents/.husky/pre-push +5 -124
  173. package/typescript/copy-overwrite/.prettierignore +1 -0
  174. package/typescript/copy-overwrite/audit.ignore.config.json +6 -6
  175. package/typescript/package-lisa/package.lisa.json +4 -2
package/package.json CHANGED
@@ -105,7 +105,9 @@
105
105
  "measure:tmpdir-growth": "node scripts/measure-tmpdir-growth.mjs",
106
106
  "lint:staged": "lint-staged --config .lintstagedrc.json",
107
107
  "check:merge-coverage": "node scripts/check-generated-artifact-merge-coverage.mjs",
108
- "check:eager-rule-budget": "node scripts/check-eager-rule-budget.mjs"
108
+ "check:eager-rule-budget": "node scripts/check-eager-rule-budget.mjs",
109
+ "security:audit": "$npm_execpath run security:audit:lisa",
110
+ "security:audit:lisa": "node scripts/lisa-audit.mjs"
109
111
  },
110
112
  "engines": {
111
113
  "npm": "please-use-bun",
@@ -192,7 +194,7 @@
192
194
  "qs": "^6.16.0"
193
195
  },
194
196
  "name": "@codyswann/lisa",
195
- "version": "4.96.2",
197
+ "version": "4.97.0",
196
198
  "description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
197
199
  "main": "dist/index.js",
198
200
  "exports": {
@@ -238,7 +240,8 @@
238
240
  "./oxlint/expo": "./oxlint/expo.json",
239
241
  "./oxlint/cdk": "./oxlint/cdk.json",
240
242
  "./oxlint/harper-fabric": "./oxlint/harper-fabric.json",
241
- "./oxlint/phaser": "./oxlint/phaser.json"
243
+ "./oxlint/phaser": "./oxlint/phaser.json",
244
+ "./audit": "./dist/core/audit.js"
242
245
  },
243
246
  "bin": {
244
247
  "lisa": "dist/index.js",
@@ -278,6 +281,7 @@
278
281
  "@types/lodash.merge": "^4.6.0",
279
282
  "@types/node": "^24.0.0",
280
283
  "@vitest/coverage-v8": "^4.1.11",
284
+ "@yarnpkg/lockfile": "^1.1.0",
281
285
  "commander": "^12.0.0",
282
286
  "esbuild-register": "^3.6.0",
283
287
  "eslint": "^9.39.5",
@@ -329,6 +333,7 @@
329
333
  "@stryker-mutator/vitest-runner": "^9.0.0",
330
334
  "@types/js-yaml": "^4.0.9",
331
335
  "@types/semver": "^7.7.1",
336
+ "@types/yarnpkg__lockfile": "^1.1.9",
332
337
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
333
338
  "aws-cdk-lib": "2.272.0",
334
339
  "constructs": "^10.5.0",
@@ -351,7 +356,7 @@
351
356
  "test": "tests"
352
357
  },
353
358
  "types": "./dist/index.d.ts",
354
- "lisaReleaseCommit": "f83b8005e6bb2e363054185f631de1d3366d2e83",
355
- "gitHead": "f83b8005e6bb2e363054185f631de1d3366d2e83",
356
- "lisaReleaseTag": "v4.96.2"
359
+ "lisaReleaseCommit": "635e3265c56174960519472bafc0b923df2c14d3",
360
+ "gitHead": "635e3265c56174960519472bafc0b923df2c14d3",
361
+ "lisaReleaseTag": "v4.97.0"
357
362
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -499,7 +499,7 @@ A blocker is active if it is open and has no cleared status label. Treat `status
499
499
 
500
500
  Before the claim mutation, apply `claim-time-guards` — **Value before claim**, or **Worth doing** in `lisa-track` on runtimes without the rule tree (Antigravity). A ready label establishes neither value nor permission to expand scope. Respect the preceding human-hold gate; a declined incidental item consumes this cycle's one processed disposition.
501
501
 
502
- **CI rework is read before everything else in 3b — before rejection detection, and before this phase posts its own claim comment.** When a required check fails on an agent's PR, the `lisa-ci-failure-redispatch` workflow moves the item from `$CLAIMED` back to `$READY` and comments a visible line plus `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->`. A marker counts **only when its comment is authored by `github-actions[bot]`** (the workflow's identity) — anyone can type the marker, so a comment from any other author is ignored. A marker is **uncleared** while its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`; a later all-green run on the PR clears it, and a marker whose PR has merged or closed counts as cleared. From the read bundle's comments, take the **newest** comment carrying any Lisa marker (`[lisa-…]` or `[claude-build-intake]`); when it is an uncleared, bot-authored `[lisa-ci-failed]` marker, **verify the PR it names** before trusting it: `gh pr view <n> --repo <org>/<repo> --json state,isCrossRepository,body` must show `state` is `OPEN`, `isCrossRepository` is `false`, and a body whose `Work-Item:` binds this item (`<org>/<repo>#<number>`). If any check fails or the read errors, treat the item as carrying no marker and continue with ordinary 3b. Otherwise classify the item **`ci-rework`**. Read it first because the claim comment below is itself a newer Lisa marker and would hide the signal. A `ci-rework` item is **CI rework, not a QA rejection**: its claimed-to-ready move is the workflow's, not a reviewer's, so rejection detection treats it as `forward-only` and **no rejection learning** is filed — no `lisa-persist-learning` candidate, no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). It also skips claim-time archaeology and takes precedence over the `already-implemented` route below: the open PR that check finds is the one to fix, not proof that the work shipped. Carry `ci-rework` and the marker's `pr=<n>` into 3c. **Bound the loop.** Every claimed-to-ready bounce gives the item a fresh ready-lane entry, which resets the `two-failed-attempts` valve below, so a PR that keeps failing would be re-dispatched forever. When the item carries 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR, intake does not re-dispatch: it does not claim, moves the item to the configured blocked role and adds the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), posts a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), and stops this item's cycle. **Agent work is not complete while the named PR's required checks are failing** — no success outcome, done label, or close may be recorded for the item until that PR merges with its required checks green.
502
+ **CI rework is read before everything else in 3b — before rejection detection, and before this phase posts its own claim comment.** When a required check fails on an agent's PR, the `lisa-ci-failure-redispatch` workflow moves the item from `$CLAIMED` back to `$READY` and comments a visible line plus `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->`. A marker counts **only when its comment is authored by `github-actions[bot]`** (the workflow's identity) — anyone can type the marker, so a comment from any other author is ignored. A marker is **uncleared** while its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`; a later all-green run on the PR clears it, and a marker whose PR has merged or closed counts as cleared. From the read bundle's comments, take the **newest** comment carrying any Lisa marker (`[lisa-…]` or `[claude-build-intake]`; claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose); when it is an uncleared, bot-authored `[lisa-ci-failed]` marker, **verify the PR it names** before trusting it: `gh pr view <n> --repo <org>/<repo> --json state,isCrossRepository,body` must show `state` is `OPEN`, `isCrossRepository` is `false`, and a body whose `Work-Item:` binds this item (`<org>/<repo>#<number>`). If any check fails or the read errors, treat the item as carrying no marker and continue with ordinary 3b. These checks and the loop bound below are implemented once in `scripts/lisa-ci-rework-route.mjs`, which `lisa-track` also runs on the `lisa-implement` dispatch path so the two paths cannot disagree; where that script exists (the Lisa repository — it is not shipped to hosts), run `node scripts/lisa-ci-rework-route.mjs --item <org>/<repo>#<number>` and act on its printed `route` — `ci-rework`, `blocked` (the loop bound), or `implement` (no marker) — instead of re-deriving the checks. When every check passes, classify the item **`ci-rework`**. Read it first so the route is decided from the comments as they stood before this claim; claim comments are ignored by the rule above, so even a re-posted claim cannot hide the signal. A `ci-rework` item is **CI rework, not a QA rejection**: its claimed-to-ready move is the workflow's, not a reviewer's, so rejection detection treats it as `forward-only` and **no rejection learning** is filed — no `lisa-persist-learning` candidate, no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). It also skips claim-time archaeology and takes precedence over the `already-implemented` route below: the open PR that check finds is the one to fix, not proof that the work shipped. Carry `ci-rework` and the marker's `pr=<n>` into 3c. **Bound the loop.** Every claimed-to-ready bounce gives the item a fresh ready-lane entry, which resets the `two-failed-attempts` valve below, so a PR that keeps failing would be re-dispatched forever. When the item carries 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR, intake does not re-dispatch: it does not claim, moves the item to the configured blocked role and adds the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), posts a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), and stops this item's cycle. **Agent work is not complete while the named PR's required checks are failing** — no success outcome, done label, or close may be recorded for the item until that PR merges with its required checks green.
503
503
 
504
504
  **Rejection detection runs first — before the relabel below.** Per the vendor-neutral `rejection-detection` rule (cite the slug; do not restate its classification table), classify this item at the **top of 3b, BEFORE** the `$READY → $CLAIMED` relabel — after the relabel the current-lane signal is gone. Read the item's Label-Event History from `lisa-github-read-issue` (chronological `LabeledEvent` / `UnlabeledEvent` on the configured `$READY` label) and classify it `rejection-reclaim | forward-only | never-left-ready | unknown`. Lane names come from `.lisa.config.json` (`github.labels.build.*`), never hardcoded. A failing/absent history yields `unknown` and the claim proceeds — detection never blocks the build. Items carrying a learning marker (`[lisa-learning-drop]` / `[lisa-learning-pr]` / `[lisa-learning-upstream-handoff]`) or the `learning:needs-triage` or `learning:low-confidence` label are never rejection triggers (no learning-about-learning). Carry the classification into the relabel and lifecycle below.
505
505
 
@@ -89,7 +89,7 @@ The input-resolver invokes `lisa-track $ARGUMENTS` (with `managedBy=` already st
89
89
  Require a successful readback of that worktree-local binding. On detached HEAD, `branch: null` is the expected pending binding; after branch creation the mandatory `attach-branch` step below must replace it before any commit. Tracker or binding failure stops the flow; never continue untracked.
90
90
  - **Persist the bundle verbatim to `.lisa/work-item-context.md`.** **Ignore guard before any write.** A host can receive these skills before its shipped `.gitignore` entry, so prove the path is ignored first, from the worktree root: `git check-ignore -q .lisa/work-item-context.md || printf '%s\n' '.lisa/work-item-context.md' >> "$(git rev-parse --git-common-dir)/info/exclude"`, then re-run `git check-ignore -q .lisa/work-item-context.md`. If it is still not ignored, stop and report — do not write the bundle. If an `.easignore` exists and `grep -qxF '.lisa/work-item-context.md' .easignore` fails, stop and report instead of writing: EAS uploads read `.easignore`, which is derived from `.gitignore`, not from `info/exclude`. There is one writer order. `lisa-track` has already written its live read, unedited, to `<worktree root>/.lisa/work-item-context.md`. With no `caller_bundle_path`, keep that file as written. With a `caller_bundle_path`, `lisa-track` leaves an existing file untouched, and this step persists the caller-supplied bundle instead of discarding it: refuse a `caller_bundle_path` that does not end in `/.lisa/work-item-context.md` — do not read it, report the refusal to the lead, and keep the live read as the file; otherwise read the file at that path and keep it as the base (copy it verbatim to the worktree's `.lisa/work-item-context.md` first if the path differs), then append under `## Added by live read` only what the live read carries that the caller bundle lacks (newer comments, changed status or graph). Either way the live validation and claim still run exactly as above. Never summarize, trim, or paraphrase the bundle; downstream agents act on this file, so anything left out of it is lost to them. The file is worktree-local and git-ignored; never stage it.
91
91
  - **Append the per-comment inventory to the file.** Finish the file with a trailing `## Comment inventory` section: one line per comment with author, date, one-line gist, and flags from `decision|constraint|credential|repro` for each decision, constraint, credential/access note, or reproduction step it carries. The inventory indexes the bundle above it; it never replaces it. **A `credential` gist names only the kind and the location** — for example `staging API token — see comment 4 in the context file` — never the secret value or identifier. The value stays only in the git-ignored context file: never copy it into task descriptions, teammate prompts, plan or roster files, tracker comments, or PR text.
92
- - Return `work_item_context: <absolute path of the file>`, the same per-comment inventory, `tracker_provider`, canonical `work_item_ref`, resolution outcome, claim outcome, and verified binding to the team lead, who then proceeds to roster selection.
92
+ - Return `work_item_context: <absolute path of the file>`, the same per-comment inventory, `tracker_provider`, canonical `work_item_ref`, resolution outcome, claim outcome, verified binding, and `lisa-track`'s `route` (with `failing_checks` and `head_ref`) to the team lead, who then proceeds to roster selection — or, for `route: ci-rework` or `route: blocked`, to the CI-rework route below.
93
93
 
94
94
  The input resolver may perform these tracker and local-binding operations before the Roster Decision because they are the mandatory gate that establishes what work the team is allowed to do. No project source, documentation, plan artifact, branch, or task may be created or changed before this transaction succeeds. Read-only discussion/orientation outside an Implement flow remains exempt per the `tracked-work` rule.
95
95
 
@@ -97,6 +97,17 @@ The input resolver is the only teammate that may be spawned before the Roster De
97
97
 
98
98
  **Rejection evidence in the claim handoff.** When this flow was dispatched from a build-intake claim that classified the item as a `rejection-reclaim` (per the `rejection-detection` rule), the context bundle carries a **rejection evidence summary** (what was rejected, the defect the QA comment named, the approach named as wrong). The plan MUST explicitly address that rejection evidence and MUST NOT re-propose the specific approach the rejection named as wrong — a bounced item must come back fixed, not re-bounced. `lisa-implement` cannot fetch this itself (it never sees the claim); it consumes what the handoff carries. Absence of rejection evidence never blocks — plan and implement normally.
99
99
 
100
+ **CI-rework route.** `lisa-track` decides the route from the item's comments before it writes anything, ignoring claim comments so a claim (including the session manager's earlier one) never hides the `[lisa-ci-failed]` marker, using the same shared helper (`scripts/lisa-ci-rework-route.mjs`) as build intake 3b. With `route: implement` nothing changes. With `route: ci-rework pr=<n>`, a required check failed on this item's existing pull request, so the work goes back to that pull request — never a new branch or a second pull request for the same item (CodySwannGT/lisa#4677). Skip the full build: no planning, research or implementation specialists, no claim-time archaeology or triage — the item was already triaged and built, and only its PR's checks are red. The lead runs this in-session instead:
101
+
102
+ 1. Put the PR's head branch (`head_ref`, or `gh pr view <n> --repo <org>/<repo> --json headRefName`) in a dedicated worktree bound to the item. If `git worktree list` already shows a worktree with `<headRefName>` checked out, reuse it (pull it up to `origin/<headRefName>` first). Otherwise run `git fetch origin <headRefName>`, then check for a local `<headRefName>` branch. If one exists and `git rev-list --count origin/<headRefName>..<headRefName>` is greater than zero, it holds a prior agent's unpushed commits: add the worktree on that local branch with `git worktree add <path> <headRefName>`, then merge `origin/<headRefName>` into it and push, so that work is published rather than discarded. Use `git worktree add -B <headRefName> <path> origin/<headRefName>` only when the local branch is absent or has nothing unpushed. Then run `node scripts/lisa-work-item.mjs link <canonical-ref>` from inside it and read it back through `node scripts/lisa-work-item.mjs current`. Run the ignore guard above there and copy the resolver's `.lisa/work-item-context.md` into that worktree unchanged. Only after that copy, and only when the resolver's worktree is a different worktree, clean the resolver's worktree up: run `node scripts/lisa-work-item.mjs clear` there and delete its `.lisa/work-item-context.md`, so no stale binding and no secret-bearing copy of the bundle are left behind.
103
+ 2. In the PR worktree's `.lisa/work-item-context.md`, append the marker comment's failing check names under `## CI failure`. Pass no rejection evidence, because nobody rejected the work.
104
+ 3. From that worktree, invoke `lisa-drive-pr-to-merge pr=<n>`, naming the failing checks: it fixes them on the existing branch and drives the pull request to merge. If that work needs specialist teammates, record the Roster Decision first as usual.
105
+ 4. Record no rejection learning: no `lisa-persist-learning` candidate and no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). The item is not complete while the marker is uncleared: record no success outcome, done role or close until the pull request merges with every required check green. The producer's next all-green run clears the marker, and a merged or closed pull request's marker counts as cleared. On merge, finish as a build success does (tracker sync, evidence, lifecycle transition). If the pull request cannot be driven green, leave the item claimed and report why. Under `managedBy=`, the terminal `DONE:` / `FAILED:` line is sent exactly as for a build.
106
+
107
+ With `route: blocked pr=<n>`, the pull request has failed its required checks 3 or more times: `lisa-track` already moved the item from whichever lane it was in (ready or claimed) to the blocked role and the `human_needed` label, and wrote no binding, so stop and report that a person needs to look at the pull request (under `managedBy=`, an exit to the blocked role is `FAILED`).
108
+
109
+ The route is runtime-neutral text: every agent that runs this skill reads the same `route` field, and the helper is a plain Node script. The session manager dispatch path it exists for is Claude Code only (see the Runtime parity table in `lisa-session-manager`); agents without a background worker reach a CI-bounced item through build intake or a direct `/lisa-implement <ref>` invocation, which take this same route.
110
+
100
111
  ## Select the agent roster
101
112
 
102
113
  Before spawning any teammate beyond the bounded input resolver, record a **Roster Decision** artifact. It must enumerate every agent or specialist type exposed by the current runtime's delegation tool and record one line per type:
@@ -78,6 +78,26 @@ This is intentionally conservative: ambiguity creates one explicit work item ins
78
78
 
79
79
  ## Phase 3 — Claim and bind
80
80
 
81
+ ### CI-rework route (first, before any claim write)
82
+
83
+ Decide the dispatch route from the item's comments as they stand **before** this phase writes anything (CodySwannGT/lisa#4677). When the configured tracker is `github` **and** `scripts/lisa-ci-rework-route.mjs` exists at the repository root, run it from the repository root:
84
+
85
+ ```bash
86
+ node scripts/lisa-ci-rework-route.mjs --item <canonical-ref>
87
+ ```
88
+
89
+ It only reads, and prints one JSON object. It is the one place the trust rules live, shared with `lisa-github-build-intake` 3b so the two dispatch paths cannot disagree: the newest counted Lisa marker must be an uncleared `[lisa-ci-failed]` marker authored by `github-actions[bot]` — claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose — and the pull request it names must be open, from this repository rather than a fork, and bound to this item by its `Work-Item:` line. Act on its `route`:
90
+
91
+ - When `route` is `implement` (any `reason`): resolve and claim the item the normal way below, and return `route: implement`.
92
+ - When `route` is `ci-rework`: return `route: ci-rework pr=<n>`, `failing_checks` and `head_ref` (the JSON's `pr`, `failingChecks` and `headRefName`). Continue through the hold check and the claim below unchanged: the claim is what moves the item from the ready lane back to the claimed lane, the same re-claim build intake 3b performs, and the binding names the same item. A ci-rework item is CI rework, not a rejection: it takes no rejection detection and records no rejection learning (the `rejection-detection` rule's CI-rework exemption).
93
+ - When `route` is `blocked` (`reason: ci-loop-bound`, 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR): first run the hold check below; if the item is held, return its `held-by-gate` outcome and stop without changing labels or posting anything. Otherwise do not claim and write no binding — the same loop bound build intake 3b applies. Move the item to the configured blocked role from whichever lane it is in: remove the configured ready and claimed labels if present (`github.labels.build.ready`, `github.labels.build.claimed` — on the session-manager path the item is already claimed), then apply the configured blocked role and the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), post a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), return `route: blocked pr=<n>`, `claim_outcome: blocked-ci-loop` and `binding_outcome: skipped-ci-loop`, then stop.
94
+
95
+ Skip this step silently and return `route: implement` when the tracker is Jira or Linear (only this repository's GitHub workflow writes the marker) or when the script is absent: `scripts/` at the Lisa repository root is not shipped to host projects, so a host never has the helper and never receives the marker. A non-zero exit or output that is not one JSON object is also `route: implement` — falling back to the normal path is always recoverable. A held item still stops at the hold check below, whatever its route.
96
+
97
+ **Why claim comments are ignored.** On the session-manager path the manager has already claimed the item before the worker starts, so the helper runs after a claim and the claim below comes back `reused`; a re-claim can also post another claim comment. Claim comments are ignored for exactly that reason: an uncleared marker on an open, bound pull request still means that pull request is red, whoever has claimed the item since.
98
+
99
+ ### Hold check and claim
100
+
81
101
  The work item is **held** when the caller declared a `human_gate`, independently of any item history,
82
102
  or `classifyReadyCandidate({ labels, body, comments, trustedHumanActorIds, humanNeededLabel, humanOnly })` from the shipped
83
103
  `scripts/intake-blocker-reprobe.mjs` returns `claimable: false`. Pass the complete live comment
@@ -116,8 +136,11 @@ Otherwise:
116
136
  readiness_declaration: build-ready|human-gate
117
137
  held_by: none|caller-declaration|item-marker
118
138
  gate_reason: <the act a person must perform>|null
119
- claim_outcome: claimed|reused|held-by-gate
120
- binding_outcome: verified|skipped-human-gate
139
+ claim_outcome: claimed|reused|held-by-gate|blocked-ci-loop
140
+ binding_outcome: verified|skipped-human-gate|skipped-ci-loop
141
+ route: implement|ci-rework pr=<n>|blocked pr=<n>
142
+ failing_checks: <comma-separated check names from the marker comment>|none
143
+ head_ref: <the pull request's head branch>|null
121
144
  work_item_context: <absolute path to .lisa/work-item-context.md>
122
145
  ```
123
146
 
@@ -10,7 +10,7 @@ For each high/critical advisory the gate reports, take the **first** action that
10
10
  2. **If an upgrade isn't possible** (no compatible patched version on the dependency graph): **force a resolution/override** on the vulnerable leaf package (both `resolutions` and `overrides`), regenerate the lockfile, retry. Done.
11
11
  3. **If an override isn't possible either** (would break a dependent, or no fixed version exists anywhere): **evaluate whether the advisory actually affects this project** — is the vulnerable code path reachable, does it process untrusted input, is it runtime vs. dev/build-only?
12
12
  4. **If it does affect the project** and neither (1) nor (2) was possible: **ask a human** what to do. This is the only rung that pauses for a person.
13
- 5. **If it does not affect the project**: **add a documented exclusion yourself** to `audit.ignore.local.json` (`{"id", "package", "reason"}` — reason states the impact evaluation), commit, retry. No human approval needed.
13
+ 5. **If it does not affect the project**: **add a documented exclusion yourself** to `audit.ignore.local.json` (`id`, `package`, `reason` = impact evaluation; dev-only copy: add `versions`, `paths`; see https://github.com/CodySwannGT/lisa/blob/main/docs/dependency-audit-exclusions.md), commit, retry. No human approval needed.
14
14
 
15
15
  Steps 1, 2, 3, and 5 are autonomous. Only step 4 escalates.
16
16
 
@@ -31,7 +31,7 @@ If those checks fail, the override is "not possible" — drop to step 3.
31
31
 
32
32
  - Never add a blanket audit bypass or lower the configured audit level.
33
33
  - Never escalate to a human (step 4) before genuinely attempting steps 1–3.
34
- - Never add an ignore entry (step 5) without an impact evaluation recorded in its `reason`. (This is a policy requirement enforced by convention. The `reason` field is not programmatically validated by Lisa tooling, so its presence relies on Claude following this rule faithfully.)
34
+ - Never add an ignore entry (step 5) without an impact evaluation recorded in its `reason`. (`lisa doctor` flags an exclusion with no written decision; the audit itself does not read `reason`.)
35
35
 
36
36
  ## Rails (bundler-audit)
37
37
 
@@ -41,7 +41,7 @@ An artifact this flow produced is **never** a rejection-reflection trigger, no m
41
41
 
42
42
  ## CI-rework exemption (a failed required check is not a rejection)
43
43
 
44
- When the newest Lisa marker comment on the item is an uncleared `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->` (no `[lisa-ci-cleared]` on that comment) **authored by `github-actions[bot]`**, naming a PR that is open, same-repository, and bound to this item, its return to `$READY` is **CI rework**: an automation moved it because a required check failed on its PR, not because a reviewer rejected it. Short-circuit to `forward-only` — no rejection learning, no candidate — and route the claim to the existing PR, as the build-intake arm specifies. Read the markers before the claim posts its own comment. A marker from any other author, or one whose PR fails those checks, is no marker; a marker whose PR has merged or closed counts as cleared.
44
+ When the newest Lisa marker comment on the item (claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose) is an uncleared `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->` (no `[lisa-ci-cleared]` on that comment) **authored by `github-actions[bot]`**, naming a PR that is open, same-repository, and bound to this item, its return to `$READY` is **CI rework**: an automation moved it because a required check failed on its PR, not because a reviewer rejected it. Short-circuit to `forward-only` — no rejection learning, no candidate — and route the claim to the existing PR, as the build-intake arm specifies. The second dispatch path — `lisa-implement` resolving the item through `lisa-track` (how the session manager dispatches) — routes it the same way, to `lisa-drive-pr-to-merge` on that PR; both paths decide through the shared `scripts/lisa-ci-rework-route.mjs` helper. Read the markers before the claim posts its own comment. A marker from any other author, or one whose PR fails those checks, is no marker; a marker whose PR has merged or closed counts as cleared.
45
45
 
46
46
  ## Reflect on a `rejection-reclaim`
47
47
 
@@ -132,7 +132,7 @@ This is the **trigger-side** half of the no-learning-loops guard. The claim-time
132
132
 
133
133
  A backward move is only a teaching signal when a person judged the work. The Lisa repository's `lisa-ci-failure-redispatch` workflow also moves items backward — `$CLAIMED` to `$READY` — when a required check fails on the item's PR, and posts `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->` as it does. That move is **CI rework**: the defect is a red check the agent has not fixed yet, not an approach a reviewer named as wrong, and reflecting on it would file a learning about a failure the agent is about to fix on the same branch.
134
134
 
135
- So before classifying as `rejection-reclaim`, read the item's comments: when the newest comment carrying a Lisa marker is an uncleared `[lisa-ci-failed]` marker (its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`) **authored by `github-actions[bot]`** — the workflow's identity; anyone can type the marker, so no other author counts — and the PR it names is open, not cross-repository, and binds this item through its `Work-Item:` line, treat the item as `forward-only`. No rejection learning is assembled and no `[lisa-rejection-candidate]` is recorded. Read the markers **before** the claim writes its own comment, which is itself a newer Lisa marker. The build-intake arm routes such an item to `lisa-drive-pr-to-merge` on the PR the marker names rather than to `lisa-implement`; agent work is not complete while the named PR's required checks are failing, and a marker whose PR has merged or closed counts as cleared.
135
+ So before classifying as `rejection-reclaim`, read the item's comments: when the newest comment carrying a Lisa marker (claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose) is an uncleared `[lisa-ci-failed]` marker (its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`) **authored by `github-actions[bot]`** — the workflow's identity; anyone can type the marker, so no other author counts — and the PR it names is open, not cross-repository, and binds this item through its `Work-Item:` line, treat the item as `forward-only`. No rejection learning is assembled and no `[lisa-rejection-candidate]` is recorded. Read the markers **before** the claim writes its own comment, which is itself a newer Lisa marker. The build-intake arm routes such an item to `lisa-drive-pr-to-merge` on the PR the marker names rather than to `lisa-implement`. The second dispatch path does the same: when the session manager (or anyone) runs `lisa-implement` on the item, `lisa-track` decides the route before its claim comment and `lisa-implement` drives the existing PR instead of building again, filing no rejection learning. Both paths decide through one helper, `scripts/lisa-ci-rework-route.mjs`, so they cannot disagree. Agent work is not complete while the named PR's required checks are failing, and a marker whose PR has merged or closed counts as cleared.
136
136
 
137
137
  Today only the GitHub arm has a producer (the workflow is Lisa-repository-only and is not shipped to hosts), so the Jira and Linear arms never see the marker; the exemption is stated vendor-neutrally so a future producer on those trackers inherits it.
138
138
 
@@ -23,6 +23,15 @@ Steps 1, 2, 3, and 5 are autonomous. Do not stop and ask the user except at step
23
23
  5. **Step 3 — evaluate impact:** If neither an upgrade nor an override is possible (no fixed version exists, or every compatible pin breaks a dependent), determine whether the vulnerability actually affects this project. Consider: is the vulnerable code path reachable from this project's usage? Does it process untrusted input? Is the dependency runtime, or dev/build-only? Record the conclusion.
24
24
  6. **Step 4 — escalate:** If the evaluation shows the vulnerability **does** affect the project and neither step 1 nor step 2 was possible, ask the user what to do. This is the only step that pauses for a human.
25
25
  7. **Step 5 — ignore:** If the evaluation shows the vulnerability **does not** affect the project, add an exclusion entry to `audit.ignore.local.json` yourself, in the format `{"id": "GHSA-xxx", "package": "pkg-name", "reason": "<impact evaluation: why this advisory does not affect this project>"}`, then commit and retry the push. No human approval is required for this step — the `reason` field is the record of your evaluation.
26
+ - **Scope the exclusion to the copy you evaluated.** An entry with only `id` (and `package`) hides the advisory for every copy of the package, including one a production dependency pulls in later. Two optional fields narrow it, and every field present must hold together:
27
+ - `versions` — a semver range the excused installed copies must fall inside, such as `">=3.0.0 <4.0.0"`.
28
+ - `paths` — a non-empty array of exact lockfile key paths for the excused copies: a `bun.lock` `packages` key such as `"lint-plugin/pkg"`, a `package-lock.json` `packages` key such as `"node_modules/lint-plugin/node_modules/pkg"`, or a `yarn.lock` selector key. No globs. Bun keys and nested npm keys isolate one parent. A `yarn.lock` selector names a requested range, not a parent, and a hoisted npm key (`"node_modules/pkg"`) names an install location; any later dependent that asks for that range or resolves to that hoisted copy is covered too, so pair those keys with a tight `versions` range.
29
+ - `package` is the lowercase npm name the audit reports (`tar`, not `node-tar`). A misspelled scope field (`path`, `version`, `Paths`) fails the audit instead of silently excusing every copy; other extra keys are ignored.
30
+ - **Whenever the vulnerable copy is dev-only** (reached only through a devDependency, such as a lint plugin pinned to an old major), add `versions` and `paths` rather than an ID-wide entry:
31
+ ```json
32
+ {"id": "GHSA-xxx", "package": "pkg", "versions": ">=3.0.0 <4.0.0", "paths": ["lint-plugin/pkg"], "reason": "<impact evaluation>"}
33
+ ```
34
+ Then any other vulnerable copy — on an unlisted path or through an npm alias — still fails the audit and is named by its lockfile path. An empty `paths` array, an invalid range, or an unreadable lockfile fails the audit with a diagnostic; it never widens into an ID-wide exclusion. The pre-push hook, the gate registry, and CI use the same matcher. `lisa doctor` checks the scope fields and that the lockfile is readable, and reports any remaining exclusion without `versions` or `paths`, but it does not match advisories against lockfile copies — a valid-looking path that names the wrong copy can pass doctor and still be rejected by the audit. Doctor also does not reject an entry with no `id` or an exclusion file that does not parse; the audit does. Only the audit proves the exclusion files are accepted. In CI, the reusable workflow audits the manager its `package_manager` input names (default `npm`), so set that input to the project's manager. A scoped entry always wins over a wider entry for the same advisory and package. Full contract: https://github.com/CodySwannGT/lisa/blob/main/docs/dependency-audit-exclusions.md
26
35
 
27
36
  ### Critical: Override the vulnerable package, not its parent
28
37
 
@@ -497,7 +497,7 @@ A blocker is active if it is open and has no cleared status label. Treat `status
497
497
 
498
498
  Before the claim mutation, apply `claim-time-guards` — **Value before claim**, or **Worth doing** in `lisa-track` on runtimes without the rule tree (Antigravity). A ready label establishes neither value nor permission to expand scope. Respect the preceding human-hold gate; a declined incidental item consumes this cycle's one processed disposition.
499
499
 
500
- **CI rework is read before everything else in 3b — before rejection detection, and before this phase posts its own claim comment.** When a required check fails on an agent's PR, the `lisa-ci-failure-redispatch` workflow moves the item from `$CLAIMED` back to `$READY` and comments a visible line plus `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->`. A marker counts **only when its comment is authored by `github-actions[bot]`** (the workflow's identity) — anyone can type the marker, so a comment from any other author is ignored. A marker is **uncleared** while its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`; a later all-green run on the PR clears it, and a marker whose PR has merged or closed counts as cleared. From the read bundle's comments, take the **newest** comment carrying any Lisa marker (`[lisa-…]` or `[claude-build-intake]`); when it is an uncleared, bot-authored `[lisa-ci-failed]` marker, **verify the PR it names** before trusting it: `gh pr view <n> --repo <org>/<repo> --json state,isCrossRepository,body` must show `state` is `OPEN`, `isCrossRepository` is `false`, and a body whose `Work-Item:` binds this item (`<org>/<repo>#<number>`). If any check fails or the read errors, treat the item as carrying no marker and continue with ordinary 3b. Otherwise classify the item **`ci-rework`**. Read it first because the claim comment below is itself a newer Lisa marker and would hide the signal. A `ci-rework` item is **CI rework, not a QA rejection**: its claimed-to-ready move is the workflow's, not a reviewer's, so rejection detection treats it as `forward-only` and **no rejection learning** is filed — no `lisa-persist-learning` candidate, no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). It also skips claim-time archaeology and takes precedence over the `already-implemented` route below: the open PR that check finds is the one to fix, not proof that the work shipped. Carry `ci-rework` and the marker's `pr=<n>` into 3c. **Bound the loop.** Every claimed-to-ready bounce gives the item a fresh ready-lane entry, which resets the `two-failed-attempts` valve below, so a PR that keeps failing would be re-dispatched forever. When the item carries 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR, intake does not re-dispatch: it does not claim, moves the item to the configured blocked role and adds the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), posts a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), and stops this item's cycle. **Agent work is not complete while the named PR's required checks are failing** — no success outcome, done label, or close may be recorded for the item until that PR merges with its required checks green.
500
+ **CI rework is read before everything else in 3b — before rejection detection, and before this phase posts its own claim comment.** When a required check fails on an agent's PR, the `lisa-ci-failure-redispatch` workflow moves the item from `$CLAIMED` back to `$READY` and comments a visible line plus `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->`. A marker counts **only when its comment is authored by `github-actions[bot]`** (the workflow's identity) — anyone can type the marker, so a comment from any other author is ignored. A marker is **uncleared** while its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`; a later all-green run on the PR clears it, and a marker whose PR has merged or closed counts as cleared. From the read bundle's comments, take the **newest** comment carrying any Lisa marker (`[lisa-…]` or `[claude-build-intake]`; claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose); when it is an uncleared, bot-authored `[lisa-ci-failed]` marker, **verify the PR it names** before trusting it: `gh pr view <n> --repo <org>/<repo> --json state,isCrossRepository,body` must show `state` is `OPEN`, `isCrossRepository` is `false`, and a body whose `Work-Item:` binds this item (`<org>/<repo>#<number>`). If any check fails or the read errors, treat the item as carrying no marker and continue with ordinary 3b. These checks and the loop bound below are implemented once in `scripts/lisa-ci-rework-route.mjs`, which `lisa-track` also runs on the `lisa-implement` dispatch path so the two paths cannot disagree; where that script exists (the Lisa repository — it is not shipped to hosts), run `node scripts/lisa-ci-rework-route.mjs --item <org>/<repo>#<number>` and act on its printed `route` — `ci-rework`, `blocked` (the loop bound), or `implement` (no marker) — instead of re-deriving the checks. When every check passes, classify the item **`ci-rework`**. Read it first so the route is decided from the comments as they stood before this claim; claim comments are ignored by the rule above, so even a re-posted claim cannot hide the signal. A `ci-rework` item is **CI rework, not a QA rejection**: its claimed-to-ready move is the workflow's, not a reviewer's, so rejection detection treats it as `forward-only` and **no rejection learning** is filed — no `lisa-persist-learning` candidate, no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). It also skips claim-time archaeology and takes precedence over the `already-implemented` route below: the open PR that check finds is the one to fix, not proof that the work shipped. Carry `ci-rework` and the marker's `pr=<n>` into 3c. **Bound the loop.** Every claimed-to-ready bounce gives the item a fresh ready-lane entry, which resets the `two-failed-attempts` valve below, so a PR that keeps failing would be re-dispatched forever. When the item carries 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR, intake does not re-dispatch: it does not claim, moves the item to the configured blocked role and adds the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), posts a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), and stops this item's cycle. **Agent work is not complete while the named PR's required checks are failing** — no success outcome, done label, or close may be recorded for the item until that PR merges with its required checks green.
501
501
 
502
502
  **Rejection detection runs first — before the relabel below.** Per the vendor-neutral `rejection-detection` rule (cite the slug; do not restate its classification table), classify this item at the **top of 3b, BEFORE** the `$READY → $CLAIMED` relabel — after the relabel the current-lane signal is gone. Read the item's Label-Event History from `lisa-github-read-issue` (chronological `LabeledEvent` / `UnlabeledEvent` on the configured `$READY` label) and classify it `rejection-reclaim | forward-only | never-left-ready | unknown`. Lane names come from `.lisa.config.json` (`github.labels.build.*`), never hardcoded. A failing/absent history yields `unknown` and the claim proceeds — detection never blocks the build. Items carrying a learning marker (`[lisa-learning-drop]` / `[lisa-learning-pr]` / `[lisa-learning-upstream-handoff]`) or the `learning:needs-triage` or `learning:low-confidence` label are never rejection triggers (no learning-about-learning). Carry the classification into the relabel and lifecycle below.
503
503
 
@@ -87,7 +87,7 @@ The input-resolver invokes `lisa-track $ARGUMENTS` (with `managedBy=` already st
87
87
  Require a successful readback of that worktree-local binding. On detached HEAD, `branch: null` is the expected pending binding; after branch creation the mandatory `attach-branch` step below must replace it before any commit. Tracker or binding failure stops the flow; never continue untracked.
88
88
  - **Persist the bundle verbatim to `.lisa/work-item-context.md`.** **Ignore guard before any write.** A host can receive these skills before its shipped `.gitignore` entry, so prove the path is ignored first, from the worktree root: `git check-ignore -q .lisa/work-item-context.md || printf '%s\n' '.lisa/work-item-context.md' >> "$(git rev-parse --git-common-dir)/info/exclude"`, then re-run `git check-ignore -q .lisa/work-item-context.md`. If it is still not ignored, stop and report — do not write the bundle. If an `.easignore` exists and `grep -qxF '.lisa/work-item-context.md' .easignore` fails, stop and report instead of writing: EAS uploads read `.easignore`, which is derived from `.gitignore`, not from `info/exclude`. There is one writer order. `lisa-track` has already written its live read, unedited, to `<worktree root>/.lisa/work-item-context.md`. With no `caller_bundle_path`, keep that file as written. With a `caller_bundle_path`, `lisa-track` leaves an existing file untouched, and this step persists the caller-supplied bundle instead of discarding it: refuse a `caller_bundle_path` that does not end in `/.lisa/work-item-context.md` — do not read it, report the refusal to the lead, and keep the live read as the file; otherwise read the file at that path and keep it as the base (copy it verbatim to the worktree's `.lisa/work-item-context.md` first if the path differs), then append under `## Added by live read` only what the live read carries that the caller bundle lacks (newer comments, changed status or graph). Either way the live validation and claim still run exactly as above. Never summarize, trim, or paraphrase the bundle; downstream agents act on this file, so anything left out of it is lost to them. The file is worktree-local and git-ignored; never stage it.
89
89
  - **Append the per-comment inventory to the file.** Finish the file with a trailing `## Comment inventory` section: one line per comment with author, date, one-line gist, and flags from `decision|constraint|credential|repro` for each decision, constraint, credential/access note, or reproduction step it carries. The inventory indexes the bundle above it; it never replaces it. **A `credential` gist names only the kind and the location** — for example `staging API token — see comment 4 in the context file` — never the secret value or identifier. The value stays only in the git-ignored context file: never copy it into task descriptions, teammate prompts, plan or roster files, tracker comments, or PR text.
90
- - Return `work_item_context: <absolute path of the file>`, the same per-comment inventory, `tracker_provider`, canonical `work_item_ref`, resolution outcome, claim outcome, and verified binding to the team lead, who then proceeds to roster selection.
90
+ - Return `work_item_context: <absolute path of the file>`, the same per-comment inventory, `tracker_provider`, canonical `work_item_ref`, resolution outcome, claim outcome, verified binding, and `lisa-track`'s `route` (with `failing_checks` and `head_ref`) to the team lead, who then proceeds to roster selection — or, for `route: ci-rework` or `route: blocked`, to the CI-rework route below.
91
91
 
92
92
  The input resolver may perform these tracker and local-binding operations before the Roster Decision because they are the mandatory gate that establishes what work the team is allowed to do. No project source, documentation, plan artifact, branch, or task may be created or changed before this transaction succeeds. Read-only discussion/orientation outside an Implement flow remains exempt per the `tracked-work` rule.
93
93
 
@@ -95,6 +95,17 @@ The input resolver is the only teammate that may be spawned before the Roster De
95
95
 
96
96
  **Rejection evidence in the claim handoff.** When this flow was dispatched from a build-intake claim that classified the item as a `rejection-reclaim` (per the `rejection-detection` rule), the context bundle carries a **rejection evidence summary** (what was rejected, the defect the QA comment named, the approach named as wrong). The plan MUST explicitly address that rejection evidence and MUST NOT re-propose the specific approach the rejection named as wrong — a bounced item must come back fixed, not re-bounced. `lisa-implement` cannot fetch this itself (it never sees the claim); it consumes what the handoff carries. Absence of rejection evidence never blocks — plan and implement normally.
97
97
 
98
+ **CI-rework route.** `lisa-track` decides the route from the item's comments before it writes anything, ignoring claim comments so a claim (including the session manager's earlier one) never hides the `[lisa-ci-failed]` marker, using the same shared helper (`scripts/lisa-ci-rework-route.mjs`) as build intake 3b. With `route: implement` nothing changes. With `route: ci-rework pr=<n>`, a required check failed on this item's existing pull request, so the work goes back to that pull request — never a new branch or a second pull request for the same item (CodySwannGT/lisa#4677). Skip the full build: no planning, research or implementation specialists, no claim-time archaeology or triage — the item was already triaged and built, and only its PR's checks are red. The lead runs this in-session instead:
99
+
100
+ 1. Put the PR's head branch (`head_ref`, or `gh pr view <n> --repo <org>/<repo> --json headRefName`) in a dedicated worktree bound to the item. If `git worktree list` already shows a worktree with `<headRefName>` checked out, reuse it (pull it up to `origin/<headRefName>` first). Otherwise run `git fetch origin <headRefName>`, then check for a local `<headRefName>` branch. If one exists and `git rev-list --count origin/<headRefName>..<headRefName>` is greater than zero, it holds a prior agent's unpushed commits: add the worktree on that local branch with `git worktree add <path> <headRefName>`, then merge `origin/<headRefName>` into it and push, so that work is published rather than discarded. Use `git worktree add -B <headRefName> <path> origin/<headRefName>` only when the local branch is absent or has nothing unpushed. Then run `node scripts/lisa-work-item.mjs link <canonical-ref>` from inside it and read it back through `node scripts/lisa-work-item.mjs current`. Run the ignore guard above there and copy the resolver's `.lisa/work-item-context.md` into that worktree unchanged. Only after that copy, and only when the resolver's worktree is a different worktree, clean the resolver's worktree up: run `node scripts/lisa-work-item.mjs clear` there and delete its `.lisa/work-item-context.md`, so no stale binding and no secret-bearing copy of the bundle are left behind.
101
+ 2. In the PR worktree's `.lisa/work-item-context.md`, append the marker comment's failing check names under `## CI failure`. Pass no rejection evidence, because nobody rejected the work.
102
+ 3. From that worktree, invoke `lisa-drive-pr-to-merge pr=<n>`, naming the failing checks: it fixes them on the existing branch and drives the pull request to merge. If that work needs specialist teammates, record the Roster Decision first as usual.
103
+ 4. Record no rejection learning: no `lisa-persist-learning` candidate and no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). The item is not complete while the marker is uncleared: record no success outcome, done role or close until the pull request merges with every required check green. The producer's next all-green run clears the marker, and a merged or closed pull request's marker counts as cleared. On merge, finish as a build success does (tracker sync, evidence, lifecycle transition). If the pull request cannot be driven green, leave the item claimed and report why. Under `managedBy=`, the terminal `DONE:` / `FAILED:` line is sent exactly as for a build.
104
+
105
+ With `route: blocked pr=<n>`, the pull request has failed its required checks 3 or more times: `lisa-track` already moved the item from whichever lane it was in (ready or claimed) to the blocked role and the `human_needed` label, and wrote no binding, so stop and report that a person needs to look at the pull request (under `managedBy=`, an exit to the blocked role is `FAILED`).
106
+
107
+ The route is runtime-neutral text: every agent that runs this skill reads the same `route` field, and the helper is a plain Node script. The session manager dispatch path it exists for is Claude Code only (see the Runtime parity table in `lisa-session-manager`); agents without a background worker reach a CI-bounced item through build intake or a direct `/lisa-implement <ref>` invocation, which take this same route.
108
+
98
109
  ## Select the agent roster
99
110
 
100
111
  Before spawning any teammate beyond the bounded input resolver, record a **Roster Decision** artifact. It must enumerate every agent or specialist type exposed by the current runtime's delegation tool and record one line per type:
@@ -76,6 +76,26 @@ This is intentionally conservative: ambiguity creates one explicit work item ins
76
76
 
77
77
  ## Phase 3 — Claim and bind
78
78
 
79
+ ### CI-rework route (first, before any claim write)
80
+
81
+ Decide the dispatch route from the item's comments as they stand **before** this phase writes anything (CodySwannGT/lisa#4677). When the configured tracker is `github` **and** `scripts/lisa-ci-rework-route.mjs` exists at the repository root, run it from the repository root:
82
+
83
+ ```bash
84
+ node scripts/lisa-ci-rework-route.mjs --item <canonical-ref>
85
+ ```
86
+
87
+ It only reads, and prints one JSON object. It is the one place the trust rules live, shared with `lisa-github-build-intake` 3b so the two dispatch paths cannot disagree: the newest counted Lisa marker must be an uncleared `[lisa-ci-failed]` marker authored by `github-actions[bot]` — claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose — and the pull request it names must be open, from this repository rather than a fork, and bound to this item by its `Work-Item:` line. Act on its `route`:
88
+
89
+ - When `route` is `implement` (any `reason`): resolve and claim the item the normal way below, and return `route: implement`.
90
+ - When `route` is `ci-rework`: return `route: ci-rework pr=<n>`, `failing_checks` and `head_ref` (the JSON's `pr`, `failingChecks` and `headRefName`). Continue through the hold check and the claim below unchanged: the claim is what moves the item from the ready lane back to the claimed lane, the same re-claim build intake 3b performs, and the binding names the same item. A ci-rework item is CI rework, not a rejection: it takes no rejection detection and records no rejection learning (the `rejection-detection` rule's CI-rework exemption).
91
+ - When `route` is `blocked` (`reason: ci-loop-bound`, 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR): first run the hold check below; if the item is held, return its `held-by-gate` outcome and stop without changing labels or posting anything. Otherwise do not claim and write no binding — the same loop bound build intake 3b applies. Move the item to the configured blocked role from whichever lane it is in: remove the configured ready and claimed labels if present (`github.labels.build.ready`, `github.labels.build.claimed` — on the session-manager path the item is already claimed), then apply the configured blocked role and the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), post a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), return `route: blocked pr=<n>`, `claim_outcome: blocked-ci-loop` and `binding_outcome: skipped-ci-loop`, then stop.
92
+
93
+ Skip this step silently and return `route: implement` when the tracker is Jira or Linear (only this repository's GitHub workflow writes the marker) or when the script is absent: `scripts/` at the Lisa repository root is not shipped to host projects, so a host never has the helper and never receives the marker. A non-zero exit or output that is not one JSON object is also `route: implement` — falling back to the normal path is always recoverable. A held item still stops at the hold check below, whatever its route.
94
+
95
+ **Why claim comments are ignored.** On the session-manager path the manager has already claimed the item before the worker starts, so the helper runs after a claim and the claim below comes back `reused`; a re-claim can also post another claim comment. Claim comments are ignored for exactly that reason: an uncleared marker on an open, bound pull request still means that pull request is red, whoever has claimed the item since.
96
+
97
+ ### Hold check and claim
98
+
79
99
  The work item is **held** when the caller declared a `human_gate`, independently of any item history,
80
100
  or `classifyReadyCandidate({ labels, body, comments, trustedHumanActorIds, humanNeededLabel, humanOnly })` from the shipped
81
101
  `scripts/intake-blocker-reprobe.mjs` returns `claimable: false`. Pass the complete live comment
@@ -114,8 +134,11 @@ Otherwise:
114
134
  readiness_declaration: build-ready|human-gate
115
135
  held_by: none|caller-declaration|item-marker
116
136
  gate_reason: <the act a person must perform>|null
117
- claim_outcome: claimed|reused|held-by-gate
118
- binding_outcome: verified|skipped-human-gate
137
+ claim_outcome: claimed|reused|held-by-gate|blocked-ci-loop
138
+ binding_outcome: verified|skipped-human-gate|skipped-ci-loop
139
+ route: implement|ci-rework pr=<n>|blocked pr=<n>
140
+ failing_checks: <comma-separated check names from the marker comment>|none
141
+ head_ref: <the pull request's head branch>|null
119
142
  work_item_context: <absolute path to .lisa/work-item-context.md>
120
143
  ```
121
144
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -497,7 +497,7 @@ A blocker is active if it is open and has no cleared status label. Treat `status
497
497
 
498
498
  Before the claim mutation, apply `claim-time-guards` — **Value before claim**, or **Worth doing** in `lisa-track` on runtimes without the rule tree (Antigravity). A ready label establishes neither value nor permission to expand scope. Respect the preceding human-hold gate; a declined incidental item consumes this cycle's one processed disposition.
499
499
 
500
- **CI rework is read before everything else in 3b — before rejection detection, and before this phase posts its own claim comment.** When a required check fails on an agent's PR, the `lisa-ci-failure-redispatch` workflow moves the item from `$CLAIMED` back to `$READY` and comments a visible line plus `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->`. A marker counts **only when its comment is authored by `github-actions[bot]`** (the workflow's identity) — anyone can type the marker, so a comment from any other author is ignored. A marker is **uncleared** while its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`; a later all-green run on the PR clears it, and a marker whose PR has merged or closed counts as cleared. From the read bundle's comments, take the **newest** comment carrying any Lisa marker (`[lisa-…]` or `[claude-build-intake]`); when it is an uncleared, bot-authored `[lisa-ci-failed]` marker, **verify the PR it names** before trusting it: `gh pr view <n> --repo <org>/<repo> --json state,isCrossRepository,body` must show `state` is `OPEN`, `isCrossRepository` is `false`, and a body whose `Work-Item:` binds this item (`<org>/<repo>#<number>`). If any check fails or the read errors, treat the item as carrying no marker and continue with ordinary 3b. Otherwise classify the item **`ci-rework`**. Read it first because the claim comment below is itself a newer Lisa marker and would hide the signal. A `ci-rework` item is **CI rework, not a QA rejection**: its claimed-to-ready move is the workflow's, not a reviewer's, so rejection detection treats it as `forward-only` and **no rejection learning** is filed — no `lisa-persist-learning` candidate, no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). It also skips claim-time archaeology and takes precedence over the `already-implemented` route below: the open PR that check finds is the one to fix, not proof that the work shipped. Carry `ci-rework` and the marker's `pr=<n>` into 3c. **Bound the loop.** Every claimed-to-ready bounce gives the item a fresh ready-lane entry, which resets the `two-failed-attempts` valve below, so a PR that keeps failing would be re-dispatched forever. When the item carries 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR, intake does not re-dispatch: it does not claim, moves the item to the configured blocked role and adds the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), posts a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), and stops this item's cycle. **Agent work is not complete while the named PR's required checks are failing** — no success outcome, done label, or close may be recorded for the item until that PR merges with its required checks green.
500
+ **CI rework is read before everything else in 3b — before rejection detection, and before this phase posts its own claim comment.** When a required check fails on an agent's PR, the `lisa-ci-failure-redispatch` workflow moves the item from `$CLAIMED` back to `$READY` and comments a visible line plus `<!-- [lisa-ci-failed] pr=<n> sha=<head> -->`. A marker counts **only when its comment is authored by `github-actions[bot]`** (the workflow's identity) — anyone can type the marker, so a comment from any other author is ignored. A marker is **uncleared** while its comment carries no `<!-- [lisa-ci-cleared] run=<id> -->`; a later all-green run on the PR clears it, and a marker whose PR has merged or closed counts as cleared. From the read bundle's comments, take the **newest** comment carrying any Lisa marker (`[lisa-…]` or `[claude-build-intake]`; claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose); when it is an uncleared, bot-authored `[lisa-ci-failed]` marker, **verify the PR it names** before trusting it: `gh pr view <n> --repo <org>/<repo> --json state,isCrossRepository,body` must show `state` is `OPEN`, `isCrossRepository` is `false`, and a body whose `Work-Item:` binds this item (`<org>/<repo>#<number>`). If any check fails or the read errors, treat the item as carrying no marker and continue with ordinary 3b. These checks and the loop bound below are implemented once in `scripts/lisa-ci-rework-route.mjs`, which `lisa-track` also runs on the `lisa-implement` dispatch path so the two paths cannot disagree; where that script exists (the Lisa repository — it is not shipped to hosts), run `node scripts/lisa-ci-rework-route.mjs --item <org>/<repo>#<number>` and act on its printed `route` — `ci-rework`, `blocked` (the loop bound), or `implement` (no marker) — instead of re-deriving the checks. When every check passes, classify the item **`ci-rework`**. Read it first so the route is decided from the comments as they stood before this claim; claim comments are ignored by the rule above, so even a re-posted claim cannot hide the signal. A `ci-rework` item is **CI rework, not a QA rejection**: its claimed-to-ready move is the workflow's, not a reviewer's, so rejection detection treats it as `forward-only` and **no rejection learning** is filed — no `lisa-persist-learning` candidate, no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). It also skips claim-time archaeology and takes precedence over the `already-implemented` route below: the open PR that check finds is the one to fix, not proof that the work shipped. Carry `ci-rework` and the marker's `pr=<n>` into 3c. **Bound the loop.** Every claimed-to-ready bounce gives the item a fresh ready-lane entry, which resets the `two-failed-attempts` valve below, so a PR that keeps failing would be re-dispatched forever. When the item carries 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR, intake does not re-dispatch: it does not claim, moves the item to the configured blocked role and adds the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), posts a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), and stops this item's cycle. **Agent work is not complete while the named PR's required checks are failing** — no success outcome, done label, or close may be recorded for the item until that PR merges with its required checks green.
501
501
 
502
502
  **Rejection detection runs first — before the relabel below.** Per the vendor-neutral `rejection-detection` rule (cite the slug; do not restate its classification table), classify this item at the **top of 3b, BEFORE** the `$READY → $CLAIMED` relabel — after the relabel the current-lane signal is gone. Read the item's Label-Event History from `lisa-github-read-issue` (chronological `LabeledEvent` / `UnlabeledEvent` on the configured `$READY` label) and classify it `rejection-reclaim | forward-only | never-left-ready | unknown`. Lane names come from `.lisa.config.json` (`github.labels.build.*`), never hardcoded. A failing/absent history yields `unknown` and the claim proceeds — detection never blocks the build. Items carrying a learning marker (`[lisa-learning-drop]` / `[lisa-learning-pr]` / `[lisa-learning-upstream-handoff]`) or the `learning:needs-triage` or `learning:low-confidence` label are never rejection triggers (no learning-about-learning). Carry the classification into the relabel and lifecycle below.
503
503
 
@@ -87,7 +87,7 @@ The input-resolver invokes `lisa-track $ARGUMENTS` (with `managedBy=` already st
87
87
  Require a successful readback of that worktree-local binding. On detached HEAD, `branch: null` is the expected pending binding; after branch creation the mandatory `attach-branch` step below must replace it before any commit. Tracker or binding failure stops the flow; never continue untracked.
88
88
  - **Persist the bundle verbatim to `.lisa/work-item-context.md`.** **Ignore guard before any write.** A host can receive these skills before its shipped `.gitignore` entry, so prove the path is ignored first, from the worktree root: `git check-ignore -q .lisa/work-item-context.md || printf '%s\n' '.lisa/work-item-context.md' >> "$(git rev-parse --git-common-dir)/info/exclude"`, then re-run `git check-ignore -q .lisa/work-item-context.md`. If it is still not ignored, stop and report — do not write the bundle. If an `.easignore` exists and `grep -qxF '.lisa/work-item-context.md' .easignore` fails, stop and report instead of writing: EAS uploads read `.easignore`, which is derived from `.gitignore`, not from `info/exclude`. There is one writer order. `lisa-track` has already written its live read, unedited, to `<worktree root>/.lisa/work-item-context.md`. With no `caller_bundle_path`, keep that file as written. With a `caller_bundle_path`, `lisa-track` leaves an existing file untouched, and this step persists the caller-supplied bundle instead of discarding it: refuse a `caller_bundle_path` that does not end in `/.lisa/work-item-context.md` — do not read it, report the refusal to the lead, and keep the live read as the file; otherwise read the file at that path and keep it as the base (copy it verbatim to the worktree's `.lisa/work-item-context.md` first if the path differs), then append under `## Added by live read` only what the live read carries that the caller bundle lacks (newer comments, changed status or graph). Either way the live validation and claim still run exactly as above. Never summarize, trim, or paraphrase the bundle; downstream agents act on this file, so anything left out of it is lost to them. The file is worktree-local and git-ignored; never stage it.
89
89
  - **Append the per-comment inventory to the file.** Finish the file with a trailing `## Comment inventory` section: one line per comment with author, date, one-line gist, and flags from `decision|constraint|credential|repro` for each decision, constraint, credential/access note, or reproduction step it carries. The inventory indexes the bundle above it; it never replaces it. **A `credential` gist names only the kind and the location** — for example `staging API token — see comment 4 in the context file` — never the secret value or identifier. The value stays only in the git-ignored context file: never copy it into task descriptions, teammate prompts, plan or roster files, tracker comments, or PR text.
90
- - Return `work_item_context: <absolute path of the file>`, the same per-comment inventory, `tracker_provider`, canonical `work_item_ref`, resolution outcome, claim outcome, and verified binding to the team lead, who then proceeds to roster selection.
90
+ - Return `work_item_context: <absolute path of the file>`, the same per-comment inventory, `tracker_provider`, canonical `work_item_ref`, resolution outcome, claim outcome, verified binding, and `lisa-track`'s `route` (with `failing_checks` and `head_ref`) to the team lead, who then proceeds to roster selection — or, for `route: ci-rework` or `route: blocked`, to the CI-rework route below.
91
91
 
92
92
  The input resolver may perform these tracker and local-binding operations before the Roster Decision because they are the mandatory gate that establishes what work the team is allowed to do. No project source, documentation, plan artifact, branch, or task may be created or changed before this transaction succeeds. Read-only discussion/orientation outside an Implement flow remains exempt per the `tracked-work` rule.
93
93
 
@@ -95,6 +95,17 @@ The input resolver is the only teammate that may be spawned before the Roster De
95
95
 
96
96
  **Rejection evidence in the claim handoff.** When this flow was dispatched from a build-intake claim that classified the item as a `rejection-reclaim` (per the `rejection-detection` rule), the context bundle carries a **rejection evidence summary** (what was rejected, the defect the QA comment named, the approach named as wrong). The plan MUST explicitly address that rejection evidence and MUST NOT re-propose the specific approach the rejection named as wrong — a bounced item must come back fixed, not re-bounced. `lisa-implement` cannot fetch this itself (it never sees the claim); it consumes what the handoff carries. Absence of rejection evidence never blocks — plan and implement normally.
97
97
 
98
+ **CI-rework route.** `lisa-track` decides the route from the item's comments before it writes anything, ignoring claim comments so a claim (including the session manager's earlier one) never hides the `[lisa-ci-failed]` marker, using the same shared helper (`scripts/lisa-ci-rework-route.mjs`) as build intake 3b. With `route: implement` nothing changes. With `route: ci-rework pr=<n>`, a required check failed on this item's existing pull request, so the work goes back to that pull request — never a new branch or a second pull request for the same item (CodySwannGT/lisa#4677). Skip the full build: no planning, research or implementation specialists, no claim-time archaeology or triage — the item was already triaged and built, and only its PR's checks are red. The lead runs this in-session instead:
99
+
100
+ 1. Put the PR's head branch (`head_ref`, or `gh pr view <n> --repo <org>/<repo> --json headRefName`) in a dedicated worktree bound to the item. If `git worktree list` already shows a worktree with `<headRefName>` checked out, reuse it (pull it up to `origin/<headRefName>` first). Otherwise run `git fetch origin <headRefName>`, then check for a local `<headRefName>` branch. If one exists and `git rev-list --count origin/<headRefName>..<headRefName>` is greater than zero, it holds a prior agent's unpushed commits: add the worktree on that local branch with `git worktree add <path> <headRefName>`, then merge `origin/<headRefName>` into it and push, so that work is published rather than discarded. Use `git worktree add -B <headRefName> <path> origin/<headRefName>` only when the local branch is absent or has nothing unpushed. Then run `node scripts/lisa-work-item.mjs link <canonical-ref>` from inside it and read it back through `node scripts/lisa-work-item.mjs current`. Run the ignore guard above there and copy the resolver's `.lisa/work-item-context.md` into that worktree unchanged. Only after that copy, and only when the resolver's worktree is a different worktree, clean the resolver's worktree up: run `node scripts/lisa-work-item.mjs clear` there and delete its `.lisa/work-item-context.md`, so no stale binding and no secret-bearing copy of the bundle are left behind.
101
+ 2. In the PR worktree's `.lisa/work-item-context.md`, append the marker comment's failing check names under `## CI failure`. Pass no rejection evidence, because nobody rejected the work.
102
+ 3. From that worktree, invoke `lisa-drive-pr-to-merge pr=<n>`, naming the failing checks: it fixes them on the existing branch and drives the pull request to merge. If that work needs specialist teammates, record the Roster Decision first as usual.
103
+ 4. Record no rejection learning: no `lisa-persist-learning` candidate and no `[lisa-rejection-candidate]` marker (the `rejection-detection` rule's CI-rework exemption). The item is not complete while the marker is uncleared: record no success outcome, done role or close until the pull request merges with every required check green. The producer's next all-green run clears the marker, and a merged or closed pull request's marker counts as cleared. On merge, finish as a build success does (tracker sync, evidence, lifecycle transition). If the pull request cannot be driven green, leave the item claimed and report why. Under `managedBy=`, the terminal `DONE:` / `FAILED:` line is sent exactly as for a build.
104
+
105
+ With `route: blocked pr=<n>`, the pull request has failed its required checks 3 or more times: `lisa-track` already moved the item from whichever lane it was in (ready or claimed) to the blocked role and the `human_needed` label, and wrote no binding, so stop and report that a person needs to look at the pull request (under `managedBy=`, an exit to the blocked role is `FAILED`).
106
+
107
+ The route is runtime-neutral text: every agent that runs this skill reads the same `route` field, and the helper is a plain Node script. The session manager dispatch path it exists for is Claude Code only (see the Runtime parity table in `lisa-session-manager`); agents without a background worker reach a CI-bounced item through build intake or a direct `/lisa-implement <ref>` invocation, which take this same route.
108
+
98
109
  ## Select the agent roster
99
110
 
100
111
  Before spawning any teammate beyond the bounded input resolver, record a **Roster Decision** artifact. It must enumerate every agent or specialist type exposed by the current runtime's delegation tool and record one line per type:
@@ -76,6 +76,26 @@ This is intentionally conservative: ambiguity creates one explicit work item ins
76
76
 
77
77
  ## Phase 3 — Claim and bind
78
78
 
79
+ ### CI-rework route (first, before any claim write)
80
+
81
+ Decide the dispatch route from the item's comments as they stand **before** this phase writes anything (CodySwannGT/lisa#4677). When the configured tracker is `github` **and** `scripts/lisa-ci-rework-route.mjs` exists at the repository root, run it from the repository root:
82
+
83
+ ```bash
84
+ node scripts/lisa-ci-rework-route.mjs --item <canonical-ref>
85
+ ```
86
+
87
+ It only reads, and prints one JSON object. It is the one place the trust rules live, shared with `lisa-github-build-intake` 3b so the two dispatch paths cannot disagree: the newest counted Lisa marker must be an uncleared `[lisa-ci-failed]` marker authored by `github-actions[bot]` — claim comments and session-manager notes (`[lisa-tracker-claim]`, `[claude-build-intake]`, `[lisa-session-manager]`) and failure markers from anyone other than `github-actions[bot]` do not count as Lisa markers for this purpose — and the pull request it names must be open, from this repository rather than a fork, and bound to this item by its `Work-Item:` line. Act on its `route`:
88
+
89
+ - When `route` is `implement` (any `reason`): resolve and claim the item the normal way below, and return `route: implement`.
90
+ - When `route` is `ci-rework`: return `route: ci-rework pr=<n>`, `failing_checks` and `head_ref` (the JSON's `pr`, `failingChecks` and `headRefName`). Continue through the hold check and the claim below unchanged: the claim is what moves the item from the ready lane back to the claimed lane, the same re-claim build intake 3b performs, and the binding names the same item. A ci-rework item is CI rework, not a rejection: it takes no rejection detection and records no rejection learning (the `rejection-detection` rule's CI-rework exemption).
91
+ - When `route` is `blocked` (`reason: ci-loop-bound`, 3 or more bot-authored `[lisa-ci-failed]` markers for the same PR): first run the hold check below; if the item is held, return its `held-by-gate` outcome and stop without changing labels or posting anything. Otherwise do not claim and write no binding — the same loop bound build intake 3b applies. Move the item to the configured blocked role from whichever lane it is in: remove the configured ready and claimed labels if present (`github.labels.build.ready`, `github.labels.build.claimed` — on the session-manager path the item is already claimed), then apply the configured blocked role and the `human_needed` label (`github.labels.build.blocked` and `github.labels.build.human_needed`, per `config-resolution`), post a plain-English comment naming the PR and its failing checks (for example: "Pull request #<n> has failed its required checks <k> times (<check names>). Lisa has stopped retrying; a person needs to look at why it keeps failing."), return `route: blocked pr=<n>`, `claim_outcome: blocked-ci-loop` and `binding_outcome: skipped-ci-loop`, then stop.
92
+
93
+ Skip this step silently and return `route: implement` when the tracker is Jira or Linear (only this repository's GitHub workflow writes the marker) or when the script is absent: `scripts/` at the Lisa repository root is not shipped to host projects, so a host never has the helper and never receives the marker. A non-zero exit or output that is not one JSON object is also `route: implement` — falling back to the normal path is always recoverable. A held item still stops at the hold check below, whatever its route.
94
+
95
+ **Why claim comments are ignored.** On the session-manager path the manager has already claimed the item before the worker starts, so the helper runs after a claim and the claim below comes back `reused`; a re-claim can also post another claim comment. Claim comments are ignored for exactly that reason: an uncleared marker on an open, bound pull request still means that pull request is red, whoever has claimed the item since.
96
+
97
+ ### Hold check and claim
98
+
79
99
  The work item is **held** when the caller declared a `human_gate`, independently of any item history,
80
100
  or `classifyReadyCandidate({ labels, body, comments, trustedHumanActorIds, humanNeededLabel, humanOnly })` from the shipped
81
101
  `scripts/intake-blocker-reprobe.mjs` returns `claimable: false`. Pass the complete live comment
@@ -114,8 +134,11 @@ Otherwise:
114
134
  readiness_declaration: build-ready|human-gate
115
135
  held_by: none|caller-declaration|item-marker
116
136
  gate_reason: <the act a person must perform>|null
117
- claim_outcome: claimed|reused|held-by-gate
118
- binding_outcome: verified|skipped-human-gate
137
+ claim_outcome: claimed|reused|held-by-gate|blocked-ci-loop
138
+ binding_outcome: verified|skipped-human-gate|skipped-ci-loop
139
+ route: implement|ci-rework pr=<n>|blocked pr=<n>
140
+ failing_checks: <comma-separated check names from the marker comment>|none
141
+ head_ref: <the pull request's head branch>|null
119
142
  work_item_context: <absolute path to .lisa/work-item-context.md>
120
143
  ```
121
144
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.96.2",
3
+ "version": "4.97.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -10,7 +10,7 @@ For each high/critical advisory the gate reports, take the **first** action that
10
10
  2. **If an upgrade isn't possible** (no compatible patched version on the dependency graph): **force a resolution/override** on the vulnerable leaf package (both `resolutions` and `overrides`), regenerate the lockfile, retry. Done.
11
11
  3. **If an override isn't possible either** (would break a dependent, or no fixed version exists anywhere): **evaluate whether the advisory actually affects this project** — is the vulnerable code path reachable, does it process untrusted input, is it runtime vs. dev/build-only?
12
12
  4. **If it does affect the project** and neither (1) nor (2) was possible: **ask a human** what to do. This is the only rung that pauses for a person.
13
- 5. **If it does not affect the project**: **add a documented exclusion yourself** to `audit.ignore.local.json` (`{"id", "package", "reason"}` — reason states the impact evaluation), commit, retry. No human approval needed.
13
+ 5. **If it does not affect the project**: **add a documented exclusion yourself** to `audit.ignore.local.json` (`id`, `package`, `reason` = impact evaluation; dev-only copy: add `versions`, `paths`; see https://github.com/CodySwannGT/lisa/blob/main/docs/dependency-audit-exclusions.md), commit, retry. No human approval needed.
14
14
 
15
15
  Steps 1, 2, 3, and 5 are autonomous. Only step 4 escalates.
16
16
 
@@ -31,7 +31,7 @@ If those checks fail, the override is "not possible" — drop to step 3.
31
31
 
32
32
  - Never add a blanket audit bypass or lower the configured audit level.
33
33
  - Never escalate to a human (step 4) before genuinely attempting steps 1–3.
34
- - Never add an ignore entry (step 5) without an impact evaluation recorded in its `reason`. (This is a policy requirement enforced by convention. The `reason` field is not programmatically validated by Lisa tooling, so its presence relies on Claude following this rule faithfully.)
34
+ - Never add an ignore entry (step 5) without an impact evaluation recorded in its `reason`. (`lisa doctor` flags an exclusion with no written decision; the audit itself does not read `reason`.)
35
35
 
36
36
  ## Rails (bundler-audit)
37
37