@codyswann/lisa 2.100.1 → 2.100.2

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 (37) hide show
  1. package/README.md +1 -0
  2. package/dist/utils/decimal-sum.d.ts +8 -0
  3. package/dist/utils/decimal-sum.d.ts.map +1 -0
  4. package/dist/utils/decimal-sum.js +68 -0
  5. package/dist/utils/decimal-sum.js.map +1 -0
  6. package/dist/utils/usage-accounting.d.ts.map +1 -1
  7. package/dist/utils/usage-accounting.js +60 -17
  8. package/dist/utils/usage-accounting.js.map +1 -1
  9. package/package.json +1 -1
  10. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  11. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  12. package/plugins/lisa/commands/intake-explain.md +18 -1
  13. package/plugins/lisa/rules/usage-accounting.md +2 -2
  14. package/plugins/lisa/scripts/automation-status-claude-adapter.mjs +1 -1
  15. package/plugins/lisa/scripts/automation-status-codex-adapter.mjs +1 -1
  16. package/plugins/lisa/skills/intake-explain/SKILL.md +25 -0
  17. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  19. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  21. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  23. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  24. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  25. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  27. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  29. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  33. package/plugins/src/base/commands/intake-explain.md +18 -1
  34. package/plugins/src/base/rules/usage-accounting.md +2 -2
  35. package/plugins/src/base/scripts/automation-status-claude-adapter.mjs +1 -1
  36. package/plugins/src/base/scripts/automation-status-codex-adapter.mjs +1 -1
  37. package/plugins/src/base/skills/intake-explain/SKILL.md +25 -0
package/README.md CHANGED
@@ -79,6 +79,7 @@ Most users only ever call `/lisa:research`, `/lisa:plan`, and `/lisa:implement`.
79
79
  | Command | What it does |
80
80
  | --- | --- |
81
81
  | `/lisa:intake <queue-url>` | Scans a Ready queue (Notion PRD database, JIRA project, GitHub repo, Linear team, Confluence space) and dispatches each item through the right lifecycle command. Designed as the cron target for unattended runs. |
82
+ | `/lisa:intake-explain <item-ref>` | Read-only per-item diagnosis for PRD or build work. Reports the lifecycle role, verdict, decisive intake or repair gate, and smallest next action before an operator chooses `/lisa:intake`, `/lisa:repair-intake`, blocker cleanup, decomposition, or product follow-up. |
82
83
  | `/lisa:queue-status [queue=prd|queue=build]` | Read-only queue inspection for the current repo. Distinguishes idle vs misconfigured queues, highlights the most actionable item, and points operators to `/lisa:intake`, `/lisa:repair-intake`, `/lisa:automation-status`, or `/lisa:verify-prd`. |
83
84
  | `/lisa:repair-intake <queue-url>` | Read/write recovery scan for blocked, stale, or inconsistent queue state when normal intake is not the right next move. |
