@codyswann/lisa 4.86.1 → 4.87.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 (218) hide show
  1. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  2. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  3. package/dist/core/upstream-evidence-manifest.js +24 -21
  4. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  5. package/package.json +4 -4
  6. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  7. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  8. package/plugins/lisa/.codex-plugin/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  9. package/plugins/lisa/.codex-plugin/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  10. package/plugins/lisa/.codex-plugin/skills/lisa-github-to-tracker/SKILL.md +5 -0
  11. package/plugins/lisa/.codex-plugin/skills/lisa-github-validate-issue/SKILL.md +2 -0
  12. package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +2 -0
  13. package/plugins/lisa/.codex-plugin/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  14. package/plugins/lisa/.codex-plugin/skills/lisa-learnings-audit/SKILL.md +9 -0
  15. package/plugins/lisa/.codex-plugin/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  16. package/plugins/lisa/.codex-plugin/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  17. package/plugins/lisa/.codex-plugin/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  18. package/plugins/lisa/.codex-plugin/skills/lisa-persist-learning/SKILL.md +27 -8
  19. package/plugins/lisa/.codex-plugin/skills/lisa-plan/SKILL.md +2 -0
  20. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +30 -5
  21. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  22. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  23. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  24. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  25. package/plugins/lisa/.codex-plugin/skills/lisa-task-decomposition/SKILL.md +18 -0
  26. package/plugins/lisa/agents/learning-judge.md +34 -14
  27. package/plugins/lisa/rules/reference/ready-role-filing.md +4 -0
  28. package/plugins/lisa/rules/reference/work-item-definition-of-ready.md +8 -0
  29. package/plugins/lisa/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  30. package/plugins/lisa/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  31. package/plugins/lisa/skills/lisa-delivery-effectiveness/agents/openai.yaml +2 -2
  32. package/plugins/lisa/skills/lisa-github-to-tracker/SKILL.md +5 -0
  33. package/plugins/lisa/skills/lisa-github-validate-issue/SKILL.md +2 -0
  34. package/plugins/lisa/skills/lisa-implement/SKILL.md +2 -0
  35. package/plugins/lisa/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  36. package/plugins/lisa/skills/lisa-learnings-audit/SKILL.md +9 -0
  37. package/plugins/lisa/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  38. package/plugins/lisa/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  39. package/plugins/lisa/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  40. package/plugins/lisa/skills/lisa-persist-learning/SKILL.md +27 -8
  41. package/plugins/lisa/skills/lisa-plan/SKILL.md +2 -0
  42. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +30 -5
  43. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  44. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  45. package/plugins/lisa/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  46. package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  47. package/plugins/lisa/skills/lisa-task-decomposition/SKILL.md +18 -0
  48. package/plugins/lisa-agy/agents/learning-judge.md +34 -14
  49. package/plugins/lisa-agy/plugin.json +1 -1
  50. package/plugins/lisa-agy/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  51. package/plugins/lisa-agy/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  52. package/plugins/lisa-agy/skills/lisa-github-to-tracker/SKILL.md +5 -0
  53. package/plugins/lisa-agy/skills/lisa-github-validate-issue/SKILL.md +2 -0
  54. package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +2 -0
  55. package/plugins/lisa-agy/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  56. package/plugins/lisa-agy/skills/lisa-learnings-audit/SKILL.md +9 -0
  57. package/plugins/lisa-agy/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  58. package/plugins/lisa-agy/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  59. package/plugins/lisa-agy/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  60. package/plugins/lisa-agy/skills/lisa-persist-learning/SKILL.md +27 -8
  61. package/plugins/lisa-agy/skills/lisa-plan/SKILL.md +2 -0
  62. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +30 -5
  63. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  64. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  65. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  66. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  67. package/plugins/lisa-agy/skills/lisa-task-decomposition/SKILL.md +18 -0
  68. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  71. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  75. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-copilot/agents/learning-judge.agent.md +34 -14
  77. package/plugins/lisa-copilot/rules/reference/ready-role-filing.md +4 -0
  78. package/plugins/lisa-copilot/rules/reference/work-item-definition-of-ready.md +8 -0
  79. package/plugins/lisa-copilot/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  80. package/plugins/lisa-copilot/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  81. package/plugins/lisa-copilot/skills/lisa-github-to-tracker/SKILL.md +5 -0
  82. package/plugins/lisa-copilot/skills/lisa-github-validate-issue/SKILL.md +2 -0
  83. package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +2 -0
  84. package/plugins/lisa-copilot/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  85. package/plugins/lisa-copilot/skills/lisa-learnings-audit/SKILL.md +9 -0
  86. package/plugins/lisa-copilot/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  87. package/plugins/lisa-copilot/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  88. package/plugins/lisa-copilot/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  89. package/plugins/lisa-copilot/skills/lisa-persist-learning/SKILL.md +27 -8
  90. package/plugins/lisa-copilot/skills/lisa-plan/SKILL.md +2 -0
  91. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +30 -5
  92. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  93. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  94. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  95. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  96. package/plugins/lisa-copilot/skills/lisa-task-decomposition/SKILL.md +18 -0
  97. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-cursor/agents/learning-judge.md +34 -14
  99. package/plugins/lisa-cursor/rules/ready-role-filing-reference.mdc +4 -0
  100. package/plugins/lisa-cursor/rules/work-item-definition-of-ready-reference.mdc +8 -0
  101. package/plugins/lisa-cursor/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  102. package/plugins/lisa-cursor/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  103. package/plugins/lisa-cursor/skills/lisa-github-to-tracker/SKILL.md +5 -0
  104. package/plugins/lisa-cursor/skills/lisa-github-validate-issue/SKILL.md +2 -0
  105. package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +2 -0
  106. package/plugins/lisa-cursor/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  107. package/plugins/lisa-cursor/skills/lisa-learnings-audit/SKILL.md +9 -0
  108. package/plugins/lisa-cursor/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  109. package/plugins/lisa-cursor/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  110. package/plugins/lisa-cursor/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  111. package/plugins/lisa-cursor/skills/lisa-persist-learning/SKILL.md +27 -8
  112. package/plugins/lisa-cursor/skills/lisa-plan/SKILL.md +2 -0
  113. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +30 -5
  114. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  115. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  116. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  117. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  118. package/plugins/lisa-cursor/skills/lisa-task-decomposition/SKILL.md +18 -0
  119. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  120. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  121. package/plugins/lisa-devin/agents/learning-judge.md +34 -14
  122. package/plugins/lisa-devin/rules/reference/ready-role-filing.md +4 -0
  123. package/plugins/lisa-devin/rules/reference/work-item-definition-of-ready.md +8 -0
  124. package/plugins/lisa-devin/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  125. package/plugins/lisa-devin/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  126. package/plugins/lisa-devin/skills/lisa-github-to-tracker/SKILL.md +5 -0
  127. package/plugins/lisa-devin/skills/lisa-github-validate-issue/SKILL.md +2 -0
  128. package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +2 -0
  129. package/plugins/lisa-devin/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  130. package/plugins/lisa-devin/skills/lisa-learnings-audit/SKILL.md +9 -0
  131. package/plugins/lisa-devin/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  132. package/plugins/lisa-devin/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  133. package/plugins/lisa-devin/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  134. package/plugins/lisa-devin/skills/lisa-persist-learning/SKILL.md +27 -8
  135. package/plugins/lisa-devin/skills/lisa-plan/SKILL.md +2 -0
  136. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +30 -5
  137. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  138. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  139. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  140. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  141. package/plugins/lisa-devin/skills/lisa-task-decomposition/SKILL.md +18 -0
  142. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  143. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  144. package/plugins/lisa-expo-agy/plugin.json +1 -1
  145. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  146. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  148. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  149. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  150. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  151. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  152. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  153. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  154. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  155. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  156. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  157. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  158. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  159. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  160. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  161. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  162. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  163. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  164. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  165. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  166. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  167. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  168. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  169. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  170. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  171. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  172. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  173. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  174. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  175. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  176. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  177. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  178. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  179. package/plugins/lisa-rails-agy/plugin.json +1 -1
  180. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  181. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  182. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  183. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  184. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  185. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  186. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  187. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  188. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  189. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  190. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  191. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  192. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  193. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  194. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  195. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  196. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  197. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  198. package/plugins/src/base/agents/learning-judge.md +34 -14
  199. package/plugins/src/base/rules/reference/ready-role-filing.md +4 -0
  200. package/plugins/src/base/rules/reference/work-item-definition-of-ready.md +8 -0
  201. package/plugins/src/base/skills/lisa-confluence-to-tracker/SKILL.md +5 -0
  202. package/plugins/src/base/skills/lisa-delivery-effectiveness/SKILL.md +7 -3
  203. package/plugins/src/base/skills/lisa-github-to-tracker/SKILL.md +5 -0
  204. package/plugins/src/base/skills/lisa-github-validate-issue/SKILL.md +2 -0
  205. package/plugins/src/base/skills/lisa-implement/SKILL.md +2 -0
  206. package/plugins/src/base/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  207. package/plugins/src/base/skills/lisa-learnings-audit/SKILL.md +9 -0
  208. package/plugins/src/base/skills/lisa-linear-to-tracker/SKILL.md +5 -0
  209. package/plugins/src/base/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  210. package/plugins/src/base/skills/lisa-notion-to-tracker/SKILL.md +5 -0
  211. package/plugins/src/base/skills/lisa-persist-learning/SKILL.md +27 -8
  212. package/plugins/src/base/skills/lisa-plan/SKILL.md +2 -0
  213. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +30 -5
  214. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-human.mjs +3 -1
  215. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +11 -5
  216. package/plugins/src/base/skills/lisa-session-manager/scripts/human-needed.mjs +112 -5
  217. package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  218. package/plugins/src/base/skills/lisa-task-decomposition/SKILL.md +18 -0
