@codyswann/lisa 7.0.4 → 7.1.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/all/copy-overwrite/scripts/lib/work-item-estimate-calibration.mjs +131 -0
  2. package/all/copy-overwrite/scripts/lib/work-item-estimate-check.mjs +15 -5
  3. package/all/copy-overwrite/scripts/lisa-estimate.mjs +29 -3
  4. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  5. package/dist/core/lisa-owned-hash-ledger.js +18 -0
  6. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  7. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  8. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  9. package/dist/core/upstream-evidence-manifest.js +38 -17
  10. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  11. package/dist/utils/usage-accounting.d.ts.map +1 -1
  12. package/dist/utils/usage-accounting.js +3 -1
  13. package/dist/utils/usage-accounting.js.map +1 -1
  14. package/package.json +4 -4
  15. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  17. package/plugins/lisa/.codex-plugin/skills/lisa-github-validate-issue/SKILL.md +2 -0
  18. package/plugins/lisa/.codex-plugin/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  19. package/plugins/lisa/.codex-plugin/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  20. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +45 -15
  21. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  22. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  23. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  24. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  25. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  26. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  27. package/plugins/lisa/.codex-plugin/skills/lisa-track/SKILL.md +11 -1
  28. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-claim/SKILL.md +1 -0
  29. package/plugins/lisa/.codex-plugin/skills/lisa-usage-accounting/references/estimate.md +25 -2
  30. package/plugins/lisa/rules/reference/work-item-definition-of-ready.md +7 -2
  31. package/plugins/lisa/skills/lisa-github-validate-issue/SKILL.md +2 -0
  32. package/plugins/lisa/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  33. package/plugins/lisa/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  34. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +45 -15
  35. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  36. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  37. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  38. package/plugins/lisa/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  39. package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  40. package/plugins/lisa/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  41. package/plugins/lisa/skills/lisa-track/SKILL.md +11 -1
  42. package/plugins/lisa/skills/lisa-tracker-claim/SKILL.md +1 -0
  43. package/plugins/lisa/skills/lisa-usage-accounting/references/estimate.md +25 -2
  44. package/plugins/lisa-agy/plugin.json +1 -1
  45. package/plugins/lisa-agy/skills/lisa-github-validate-issue/SKILL.md +2 -0
  46. package/plugins/lisa-agy/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  47. package/plugins/lisa-agy/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  48. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +45 -15
  49. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  50. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  51. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  52. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  53. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  54. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  55. package/plugins/lisa-agy/skills/lisa-track/SKILL.md +11 -1
  56. package/plugins/lisa-agy/skills/lisa-tracker-claim/SKILL.md +1 -0
  57. package/plugins/lisa-agy/skills/lisa-usage-accounting/references/estimate.md +25 -2
  58. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  60. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  61. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  65. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-copilot/rules/reference/work-item-definition-of-ready.md +7 -2
  67. package/plugins/lisa-copilot/skills/lisa-github-validate-issue/SKILL.md +2 -0
  68. package/plugins/lisa-copilot/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  69. package/plugins/lisa-copilot/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  70. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +45 -15
  71. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  72. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  73. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  74. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  75. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  76. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  77. package/plugins/lisa-copilot/skills/lisa-track/SKILL.md +11 -1
  78. package/plugins/lisa-copilot/skills/lisa-tracker-claim/SKILL.md +1 -0
  79. package/plugins/lisa-copilot/skills/lisa-usage-accounting/references/estimate.md +25 -2
  80. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-cursor/rules/work-item-definition-of-ready-reference.mdc +7 -2
  82. package/plugins/lisa-cursor/skills/lisa-github-validate-issue/SKILL.md +2 -0
  83. package/plugins/lisa-cursor/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  84. package/plugins/lisa-cursor/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  85. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +45 -15
  86. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  87. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  88. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  89. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  90. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  91. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  92. package/plugins/lisa-cursor/skills/lisa-track/SKILL.md +11 -1
  93. package/plugins/lisa-cursor/skills/lisa-tracker-claim/SKILL.md +1 -0
  94. package/plugins/lisa-cursor/skills/lisa-usage-accounting/references/estimate.md +25 -2
  95. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  97. package/plugins/lisa-devin/rules/reference/work-item-definition-of-ready.md +7 -2
  98. package/plugins/lisa-devin/skills/lisa-github-validate-issue/SKILL.md +2 -0
  99. package/plugins/lisa-devin/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  100. package/plugins/lisa-devin/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  101. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +45 -15
  102. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  103. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  104. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  105. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  106. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  107. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  108. package/plugins/lisa-devin/skills/lisa-track/SKILL.md +11 -1
  109. package/plugins/lisa-devin/skills/lisa-tracker-claim/SKILL.md +1 -0
  110. package/plugins/lisa-devin/skills/lisa-usage-accounting/references/estimate.md +25 -2
  111. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  113. package/plugins/lisa-expo-agy/plugin.json +1 -1
  114. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  116. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  118. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  120. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  121. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  123. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  125. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  127. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  128. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  129. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  130. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  131. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  132. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  134. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  135. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  136. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  137. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  138. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  139. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  141. package/plugins/lisa-rails-agy/plugin.json +1 -1
  142. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  143. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  144. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  145. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  146. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  148. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  149. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  150. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  151. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  152. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  153. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  154. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  155. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  156. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  157. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  158. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  159. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  160. package/plugins/src/base/rules/reference/work-item-definition-of-ready.md +7 -2
  161. package/plugins/src/base/skills/lisa-github-validate-issue/SKILL.md +2 -0
  162. package/plugins/src/base/skills/lisa-jira-validate-ticket/SKILL.md +2 -0
  163. package/plugins/src/base/skills/lisa-linear-validate-issue/SKILL.md +2 -0
  164. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +45 -15
  165. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  166. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +10 -3
  167. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-workers.mjs +52 -1
  168. package/plugins/src/base/skills/lisa-session-manager/scripts/orphan-sweep.mjs +2 -20
  169. package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +5 -1
  170. package/plugins/src/base/skills/lisa-session-manager/scripts/take-check.mjs +110 -0
  171. package/plugins/src/base/skills/lisa-track/SKILL.md +11 -1
  172. package/plugins/src/base/skills/lisa-tracker-claim/SKILL.md +1 -0
  173. package/plugins/src/base/skills/lisa-usage-accounting/references/estimate.md +25 -2
  174. package/scripts/two-channel-couplings.json +1 -1
  175. package/typescript/copy-overwrite/.prettierignore +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"usage-accounting.d.ts","sourceRoot":"","sources":["../../src/utils/usage-accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,sBAAsB,EACvB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,+BAA+B,GAChC,CAAC;AACF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC;AAMxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AAEzG,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAgStC;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,cAAc,CAAC,EAAE,eAAe,GAAG,IAAI,EACvC,cAAc,CAAC,EAAE,SAAS,sBAAsB,EAAE,GACjD,eAAe,CAoDjB;AAyBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAGvE;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,MAAM,EAAE,eAAe,CAAC;CACzB,GAAG,MAAM,CAGT;AA0CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE;IACL,cAAc,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACnD,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACjC,GACA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176,7 +176,9 @@ function resolveChildRollupParts(previousRollup, childArtifacts, directEntryIds)
176
176
  const collected = collectLisaUsageChildArtifacts(childArtifacts, directEntryIds);
177
177
  const deduped = collected.childEntries;
178
178
  const childCurrency = resolveDirectCostCurrency(deduped);
179
- const childTokensIncomplete = deduped.some(hasMeasuredSubset);
179
+ // A child run with no token total (unavailable telemetry) leaves the sum
180
+ // partial just as a measured subset does, so both mark it incomplete.
181
+ const childTokensIncomplete = deduped.some(entry => hasMeasuredSubset(entry) || entry.totalTokens === null);
180
182
  const rawChildCost = sumNullableDecimals(deduped.map(entry => entry.cost));
181
183
  return {
182
184
  childEntryIds: deduped.map(entry => entry.entryId),
@@ -1 +1 @@
1
- {"version":3,"file":"usage-accounting.js","sourceRoot":"","sources":["../../src/utils/usage-accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAMlH,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,+BAA+B,GAChC,CAAC;AAEF,uHAAuH;AAEvH,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AAEzG,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B;;;;;;GAMG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAA6B;IACnD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,C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CAAC,MAAM;QACxC,CAAC,CAAC,CAAC,cAAc,IAAI,KAAK,CAAC,MAAM,CAAC;QAClC,CAAC,CAAC,qBAAqB,CACnB,aAAa,EACb,cAAc,EACd,KAAK,CAAC,cAAc,CACrB,CAAC;IACR,MAAM,YAAY,GAAG,aAAa,CAAC;QACjC,OAAO,EAAE,aAAa;QACtB,MAAM;KACP,CAAC,CAAC,OAAO,EAAE,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAE3E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK;YACV,CAAC,CAAC,GAAG,YAAY,OAAO,mBAAmB,CAAC,KAAK,CAAC,EAAE;YACpD,CAAC,CAAC,GAAG,YAAY,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,GAAG,MAAM,OAAO,YAAY,IAAI,CAAC;IAC1C,CAAC;IAED,OAAO,GAAG,MAAM,OAAO,YAAY,OAAO,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;AACzE,CAAC;AAED,6EAA6E"}
package/package.json CHANGED
@@ -199,7 +199,7 @@
199
199
  "zod": "^4.6.7"
200
200
  },
201
201
  "name": "@codyswann/lisa",
202
- "version": "7.0.4",
202
+ "version": "7.1.0",
203
203
  "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",
204
204
  "main": "dist/index.js",
205
205
  "exports": {
@@ -370,7 +370,7 @@
370
370
  "optional": true
371
371
  }
372
372
  },
373
- "lisaReleaseCommit": "1eb2aded6cecddcb44ee2732e3342efe4c9c2c93",
374
- "gitHead": "1eb2aded6cecddcb44ee2732e3342efe4c9c2c93",
375
- "lisaReleaseTag": "v7.0.4"
373
+ "lisaReleaseCommit": "85d0897aa78fc9edd87050593dcd99e0dff4e347",
374
+ "gitHead": "85d0897aa78fc9edd87050593dcd99e0dff4e347",
375
+ "lisaReleaseTag": "v7.1.0"
376
376
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "7.0.4",
3
+ "version": "7.1.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": "7.0.4",
3
+ "version": "7.1.0",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -410,6 +410,8 @@ Enforces the token-estimate part of the vendor-neutral `work-item-definition-of-
410
410
 
411
411
  **What it checks.** An item with **no** `## Lisa Estimate` section PASSes: an estimate is not required at creation or at ready, because deterministic sources (Sentry, New Relic, monitors) cannot produce one, and the claiming agent writes it before any work begins. A section that **is** present FAILs when its `<!-- lisa:estimate ... -->` token is missing or unparseable, the token range is inverted, the recommended model is not in `workItem.estimate.models`, or the dollar range disagrees with the price table the token names. There is never more than one section.
412
412
 
413
+ At claim time `lisa-track` reruns the same check with `--phase claim`, where a missing estimate fails and the claiming agent writes one before any work; this validator runs the ready-time form.
414
+
413
415
  Remediation: re-render the section with `node scripts/lisa-estimate.mjs render --tokens-low <n> --tokens-high <n> --model <allowed value> --body-file <file>` and write the result back. Never ask a person for the estimate.
414
416
 
415
417
  `product_relevant: false` — the estimate is produced by agents, not by whoever wrote the item.
@@ -412,6 +412,8 @@ Enforces the token-estimate part of the vendor-neutral `work-item-definition-of-
412
412
 
413
413
  **What it checks.** An item with **no** `## Lisa Estimate` section PASSes: an estimate is not required at creation or at ready, because deterministic sources (Sentry, New Relic, monitors) cannot produce one, and the claiming agent writes it before any work begins. A section that **is** present FAILs when its `<!-- lisa:estimate ... -->` token is missing or unparseable, the token range is inverted, the recommended model is not in `workItem.estimate.models`, or the dollar range disagrees with the price table the token names. There is never more than one section.
414
414
 
415
+ At claim time `lisa-track` reruns the same check with `--phase claim`, where a missing estimate fails and the claiming agent writes one before any work; this validator runs the ready-time form.
416
+
415
417
  Remediation: re-render the section with `node scripts/lisa-estimate.mjs render --tokens-low <n> --tokens-high <n> --model <allowed value> --body-file <file>` and write the result back. Never ask a person for the estimate.
416
418
 
417
419
  `product_relevant: false` — the estimate is produced by agents, not by whoever wrote the item.
@@ -397,6 +397,8 @@ Enforces the token-estimate part of the vendor-neutral `work-item-definition-of-
397
397
 
398
398
  **What it checks.** An item with **no** `## Lisa Estimate` section PASSes: an estimate is not required at creation or at ready, because deterministic sources (Sentry, New Relic, monitors) cannot produce one, and the claiming agent writes it before any work begins. A section that **is** present FAILs when its `<!-- lisa:estimate ... -->` token is missing or unparseable, the token range is inverted, the recommended model is not in `workItem.estimate.models`, or the dollar range disagrees with the price table the token names. There is never more than one section.
399
399
 
400
+ At claim time `lisa-track` reruns the same check with `--phase claim`, where a missing estimate fails and the claiming agent writes one before any work; this validator runs the ready-time form.
401
+
400
402
  Remediation: re-render the section with `node scripts/lisa-estimate.mjs render --tokens-low <n> --tokens-high <n> --model <allowed value> --body-file <file>` and write the result back. Never ask a person for the estimate.
401
403
 
402
404
  `product_relevant: false` — the estimate is produced by agents, not by whoever wrote the item.
@@ -83,6 +83,23 @@ the manager.
83
83
  entry, exactly as before. A plain all-digit entry is a login here but a numeric id to
84
84
  `item-answer`, so `validate` warns about it; write `login:<v>` or `id:<v>` instead. The `queue`
85
85
  output echoes the entries as `operators`.
86
+ - **Taking an item: assign it to "me".** This is the one statement of the rule; every step below
87
+ that takes, files or moves an item follows it.
88
+ 1. Every item the manager takes is assigned to "me" when it has no assignee: dispatching or
89
+ claiming it, releasing it (Blocked to Ready), re-dispatching or retrying it, or driving it
90
+ as the manager. Never replace an existing assignee: an item assigned to someone other than
91
+ "me" or an operator is never taken, and an operator's assignment is never overwritten.
92
+ 2. Every item the manager files (a promotion ticket, a split child, a follow-up, the retirement
93
+ proposal) is created assigned to "me", unless an operator or another person was named as its
94
+ owner.
95
+ 3. A state move the manager makes on an unassigned item sets the assignee to "me" in the same
96
+ `lisa-tracker-write` update, and the read-back confirms both.
97
+ 4. Before `spawn`, re-read the item with `lisa-tracker-read` and pass its live assignees as
98
+ `--assignees '<json>'`: `[]` when unassigned, GitHub `[{"login":…,"id":…}]` with the REST
99
+ numeric `.assignees[].id`, Jira accountIds, Linear user ids. `spawn` refuses an unassigned
100
+ item, or one held by anyone but "me" or an operator, with exit 5 and launches nothing. An
101
+ unassigned item at that point is a failed claim: assign it to "me", read it back, and spawn
102
+ again; never dispatch it unassigned. `foreign` means someone else holds it: leave it.
86
103
  - **Workers** start only through `spawn`. The worker prompt is exactly
87
104
  `/lisa:implement <REF> managedBy=<manager-name>`; `lisa-implement` owns what `managedBy=` means.
88
105
  Never start a worker another way, and never reuse a worker for another item or a new attempt.
@@ -231,7 +248,8 @@ In this order, every time:
231
248
  leaves a pending question the next cycle finishes, never a marker nobody will remove.
232
249
  3. **Tracker.** One `lisa-tracker-write` update: apply `marker` (add the label, or, when
233
250
  `marker.type` is `role`, move the item to the `blocked` role), for `exhausted` also move the
234
- item to the `blocked` role (`move`), and post `comment` as a comment. Use only the names
251
+ item to the `blocked` role (`move`), and post `comment` as a comment. When that update moves
252
+ an unassigned item, it also assigns it to "me" ("Taking an item"). Use only the names
235
253
  `mark-plan` returned; never hard-code one.
236
254
  4. **Read back** with `lisa-tracker-read`: the marker (and the move) landed and the comment is
237
255
  there. Never claim a mark you did not read back.
@@ -375,7 +393,8 @@ leave the ledger as it is (`markedAt` stays null), carry on with the cycle and e
375
393
  - **`[<REF>] DONE: …` / `[<REF>] FAILED: …` from a worker:**
376
394
  `ledger finish <ref> --status DONE|FAILED --sender <sender>` (reason on STDIN) and post one line
377
395
  to Telegram. On `FAILED`, also move the item to the `blocked`
378
- role through `lisa-tracker-write` with a comment `[lisa-session-manager] Worker failed: <reason>`,
396
+ role through `lisa-tracker-write` with a comment `[lisa-session-manager] Worker failed: <reason>`
397
+ (assigning "me" in the same update when it is unassigned: "Taking an item"),
379
398
  and read both back with `lisa-tracker-read`. When the reason says a
380
399
  design or product decision is needed, mark it instead ("Mark and move on", `--kind decision`).
381
400
 
@@ -477,9 +496,9 @@ shows them.
477
496
  |---|---|
478
497
  | `working`, `waiting`, `finished` | Nothing. |
479
498
  | `requestion` | With Telegram: re-send the pending question once, then re-record it with `ledger set-question` (same text, new message id); that restarts the re-ping clock. With no channel: nothing to re-send; leave it pending. |
480
- | `stalled`, `dead` | Read the item. If it left the `claimed` role, a human moved it: do not retry or move it; `ledger finish <ref> --status FAILED` with reason "left the claimed role outside the manager". Otherwise check for a merged PR first (`gh pr list --state merged --search <ref>` in the item's repo dir). If merged, leave the state change to Lisa's lifecycle and `ledger finish <ref> --status DONE` with reason "PR merged". Otherwise `claude stop <worker>` if it is still listed, then `spawn` a **fresh** attempt when capacity allows (the CLI counts attempts). |
499
+ | `stalled`, `dead` | Read the item. If it left the `claimed` role, a human moved it: do not retry or move it; `ledger finish <ref> --status FAILED` with reason "left the claimed role outside the manager". Otherwise check for a merged PR first (`gh pr list --state merged --search <ref>` in the item's repo dir). If merged, leave the state change to Lisa's lifecycle and `ledger finish <ref> --status DONE` with reason "PR merged". Otherwise `claude stop <worker>` if it is still listed, then re-read the item (after the stop, so a reassignment in the meantime is seen) and `spawn` a **fresh** attempt when capacity allows, with that re-read's `--assignees` ("Taking an item"; the CLI counts attempts). |
481
500
  | `setup-gap` | The worker's first prompt never ran: `setupGap.kind` is `unknown-command` (Lisa's plugin is not visible in that repo, so `/lisa:implement` is unknown there) or `prompt-blocked` (a `UserPromptSubmit` hook rejected the prompt; `setupGap.detail` is what the hook said). Retrying cannot fix it. `claude stop <worker>` if it is still listed, `ledger finish <ref> --status FAILED --setup-gap` with reason "setup gap: <kind>: <detail>" (the spawn is not counted as an attempt). Then read the item: If it left the `claimed` role, a human moved it: respect that and do not move it back to the `ready` role. Otherwise move the item back to the `ready` role. Either way post one plain-language line naming the repo and the fix to Telegram, do not respawn it, do not dispatch to that repo again until the operator fixes it, and end the cycle `recovery-required` with that line as the summary. `classify` has already recorded the repo's setup gap, so later cycles' `queue` leaves that repo out and `spawn` refuses it until the operator fixes the repo and runs `ledger clear-setup-gap <repo>` (`.` on a single-repo project); include that command in the line. |
482
- | `blocked-on-prompt` | The live worker is stuck on a prompt nobody attached can answer: its agent row reports `waitingFor` (e.g. "permission prompt") other than waiting on its own subagent. It will never proceed on its own, however its logs change. `claude stop <worker>` if it is still listed, then `spawn` a **fresh** attempt when capacity allows (the CLI counts attempts; at `stall.maxAttempts` it classifies `exhausted` instead). Send the operator one plain-English line naming the item, the `waitingFor` text, and that the worker was stopped and a fresh attempt starts when capacity allows (Telegram when configured, else the cycle summary). This is once per occurrence: the fresh worker is not blocked, so the same occurrence never repeats. Not a `setup-gap`: the first prompt ran, so the attempt counts and the item stays claimed. |
501
+ | `blocked-on-prompt` | The live worker is stuck on a prompt nobody attached can answer: its agent row reports `waitingFor` (e.g. "permission prompt") other than waiting on its own subagent. It will never proceed on its own, however its logs change. `claude stop <worker>` if it is still listed, then re-read the item and `spawn` a **fresh** attempt when capacity allows, with its `--assignees` ("Taking an item"; the CLI counts attempts; at `stall.maxAttempts` it classifies `exhausted` instead). Send the operator one plain-English line naming the item, the `waitingFor` text, and that the worker was stopped and a fresh attempt starts when capacity allows (Telegram when configured, else the cycle summary). This is once per occurrence: the fresh worker is not blocked, so the same occurrence never repeats. Not a `setup-gap`: the first prompt ran, so the attempt counts and the item stays claimed. |
483
502
  | `exhausted` | Attempts reached `stall.maxAttempts`. Stop the worker if listed, `ledger finish <ref> --status FAILED`, then follow "Mark and move on" with `--kind exhausted` and, as the reason, how many attempts failed and how each ended: it moves the item to the `blocked` role and marks it for a human. |
484
503
 
485
504
  Why a worker started with `--dangerously-skip-permissions` reaches a permission prompt at all is
@@ -537,11 +556,13 @@ just as long. Sweep both every cycle, after `classify` and before Dispatch:
537
556
  or is in the `review` role; leave it where it is. A later cycle that still sees a recent refusal puts the item
538
557
  in `return`, or in `parked` when a person holds it or it is in the `review` role, and retries
539
558
  finishing once the refusal is more than 24 hours old.
540
- - `return`: move it to the `ready` role with the entry's `comment`. A merged item whose
559
+ - `return`: move it to the `ready` role with the entry's `comment` (assigning "me" in the same
560
+ update when it is unassigned: "Taking an item", rule 3). A merged item whose
541
561
  completion was refused, and an item whose pull request was closed without merging, land here
542
562
  with a comment that names that pull request, so the next agent builds on the earlier work.
543
- - `redispatch`: an open pull request and no worker. Claim it (`reused`) and `spawn` it exactly
544
- as Dispatch steps 2.3 and 2.4, ahead of new items, while `capacity` says `can_spawn`. A
563
+ - `redispatch`: an open pull request and no worker. Claim it (`reused`), assigning it to "me"
564
+ when it is unassigned ("Taking an item"), and `spawn` it exactly as Dispatch steps 2.3 and
565
+ 2.4, ahead of new items, while `capacity` says `can_spawn`. A
545
566
  spawn that reaches `stall.maxAttempts` follows the `exhausted` row above.
546
567
  - `parked`: post the entry's `comment` only when `reasonOnItem` is false. An item in the
547
568
  `review` role with an open pull request is parked, never re-dispatched: it is waiting on
@@ -567,12 +588,13 @@ queue below). For each:
567
588
  rule); never treat "blocker closed" as "unblocked".