84
85
  | `/lisa:automation-status` | Read-only inspection of the repo's expected Lisa automation fleet so operators can distinguish empty queues from stale, drifted, or failing scheduler jobs. |
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Sum nullable decimal amounts using scaled integer math.
3
+ *
4
+ * @param values Decimal values to aggregate.
5
+ * @returns The decimal sum of present values, or null when all are missing.
6
+ */
7
+ export declare function sumNullableDecimals(values: readonly (number | null)[]): number | null;
8
+ //# sourceMappingURL=decimal-sum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimal-sum.d.ts","sourceRoot":"","sources":["../../src/utils/decimal-sum.ts"],"names":[],"mappings":"AA6CA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GACjC,MAAM,GAAG,IAAI,CA6Bf"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Render a finite number in plain decimal notation for BigInt scaling.
3
+ *
4
+ * @param value Finite number to normalize.
5
+ * @returns A plain decimal string without exponent notation.
6
+ */
7
+ function renderPlainDecimal(value) {
8
+ const rendered = String(value);
9
+ if (!rendered.includes("e") && !rendered.includes("E")) {
10
+ return rendered;
11
+ }
12
+ const [mantissa = "0", exponentPart = "0"] = rendered
13
+ .toLowerCase()
14
+ .split("e");
15
+ const exponent = Number(exponentPart);
16
+ const negative = mantissa.startsWith("-");
17
+ const unsigned = negative ? mantissa.slice(1) : mantissa;
18
+ const [whole = "0", fractional = ""] = unsigned.split(".");
19
+ const digits = `${whole}${fractional}`;
20
+ const decimalIndex = whole.length + exponent;
21
+ const plain = decimalIndex <= 0
22
+ ? `0.${"0".repeat(Math.abs(decimalIndex))}${digits}`
23
+ : decimalIndex >= digits.length
24
+ ? `${digits}${"0".repeat(decimalIndex - digits.length)}`
25
+ : `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`;
26
+ return negative ? `-${plain}` : plain;
27
+ }
28
+ /**
29
+ * Remove insignificant trailing zeros from a fractional decimal string.
30
+ *
31
+ * @param value Fractional decimal digits.
32
+ * @returns Fractional digits with redundant right-side zeros removed.
33
+ */
34
+ function trimTrailingZeros(value) {
35
+ const end = [...value].reduce((lastNonZero, digit, index) => (digit === "0" ? lastNonZero : index + 1), 0);
36
+ return value.slice(0, end);
37
+ }
38
+ /**
39
+ * Sum nullable decimal amounts using scaled integer math.
40
+ *
41
+ * @param values Decimal values to aggregate.
42
+ * @returns The decimal sum of present values, or null when all are missing.
43
+ */
44
+ export function sumNullableDecimals(values) {
45
+ const present = values.filter((value) => value !== null);
46
+ if (present.length === 0) {
47
+ return null;
48
+ }
49
+ const decimals = present.map(value => renderPlainDecimal(value));
50
+ const scale = Math.max(...decimals.map(decimal => decimal.split(".")[1]?.length ?? 0));
51
+ const factor = 10n ** BigInt(scale);
52
+ const total = decimals.reduce((sum, decimal) => {
53
+ const negative = decimal.startsWith("-");
54
+ const unsigned = negative ? decimal.slice(1) : decimal;
55
+ const [whole = "0", fractional = ""] = unsigned.split(".");
56
+ const units = BigInt(`${whole}${fractional.padEnd(scale, "0")}` || "0");
57
+ return negative ? sum - units : sum + units;
58
+ }, 0n);
59
+ const negative = total < 0n;
60
+ const absolute = negative ? -total : total;
61
+ const whole = absolute / factor;
62
+ const fractional = scale === 0 ? "" : String(absolute % factor).padStart(scale, "0");
63
+ const rendered = scale === 0
64
+ ? String(whole)
65
+ : `${whole}.${trimTrailingZeros(fractional) || "0"}`;
66
+ return Number(negative ? `-${rendered}` : rendered);
67
+ }
68
+ //# sourceMappingURL=decimal-sum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimal-sum.js","sourceRoot":"","sources":["../../src/utils/decimal-sum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,KAAa;IACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,CAAC,GAAG,QAAQ;SAClD,WAAW,EAAE;SACb,KAAK,CAAC,GAAG,CAAC,CAAC;IACd,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,CAA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eAAe,GAAG,IAAI,GACtC,eAAe,CAiCjB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAE1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,MAAM,EAAE,eAAe,CAAC;CACzB,GAAG,MAAM,CAsBT;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,GACf,sBAAsB,CAwCxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE;IACL,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACjC,GACA,MAAM,CAsBR"}
@@ -1,3 +1,4 @@
1
+ import { sumNullableDecimals } from "./decimal-sum.js";
1
2
  export const LISA_USAGE_HEADING = "## Lisa Usage";
2
3
  const ENTRY_PATTERN = /<!-- lisa:usage-entry entry_id=(\S+) flow=(\S+) run_id=(\S+) provider=(\S+) model=(\S+) source=(\S+) input_tokens=(\S+) cached_input_tokens=(\S+) output_tokens=(\S+) reasoning_tokens=(\S+) total_tokens=(\S+) cost=(\S+) currency=(\S+) pricing_status=(\S+) pricing_source=(\S+) artifact_ref=(\S+) parent_artifact_ref=(\S*) -->/g;
3
4
  const ROLLUP_PATTERN = /<!-- lisa:usage-rollup direct_entry_ids=(\S*) child_entry_ids=(\S*) child_refs=(\S*) direct_tokens=(\S+) child_tokens=(\S+) total_tokens=(\S+) direct_cost=(\S+) child_cost=(\S+) total_cost=(\S+) currency=(\S+) -->/;
@@ -12,7 +13,10 @@ function parseNullableNumber(value) {
12
13
  return null;
13
14
  }
14
15
  const parsed = Number(value);
15
- return Number.isFinite(parsed) ? parsed : null;
16
+ if (!Number.isFinite(parsed)) {
17
+ throw new Error(`Invalid Lisa usage numeric token: ${value}`);
18
+ }
19
+ return parsed;
16
20
  }
17
21
  /**
18
22
  * Parse a nullable string token field.
@@ -24,7 +28,31 @@ function parseNullableString(value) {
24
28
  if (value === "null" || value.length === 0) {
25
29
  return null;
26
30
  }
27
- return value;
31
+ return decodeTokenValue(value);
32
+ }
33
+ /**
34
+ * Decode a percent-encoded token field.
35
+ *
36
+ * @param value Serialized token field.
37
+ * @returns The decoded token value, or the original value for legacy tokens.
38
+ */
39
+ function decodeTokenValue(value) {
40
+ try {
41
+ return decodeURIComponent(value);
42
+ }
43
+ catch {
44
+ return value;
45
+ }
46
+ }
47
+ /**
48
+ * Serialize a token field so whitespace, delimiters, and HTML comment endings
49
+ * cannot corrupt the machine-readable comment on the next parse.
50
+ *
51
+ * @param value String token value to render.
52
+ * @returns The percent-encoded token value.
53
+ */
54
+ function encodeTokenValue(value) {
55
+ return encodeURIComponent(value);
28
56
  }