@@ -202,11 +202,17 @@ Per cycle
202
202
  unset); trustedHumanActorIds in the input is ignored. stdout
203
203
  {action:release|keep|escalate|skip-human-gate,reason,edges,gate}.
204
204
  --ref fills pendingQuestion from the ledger.
205
- mark-plan <ref> --kind <kind> STDIN: question or reason
205
+ mark-plan <ref> --kind <kind> [--cause <cause>] STDIN: question or reason
206
206
  Plans marking an item that needs a human; writes nothing. kind:
207
- worker-question | repo-route | exhausted | decision. stdout {ref,kind,
208
- marker:{type:"label"|"role",value},[move:{role:"blocked",value},]
209
- comment,answerWith:{item,cli,channel}}. marker is the tracker's
207
+ worker-question | repo-route | exhausted | decision. cause: planning
208
+ (default) | environment (outage, expired credential, flaky tool) |
209
+ human-gate (a decision planning flagged as a human gate). stdout
210
+ {ref,kind,marker:{type:"label"|"role",value},[move:{role:"blocked",
211
+ value},]comment,answerWith:{item,cli,channel},planningMiss:{counts,
212
+ reason[,stageHint,candidate]}}. planningMiss.counts is true for a
213
+ worker-question, decision or repo-route with cause planning; never
214
+ for exhausted. candidate is the persist-learning skeleton (signal,
215
+ triggering_issue, provenance, scope_hint, kind, missing). marker is the tracker's
210
216
  configured human-needed label, else the configured blocked role;
