@codyswann/lisa 8.1.1 → 8.2.1

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 (228) hide show
  1. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  2. package/dist/core/upstream-evidence-manifest.json +146 -11
  3. package/package.json +4 -4
  4. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  5. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  6. package/plugins/lisa/.codex-plugin/scripts/queue-contract-resolution.mjs +583 -0
  7. package/plugins/lisa/.codex-plugin/scripts/ready-queue-order.mjs +99 -25
  8. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-comment.mjs +185 -0
  9. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-confirm.mjs +130 -0
  10. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-edges.mjs +466 -0
  11. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-pending.mjs +257 -0
  12. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-restore.mjs +180 -0
  13. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-summary.mjs +239 -0
  14. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-sweep.mjs +397 -0
  15. package/plugins/lisa/.codex-plugin/scripts/stale-blocker-verify.mjs +194 -0
  16. package/plugins/lisa/.codex-plugin/skills/lisa-atlassian-access/SKILL.md +1 -0
  17. package/plugins/lisa/.codex-plugin/skills/lisa-github-build-intake/SKILL.md +2 -7
  18. package/plugins/lisa/.codex-plugin/skills/lisa-jira-build-intake/SKILL.md +2 -0
  19. package/plugins/lisa/.codex-plugin/skills/lisa-linear-access/SKILL.md +44 -0
  20. package/plugins/lisa/.codex-plugin/skills/lisa-linear-build-intake/SKILL.md +2 -0
  21. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +127 -2
  22. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  23. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  24. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  25. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  26. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  27. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  28. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  29. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
  30. package/plugins/lisa/scripts/ready-queue-order.mjs +99 -25
  31. package/plugins/lisa/scripts/stale-blocker-comment.mjs +185 -0
  32. package/plugins/lisa/scripts/stale-blocker-confirm.mjs +130 -0
  33. package/plugins/lisa/scripts/stale-blocker-edges.mjs +466 -0
  34. package/plugins/lisa/scripts/stale-blocker-pending.mjs +257 -0
  35. package/plugins/lisa/scripts/stale-blocker-restore.mjs +180 -0
  36. package/plugins/lisa/scripts/stale-blocker-summary.mjs +239 -0
  37. package/plugins/lisa/scripts/stale-blocker-sweep.mjs +397 -0
  38. package/plugins/lisa/scripts/stale-blocker-verify.mjs +194 -0
  39. package/plugins/lisa/skills/lisa-atlassian-access/SKILL.md +1 -0
  40. package/plugins/lisa/skills/lisa-github-build-intake/SKILL.md +2 -7
  41. package/plugins/lisa/skills/lisa-jira-build-intake/SKILL.md +2 -0
  42. package/plugins/lisa/skills/lisa-linear-access/SKILL.md +44 -0
  43. package/plugins/lisa/skills/lisa-linear-build-intake/SKILL.md +2 -0
  44. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +127 -2
  45. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  46. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  47. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  48. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  49. package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  50. package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  51. package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  52. package/plugins/lisa/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
  53. package/plugins/lisa-agy/plugin.json +1 -1
  54. package/plugins/lisa-agy/scripts/ready-queue-order.mjs +99 -25
  55. package/plugins/lisa-agy/scripts/stale-blocker-comment.mjs +185 -0
  56. package/plugins/lisa-agy/scripts/stale-blocker-confirm.mjs +130 -0
  57. package/plugins/lisa-agy/scripts/stale-blocker-edges.mjs +466 -0
  58. package/plugins/lisa-agy/scripts/stale-blocker-pending.mjs +257 -0
  59. package/plugins/lisa-agy/scripts/stale-blocker-restore.mjs +180 -0
  60. package/plugins/lisa-agy/scripts/stale-blocker-summary.mjs +239 -0
  61. package/plugins/lisa-agy/scripts/stale-blocker-sweep.mjs +397 -0
  62. package/plugins/lisa-agy/scripts/stale-blocker-verify.mjs +194 -0
  63. package/plugins/lisa-agy/skills/lisa-atlassian-access/SKILL.md +1 -0
  64. package/plugins/lisa-agy/skills/lisa-github-build-intake/SKILL.md +2 -7
  65. package/plugins/lisa-agy/skills/lisa-jira-build-intake/SKILL.md +2 -0
  66. package/plugins/lisa-agy/skills/lisa-linear-access/SKILL.md +44 -0
  67. package/plugins/lisa-agy/skills/lisa-linear-build-intake/SKILL.md +2 -0
  68. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +127 -2
  69. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  70. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  71. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  72. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  73. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  74. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  75. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  76. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
  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/scripts/ready-queue-order.mjs +99 -25
  86. package/plugins/lisa-copilot/scripts/stale-blocker-comment.mjs +185 -0
  87. package/plugins/lisa-copilot/scripts/stale-blocker-confirm.mjs +130 -0
  88. package/plugins/lisa-copilot/scripts/stale-blocker-edges.mjs +466 -0
  89. package/plugins/lisa-copilot/scripts/stale-blocker-pending.mjs +257 -0
  90. package/plugins/lisa-copilot/scripts/stale-blocker-restore.mjs +180 -0
  91. package/plugins/lisa-copilot/scripts/stale-blocker-summary.mjs +239 -0
  92. package/plugins/lisa-copilot/scripts/stale-blocker-sweep.mjs +397 -0
  93. package/plugins/lisa-copilot/scripts/stale-blocker-verify.mjs +194 -0
  94. package/plugins/lisa-copilot/skills/lisa-atlassian-access/SKILL.md +1 -0
  95. package/plugins/lisa-copilot/skills/lisa-github-build-intake/SKILL.md +2 -7
  96. package/plugins/lisa-copilot/skills/lisa-jira-build-intake/SKILL.md +2 -0
  97. package/plugins/lisa-copilot/skills/lisa-linear-access/SKILL.md +44 -0
  98. package/plugins/lisa-copilot/skills/lisa-linear-build-intake/SKILL.md +2 -0
  99. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +127 -2
  100. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  101. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  102. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  103. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  104. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  105. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  106. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  107. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
  108. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +99 -25
  110. package/plugins/lisa-cursor/scripts/stale-blocker-comment.mjs +185 -0
  111. package/plugins/lisa-cursor/scripts/stale-blocker-confirm.mjs +130 -0
  112. package/plugins/lisa-cursor/scripts/stale-blocker-edges.mjs +466 -0
  113. package/plugins/lisa-cursor/scripts/stale-blocker-pending.mjs +257 -0
  114. package/plugins/lisa-cursor/scripts/stale-blocker-restore.mjs +180 -0
  115. package/plugins/lisa-cursor/scripts/stale-blocker-summary.mjs +239 -0
  116. package/plugins/lisa-cursor/scripts/stale-blocker-sweep.mjs +397 -0
  117. package/plugins/lisa-cursor/scripts/stale-blocker-verify.mjs +194 -0
  118. package/plugins/lisa-cursor/skills/lisa-atlassian-access/SKILL.md +1 -0
  119. package/plugins/lisa-cursor/skills/lisa-github-build-intake/SKILL.md +2 -7
  120. package/plugins/lisa-cursor/skills/lisa-jira-build-intake/SKILL.md +2 -0
  121. package/plugins/lisa-cursor/skills/lisa-linear-access/SKILL.md +44 -0
  122. package/plugins/lisa-cursor/skills/lisa-linear-build-intake/SKILL.md +2 -0
  123. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +127 -2
  124. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  125. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  126. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  127. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  128. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  129. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  130. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  131. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
  132. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  134. package/plugins/lisa-devin/scripts/ready-queue-order.mjs +99 -25
  135. package/plugins/lisa-devin/scripts/stale-blocker-comment.mjs +185 -0
  136. package/plugins/lisa-devin/scripts/stale-blocker-confirm.mjs +130 -0
  137. package/plugins/lisa-devin/scripts/stale-blocker-edges.mjs +466 -0
  138. package/plugins/lisa-devin/scripts/stale-blocker-pending.mjs +257 -0
  139. package/plugins/lisa-devin/scripts/stale-blocker-restore.mjs +180 -0
  140. package/plugins/lisa-devin/scripts/stale-blocker-summary.mjs +239 -0
  141. package/plugins/lisa-devin/scripts/stale-blocker-sweep.mjs +397 -0
  142. package/plugins/lisa-devin/scripts/stale-blocker-verify.mjs +194 -0
  143. package/plugins/lisa-devin/skills/lisa-atlassian-access/SKILL.md +1 -0
  144. package/plugins/lisa-devin/skills/lisa-github-build-intake/SKILL.md +2 -7
  145. package/plugins/lisa-devin/skills/lisa-jira-build-intake/SKILL.md +2 -0
  146. package/plugins/lisa-devin/skills/lisa-linear-access/SKILL.md +44 -0
  147. package/plugins/lisa-devin/skills/lisa-linear-build-intake/SKILL.md +2 -0
  148. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +127 -2
  149. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  150. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  151. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  152. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  153. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  154. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  155. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  156. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
  157. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  158. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  159. package/plugins/lisa-expo-agy/plugin.json +1 -1
  160. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  161. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  162. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  163. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  164. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  165. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  166. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  167. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  168. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  169. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  170. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  171. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  172. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  173. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  174. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  175. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  176. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  177. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  178. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  179. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  180. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  181. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  182. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  183. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  184. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  185. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  186. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  187. package/plugins/lisa-rails-agy/plugin.json +1 -1
  188. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  189. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  190. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  191. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  192. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  193. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  194. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  195. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  196. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  197. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  198. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  199. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  200. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  201. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  202. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  203. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  204. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  205. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  206. package/plugins/src/base/scripts/ready-queue-order.mjs +99 -25
  207. package/plugins/src/base/scripts/stale-blocker-comment.mjs +185 -0
  208. package/plugins/src/base/scripts/stale-blocker-confirm.mjs +130 -0
  209. package/plugins/src/base/scripts/stale-blocker-edges.mjs +466 -0
  210. package/plugins/src/base/scripts/stale-blocker-pending.mjs +257 -0
  211. package/plugins/src/base/scripts/stale-blocker-restore.mjs +180 -0
  212. package/plugins/src/base/scripts/stale-blocker-summary.mjs +239 -0
  213. package/plugins/src/base/scripts/stale-blocker-sweep.mjs +397 -0
  214. package/plugins/src/base/scripts/stale-blocker-verify.mjs +194 -0
  215. package/plugins/src/base/skills/lisa-atlassian-access/SKILL.md +1 -0
  216. package/plugins/src/base/skills/lisa-github-build-intake/SKILL.md +2 -7
  217. package/plugins/src/base/skills/lisa-jira-build-intake/SKILL.md +2 -0
  218. package/plugins/src/base/skills/lisa-linear-access/SKILL.md +44 -0
  219. package/plugins/src/base/skills/lisa-linear-build-intake/SKILL.md +2 -0
  220. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +127 -2
  221. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +90 -20
  222. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links-results.mjs +254 -0
  223. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-stale-links.mjs +243 -0
  224. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +60 -0
  225. package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +68 -8
  226. package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +49 -0
  227. package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-github.mjs +196 -0
  228. package/plugins/src/base/skills/lisa-session-manager/scripts/stale-links-state.mjs +173 -0