29
57
  /**
30
58
  * Serialize a nullable token field.
@@ -33,7 +61,10 @@ function parseNullableString(value) {
33
61
  * @returns The canonical string form used inside usage tokens.
34
62
  */
35
63
  function renderNullable(value) {
36
- return value === null ? "null" : String(value);
64
+ if (value === null) {
65
+ return "null";
66
+ }
67
+ return typeof value === "number" ? String(value) : encodeTokenValue(value);
37
68
  }
38
69
  /**
39
70
  * Parse a comma-separated token field into stable document order.
@@ -45,7 +76,17 @@ function parseCsv(value) {
45
76
  if (value.length === 0) {
46
77
  return [];
47
78
  }
48
- return value.split(",");
79
+ return value.split(",").map(decodeTokenValue);
80
+ }
81
+ /**
82
+ * Serialize a list as a comma-delimited token field with each item encoded
83
+ * independently, so commas inside item values are preserved.
84
+ *
85
+ * @param values String values to serialize.
86
+ * @returns Encoded comma-delimited list.
87
+ */
88
+ function renderCsv(values) {
89
+ return values.map(encodeTokenValue).join(",");
49
90
  }
50
91
  /**
51
92
  * Sum nullable numeric values while preserving null when nothing was recorded.
@@ -148,7 +189,7 @@ export function mergeLisaUsageEntries(existingEntries, nextEntries) {
148
189
  export function createLisaUsageRollup(entries, previousRollup) {
149
190
  const directEntryIds = entries.map(entry => entry.entryId);
150
191
  const directTokens = sumNullable(entries.map(entry => entry.totalTokens));
151
- const directCost = sumNullable(entries.map(entry => entry.cost));
192
+ const directCost = sumNullableDecimals(entries.map(entry => entry.cost));
152
193
  const childEntryIds = previousRollup?.childEntryIds ?? [];
153
194
  const childRefs = previousRollup?.childRefs ?? [];
154
195
  const childTokens = previousRollup ? previousRollup.childTokens : null;
@@ -158,7 +199,7 @@ export function createLisaUsageRollup(entries, previousRollup) {
158
199
  : (directTokens ?? 0) + (childTokens ?? 0);
159
200
  const totalCost = directCost === null && childCost === null
160
201
  ? null
161
- : (directCost ?? 0) + (childCost ?? 0);
202
+ : sumNullableDecimals([directCost, childCost]);
162
203
  const currency = entries.find(entry => entry.currency !== null)?.currency ??
163
204
  previousRollup?.currency ??
164
205
  null;
@@ -182,7 +223,7 @@ export function createLisaUsageRollup(entries, previousRollup) {
182
223
  * @returns The canonical `lisa:usage-entry` token line.
183
224
  */
184
225
  export function renderLisaUsageEntryToken(entry) {
185
- return `<!-- lisa:usage-entry entry_id=${entry.entryId} flow=${entry.flow} run_id=${entry.runId} provider=${entry.provider} model=${entry.model} source=${entry.source} input_tokens=${renderNullable(entry.inputTokens)} cached_input_tokens=${renderNullable(entry.cachedInputTokens)} output_tokens=${renderNullable(entry.outputTokens)} reasoning_tokens=${renderNullable(entry.reasoningTokens)} total_tokens=${renderNullable(entry.totalTokens)} cost=${renderNullable(entry.cost)} currency=${renderNullable(entry.currency)} pricing_status=${entry.pricingStatus} pricing_source=${renderNullable(entry.pricingSource)} artifact_ref=${entry.artifactRef} parent_artifact_ref=${entry.parentArtifactRef ?? ""} -->`;
226
+ return `<!-- lisa:usage-entry entry_id=${encodeTokenValue(entry.entryId)} flow=${encodeTokenValue(entry.flow)} run_id=${encodeTokenValue(entry.runId)} provider=${encodeTokenValue(entry.provider)} model=${encodeTokenValue(entry.model)} source=${encodeTokenValue(entry.source)} input_tokens=${renderNullable(entry.inputTokens)} cached_input_tokens=${renderNullable(entry.cachedInputTokens)} output_tokens=${renderNullable(entry.outputTokens)} reasoning_tokens=${renderNullable(entry.reasoningTokens)} total_tokens=${renderNullable(entry.totalTokens)} cost=${renderNullable(entry.cost)} currency=${renderNullable(entry.currency)} pricing_status=${encodeTokenValue(entry.pricingStatus)} pricing_source=${renderNullable(entry.pricingSource)} artifact_ref=${encodeTokenValue(entry.artifactRef)} parent_artifact_ref=${entry.parentArtifactRef === null ? "" : encodeTokenValue(entry.parentArtifactRef)} -->`;
186
227
  }
187
228
  /**
188
229
  * Render the machine-readable rollup token for a managed usage section.
@@ -191,7 +232,7 @@ export function renderLisaUsageEntryToken(entry) {
191
232
  * @returns The canonical `lisa:usage-rollup` token line.
192
233
  */