211
217
  exhausted also moves to the blocked role. comment starts with
212
218
  [lisa-session-manager-question] and says, in plain words, how to
@@ -214,7 +220,7 @@ Per cycle
214
220
  answerWith.item is null otherwise), with the answerCommand that status
215
221
  lists, or on Telegram when it is the channel. Exit 2 for an unknown
216
222
  kind, empty or credential-shaped text, no marker configured, or
217
- exhausted with no blocked role.
223
+ exhausted with no blocked role, or an unknown cause.
218
224
  answer <ref> STDIN: the answer
219
225
  Queues an operator's answer (source "cli") for the next cycle to
220
226
  deliver. stdout {queued:true,ref,source}. Exit 2 when <ref> has no
@@ -27,6 +27,103 @@ export const HUMAN_NEEDED_KINDS = Object.freeze([
27
27
  "decision",
28
28
  ]);
29
29
 
30
+ /**
31
+ * Why a stop needed a human, as far as the planning-miss signal cares
32
+ * (CodySwannGT/lisa#4569). `planning` is the default: the item passed the
33
+ * ready gate and still needed a person. `environment` is an outage, an
34
+ * expired credential or a flaky tool; `human-gate` is a decision planning
35
+ * flagged as a human gate on the item. Neither of those two is a planning
36
+ * miss.
37
+ */
38
+ export const PLANNING_MISS_CAUSES = Object.freeze([
39
+ "planning",
40
+ "environment",
41
+ "human-gate",
42
+ ]);
43
+
44
+ /**
45
+ * Each kind that counts as a planning miss, with the planning stage most
46
+ * likely to have let it through. A hint for the judge, never its verdict:
47
+ * `learning-judge` names the stage it can prove.
48
+ */
49
+ const PLANNING_MISS_STAGES = Object.freeze({
50
+ // The stateless-pickup dry-run (S18) exists to find the question first.
51
+ "worker-question": "ready-gate",
52
+ // How the product should behave is the PRD's to decide.
53
+ decision: "prd",
54
+ // A leaf the router cannot place should have been split per repo-scope-split.
55
+ // Raised before the claim, but after the item passed the ready gate and was
56
+ // picked for dispatch: the operator ruled it a planning miss (#4569), and
57
+ // the planning-miss rate's denominator counts these routing holds too.
58
+ "repo-route": "decomposition",
59
+ });
60
+
61
+ /** Why a stop does not count, keyed by what ruled it out. */
62
+ const NOT_A_PLANNING_MISS = Object.freeze({
63
+ exhausted:
64
+ "repeated failed attempts are a build or environment problem, not a gap in the plan",
65
+ environment:
66
+ "an outage, an expired credential or a flaky tool is not a gap in the plan",
67
+ "human-gate":
68
+ "planning flagged this decision as a human gate, so asking was the plan working",
69
+ });
70
+
71
+ /**
72
+ * Whether a human-needed stop is a planning miss: the PRD, decomposition or
73
+ * ready gate let through an item a dispatched worker could not finish without
74
+ * a person. Throws on an unknown cause.
75
+ * @param {{kind: string, cause?: string}} input - The `--kind` and `--cause`
76
+ * @returns {{counts: boolean, reason: string, stageHint?: string}} Verdict
77
+ */
78
+ export function planningMissFor({ kind, cause = "planning" }) {
79
+ if (!PLANNING_MISS_CAUSES.includes(cause)) {
80
+ throw new Error(
81
+ `--cause must be one of: ${PLANNING_MISS_CAUSES.join(", ")}.`
82
+ );
83
+ }
84
+ if (cause !== "planning") {
85
+ return { counts: false, reason: NOT_A_PLANNING_MISS[cause] };
86
+ }
87
+ // Own keys only: an inherited name such as `toString` is not a kind.
88
+ const stageHint = Object.hasOwn(PLANNING_MISS_STAGES, kind)
89
+ ? PLANNING_MISS_STAGES[kind]
90
+ : undefined;
91
+ if (!stageHint) {
92
+ return { counts: false, reason: NOT_A_PLANNING_MISS.exhausted };
93
+ }
94
+ return {
95
+ counts: true,
96
+ stageHint,
97
+ reason:
98
+ "the item passed the ready gate and a dispatched worker still needed a human, so planning let a gap through",
99
+ };
100
+ }
101
+
102
+ /**
103
+ * The planning-miss verdict for `planMark`, plus the fields of the
104
+ * `lisa-persist-learning` candidate the manager can fill in without judgment.
105
+ * The rule and its why are the manager's to draft: they name the check
106
+ * planning should have run, which no script can know.
107
+ * @param {{ref: string, kind: string, cause?: string, question: string}}
108
+ * input - The item, why, the cause and the question text
109
+ * @returns {object} `{counts, reason, stageHint?, candidate?}`
110
+ */
111
+ function planningMissPlan({ ref, kind, cause, question }) {
112
+ const verdict = planningMissFor({ kind, cause });
113
+ if (!verdict.counts) return verdict;
114
+ return {
115
+ ...verdict,
116
+ candidate: {
117
+ signal: "planning-miss",
118
+ triggering_issue: ref,
119
+ provenance: [ref],
120
+ scope_hint: "project",
121
+ kind,
122
+ missing: question,
123
+ },
124
+ };
125
+ }
126
+
30
127
  /** Marks the manager's question comment, so its answer can be found after it. */
31
128
  export const QUESTION_MARKER = "[lisa-session-manager-question]";
32
129
 
@@ -134,13 +231,16 @@ function chooseMarker(label, blocked) {
134
231
  * unknown kind, empty or credential-shaped text, no marker, or an `exhausted`
135
232
  * item with no `blocked` role to move it to.
136
233
  * @param {{ref: string, kind: string, text: string, label?: string,
137
- * blocked?: string, channel?: boolean, answerers?: boolean}} input - The
138
- * item, why, the question, the configured human-needed label and `blocked`
139
- * role value, whether a notification channel exists, and whether anyone
140
- * (operatorIds / trustedAuthorIds) may answer on the item
234
+ * blocked?: string, channel?: boolean, answerers?: boolean, cause?: string}}
235
+ * input - The item, why, the question, the configured human-needed label
236
+ * and `blocked` role value, whether a notification channel exists, whether
237
+ * anyone (operatorIds / trustedAuthorIds) may answer on the item, and the
238
+ * cause the planning-miss signal needs (default `planning`)
141
239
  * @returns {{ref: string, kind: string, marker: {type: string, value: string},
142
240
  * move?: {role: "blocked", value: string}, comment: string,
143
- * answerWith: {item: string|null, cli: string, channel: string|null}}} Plan
241
+ * answerWith: {item: string|null, cli: string, channel: string|null},
242
+ * planningMiss: {counts: boolean, reason: string, stageHint?: string,
243
+ * candidate?: object}}} Plan
144
244
  */
145
245
  export function planMark({
146
246
  ref,
@@ -150,10 +250,16 @@ export function planMark({
150
250
  blocked,
151
251
  channel = false,
152
252
  answerers = true,
253
+ cause = "planning",
153
254
  }) {
154
255
  if (!HUMAN_NEEDED_KINDS.includes(kind)) {
155
256
  throw new Error(`--kind must be one of: ${HUMAN_NEEDED_KINDS.join(", ")}.`);
156
257
  }
258
+ if (!PLANNING_MISS_CAUSES.includes(cause)) {
259
+ throw new Error(
260
+ `--cause must be one of: ${PLANNING_MISS_CAUSES.join(", ")}.`
261
+ );
262
+ }
157
263
  const question = String(text ?? "").trim();
158
264
  if (question === "") throw new Error("the question or reason is empty");
159
265
  const shape = findCredentialShape(question);
@@ -194,5 +300,6 @@ export function planMark({
194
300
  cli: `the answerCommand that session-manager.mjs status lists for ${ref} (answer on stdin)`,
195
301
  channel: channel ? `Answer with: ${short} <your answer>` : null,
196
302
  },
303
+ planningMiss: planningMissPlan({ ref, kind, cause, question }),
197
304
  };
198
305
  }
@@ -111,7 +111,11 @@ const COMMANDS = {
111
111
  options: { input: text, ref: text },
112
112
  positionals: 0,
113
113
  },
114
- "mark-plan": { run: markPlan, options: { kind: text }, positionals: 1 },
114
+ "mark-plan": {
115
+ run: markPlan,
116
+ options: { kind: text, cause: text },
117
+ positionals: 1,
118
+ },
115
119
  answer: { run: answer, options: {}, positionals: 1 },
116
120
  "item-answer": { run: itemAnswer, options: {}, positionals: 1 },
117
121
  "record-cycle": {
@@ -9,6 +9,24 @@ Break work into ordered, well-scoped tasks that can be independently implemented
9
9
 
10
10
  ## Decomposition Process
11
11
 
12
+ ### 0. Load the learned planning checks
13
+
14
+ Every time a dispatched worker had to stop for a human, or file a new ticket mid-build, because planning let a gap through, `learning-judge` may have persisted the check planning should have run as a `planning-miss` learning (CodySwannGT/lisa#4569). Those checks only help if planning reads them back. Before decomposing, load them through the learnings contract's **bounded projection** — never by reading the ledger file wholesale:
15
+
16
+ ```bash
17
+ node -e 'import("@codyswann/lisa/learnings").then(async m => { const { readFile } = await import("node:fs/promises"); const file = m.resolveProjectLearningsFile(await m.readProjectConfig(process.cwd())); const raw = await readFile(file, "utf8").catch(() => null); if (raw === null) return; const { entries, omittedCount } = m.projectLearnings(m.parseLearningsFile(raw)); const checks = entries.filter(e => /^Planning \((prd|decomposition|ready-gate)\):/.test(e.rule)).map(e => ({ id: e.id, rule: e.rule, confidence: e.confidence })); console.log(JSON.stringify({ checks, omittedCount })); }).catch(error => console.error(`learned planning checks unavailable: ${error.message}`))' || true
18
+ ```
19
+
20
+ Run it from the project root. No output means there is no ledger yet: carry on. A malformed ledger prints one warning and yields nothing: carry on without it. Never let this step block planning.
21
+
22
+ Each check names the stage that owns it, and binds there:
23
+
24
+ - **`Planning (prd): …`** — a requirement the PRD must settle. In PRD intake (`*-to-tracker` Phase 1.45) a register entry that fails one is a `product-clarity` item, like any other requirement-quality failure.
25
+ - **`Planning (decomposition): …`** — binds in this skill: apply each as an extra obligation on every work unit it concerns, alongside steps 1–6 below. A unit that cannot meet it is split, re-scoped or given its missing dependency now, not left for the worker to discover.
26
+ - **`Planning (ready-gate): …`** — binds in the validator's S18 stateless-pickup dry-run (`lisa-jira-validate-ticket`, `lisa-github-validate-issue`, `lisa-linear-validate-issue`): each becomes a question the dry-run must be able to answer from the item and the links it can resolve.
27
+
28
+ A check is a learned heuristic, not a new gate number: cite its `id` where it changed a decision, so `last_confirmed` can be advanced at claim time (`project-learnings`). When a check plainly does not apply to this work, skip it silently.
29
+
12
30
  ### 1. Identify Units of Work
13
31
 
14
32
  - Break the work into the smallest units that are independently valuable