568
589
  2. Pipe `{labels,body,comments,edges}` as JSON to `blocked-plan --ref <ref>`. Act on `action`:
569
590
  - `release`: dissolve the edges and move the item to the `ready` role in one `lisa-tracker-write`
570
- update, with a comment `[lisa-session-manager] Released: <reason>`; read it back with `lisa-tracker-read` and confirm the
571
- role changed before you claim it did. Notify Telegram.
591
+ update, with a comment `[lisa-session-manager] Released: <reason>`, setting the assignee to
592
+ "me" in that same update when the item is unassigned ("Taking an item"); read it back with
593
+ `lisa-tracker-read` and confirm the role (and the assignee) changed before you claim it did. Notify Telegram.
572
594
  - `decide` (access-only; a blocker was closed NOT PLANNED): relay nothing to the operator. Make
573
595
  the call from the item's and blocker's evidence: re-scope the item to build without the
574
596
  dependency (dissolve the edge and move it to the `ready` role), drop an edge that no longer applies, or
575
- close the item. Post `[lisa-session-manager] Decision: <which> — <why>` in the same
597
+ close the item; a move of an unassigned item also assigns it to "me" ("Taking an item"). Post `[lisa-session-manager] Decision: <which> — <why>` in the same
576
598
  `lisa-tracker-write` update, and read it back before you claim it landed. Notify Telegram.