193
234
  export function renderLisaUsageRollupToken(rollup) {
194
- return `<!-- lisa:usage-rollup direct_entry_ids=${rollup.directEntryIds.join(",")} child_entry_ids=${rollup.childEntryIds.join(",")} child_refs=${rollup.childRefs.join(",")} direct_tokens=${renderNullable(rollup.directTokens)} child_tokens=${renderNullable(rollup.childTokens)} total_tokens=${renderNullable(rollup.totalTokens)} direct_cost=${renderNullable(rollup.directCost)} child_cost=${renderNullable(rollup.childCost)} total_cost=${renderNullable(rollup.totalCost)} currency=${renderNullable(rollup.currency)} -->`;
235
+ return `<!-- lisa:usage-rollup direct_entry_ids=${renderCsv(rollup.directEntryIds)} child_entry_ids=${renderCsv(rollup.childEntryIds)} child_refs=${renderCsv(rollup.childRefs)} direct_tokens=${renderNullable(rollup.directTokens)} child_tokens=${renderNullable(rollup.childTokens)} total_tokens=${renderNullable(rollup.totalTokens)} direct_cost=${renderNullable(rollup.directCost)} child_cost=${renderNullable(rollup.childCost)} total_cost=${renderNullable(rollup.totalCost)} currency=${renderNullable(rollup.currency)} -->`;
195
236
  }