@@ -52,6 +52,14 @@ import { orphanPlan } from "./cli-orphans.mjs";
52
52
  import { overruledPlan } from "./cli-overruled.mjs";
53
53
  import { repoDir, start, status, stop, validate } from "./cli-manager.mjs";
54
54
  import { queue } from "./cli-queue.mjs";
55
+ import { staleLinksConfirm, staleLinksPlan } from "./cli-stale-links.mjs";
56
+ import {
57
+ staleLinksPending,
58
+ staleLinksPosted,
59
+ staleLinksReport,
60
+ staleLinksRestored,
61
+ staleLinksVerify,
62
+ } from "./cli-stale-links-results.mjs";
55
63
  import { CliError, EXIT } from "./cli-runtime.mjs";
56
64
  import {
57
65
  coexistence,
@@ -134,6 +142,47 @@ const COMMANDS = {
134
142
  options: { input: text, max: text },
135
143
  positionals: 0,
136
144
  },
145
+ "stale-links-plan": {
146
+ run: staleLinksPlan,
147
+ options: { tracker: text, input: text, max: text, "github-repo": text },
148
+ positionals: 0,
149
+ },
150
+ "stale-links-confirm": {
151
+ run: staleLinksConfirm,
152
+ options: { tracker: text, input: text, plan: text, "github-repo": text },
153
+ positionals: 0,
154
+ },
155
+ "stale-links-verify": {
156
+ run: staleLinksVerify,
157
+ options: {
158
+ tracker: text,
159
+ input: text,
160
+ plan: text,
161
+ blockers: text,
162
+ "github-repo": text,
163
+ },
164
+ positionals: 0,
165
+ },
166
+ "stale-links-pending": {
167
+ run: staleLinksPending,
168
+ options: {},
169
+ positionals: 0,
170
+ },
171
+ "stale-links-posted": {
172
+ run: staleLinksPosted,
173
+ options: { ref: text, removed: text, failed: flag },
174
+ positionals: 0,
175
+ },
176
+ "stale-links-restored": {
177
+ run: staleLinksRestored,
178
+ options: { tracker: text, input: text, ref: text, "github-repo": text },
179
+ positionals: 0,
180
+ },
181
+ "stale-links-report": {
182
+ run: staleLinksReport,
183
+ options: { input: text },
184
+ positionals: 0,
185
+ },
137
186
  "orphan-plan": {
138
187
  run: orphanPlan,
139
188
  options: { input: text, max: text, "stale-hours": text },
@@ -0,0 +1,196 @@
1
+ /**
2
+ * The GitHub reads behind `stale-links-plan --tracker github`
3
+ * (CodySwannGT/lisa#5065): every open issue, the native `blocked_by`
4
+ * dependencies of those that have any, the issue each `Blocked by` body line
5
+ * names, and the comments of every issue with a blocker (for the marker
6
+ * dedupe). Every read goes through `gh`, GitHub's access layer, with
7
+ * the scrubbed worker env. A blocker that cannot be read is passed on as
8
+ * null, so the plan reports it as inaccessible instead of guessing.
9
+ * @module session-manager/stale-links-github
10
+ */
11
+ import { parseBlockedByRefs } from "../../../scripts/stale-blocker-edges.mjs";
12
+ import { CliError, mustRun, run } from "./cli-runtime.mjs";
13
+ import { parseJson } from "./json-input.mjs";
14
+ import { scrubWorkerEnv } from "./workers.mjs";
15
+
16
+ /**
17
+ * Every page of one paginated `gh api` list, flattened.
18
+ * @param {object} ctx - CLI context
19
+ * @param {string} endpoint
20
+ * @returns {object[]}
21
+ */
22
+ function listAll(ctx, endpoint) {
23
+ const stdout = mustRun("gh", ["api", "--paginate", "--slurp", endpoint], {
24
+ env: scrubWorkerEnv(ctx.env),
25
+ });
26
+ const pages = parseJson(stdout, `gh api ${endpoint}`);
27
+ return Array.isArray(pages) ? pages.flat() : [];
28
+ }
29
+
30
+ /**
31
+ * One issue by canonical ref, or null when it cannot be read.
32
+ *
33
+ * probe-direction: fail-closed — a null blocker is judged inaccessible, so its
34
+ * link is kept and reported, never removed; a failed read can only shrink what
35
+ * the sweep clears.
36
+ * @param {object} ctx - CLI context
37
+ * @param {string} ref - `owner/repo#n`
38
+ * @returns {object | null}
39
+ */
40
+ function readIssue(ctx, ref) {
41
+ const [repo, number] = ref.split("#");
42
+ const result = run("gh", ["api", `repos/${repo}/issues/${number}`], {
43
+ env: scrubWorkerEnv(ctx.env),
44
+ });
45
+ if (result.missing) throw new CliError("gh is not on PATH.", 1);
46
+ if (result.status !== 0) return null;
47
+ try {
48
+ return JSON.parse(result.stdout);
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Whether an issue has any native blocker, open or closed.
56
+ * @param {Record<string, any>} row - REST issue
57
+ * @returns {boolean}
58
+ */
59
+ const hasNativeBlockers = row =>
60
+ Number(row?.issue_dependencies_summary?.total_blocked_by ?? 0) > 0;
61
+
62
+ /**
63
+ * A cached reader for blocker issues, so a blocker named by several items is
64
+ * read once per command.
65
+ * @param {object} ctx - CLI context
66
+ * @returns {(ref: string) => object | null}
67
+ */
68
+ export function blockerReader(ctx) {
69
+ const cache = new Map();
70
+ return ref => {
71
+ if (!cache.has(ref)) cache.set(ref, readIssue(ctx, ref));
72
+ return cache.get(ref);
73
+ };
74
+ }
75
+
76
+ /**
77
+ * Whether a REST issue names any blocker, natively or in its body.
78
+ * @param {Record<string, any>} row - REST issue
79
+ * @param {string} repo - `owner/repo`
80
+ * @returns {boolean}
81
+ */
82
+ export const hasBlockers = (row, repo) =>
83
+ hasNativeBlockers(row) ||
84
+ parseBlockedByRefs(row?.body, repo.toLowerCase()).length > 0;
85
+
86
+ /**
87
+ * The REST issue with its blockers attached, in the shape the shared rule
88
+ * reads (`nativeBlockers`, `bodyBlockers`). An issue with no blocker gets
89
+ * empty ones without a single read.
90
+ * @param {object} ctx - CLI context
91
+ * @param {string} repo - `owner/repo`
92
+ * @param {Record<string, any>} row - REST issue
93
+ * @param {(ref: string) => object | null} blocker - From {@link blockerReader}
94
+ * @returns {Record<string, any>}
95
+ */
96
+ export function withBlockers(ctx, repo, row, blocker) {
97
+ const own = repo.toLowerCase();
98
+ const nativeBlockers = hasNativeBlockers(row)
99
+ ? listAll(
100
+ ctx,
101
+ `repos/${repo}/issues/${row.number}/dependencies/blocked_by?per_page=100`
102
+ )
103
+ : [];
104
+ const bodyBlockers = Object.fromEntries(
105
+ parseBlockedByRefs(row.body, own).map(ref => [ref, blocker(ref)])
106
+ );
107
+ return { ...row, nativeBlockers, bodyBlockers };
108
+ }
109
+
110
+ /**
111
+ * One issue with its blockers and comments, as the plan reads it.
112
+ * @param {object} ctx - CLI context
113
+ * @param {string} repo - `owner/repo`
114
+ * @param {Record<string, any>} row - REST issue
115
+ * @param {(ref: string) => object | null} blocker - From {@link blockerReader}
116
+ * @returns {Record<string, any>}
117
+ */
118
+ function staleLinkItem(ctx, repo, row, blocker) {
119
+ const enriched = readOrUnreadable(() =>
120
+ withBlockers(ctx, repo, row, blocker)
121
+ );
122
+ const comments = readOrUnreadable(() =>
123
+ listAll(ctx, `repos/${repo}/issues/${row.number}/comments?per_page=100`)
124
+ );
125
+ // probe-direction: fail-closed — a candidate whose dependency list or
126
+ // comments could not be read gets `nativeBlockers: null`, which the plan
127
+ // reads as "blocker list not read": it is reported and nothing of it is
128
+ // removed (without its comments, a link a person put back could not be
129
+ // told apart). Every other candidate is still planned.
130
+ const unreadable = enriched === null || comments === null;
131
+ return {
132
+ repo: repo.toLowerCase(),
133
+ number: row.number,
134
+ // Carried so confirm can skip an issue closed since the plan, and the
135
+ // ready claim can apply the queue's own container rule.
136
+ state: row.state ?? "",
137
+ sub_issues_summary: row.sub_issues_summary ?? null,
138
+ body: row.body ?? "",
139
+ labels: row.labels ?? [],
140
+ nativeBlockers: unreadable ? null : enriched.nativeBlockers,
141
+ bodyBlockers: unreadable ? {} : enriched.bodyBlockers,
142
+ // Every candidate can hold a stale link, so its comments are read for
143
+ // the marker dedupe; issues with no blocker are never read.
144
+ comments: comments ?? [],
145
+ };
146
+ }
147
+
148
+ /**
149
+ * Run one read, or return null when it fails (the caller decides what an
150
+ * unread result means; here it always holds the candidate back).
151
+ * @template T
152
+ * @param {() => T} read
153
+ * @returns {T | null}
154
+ */
155
+ function readOrUnreadable(read) {
156
+ try {
157
+ return read();
158
+ } catch {
159
+ // probe-direction: fail-closed — see staleLinkItem: null means "not
160
+ // read", which removes nothing.
161
+ return null;
162
+ }
163
+ }
164
+
165
+ /**
166
+ * Read every open issue with a blocker, ready for `planStaleLinkSweep`.
167
+ * @param {object} ctx - CLI context
168
+ * @param {string} repo - `owner/repo`
169
+ * @returns {{ items: object[] }}
170
+ */
171
+ export function collectGithubStaleLinkInput(ctx, repo) {
172
+ const blocker = blockerReader(ctx);
173
+ const items = listAll(ctx, `repos/${repo}/issues?state=open&per_page=100`)
174
+ .filter(row => !row.pull_request && hasBlockers(row, repo))
175
+ .map(row => staleLinkItem(ctx, repo, row, blocker));
176
+ return { items };
177
+ }
178
+
179
+ /**
180
+ * Re-read one issue, every blocker it names and its comments, right before
181
+ * the writes (`stale-links-confirm`).
182
+ * @param {object} ctx - CLI context
183
+ * @param {string} repo - `owner/repo`
184
+ * @param {number} number - Issue number
185
+ * @returns {Record<string, any>}
186
+ */
187
+ export function readGithubStaleLinkItem(ctx, repo, number) {
188
+ const row = readIssue(ctx, `${repo}#${number}`);
189
+ if (!row) {
190
+ throw new CliError(
191
+ `Could not read ${repo}#${number} to confirm the plan.`,
192
+ 1
193
+ );
194
+ }
195
+ return staleLinkItem(ctx, repo, row, blockerReader(ctx));
196
+ }
@@ -0,0 +1,173 @@
1
+ /**
2
+ * The session manager's stale-link state across cycles (CodySwannGT/lisa#5065),
3
+ * kept in its state directory:
4
+ *
5
+ * - `stale-links-pending.json`: comments owed for confirmed removals, until
6
+ * they post.
7
+ * - `stale-links-failures.json`: items whose planned removals did not
8
+ * happen, so the planner puts them after every other candidate.
9
+ * - `stale-links-inflight.json`: plans confirmed before their deletes, until
10
+ * a read-back succeeds, so a failed read-back is retried, not lost.
11
+ * - `stale-links-restores.json`: links put back after a blocker reopened,
12
+ * until a read-back shows them present; the queue holds those items.
13
+ *
14
+ * All are replaced atomically. Only a missing file reads as empty. Every
15
+ * read-change-write of either file runs inside {@link withStateLock}, the
16
+ * ledger's cross-process lock, so two overlapping commands on one project
17
+ * root never drop each other's owed comment or failure count.
18
+ * @module session-manager/stale-links-state
19
+ */
20
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
21
+ import path from "node:path";
22
+
23
+ import { CliError } from "./cli-runtime.mjs";
24
+ import { withLedgerLock } from "./ledger-lock.mjs";
25
+
26
+ /**
27
+ * @param {string} root - Project root
28
+ * @param {string} name - File name
29
+ * @returns {string} The state file
30
+ */
31
+ const stateFile = (root, name) =>
32
+ path.join(root, ".lisa", "session-manager", name);
33
+
34
+ /**
35
+ * Run one whole read-change-write of the stale-link state under the
36
+ * project root's lock.
37
+ * @template T
38
+ * @param {string} root - Project root
39
+ * @param {() => T | Promise<T>} operation - Reads, changes and writes
40
+ * @returns {Promise<T>}
41
+ */
42
+ export async function withStateLock(root, operation) {
43
+ const target = stateFile(root, "stale-links-state");
44
+ mkdirSync(path.dirname(target), { recursive: true });
45
+ return withLedgerLock(target, undefined, async () => operation());
46
+ }
47
+
48
+ /**
49
+ * @param {string} root - Project root
50
+ * @returns {string} The pending-comments file
51
+ */
52
+ export const pendingPath = root => stateFile(root, "stale-links-pending.json");
53
+
54
+ /**
55
+ * @param {string} root - Project root
56
+ * @returns {string} The removal-failures file
57
+ */
58
+ export const failuresPath = root =>
59
+ stateFile(root, "stale-links-failures.json");
60
+
61
+ /**
62
+ * Read one state file.
63
+ * @param {string} file
64
+ * @param {(parsed: unknown) => boolean} valid - Shape check
65
+ * @param {unknown} empty - Value when the file does not exist yet
66
+ * @returns {any}
67
+ */
68
+ function readState(file, valid, empty) {
69
+ try {
70
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
71
+ if (!valid(parsed)) throw new Error("unexpected shape");
72
+ return parsed;
73
+ } catch (error) {
74
+ // probe-direction: fail-closed — only a missing file reads as empty; an
75
+ // unreadable or corrupt one throws, so no owed comment or failure count
76
+ // is silently dropped.
77
+ if (error?.code === "ENOENT") return empty;
78
+ throw new CliError(`${file}: ${error.message}`, 1);
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Replace one state file atomically.
84
+ * @param {string} file
85
+ * @param {unknown} value
86
+ * @returns {void}
87
+ */
88
+ function writeState(file, value) {
89
+ mkdirSync(path.dirname(file), { recursive: true });
90
+ const temp = `${file}.${process.pid}.tmp`;
91
+ writeFileSync(temp, `${JSON.stringify(value, null, 2)}\n`);
92
+ renameSync(temp, file);
93
+ }
94
+
95
+ /**
96
+ * @param {unknown} value
97
+ * @returns {boolean}
98
+ */
99
+ const isRecord = value =>
100
+ Boolean(value) && typeof value === "object" && !Array.isArray(value);
101
+
102
+ /**
103
+ * @param {string} root
104
+ * @returns {import("../../../scripts/stale-blocker-pending.mjs").PendingComment[]}
105
+ */
106
+ export const readPending = root =>
107
+ readState(pendingPath(root), Array.isArray, []);
108
+
109
+ /**
110
+ * @param {string} root
111
+ * @param {readonly object[]} pending
112
+ * @returns {void}
113
+ */
114
+ export const writePending = (root, pending) =>
115
+ writeState(pendingPath(root), pending);
116
+
117
+ /**
118
+ * @param {string} root
119
+ * @returns {import("../../../scripts/stale-blocker-pending.mjs").RemovalFailures}
120
+ */
121
+ export const readFailures = root => readState(failuresPath(root), isRecord, {});
122
+
123
+ /**
124
+ * @param {string} root
125
+ * @param {object} failures
126
+ * @returns {void}
127
+ */
128
+ export const writeFailures = (root, failures) =>
129
+ writeState(failuresPath(root), failures);
130
+
131
+ /**
132
+ * @param {string} root - Project root
133
+ * @returns {string} The in-flight file: plans confirmed whose read-back has
134
+ * not succeeded yet
135
+ */
136
+ export const inFlightPath = root =>
137
+ stateFile(root, "stale-links-inflight.json");
138
+
139
+ /**
140
+ * @param {string} root - Project root
141
+ * @returns {string} The owed-restores file: links put back whose read-back
142
+ * has not shown them present yet
143
+ */
144
+ export const restoresPath = root =>
145
+ stateFile(root, "stale-links-restores.json");
146
+
147
+ /**
148
+ * @param {string} root
149
+ * @returns {import("../../../scripts/stale-blocker-pending.mjs").InFlight}
150
+ */
151
+ export const readInFlight = root => readState(inFlightPath(root), isRecord, {});
152
+
153
+ /**
154
+ * @param {string} root
155
+ * @param {object} inflight
156
+ * @returns {void}
157
+ */
158
+ export const writeInFlight = (root, inflight) =>
159
+ writeState(inFlightPath(root), inflight);
160
+
161
+ /**
162
+ * @param {string} root
163
+ * @returns {import("../../../scripts/stale-blocker-pending.mjs").OwedRestores}
164
+ */
165
+ export const readRestores = root => readState(restoresPath(root), isRecord, {});
166
+
167
+ /**
168
+ * @param {string} root
169
+ * @param {object} restores
170
+ * @returns {void}
171
+ */
172
+ export const writeRestores = (root, restores) =>
173
+ writeState(restoresPath(root), restores);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
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": "8.1.1",
3
+ "version": "8.2.1",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"