577
599
  - `keep` with a manager question pending: "Waiting on a human" above handles it.
578
600
  - `keep`, `escalate`, `skip-human-gate`: leave it. Gate self-blocks and clarification blocks
@@ -667,13 +689,17 @@ Skip while `capacity` reports `paused`. Otherwise:
667
689
  entries, which on GitHub is the assignee's numeric id from the REST issue's
668
690
  `.assignees[].id` (not the `id` of a GraphQL-backed `--json assignees` read, which is a node
669
691
  id), on Jira the accountId and on Linear the user id; plain entries as "me" is compared; the
670
- claim assigns only an unassigned item, so an operator's item keeps the operator); anything
671
- else means skip. Then
692
+ claim assigns only an unassigned item, so an operator's item keeps the operator), or on
693
+ `claimed` or `reused` with no assignee, which goes on to the re-read below and its
694
+ assignment repair; anything else (an unsuccessful claim, or an assignee who is neither
695
+ "me" nor an operator) means skip. Then
672
696
  re-read the item with `lisa-tracker-read`: if the re-read shows an assignee that is neither
673
697
  "me" nor an operator, or shows the state did not change to the `claimed` role, skip it
674
- (someone else holds it, or the claim did not land).
698
+ (someone else holds it, or the claim did not land). If it shows no assignee at all, the
699
+ claim failed to assign: assign it to "me" ("Taking an item") and re-read before going on.
675
700
  Never spawn on the claim's word alone.
676
- 4. **Spawn.** `spawn <ref> [--repo <key>]`.
701
+ 4. **Spawn.** `spawn <ref> --assignees '<json>' [--repo <key>]`, with the assignees the step 3
702
+ re-read showed ("Taking an item", rule 4).
677
703
  - exit 0: post `[<REF>] started in <repo> (<name>)` to Telegram.
678
704
  - exit 3 (no capacity): move the item back to the `ready` role and stop dispatching.
679
705
  - exit 4 (a live worker holds it): if the ledger has no item for it, record it with
@@ -694,6 +720,9 @@ Skip while `capacity` reports `paused`. Otherwise:
694
720
  message as the summary.
695
721
  - `already-recorded` (the operator was told when it was recorded): post nothing and
696
722
  continue with the next item.
723
+ - exit 5 (not taken; nothing launched): `reason` `unassigned` means assign the item to "me"
724
+ through `lisa-tracker-write`, read it back, and spawn again with the new assignees;
725
+ `foreign` means someone else holds it, so leave it where it is and continue.
697
726
  - any other exit: move the item back to the `ready` role, notify Telegram, continue.
698
727
  3. **Backlog tier, lowest priority.** Only when `backlogPickup` is on, every `ordered` item has been
699
728
  taken or skipped, and `capacity` still says `can_spawn`. Ready work always wins: never promote a
@@ -769,7 +798,8 @@ tracker-derived), it holds when BOTH: a date-filtered tracker search finds no it
769
798
  `claimed` role in the trailing 14 days, AND this cycle found zero Ready candidates. Then record
770
799
  `policy-obsolete` and file **one** proposal through `lisa-tracker-write`, deduped on the marker
771
800
  `[lisa-session-manager-retirement]` (search open and closed items for it first; never match on the
772
- title), proposing `/lisa:tear-down-automations session-manager` or a longer `interval`. Keep running.
801
+ title), proposing `/lisa:tear-down-automations session-manager` or a longer `interval`, assigned to "me"
802
+ ("Taking an item", rule 2). Keep running.
773
803
 
774
804
  Record with the summary (one plain line, the contract's exemplar voice) on STDIN:
775
805
 
@@ -32,6 +32,7 @@ export const EXIT = Object.freeze({
32
32
  SETUP: 2,
33
33
  NO_CAPACITY: 3,
34
34
  LIVE_WORKER: 4,
35
+ NOT_TAKEN: 5,
35
36
  });
36
37
 
37
38
  /** The config files Lisa reads, local over global per key. */
@@ -14,7 +14,8 @@ prints a bare path); errors go to stderr. Untrusted text (answers, questions,
14
14
  reasons, Telegram messages, summaries) is read from STDIN, never from argv.
15
15
 
16
16
  Exit codes: 0 ok; 1 a command failed (claude, tmux or gh error); 2 bad repo,
17
- bad config or bad usage; 3 no capacity; 4 a live worker already holds the ref.
17
+ bad config or bad usage; 3 no capacity; 4 a live worker already holds the ref;
18
+ 5 spawn refused an item that was not taken (unassigned or someone else's).
18
19
 
19
20
  Workers and capacity
20
21
  capacity [--max-workers <n>]
@@ -24,10 +25,16 @@ Workers and capacity
24
25
  (capacity and spawn also take --meminfo <file>, a TEST-ONLY flag that
25
26
  reads memory from a Linux meminfo file instead of this host. Skills
26
27
  never pass it.)
27
- spawn <ref> [--repo <key>] [--max-workers <n>]
28
+ spawn <ref> --assignees <json> [--repo <key>] [--max-workers <n>]
29
+ --assignees is required: the JSON array of the item's live assignees
30
+ as read back from the tracker, [] when unassigned (GitHub [{login,id}]
31
+ with the REST numeric id; Jira accountIds; Linear user ids).
28
32
  Checks, in order: repo dir resolves and has .lisa.config.json (exit 2);
29
33
  capacity (exit 3, stdout = capacity report); no live wk- worker for the
30
- ref (exit 4, stdout = {ref,worker,sessionId}); no recorded setup gap
34
+ ref (exit 4, stdout = {ref,worker,sessionId}); --assignees present (exit
35
+ 2) and the item taken: at least one assignee, every one "me" (ledger
36
+ control.me) or a sessionManager.operatorIds entry (exit 5, stdout =
37
+ {ref,reason:"unassigned"|"foreign",me,foreign}); no recorded setup gap
31
38
  for the repo (exit 2, nothing launched or recorded: fix the repo, then
32
39
  ledger clear-setup-gap <repo>); no pending question in
33
40
  the ledger for the ref (exit 2: clear it first). Then runs, with cwd = repo
@@ -5,7 +5,9 @@
5
5
  * `spawn` is the one that starts yolo-mode sessions, so its checks run in a
6
6
  * fixed order and each has its own exit code the manager skill branches on:
7
7
  * the repo must be a Lisa repo (2), there must be capacity (3), and no live
8
- * worker may already hold the ref (4). Only then does it run
8
+ * worker may already hold the ref (4), and the item must be taken: its
9
+ * read-back assignees (`--assignees`) name "me" or an operator and nobody
10
+ * else (5, take-check.mjs). Only then does it run
9
11
  * `claude --bg`, with the cwd set to the routed repo and every `TELEGRAM_*`
10
12
  * variable removed from the worker's environment. A repo whose workspace
11
13
  * trust was never accepted is exit 2 too (see worker-launch.mjs). So is a
@@ -25,6 +27,8 @@ import { createHash } from "node:crypto";
25
27
  import { readFile } from "node:fs/promises";
26
28
 
27
29
  import { computeCapacity, readMachineStats } from "./capacity.mjs";
30
+ import { parseJson } from "./json-input.mjs";
31
+ import { judgeTake } from "./take-check.mjs";
28
32
  import {
29
33
  CliError,
30
34
  EXIT,
@@ -260,6 +264,7 @@ export async function spawn(ctx) {
260
264
  }
261
265
 
262
266
  const ledger = await readLedger(ctx.root);
267
+ refuseUntaken(ctx, config, ledger, ref);
263
268
  const repo = key ?? ".";
264
269
  refuseSetupGap(ledger, repo);
265
270
  // A spawn no longer clears a pending question (lisa#4571), and a worker
@@ -299,6 +304,52 @@ export async function spawn(ctx) {
299
304
  return { json: { ref, name, sessionId, repo, cwd: repoDir, firstPrompt } };
300
305
  }
301
306
 
307
+ /**
308
+ * Refuse, with exit 5, an item that was not taken: the assign-on-take rule.
309
+ * `--assignees` is the JSON array of the item's live assignees as the
310
+ * manager read them back (`[]` when nobody is assigned): GitHub
311
+ * `{login, id}` objects, Jira accountIds, Linear user ids. Missing or not an
312
+ * array is exit 2, so no caller can skip the check by leaving it out.
313
+ * @param {object} ctx - CLI context
314
+ * @param {{operatorIds?: unknown}} config - Session-manager config
315
+ * @param {Awaited<ReturnType<typeof readLedger>>} ledger - Ledger
316
+ * @param {string} ref - Item ref
317
+ * @returns {void}
318
+ */
319
+ function refuseUntaken(ctx, config, ledger, ref) {
320
+ const raw = ctx.values.assignees;
321
+ const assignees =
322
+ raw === undefined ? undefined : parseJson(raw, "--assignees");
323
+ if (!Array.isArray(assignees)) {
324
+ throw new CliError(
325
+ `spawn needs --assignees: the JSON array of ${ref}'s live assignees ` +
326
+ "as read back from the tracker ([] when unassigned).",
327
+ EXIT.SETUP
328
+ );
329
+ }
330
+ const me = ledger.control.me ?? null;
331
+ const project = loadProject(ctx.root);
332
+ const verdict = judgeTake(assignees, {
333
+ me,
334
+ operatorIds: config.operatorIds,
335
+ tracker: project.local?.tracker ?? project.global?.tracker,
336
+ });
337
+ if (verdict.ok) return;
338
+ const message =
339
+ verdict.reason === "unassigned"
340
+ ? `${ref} is unassigned; nothing was spawned. Assign it to "me" ` +
341
+ `(${me ?? "not recorded: run ledger control --me <id>"}), read it ` +
342
+ "back, and spawn again."
343
+ : `${ref} is assigned to someone other than "me" or an operator ` +
344
+ `(${verdict.foreign.join(", ")}); nothing was spawned. Leave it.`;
345
+ throw new CliError(message, EXIT.NOT_TAKEN, {
346
+ ref,
347
+ reason: verdict.reason,
348
+ me,
349
+ foreign: verdict.foreign,
350
+ });
351
+ }
352
+
302
353
  /**
303
354
  * The ledger row for `ref`, or exit 2.
304
355
  * @param {Awaited<ReturnType<typeof readLedger>>} ledger - Ledger
@@ -22,11 +22,11 @@
22
22
  * @module session-manager/orphan-sweep
23
23
  */
24
24
  import {
25
- entryMatches,
26
25
  idComparableValues,
27
26
  parseIdEntries,
28
27
  } from "../../../scripts/operator-id-kinds.mjs";
29
28
  import { holdDigest, judgeHold } from "./orphan-holds.mjs";
29
+ import { assigneeFields, isMeOrOperator } from "./take-check.mjs";
30
30
  import { FINISH_RETRY_HOURS, classifyOrphan } from "./orphan-buckets.mjs";
31
31
 
32
32
  export {
@@ -62,22 +62,6 @@ function idOrNull(value) {
62
62
  return Number.isSafeInteger(value) ? String(value) : null;
63
63
  }
64
64
 
65
- /**
66
- * The fields one assignee is compared on, the way `queue` compares them: a
67
- * plain string is the tracker's normalized id (GitHub login, Jira accountId,
68
- * Linear user id); a `{login, id}` object adds the kind-keyed fields.
69
- * @param {unknown} assignee - One assignee as the tracker gave it
70
- * @returns {{plain: string|null, login: string|null, id: string|null}} Fields
71
- */
72
- function assigneeFields(assignee) {
73
- if (assignee !== null && typeof assignee === "object") {
74
- const login = idOrNull(assignee.login);
75
- const id = idOrNull(assignee.id ?? assignee.accountId);
76
- return { plain: login ?? id, login, id };
77
- }
78
- return { plain: idOrNull(assignee), login: null, id: null };
79
- }
80
-
81
65
  /**
82
66
  * Whether any assignee is neither "me" nor an operator.
83
67
  * @param {unknown} assignees - The item's assignees
@@ -87,9 +71,7 @@ function assigneeFields(assignee) {
87
71
  function heldBySomeoneElse(assignees, who) {
88
72
  return (Array.isArray(assignees) ? assignees : []).some(assignee => {
89
73
  const fields = assigneeFields(assignee);
90
- if (fields.plain === null) return false;
91
- if (who.me !== null && fields.plain === who.me) return false;
92
- return !who.operators.some(entry => entryMatches(entry, fields));
74
+ return fields.plain !== null && !isMeOrOperator(fields, who);
93
75
  });
94
76
  }
95
77
 
@@ -69,7 +69,11 @@ const MEASURE = { "max-workers": text, meminfo: text };
69
69
  /** Each subcommand: handler, accepted flags, and how many positionals. */
70
70
  const COMMANDS = {
71
71
  capacity: { run: capacity, options: MEASURE, positionals: 0 },
72
- spawn: { run: spawn, options: { ...MEASURE, repo: text }, positionals: 1 },
72
+ spawn: {
73
+ run: spawn,
74
+ options: { ...MEASURE, repo: text, assignees: text },
75
+ positionals: 1,
76
+ },
73
77
  resume: { run: resume, options: {}, positionals: 1 },
74
78
  classify: { run: classify, options: {}, positionals: 1 },
75
79
  status: { run: status, options: {}, positionals: 0 },
@@ -0,0 +1,110 @@
1
+ /**
2
+ * The assign-on-take rule (CodySwannGT/lisa#5029), as a check `spawn` runs
3
+ * before it launches anything.
4
+ *
5
+ * The rule (runbook "Fixed facts", "Taking an item"): every item the manager
6
+ * takes is assigned to "me" when it has no assignee, and nothing is ever
7
+ * dispatched unassigned. The claim step used to do the assigning implicitly,
8
+ * and the dispatch step accepted the claim's word for it, so an item the
9
+ * manager released, re-dispatched or drove itself could reach a worker with
10
+ * nobody named on it. `spawn` now needs the assignees the manager read back
11
+ * from the tracker (`--assignees`) and refuses, with exit 5, an item that is
12
+ * unassigned or held by anyone other than "me" or an operator.
13
+ *
14
+ * An assignee is compared exactly as the queue and the orphan sweep compare
15
+ * one: a plain string is the tracker's normalized id (GitHub login, Jira
16
+ * accountId, Linear user id), and a `{login, id}` object (GitHub, with the
17
+ * REST numeric id) also matches `login:` and `id:` operator entries.
18
+ * Pure: no I/O.
19
+ * @module session-manager/take-check
20
+ */
21
+ import {
22
+ entryMatches,
23
+ parseIdEntries,
24
+ } from "../../../scripts/operator-id-kinds.mjs";
25
+
26
+ /**
27
+ * A trimmed id string, or null. Numeric ids become strings.
28
+ * @param {unknown} value - Raw id
29
+ * @returns {string | null} Comparable id
30
+ */
31
+ function idOrNull(value) {
32
+ if (typeof value === "string" && value.trim() !== "") return value.trim();
33
+ return Number.isSafeInteger(value) ? String(value) : null;
34
+ }
35
+
36
+ /**
37
+ * The fields one assignee is compared on: a plain string is the tracker's
38
+ * normalized id (GitHub login, Jira accountId, Linear user id); a
39
+ * `{login, id}` object adds the kind-keyed fields.
40
+ * @param {unknown} assignee - One assignee as the tracker gave it
41
+ * @returns {{plain: string|null, login: string|null, id: string|null}} Fields
42
+ */
43
+ export function assigneeFields(assignee) {
44
+ if (assignee !== null && typeof assignee === "object") {
45
+ const login = idOrNull(assignee.login);
46
+ const id = idOrNull(assignee.id ?? assignee.accountId);
47
+ return { plain: login ?? id, login, id };
48
+ }
49
+ return { plain: idOrNull(assignee), login: null, id: null };
50
+ }
51
+
52
+ /**
53
+ * The fields `spawn` compares one read-back assignee on. A plain string means
54
+ * what the tracker's normalized id is: on GitHub a login (so `login:` entries
55
+ * match it and `id:` entries never do, since anyone can pick an all-digit
56
+ * login), and on Jira and Linear an account id (so `id:` entries match it).
57
+ * With no known tracker it keeps `assigneeFields`' plain-only reading.
58
+ * @param {unknown} assignee - One assignee as read back
59
+ * @param {string | undefined} tracker - `github`, `jira` or `linear`
60
+ * @returns {{plain: string|null, login: string|null, id: string|null}} Fields
61
+ */
62
+ function takenFields(assignee, tracker) {
63
+ const fields = assigneeFields(assignee);
64
+ if (typeof assignee !== "string" || fields.plain === null) return fields;
65
+ if (tracker === "github") return { ...fields, login: fields.plain };
66
+ if (tracker === "jira" || tracker === "linear") {
67
+ return { ...fields, id: fields.plain };
68
+ }
69
+ return fields;
70
+ }
71
+
72
+ /**
73
+ * Whether one assignee is "me" or an operator.
74
+ * @param {{plain: string|null, login: string|null, id: string|null}} fields - Assignee fields
75
+ * @param {{me: string|null, operators: object[]}} who - Identities
76
+ * @returns {boolean} True for "me" or an operator
77
+ */
78
+ export function isMeOrOperator(fields, who) {
79
+ if (fields.plain === null) return false;
80
+ if (who.me !== null && fields.plain === who.me) return true;
81
+ return who.operators.some(entry => entryMatches(entry, fields));
82
+ }
83
+
84
+ /**
85
+ * Judge whether an item may be dispatched under the assign-on-take rule.
86
+ * @param {unknown} assignees - The item's live assignees, as read back
87
+ * @param {{me?: string|null, operatorIds?: unknown, tracker?: string}} identities - "Me"
88
+ * (`ledger control.me`), `sessionManager.operatorIds`, and the project's
89
+ * tracker, which says what a plain assignee string is
90
+ * @returns {{ok: true} | {ok: false, reason: "unassigned"|"foreign", foreign: string[]}}
91
+ * `unassigned`: nobody is named, so assign "me" and read it back first;
92
+ * `foreign`: someone other than "me" or an operator holds it, so leave it
93
+ */
94
+ export function judgeTake(assignees, identities) {
95
+ const who = {
96
+ me: idOrNull(identities.me),
97
+ operators: parseIdEntries(identities.operatorIds),
98
+ };
99
+ const named = (Array.isArray(assignees) ? assignees : [])
100
+ .map(assignee => takenFields(assignee, identities.tracker))
101
+ .filter(fields => fields.plain !== null);
102
+ if (named.length === 0)
103
+ return { ok: false, reason: "unassigned", foreign: [] };
104
+ const foreign = named
105
+ .filter(fields => !isMeOrOperator(fields, who))
106
+ .map(fields => fields.plain);
107
+ return foreign.length === 0
108
+ ? { ok: true }
109
+ : { ok: false, reason: "foreign", foreign };
110
+ }
@@ -127,7 +127,15 @@ Otherwise:
127
127
 
128
128
  3. Read the binding back through `node scripts/lisa-work-item.mjs current` and require it to equal the canonical reference. If binding fails, stop before durable project work.
129
129
  - A detached-HEAD worktree is valid at this stage: the binding records `branch: null` as a pending state. Create the feature branch only after the gate succeeds, then run `node scripts/lisa-work-item.mjs attach-branch`. Commit preparation and validation fail closed until that attachment succeeds.
130
- 4. **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`. Then write the full resolved work-item context — the live vendor read bundle, unedited, every comment included — to the worktree-local, git-ignored `<worktree root>/.lisa/work-item-context.md`, then return this structured result (the file is the context; a summary in the reply never substitutes for it). When a `caller_bundle_path` was forwarded for this work item and the file already exists, do not overwrite it — it holds the caller's bundle (or a previous run's) and is left for the resolver step. Otherwise this is the first write; when `lisa-implement` forwarded a `caller_bundle_path`, its resolver step then keeps the bundle at that path as the base and appends only what this live read adds, and in every case finishes it with the `## Comment inventory` section:
130
+ 4. **Token estimate before any work** (`work-item-definition-of-ready`, gate S21; contract in the `lisa-usage-accounting` skill's `references/estimate.md`). Write the item's live body to a scratch file and run `node scripts/lisa-estimate.mjs check --phase claim --body-file <file>`. Exit 0 (`PASS`, or `N/A` because `workItem.estimate.required` is `false`) → continue. Exit 1 because the estimate is missing → estimate it now, yourself; never ask a person and never stop for one:
131
+ 1. Pick a first token range and a recommended model from `workItem.estimate.models` (`node scripts/lisa-estimate.mjs config` prints them) by reading the item: scope, files it touches, type, how much verification it needs.
132
+ 2. Calibrate it. Fetch the bodies of up to 20 comparable finished items in this repository — same type, closed or done, carrying a `## Lisa Estimate` section — as a JSON array (GitHub: `gh issue list --repo <org>/<repo> --state closed --label <type label> --search '"Lisa Estimate" in:body' --limit 20 --json body`. Jira and Linear projects can serve several repositories, so scope those searches to this one by its `repo:<name>` label (the repo marker in the `config-resolution` rule; `<name>` is this repository's short name). Jira: through `lisa-atlassian-access`, `operation: search-issues jql:"project = <KEY> AND labels = \"repo:<name>\" AND issuetype = <type> AND statusCategory = Done AND text ~ \"Lisa Estimate\" ORDER BY resolved DESC"`, the first 20. Linear: through `lisa-linear-access`, `operation: list-issues team:<ID> label:repo:<name> state_type:["completed"]`. A listing may not carry full descriptions and has no body search, so read each candidate with `lisa-linear-access` `operation: get-issue id:<ID>` and keep the first 20 that carry the item's type label and a `## Lisa Estimate` section in that full description. Save each item's description as markdown text in `[{"body": "..."}]`). Run `node scripts/lisa-estimate.mjs calibrate --tokens-low <n> --tokens-high <n> --history-file <file>` and use the range and `basis` it prints. With no history it says so; keep your range.
133
+ 3. Render and write it: `node scripts/lisa-estimate.mjs render --tokens-low <n> --tokens-high <n> --model <id> --basis "<basis>" --body-file <file>` prints the whole body with the section in place. Write that body back through `lisa-tracker-write` (update), read the item back, and rerun the claim-phase check on the stored body; it must exit 0.
134
+
135
+ Exit 1 because a present estimate is malformed → re-render it the same way.
136
+
137
+ An estimate failure never blocks the work. The item is already claimed, and stopping here would strand it in the claimed state with no trace of why. When a check exits 2, calibration or rendering fails, or the written body does not read back with a passing claim-phase check, continue to step 5 with `estimate_outcome: failed` and `estimate_failure: <reason>`, and post one comment on the item through `lisa-tracker-write` that a non-technical reader can follow, for example: "Lisa could not record a cost estimate for this item before starting work, because the project's estimate settings could not be read. The work is going ahead without one. What it actually cost will still be recorded when it is done." Name the real reason in plain words, not an exit code. Record `estimate_outcome: present|written|failed|n/a` in the result.
138
+ 5. **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`. Then write the full resolved work-item context — the live vendor read bundle, unedited, every comment included — to the worktree-local, git-ignored `<worktree root>/.lisa/work-item-context.md`, then return this structured result (the file is the context; a summary in the reply never substitutes for it). When a `caller_bundle_path` was forwarded for this work item and the file already exists, do not overwrite it — it holds the caller's bundle (or a previous run's) and is left for the resolver step. Otherwise this is the first write; when `lisa-implement` forwarded a `caller_bundle_path`, its resolver step then keeps the bundle at that path as the base and appends only what this live read adds, and in every case finishes it with the `## Comment inventory` section:
131
139
 
132
140
  ```text
133
141
  tracker_provider: jira|github|linear
@@ -138,6 +146,8 @@ Otherwise:
138
146
  gate_reason: <the act a person must perform>|null
139
147
  claim_outcome: claimed|reused|held-by-gate|blocked-ci-loop
140
148
  binding_outcome: verified|skipped-human-gate|skipped-ci-loop
149
+ estimate_outcome: present|written|failed|n/a
150
+ estimate_failure: <plain-English reason>|null
141
151
  route: implement|ci-rework pr=<n>|blocked pr=<n>
142
152
  failing_checks: <comma-separated check names from the marker comment>|none
143
153
  head_ref: <the pull request's head branch>|null