196
237
  /**
197
238
  * Render the canonical `## Lisa Usage` section body from direct entries and a
@@ -230,12 +271,12 @@ export function parseLisaUsageSection(document) {
230
271
  const range = findUsageSectionRange(document);
231
272
  const section = range ? document.slice(range.start, range.end) : "";
232
273
  const entries = Array.from(section.matchAll(ENTRY_PATTERN), match => ({
233
- entryId: match[1] ?? "",
234
- flow: match[2] ?? "",
235
- runId: match[3] ?? "",
236
- provider: match[4] ?? "",
237
- model: match[5] ?? "",
238
- source: match[6] ?? "",
274
+ entryId: decodeTokenValue(match[1] ?? ""),
275
+ flow: decodeTokenValue(match[2] ?? ""),
276
+ runId: decodeTokenValue(match[3] ?? ""),
277
+ provider: decodeTokenValue(match[4] ?? ""),
278
+ model: decodeTokenValue(match[5] ?? ""),
279
+ source: decodeTokenValue(match[6] ?? ""),
239
280
  inputTokens: parseNullableNumber(match[7] ?? ""),
240
281
  cachedInputTokens: parseNullableNumber(match[8] ?? ""),
241
282
  outputTokens: parseNullableNumber(match[9] ?? ""),
@@ -243,9 +284,9 @@ export function parseLisaUsageSection(document) {
243
284
  totalTokens: parseNullableNumber(match[11] ?? ""),
244
285
  cost: parseNullableNumber(match[12] ?? ""),
245
286
  currency: parseNullableString(match[13] ?? ""),
246
- pricingStatus: match[14] ?? "",
287
+ pricingStatus: decodeTokenValue(match[14] ?? ""),
247
288
  pricingSource: parseNullableString(match[15] ?? ""),
248
- artifactRef: match[16] ?? "",
289
+ artifactRef: decodeTokenValue(match[16] ?? ""),
249
290
  parentArtifactRef: parseNullableString(match[17] ?? ""),
250
291
  }));
251
292
  const rollupMatch = ROLLUP_PATTERN.exec(section);
@@ -278,7 +319,9 @@ export function parseLisaUsageSection(document) {
278
319
  export function upsertLisaUsageSection(document, input) {
279
320
  const parsed = parseLisaUsageSection(document);
280
321
  const mergedEntries = mergeLisaUsageEntries(parsed.entries, input.entries);
281
- const rollup = input.rollup ?? createLisaUsageRollup(mergedEntries, parsed.rollup);
322
+ const rollup = mergedEntries.length === 0 && input.rollup
323
+ ? input.rollup
324
+ : createLisaUsageRollup(mergedEntries, input.rollup ?? parsed.rollup);
282
325
  const usageSection = renderLisaUsageSection({
283
326
  entries: mergedEntries,
284
327
  rollup,
@@ -1 +1 @@
1
- {"version":3,"file":"usage-accounting.js","sourceRoot":"","sources":["../../src/utils/usage-accounting.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAkDlD,MAAM,aAAa,GACjB,uUAAuU,CAAC;AAE1U,MAAM,cAAc,GAClB,uNAAuN,CAAC;AAE1N;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAA6B;IACnD,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,SAAS,QAAQ,CAAC,KAAa;IAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1B,CAA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AAC;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,CAAC,CAAC,CAAC,GAAG,YAAY,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,YAAY,IAAI,CAAC;IACvE,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,GAAG,MAAM,OAAO,YAAY,IAAI,CAAC;IAC1C,CAAC;IAED,OAAO,GAAG,MAAM,OAAO,YAAY,OAAO,KAAK,IAAI,CAAC;AACtD,CAAC"}
package/package.json CHANGED
@@ -82,7 +82,7 @@
82
82
  "lodash": ">=4.18.1"
83
83
  },
84
84
  "name": "@codyswann/lisa",
85
- "version": "2.100.1",
85
+ "version": "2.100.2",
86
86
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
87
87
  "main": "dist/index.js",
88
88
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
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": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -11,4 +11,21 @@ Common operator usage:
11
11
  - `/lisa:intake-explain PRD-456`
12
12
  - `/lisa:intake-explain https://linear.app/acme/issue/ENG-123/example`
13
13
 
14
- This surface is read-only in v1. Use it when you need a deterministic explanation for why one item is moving, waiting, blocked, skipped, or ignored before deciding whether to run `/lisa:intake`, `/lisa:repair-intake`, `/lisa:queue-status`, or a tracker-native fix.
14
+ The diagnosis uses stable verdicts:
15
+
16
+ - `ELIGIBLE_FOR_INTAKE`: run `/lisa:intake <queue>` when normal pickup is the next move.
17
+ - `ELIGIBLE_FOR_REPAIR`: run `/lisa:repair-intake <queue>` when Lisa-owned stuck work is actionable.
18
+ - `WAITING_ON_STALENESS`: wait and re-check after the configured freshness window.
19
+ - `HELD_BY_BLOCKERS`: clear the listed dependency or blocker before rerunning intake.
20
+ - `NON_LEAF_CONTAINER`: decompose the item or move build-ready status to leaf work.
21
+ - `PRODUCT_OWNED_STATE`: finish product clarification, promotion, or verification first.
22
+ - `MISCONFIGURED`: fix lifecycle labels, repo scope, or queue configuration before relying on automation.
23
+
24
+ Use it for these operator workflows:
25
+
26
+ - Intake triage: confirm whether one item would be picked up by `/lisa:intake` right now.
27
+ - Repair triage: decide whether a blocked or in-progress item is stale enough for `/lisa:repair-intake`.
28
+ - Product follow-up: distinguish product-owned draft/shipped/verified states from Lisa-owned work.
29
+ - Queue cleanup: identify leaf-only, repo-scope, dependency, or lifecycle-adoption fixes without mutating the item.
30
+
31
+ This surface is read-only in v1. It never claims, relabels, comments on, repairs, or decomposes the item; it only reports the item facts, verdict, decisive gate, and smallest useful next action before an operator chooses `/lisa:intake`, `/lisa:repair-intake`, `/lisa:queue-status`, or a tracker-native fix.
@@ -73,7 +73,7 @@ Every visible direct entry row ends with exactly one machine-readable token:
73
73
  <!-- lisa:usage-entry entry_id=<id> flow=<flow> run_id=<run-id> provider=<provider> model=<model> source=<source> input_tokens=<n|null> cached_input_tokens=<n|null> output_tokens=<n|null> reasoning_tokens=<n|null> total_tokens=<n|null> cost=<decimal|null> currency=<code|null> pricing_status=<status> pricing_source=<ref|null> artifact_ref=<ref> parent_artifact_ref=<ref-or-empty> -->
74
74
  ```
75
75
 
76
- Field order is fixed. A reader parses the usage ledger by matching `<!-- lisa:usage-entry ` lines only; it never needs to scrape prose or table cell positions.
76
+ Field order is fixed. A reader parses the usage ledger by matching `<!-- lisa:usage-entry ` lines only; it never needs to scrape prose or table cell positions. String fields are percent-encoded before rendering and decoded after parsing, so whitespace, commas, and HTML comment terminators inside source values cannot split or truncate the token.
77
77
 
78
78
  Every managed section also ends with exactly one rollup token:
79
79
 
@@ -86,7 +86,7 @@ Every managed section also ends with exactly one rollup token:
86
86
  - `child_refs` enumerates the child artifacts consulted for the rollup.
87
87
  - `total_*` fields equal direct plus child totals over the deduped entry set.
88
88
 
89
- The rollup token is the machine-readable summary. The visible rollup table mirrors it for humans.
89
+ The rollup token is the machine-readable summary. The visible rollup table mirrors it for humans. List fields are comma-delimited after encoding each item independently; commas inside an item are encoded as data, not treated as separators.
90
90
 
91
91
  ## Visible rendering contract
92
92
 
@@ -21,7 +21,7 @@ const CLAUDE_ACTIVE_STATUSES = new Set([
21
21
  const RUN_FAILURE_PATTERN =
22
22
  /\b(failed|failure|errored|error|exception|crash(?:ed)?)\b/i;
23
23
  const NEGATED_FAILURE_PATTERN =
24
- /\b(no|without)\s+(?:recent\s+)?fail(?:ure|ed)\b/i;
24
+ /\b(no|without)\s+(?:recent\s+)?(?:fail(?:ure|ed)|errors?|exceptions?)\b/i;
25
25
 
26
26
  /**
27
27
  * @typedef {import("./automation-status-expected-fleet.mjs").resolveExpectedAutomationFleet extends (...args: any[]) => infer T ? T : never} ExpectedFleet
@@ -20,7 +20,7 @@ const CODEx_RUNTIME_LABEL = "Codex automations";
20
20
  const RUN_FAILURE_PATTERN =
21
21
  /\b(failed|failure|errored|error|exception|crash(?:ed)?)\b/i;
22
22
  const NEGATED_FAILURE_PATTERN =
23
- /\b(no|without)\s+(?:recent\s+)?fail(?:ure|ed)\b/i;
23
+ /\b(no|without)\s+(?:recent\s+)?(?:fail(?:ure|ed)|errors?|exceptions?)\b/i;
24
24
 
25
25
  /**
26
26
  * @typedef {import("./automation-status-expected-fleet.mjs").resolveExpectedAutomationFleet extends (...args: any[]) => infer T ? T : never} ExpectedFleet
@@ -143,6 +143,31 @@ The explanation must stay aligned with existing Lisa rules:
143
143
  - If a claimed, in-review, or blocked item is not yet repairable, explain the relevant staleness or backoff condition at a human-readable level.
144
144
  - If the source lane, tracker lane, repo/project scope, or lifecycle namespace is unresolved, report `MISCONFIGURED` instead of pretending the item is idle or actionable.
145
145
 
146
+ ## Build item gate diagnosis
147
+
148
+ For build lifecycle items, run the same read-side checks that build intake runs before it would claim an issue. This is still a read-only explanation: if execution intake would stamp repo labels, split a cross-repo leaf, move a stale container from `ready` to `claimed`, or post a dependency-hold comment, intake-explain reports what intake would do but does not stamp, does not split, does not move labels, and does not comment.
149
+
150
+ Resolve the current repo using the same repo-scope contract as build intake: local config `repo`, then `.lisa.config.json` `github.repo`, then the git remote basename. Resolve the build lifecycle roles from `.lisa.config.json` `github.labels.build.*` with the usual defaults (`status:ready`, `status:in-progress`, `status:blocked`, `status:done`, plus any configured env-specific done labels). If those signals cannot be resolved, return `MISCONFIGURED`.
151
+
152
+ For GitHub build items, collect these reader signals before choosing a verdict:
153
+
154
+ - current build lifecycle role label and any conflicting `status:*` labels
155
+ - `repo:<current>` / `repo:<other>` labels, including whether the item is unlabeled for repo scope
156
+ - type labels such as `type:Epic`, `type:Story`, `type:Spike`, `type:Bug`, `type:Task`, `type:Sub-task`, and `type:Improvement`
157
+ - native GitHub sub-issues and their open/closed state
158
+ - body parentage used by `github-read-issue`, including task-list child references and `Parent: #123` style references
159
+ - explicit dependency holds from `Blocked by: #123`, comma-separated refs, `owner/repo#123`, and GitHub issue URLs
160
+ - blocker issue state and blocker status labels
161
+
162
+ Apply gate verdicts in the same order as build intake:
163
+
164
+ 1. **Repo-scope gate.** A build item carrying `repo:<other>` and not `repo:<current>` is outside this repo's pickup lane. Return `MISCONFIGURED` when repo scope is absent or contradictory enough that the current repo cannot be determined confidently; otherwise explain the repo-scope mismatch and recommend running intake in the target repo or fixing the `repo:<name>` label. For an unlabeled item whose target repo is obvious from the item body, report the inferred repo signal but stay read-only: execution intake would stamp `repo:<name>`, while intake-explain only says it would do so. A multi-repo leaf is not directly buildable; explain that execution intake would split it per `repo-scope-split`, but this read-only diagnosis does not split.
165
+ 2. **Leaf-only gate.** If the item has open child work from native GitHub sub-issues or body parentage, return `NON_LEAF_CONTAINER` and explain that direct build pickup is leaf-only per `leaf-only-lifecycle`. If it has no open children but carries a container type (`type:Epic`, `type:Story`, or `type:Spike`), also return `NON_LEAF_CONTAINER` because a childless container type still needs decomposition or reclassification. The next action is decomposition, moving `status:ready` to leaf children, or correcting the issue type. Execution build intake would move such a stale ready container out of the pickup queue; this read-only diagnosis must not perform that repair.
166
+ 3. **Dependency hold gate.** If a single-repo leaf for the current repo has explicit blockers, read each blocker. Closed blockers are clear. Open blockers are clear only when they carry a cleared build status such as `status:code-review`, `status:on-dev`, `status:on-stg`, `status:done`, or the configured done-equivalent labels. Open blockers with `status:ready`, `status:in-progress`, no cleared status label, or inaccessible state are active. Return `HELD_BY_BLOCKERS`, list the active blocker refs, and make the next action blocker resolution rather than `/lisa:intake`.
167
+ 4. **Ready leaf.** A build item in the configured ready role, scoped to the current repo, with no open child work and no active blockers returns `ELIGIBLE_FOR_INTAKE`. The `Why:` line should say it is a single-repo leaf for the current repo and that leaf-only, repo-scope, and dependency gates all pass.
168
+
169
+ Relevant `Signals:` should include the decisive context, not every field: for example `repo:lisa; type:Sub-task; no open children`, `open children #12/#13`, `repo:api but current repo is web`, or `active blockers CodySwannGT/lisa#123`.
170
+
146
171
  ## Rule explanation expectations
147
172
 
148
173
  The `Why:` line should name the decisive Lisa contract in plain English rather than only echoing a raw status label. Good explanations usually mention one of:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
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": "2.100.1",
3
+ "version": "2.100.2",
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-expo",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Expo and React Native-specific skills, agents, rules, and MCP servers.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.100.1",
3
+ "version": "2.100.2",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -11,4 +11,21 @@ Common operator usage:
11
11
  - `/lisa:intake-explain PRD-456`
12
12
  - `/lisa:intake-explain https://linear.app/acme/issue/ENG-123/example`
13
13
 
14
- This surface is read-only in v1. Use it when you need a deterministic explanation for why one item is moving, waiting, blocked, skipped, or ignored before deciding whether to run `/lisa:intake`, `/lisa:repair-intake`, `/lisa:queue-status`, or a tracker-native fix.
14
+ The diagnosis uses stable verdicts:
15
+
16
+ - `ELIGIBLE_FOR_INTAKE`: run `/lisa:intake <queue>` when normal pickup is the next move.
17
+ - `ELIGIBLE_FOR_REPAIR`: run `/lisa:repair-intake <queue>` when Lisa-owned stuck work is actionable.
18
+ - `WAITING_ON_STALENESS`: wait and re-check after the configured freshness window.
19
+ - `HELD_BY_BLOCKERS`: clear the listed dependency or blocker before rerunning intake.
20
+ - `NON_LEAF_CONTAINER`: decompose the item or move build-ready status to leaf work.
21
+ - `PRODUCT_OWNED_STATE`: finish product clarification, promotion, or verification first.
22
+ - `MISCONFIGURED`: fix lifecycle labels, repo scope, or queue configuration before relying on automation.
23
+
24
+ Use it for these operator workflows:
25
+
26
+ - Intake triage: confirm whether one item would be picked up by `/lisa:intake` right now.
27
+ - Repair triage: decide whether a blocked or in-progress item is stale enough for `/lisa:repair-intake`.
28
+ - Product follow-up: distinguish product-owned draft/shipped/verified states from Lisa-owned work.
29
+ - Queue cleanup: identify leaf-only, repo-scope, dependency, or lifecycle-adoption fixes without mutating the item.
30
+
31
+ This surface is read-only in v1. It never claims, relabels, comments on, repairs, or decomposes the item; it only reports the item facts, verdict, decisive gate, and smallest useful next action before an operator chooses `/lisa:intake`, `/lisa:repair-intake`, `/lisa:queue-status`, or a tracker-native fix.
@@ -73,7 +73,7 @@ Every visible direct entry row ends with exactly one machine-readable token:
73
73
  <!-- lisa:usage-entry entry_id=<id> flow=<flow> run_id=<run-id> provider=<provider> model=<model> source=<source> input_tokens=<n|null> cached_input_tokens=<n|null> output_tokens=<n|null> reasoning_tokens=<n|null> total_tokens=<n|null> cost=<decimal|null> currency=<code|null> pricing_status=<status> pricing_source=<ref|null> artifact_ref=<ref> parent_artifact_ref=<ref-or-empty> -->
74
74
  ```
75
75
 
76
- Field order is fixed. A reader parses the usage ledger by matching `<!-- lisa:usage-entry ` lines only; it never needs to scrape prose or table cell positions.
76
+ Field order is fixed. A reader parses the usage ledger by matching `<!-- lisa:usage-entry ` lines only; it never needs to scrape prose or table cell positions. String fields are percent-encoded before rendering and decoded after parsing, so whitespace, commas, and HTML comment terminators inside source values cannot split or truncate the token.
77
77
 
78
78
  Every managed section also ends with exactly one rollup token:
79
79
 
@@ -86,7 +86,7 @@ Every managed section also ends with exactly one rollup token:
86
86
  - `child_refs` enumerates the child artifacts consulted for the rollup.
87
87
  - `total_*` fields equal direct plus child totals over the deduped entry set.
88
88
 
89
- The rollup token is the machine-readable summary. The visible rollup table mirrors it for humans.
89
+ The rollup token is the machine-readable summary. The visible rollup table mirrors it for humans. List fields are comma-delimited after encoding each item independently; commas inside an item are encoded as data, not treated as separators.
90
90
 
91
91
  ## Visible rendering contract
92
92
 
@@ -21,7 +21,7 @@ const CLAUDE_ACTIVE_STATUSES = new Set([
21
21
  const RUN_FAILURE_PATTERN =
22
22
  /\b(failed|failure|errored|error|exception|crash(?:ed)?)\b/i;
23
23
  const NEGATED_FAILURE_PATTERN =
24
- /\b(no|without)\s+(?:recent\s+)?fail(?:ure|ed)\b/i;
24
+ /\b(no|without)\s+(?:recent\s+)?(?:fail(?:ure|ed)|errors?|exceptions?)\b/i;
25
25
 
26
26
  /**
27
27
  * @typedef {import("./automation-status-expected-fleet.mjs").resolveExpectedAutomationFleet extends (...args: any[]) => infer T ? T : never} ExpectedFleet
@@ -20,7 +20,7 @@ const CODEx_RUNTIME_LABEL = "Codex automations";
20
20
  const RUN_FAILURE_PATTERN =
21
21
  /\b(failed|failure|errored|error|exception|crash(?:ed)?)\b/i;
22
22
  const NEGATED_FAILURE_PATTERN =
23
- /\b(no|without)\s+(?:recent\s+)?fail(?:ure|ed)\b/i;
23
+ /\b(no|without)\s+(?:recent\s+)?(?:fail(?:ure|ed)|errors?|exceptions?)\b/i;
24
24
 
25
25
  /**
26
26
  * @typedef {import("./automation-status-expected-fleet.mjs").resolveExpectedAutomationFleet extends (...args: any[]) => infer T ? T : never} ExpectedFleet
@@ -143,6 +143,31 @@ The explanation must stay aligned with existing Lisa rules:
143
143
  - If a claimed, in-review, or blocked item is not yet repairable, explain the relevant staleness or backoff condition at a human-readable level.
144
144
  - If the source lane, tracker lane, repo/project scope, or lifecycle namespace is unresolved, report `MISCONFIGURED` instead of pretending the item is idle or actionable.
145
145
 
146
+ ## Build item gate diagnosis
147
+
148
+ For build lifecycle items, run the same read-side checks that build intake runs before it would claim an issue. This is still a read-only explanation: if execution intake would stamp repo labels, split a cross-repo leaf, move a stale container from `ready` to `claimed`, or post a dependency-hold comment, intake-explain reports what intake would do but does not stamp, does not split, does not move labels, and does not comment.
149
+
150
+ Resolve the current repo using the same repo-scope contract as build intake: local config `repo`, then `.lisa.config.json` `github.repo`, then the git remote basename. Resolve the build lifecycle roles from `.lisa.config.json` `github.labels.build.*` with the usual defaults (`status:ready`, `status:in-progress`, `status:blocked`, `status:done`, plus any configured env-specific done labels). If those signals cannot be resolved, return `MISCONFIGURED`.
151
+
152
+ For GitHub build items, collect these reader signals before choosing a verdict:
153
+
154
+ - current build lifecycle role label and any conflicting `status:*` labels
155
+ - `repo:<current>` / `repo:<other>` labels, including whether the item is unlabeled for repo scope
156
+ - type labels such as `type:Epic`, `type:Story`, `type:Spike`, `type:Bug`, `type:Task`, `type:Sub-task`, and `type:Improvement`
157
+ - native GitHub sub-issues and their open/closed state
158
+ - body parentage used by `github-read-issue`, including task-list child references and `Parent: #123` style references
159
+ - explicit dependency holds from `Blocked by: #123`, comma-separated refs, `owner/repo#123`, and GitHub issue URLs
160
+ - blocker issue state and blocker status labels
161
+
162
+ Apply gate verdicts in the same order as build intake:
163
+
164
+ 1. **Repo-scope gate.** A build item carrying `repo:<other>` and not `repo:<current>` is outside this repo's pickup lane. Return `MISCONFIGURED` when repo scope is absent or contradictory enough that the current repo cannot be determined confidently; otherwise explain the repo-scope mismatch and recommend running intake in the target repo or fixing the `repo:<name>` label. For an unlabeled item whose target repo is obvious from the item body, report the inferred repo signal but stay read-only: execution intake would stamp `repo:<name>`, while intake-explain only says it would do so. A multi-repo leaf is not directly buildable; explain that execution intake would split it per `repo-scope-split`, but this read-only diagnosis does not split.
165
+ 2. **Leaf-only gate.** If the item has open child work from native GitHub sub-issues or body parentage, return `NON_LEAF_CONTAINER` and explain that direct build pickup is leaf-only per `leaf-only-lifecycle`. If it has no open children but carries a container type (`type:Epic`, `type:Story`, or `type:Spike`), also return `NON_LEAF_CONTAINER` because a childless container type still needs decomposition or reclassification. The next action is decomposition, moving `status:ready` to leaf children, or correcting the issue type. Execution build intake would move such a stale ready container out of the pickup queue; this read-only diagnosis must not perform that repair.
166
+ 3. **Dependency hold gate.** If a single-repo leaf for the current repo has explicit blockers, read each blocker. Closed blockers are clear. Open blockers are clear only when they carry a cleared build status such as `status:code-review`, `status:on-dev`, `status:on-stg`, `status:done`, or the configured done-equivalent labels. Open blockers with `status:ready`, `status:in-progress`, no cleared status label, or inaccessible state are active. Return `HELD_BY_BLOCKERS`, list the active blocker refs, and make the next action blocker resolution rather than `/lisa:intake`.
167
+ 4. **Ready leaf.** A build item in the configured ready role, scoped to the current repo, with no open child work and no active blockers returns `ELIGIBLE_FOR_INTAKE`. The `Why:` line should say it is a single-repo leaf for the current repo and that leaf-only, repo-scope, and dependency gates all pass.
168
+
169
+ Relevant `Signals:` should include the decisive context, not every field: for example `repo:lisa; type:Sub-task; no open children`, `open children #12/#13`, `repo:api but current repo is web`, or `active blockers CodySwannGT/lisa#123`.
170
+
146
171
  ## Rule explanation expectations
147
172
 
148
173
  The `Why:` line should name the decisive Lisa contract in plain English rather than only echoing a raw status label. Good explanations usually mention one of: