@codyswann/lisa 4.84.7 → 4.84.8

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 (150) hide show
  1. package/all/copy-overwrite/scripts/lib/completion-authorization.mjs +282 -0
  2. package/all/copy-overwrite/scripts/lib/completion-proof-adapters.mjs +213 -0
  3. package/all/copy-overwrite/scripts/lib/completion-proof-conformance.mjs +115 -0
  4. package/all/copy-overwrite/scripts/lib/completion-proof-content.mjs +408 -0
  5. package/all/copy-overwrite/scripts/lib/completion-proof-errors.mjs +16 -0
  6. package/all/copy-overwrite/scripts/lib/completion-proof-github.mjs +233 -0
  7. package/all/copy-overwrite/scripts/lib/completion-proof-markdown.mjs +70 -0
  8. package/all/copy-overwrite/scripts/lib/completion-proof-projection.mjs +169 -0
  9. package/all/copy-overwrite/scripts/lib/completion-proof-publisher.mjs +238 -0
  10. package/all/copy-overwrite/scripts/lib/completion-proof-reader.mjs +175 -0
  11. package/all/copy-overwrite/scripts/lib/completion-proof-shape.mjs +374 -0
  12. package/all/copy-overwrite/scripts/lib/completion-proof-source.mjs +174 -0
  13. package/all/copy-overwrite/scripts/lib/history-secret-scanner.mjs +20 -5
  14. package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +15 -0
  15. package/all/copy-overwrite/scripts/lib/usage-effectiveness.d.mts +27 -0
  16. package/all/copy-overwrite/scripts/lib/usage-effectiveness.mjs +156 -0
  17. package/all/copy-overwrite/scripts/lib/usage-ledger-integrity.d.mts +8 -0
  18. package/all/copy-overwrite/scripts/lib/usage-ledger-integrity.mjs +141 -0
  19. package/all/copy-overwrite/scripts/lib/usage-ledger.d.mts +89 -0
  20. package/all/copy-overwrite/scripts/lib/usage-ledger.mjs +206 -0
  21. package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +3 -1
  22. package/all/copy-overwrite/scripts/lisa-work-item.mjs +255 -39
  23. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +141 -3
  24. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  25. package/dist/core/lisa-owned-hash-ledger.js +186 -0
  26. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  27. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  28. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  29. package/dist/core/upstream-evidence-manifest.js +101 -12
  30. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  31. package/dist/opencode/plugin-templates/parity-safety-net.sh +3 -1
  32. package/dist/utils/effectiveness.d.ts +4 -41
  33. package/dist/utils/effectiveness.d.ts.map +1 -1
  34. package/dist/utils/effectiveness.js +2 -126
  35. package/dist/utils/effectiveness.js.map +1 -1
  36. package/dist/utils/usage-accounting.d.ts +5 -100
  37. package/dist/utils/usage-accounting.d.ts.map +1 -1
  38. package/dist/utils/usage-accounting.js +4 -287
  39. package/dist/utils/usage-accounting.js.map +1 -1
  40. package/package.json +4 -4
  41. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa/.codex-plugin/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  44. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-evidence/SKILL.md +7 -1
  45. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  46. package/plugins/lisa/hooks/parity-safety-net.sh +3 -1
  47. package/plugins/lisa/rules/eager/00-rule-index.md +1 -0
  48. package/plugins/lisa/rules/reference/completion-authorization.md +10 -0
  49. package/plugins/lisa/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  50. package/plugins/lisa/skills/lisa-tracker-evidence/SKILL.md +7 -1
  51. package/plugins/lisa/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  52. package/plugins/lisa-agy/hooks/parity-safety-net.sh +3 -1
  53. package/plugins/lisa-agy/plugin.json +1 -1
  54. package/plugins/lisa-agy/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  55. package/plugins/lisa-agy/skills/lisa-tracker-evidence/SKILL.md +7 -1
  56. package/plugins/lisa-agy/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  57. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  60. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  64. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-copilot/hooks/parity-safety-net.sh +3 -1
  66. package/plugins/lisa-copilot/rules/eager/00-rule-index.md +1 -0
  67. package/plugins/lisa-copilot/rules/reference/completion-authorization.md +10 -0
  68. package/plugins/lisa-copilot/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  69. package/plugins/lisa-copilot/skills/lisa-tracker-evidence/SKILL.md +7 -1
  70. package/plugins/lisa-copilot/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  71. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-cursor/hooks/parity-safety-net.sh +3 -1
  73. package/plugins/lisa-cursor/rules/00-rule-index.mdc +1 -0
  74. package/plugins/lisa-cursor/rules/completion-authorization-reference.mdc +15 -0
  75. package/plugins/lisa-cursor/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  76. package/plugins/lisa-cursor/skills/lisa-tracker-evidence/SKILL.md +7 -1
  77. package/plugins/lisa-cursor/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  78. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  80. package/plugins/lisa-devin/hooks/parity-safety-net.sh +3 -1
  81. package/plugins/lisa-devin/rules/eager/00-rule-index.md +1 -0
  82. package/plugins/lisa-devin/rules/reference/completion-authorization.md +10 -0
  83. package/plugins/lisa-devin/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  84. package/plugins/lisa-devin/skills/lisa-tracker-evidence/SKILL.md +7 -1
  85. package/plugins/lisa-devin/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  86. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  88. package/plugins/lisa-expo-agy/plugin.json +1 -1
  89. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  93. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  96. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  100. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  103. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  107. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  109. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  110. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  111. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  114. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  115. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  116. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  117. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  120. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  121. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  123. package/plugins/lisa-rails-agy/plugin.json +1 -1
  124. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  125. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  126. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  127. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  128. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  129. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  130. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  131. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  132. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  135. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  136. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  137. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  138. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  139. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  141. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  142. package/plugins/src/base/hooks/parity-safety-net.sh +3 -1
  143. package/plugins/src/base/rules/eager/00-rule-index.md +1 -0
  144. package/plugins/src/base/rules/reference/completion-authorization.md +10 -0
  145. package/plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md +15 -1
  146. package/plugins/src/base/skills/lisa-tracker-evidence/SKILL.md +7 -1
  147. package/plugins/src/base/skills/lisa-tracker-evidence/references/completion-authorization.md +193 -0
  148. package/scripts/two-channel-couplings.json +2 -2
  149. package/typescript/copy-overwrite/.prettierignore +15 -0
  150. package/typescript/copy-overwrite/scripts/check-skipped-required-checks.mjs +32 -0
@@ -1,68 +1,11 @@
1
+ import { LISA_USAGE_HEADING, parseLisaUsageSection, } from "../../all/copy-overwrite/scripts/lib/usage-ledger.mjs";
2
+ import { verifyLisaUsageSectionIntegrity } from "../../all/copy-overwrite/scripts/lib/usage-ledger-integrity.mjs";
3
+ export { LISA_USAGE_HEADING, parseLisaUsageSection, verifyLisaUsageSectionIntegrity, };
1
4
  /* eslint-disable max-lines -- Usage ledger parsing, rendering, and rollup helpers share one public utility surface. */
2
5
  import { collectLisaUsageChildArtifacts } from "./usage-accounting-rollup.js";
3
6
  import { sumNullableDecimals } from "./decimal-sum.js";
4
- import { parseEffectivenessTokens, renderEffectivenessToken, } from "./effectiveness.js";
5
- export const LISA_USAGE_HEADING = "## Lisa Usage";
6
- const ENTRY_TOKEN_PATTERN = /<!-- lisa:usage-entry [^\r\n]*? -->/g;
7
- const LEGACY_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*) -->$/;
8
- const RELEASED_MIDDLE_FIELD_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+) measured_subset_tokens=(\S+) cost=(\S+) currency=(\S+) pricing_status=(\S+) pricing_source=(\S+) artifact_ref=(\S+) parent_artifact_ref=(\S*) -->$/;
9
- const MEASURED_SUBSET_PATTERN = /<!-- lisa:usage-entry-measured-subset entry_id=(\S+) measured_subset_tokens=(\S+) -->/g;
10
- 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+)(?: child_currency=(\S+))? -->/;
11
- const ROLLUP_TOKEN_STATUS_PATTERN = /<!-- lisa:usage-rollup-token-status child_tokens_incomplete=true -->/;
7
+ import { renderEffectivenessToken } from "./effectiveness.js";
12
8
  const MIXED_CURRENCY = "mixed";
13
- /**
14
- * Parse a nullable numeric token field.
15
- *
16
- * @param value Serialized numeric token value.
17
- * @returns The parsed number or null when the token is empty.
18
- */
19
- function parseNullableNumber(value) {
20
- if (value === "null" || value.length === 0) {
21
- return null;
22
- }
23
- const parsed = Number(value);
24
- if (!Number.isFinite(parsed)) {
25
- throw new Error(`Invalid Lisa usage numeric token: ${value}`);
26
- }
27
- return parsed;
28
- }
29
- /**
30
- * Parse the additive field from the published 2.222.0 marker. Legacy callers
31
- * could serialize an omitted property as the literal `undefined`; no other
32
- * numeric field receives this compatibility exception.
33
- *
34
- * @param value Transitional measured-subset token value.
35
- * @returns The parsed subtotal, or null for the published undefined omission.
36
- */
37
- function parseReleasedMeasuredSubset(value) {
38
- return value === "undefined" ? null : parseNullableNumber(value);
39
- }
40
- /**
41
- * Parse a nullable string token field.
42
- *
43
- * @param value Serialized string token value.
44
- * @returns The parsed string or null when the token is empty.
45
- */
46
- function parseNullableString(value) {
47
- if (value === "null" || value.length === 0) {
48
- return null;
49
- }
50
- return decodeTokenValue(value);
51
- }
52
- /**
53
- * Decode a percent-encoded token field.
54
- *
55
- * @param value Serialized token field.
56
- * @returns The decoded token value, or the original value for legacy tokens.
57
- */
58
- function decodeTokenValue(value) {
59
- try {
60
- return decodeURIComponent(value);
61
- }
62
- catch {
63
- return value;
64
- }
65
- }
66
9
  /**
67
10
  * Serialize a token field so whitespace, delimiters, and HTML comment endings
68
11
  * cannot corrupt the machine-readable comment on the next parse.
@@ -85,18 +28,6 @@ function renderNullable(value) {
85
28
  }
86
29
  return typeof value === "number" ? String(value) : encodeTokenValue(value);
87
30
  }
88
- /**
89
- * Parse a comma-separated token field into stable document order.
90
- *
91
- * @param value Serialized CSV token field.
92
- * @returns The parsed item list.
93
- */
94
- function parseCsv(value) {
95
- if (value.length === 0) {
96
- return [];
97
- }
98
- return value.split(",").map(decodeTokenValue);
99
- }
100
31
  /**
101
32
  * Serialize a list as a comma-delimited token field with each item encoded
102
33
  * independently, so commas inside item values are preserved.
@@ -143,31 +74,6 @@ function resolveDirectCostCurrency(entries) {
143
74
  }
144
75
  return currencies.values().next().value ?? null;
145
76
  }
146
- /**
147
- * Locate the current managed usage-section boundaries inside an artifact body.
148
- *
149
- * @param document Artifact markdown to inspect.
150
- * @returns The start/end character offsets for the section, if present.
151
- */
152
- function findUsageSectionRange(document) {
153
- const heading = `${LISA_USAGE_HEADING}\n`;
154
- const start = document.indexOf(heading);
155
- if (start === -1) {
156
- if (!document.endsWith(LISA_USAGE_HEADING)) {
157
- return null;
158
- }
159
- return {
160
- start: document.length - LISA_USAGE_HEADING.length,
161
- end: document.length,
162
- };
163
- }
164
- const afterHeading = start + heading.length;
165
- const nextHeadingOffset = document.slice(afterHeading).search(/^##\s+/m);
166
- const end = nextHeadingOffset === -1
167
- ? document.length
168
- : afterHeading + nextHeadingOffset;
169
- return { start, end };
170
- }
171
77
  /**
172
78
  * Split an artifact body around the managed usage section.
173
79
  *
@@ -417,195 +323,6 @@ export function renderLisaUsageSection(input) {
417
323
  ];
418
324
  return `${lines.join("\n")}\n`;
419
325
  }
420
- /**
421
- * Parse the managed rollup and its optional token-completeness extension.
422
- *
423
- * @param section Managed usage section text.
424
- * @returns The parsed rollup, or null when the section has no rollup token.
425
- */
426
- function parseLisaUsageRollup(section) {
427
- const match = ROLLUP_PATTERN.exec(section);
428
- if (match === null) {
429
- return null;
430
- }
431
- return {
432
- directEntryIds: parseCsv(match[1] ?? ""),
433
- childEntryIds: parseCsv(match[2] ?? ""),
434
- childRefs: parseCsv(match[3] ?? ""),
435
- directTokens: parseNullableNumber(match[4] ?? ""),
436
- childTokens: parseNullableNumber(match[5] ?? ""),
437
- ...(ROLLUP_TOKEN_STATUS_PATTERN.test(section)
438
- ? { childTokensIncomplete: true }
439
- : {}),
440
- totalTokens: parseNullableNumber(match[6] ?? ""),
441
- directCost: parseNullableNumber(match[7] ?? ""),
442
- childCost: parseNullableNumber(match[8] ?? ""),
443
- totalCost: parseNullableNumber(match[9] ?? ""),
444
- currency: parseNullableString(match[10] ?? ""),
445
- childCurrency: parseNullableString(match[11] ?? ""),
446
- };
447
- }
448
- /**
449
- * Parse the managed usage section out of an artifact body or comment.
450
- *
451
- * @param document Artifact markdown to inspect.
452
- * @returns Parsed direct entries, rollup token, and the located section range.
453
- */
454
- export function parseLisaUsageSection(document) {
455
- const range = findUsageSectionRange(document);
456
- const section = range ? document.slice(range.start, range.end) : "";
457
- const effectiveness = parseEffectivenessTokens(section);
458
- const measuredSubsets = new Map(Array.from(section.matchAll(MEASURED_SUBSET_PATTERN), match => [
459
- decodeTokenValue(match[1] ?? ""),
460
- parseNullableNumber(match[2] ?? ""),
461
- ]));
462
- const entries = Array.from(section.matchAll(ENTRY_TOKEN_PATTERN), tokenMatch => {
463
- const token = tokenMatch[0];
464
- const releasedMatch = RELEASED_MIDDLE_FIELD_ENTRY_PATTERN.exec(token);
465
- const match = releasedMatch ?? LEGACY_ENTRY_PATTERN.exec(token);
466
- if (match === null) {
467
- throw new Error(`Invalid Lisa usage entry token: ${token}`);
468
- }
469
- const releasedFieldOffset = releasedMatch === null ? 0 : 1;
470
- const entryId = decodeTokenValue(match[1] ?? "");
471
- const embeddedMeasuredSubset = releasedMatch === null
472
- ? null
473
- : parseReleasedMeasuredSubset(match[12] ?? "");
474
- return {
475
- entryId,
476
- ...(effectiveness.has(entryId)
477
- ? { effectiveness: effectiveness.get(entryId) }
478
- : {}),
479
- flow: decodeTokenValue(match[2] ?? ""),
480
- runId: decodeTokenValue(match[3] ?? ""),
481
- provider: decodeTokenValue(match[4] ?? ""),
482
- model: decodeTokenValue(match[5] ?? ""),
483
- source: decodeTokenValue(match[6] ?? ""),
484
- inputTokens: parseNullableNumber(match[7] ?? ""),
485
- cachedInputTokens: parseNullableNumber(match[8] ?? ""),
486
- outputTokens: parseNullableNumber(match[9] ?? ""),
487
- reasoningTokens: parseNullableNumber(match[10] ?? ""),
488
- totalTokens: parseNullableNumber(match[11] ?? ""),
489
- measuredSubsetTokens: measuredSubsets.has(entryId)
490
- ? (measuredSubsets.get(entryId) ?? null)
491
- : embeddedMeasuredSubset,
492
- cost: parseNullableNumber(match[12 + releasedFieldOffset] ?? ""),
493
- currency: parseNullableString(match[13 + releasedFieldOffset] ?? ""),
494
- pricingStatus: decodeTokenValue(match[14 + releasedFieldOffset] ?? ""),
495
- pricingSource: parseNullableString(match[15 + releasedFieldOffset] ?? ""),
496
- artifactRef: decodeTokenValue(match[16 + releasedFieldOffset] ?? ""),
497
- parentArtifactRef: parseNullableString(match[17 + releasedFieldOffset] ?? ""),
498
- };
499
- });
500
- const entryIds = new Set(entries.map(entry => entry.entryId));
501
- for (const entryId of effectiveness.keys()) {
502
- if (!entryIds.has(entryId)) {
503
- throw new Error(`Effectiveness observation has no usage entry: ${entryId}`);
504
- }
505
- }
506
- return { entries, rollup: parseLisaUsageRollup(section), range };
507
- }
508
- /**
509
- * Sort ids so an integrity report is deterministic regardless of document order.
510
- *
511
- * @param ids Entry ids to normalize.
512
- * @returns The ids in stable sorted order.
513
- */
514
- function sortedIds(ids) {
515
- return [...ids].sort((left, right) => left > right ? 1 : left < right ? -1 : 0);
516
- }
517
- /**
518
- * Emit an issue only when it actually names something, so callers can compose
519
- * checks by concatenation instead of conditional accumulation.
520
- *
521
- * @param code Stable issue code.
522
- * @param entryIds Entry ids the issue is about.
523
- * @param message Operator-readable description.
524
- * @returns A zero- or one-element issue list.
525
- */
526
- function reportIssue(code, entryIds, message) {
527
- return entryIds.length === 0 ? [] : [{ code, entryIds, message }];
528
- }
529
- /**
530
- * Report entries the caller just wrote that the stored surface cannot produce.
531
- *
532
- * @param expectedEntryIds Entry ids the caller believes it persisted.
533
- * @param parsedEntryIds Entry ids actually parseable from the stored section.
534
- * @returns Zero or one `missing-entry-token` issue.
535
- */
536
- function findDroppedExpectedEntries(expectedEntryIds, parsedEntryIds) {
537
- const missing = sortedIds(expectedEntryIds.filter(entryId => !parsedEntryIds.has(entryId)));
538
- return reportIssue("missing-entry-token", missing, `Stored section does not contain a parseable lisa:usage-entry token for: ${missing.join(", ")}. The write surface dropped them.`);
539
- }
540
- /**
541
- * Report rollup references that resolve to no direct entry in the same section.
542
- *
543
- * @param rollupEntryIds Entry ids named by the stored rollup token.
544
- * @param parsedEntryIds Entry ids actually parseable from the stored section.
545
- * @param alreadyReported Ids already reported as dropped caller expectations.
546
- * @returns Zero or one `missing-entry-token` issue.
547
- */
548
- function findUnresolvableRollupReferences(rollupEntryIds, parsedEntryIds, alreadyReported) {
549
- const unresolvable = sortedIds(rollupEntryIds.filter(entryId => !parsedEntryIds.has(entryId) && !alreadyReported.includes(entryId)));
550
- return reportIssue("missing-entry-token", unresolvable, `Rollup direct_entry_ids names entries that cannot be parsed from the same section: ${unresolvable.join(", ")}.`);
551
- }
552
- /**
553
- * Report direct entries the stored rollup token fails to account for.
554
- *
555
- * @param rollup Stored rollup token, or null when the section carries none.
556
- * @param parsedEntryIds Entry ids actually parseable from the stored section.
557
- * @returns Zero or one issue describing the disagreement.
558
- */
559
- function findRollupCoverageGaps(rollup, parsedEntryIds) {
560
- const entryIds = sortedIds(parsedEntryIds);
561
- if (rollup === null) {
562
- // Every section Lisa writes carries a rollup token, even a child-only or
563
- // fully empty ledger, so a missing token is always corruption -- report
564
- // it unconditionally rather than routing through reportIssue(), which
565
- // suppresses issues that name zero entries.
566
- return [
567
- {
568
- code: "missing-rollup-token",
569
- entryIds,
570
- message: `Stored section has ${entryIds.length} direct entr${entryIds.length === 1 ? "y" : "ies"} but no lisa:usage-rollup token.`,
571
- },
572
- ];
573
- }
574
- const recorded = new Set(rollup.directEntryIds);
575
- const unrecorded = entryIds.filter(entryId => !recorded.has(entryId));
576
- return reportIssue("unrecorded-entry", unrecorded, `Stored section contains direct entries absent from rollup direct_entry_ids: ${unrecorded.join(", ")}.`);
577
- }
578
- /**
579
- * Verify that a STORED managed usage section is still a readable ledger.
580
- *
581
- * This exists because a write surface can accept a section, report success, and
582
- * silently destroy part of it. Callers must run this against the bytes read back
583
- * from the host, never against the payload they sent and never against the
584
- * mutation's return value — trusting the mutation result is precisely what let a
585
- * Linear description strip every entry token while reporting `success: true`.
586
- *
587
- * @param storedDocument Artifact body or comment body as read back from the host.
588
- * @param expected Optional expectations from the write that was just performed.
589
- * @param expected.entryIds Entry ids the caller believes it just persisted.
590
- * @returns Whether the stored ledger is enumerable, plus every issue found.
591
- */
592
- export function verifyLisaUsageSectionIntegrity(storedDocument, expected) {
593
- const parsed = parseLisaUsageSection(storedDocument);
594
- const expectedEntryIds = expected?.entryIds ?? [];
595
- if (parsed.range === null) {
596
- const missing = sortedIds(expectedEntryIds);
597
- const issues = reportIssue("missing-section", missing, `Stored artifact has no ${LISA_USAGE_HEADING} section, but ${missing.length} usage entr${missing.length === 1 ? "y was" : "ies were"} written to it.`);
598
- return { ok: issues.length === 0, issues };
599
- }
600
- const parsedEntryIds = new Set(parsed.entries.map(entry => entry.entryId));
601
- const droppedExpected = findDroppedExpectedEntries(expectedEntryIds, parsedEntryIds);
602
- const issues = [
603
- ...droppedExpected,
604
- ...findUnresolvableRollupReferences(parsed.rollup?.directEntryIds ?? [], parsedEntryIds, droppedExpected.flatMap(issue => issue.entryIds)),
605
- ...findRollupCoverageGaps(parsed.rollup, parsedEntryIds),
606
- ];
607
- return { ok: issues.length === 0, issues };
608
- }
609
326
  /**
610
327
  * Append or replace the canonical `## Lisa Usage` section in a markdown
611
328
  * artifact while preserving prior entries that are not being refreshed.
@@ -1 +1 @@
1
- {"version":3,"file":"usage-accounting.js","sourceRoot":"","sources":["../../src/utils/usage-accounting.ts"],"names":[],"mappings":"AAAA,uHAAuH;AAEvH,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GAEzB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AA8DlD,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AAEnE,MAAM,oBAAoB,GACxB,wUAAwU,CAAC;AAE3U,MAAM,mCAAmC,GACvC,qWAAqW,CAAC;AAExW,MAAM,uBAAuB,GAC3B,wFAAwF,CAAC;AAE3F,MAAM,cAAc,GAClB,iPAAiP,CAAC;AAEpP,MAAM,2BAA2B,GAC/B,s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,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;AAED,6EAA6E"}
package/package.json CHANGED
@@ -189,7 +189,7 @@
189
189
  "qs": "^6.16.0"
190
190
  },
191
191
  "name": "@codyswann/lisa",
192
- "version": "4.84.7",
192
+ "version": "4.84.8",
193
193
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
194
194
  "main": "dist/index.js",
195
195
  "exports": {
@@ -347,7 +347,7 @@
347
347
  "test": "tests"
348
348
  },
349
349
  "types": "./dist/index.d.ts",
350
- "lisaReleaseCommit": "c4b4854246e19e87038c9a31bc480085e1e004bf",
351
- "gitHead": "c4b4854246e19e87038c9a31bc480085e1e004bf",
352
- "lisaReleaseTag": "v4.84.7"
350
+ "lisaReleaseCommit": "f886101a6189bbfc6c268bc128b9c6fd4bb7730f",
351
+ "gitHead": "f886101a6189bbfc6c268bc128b9c6fd4bb7730f",
352
+ "lisaReleaseTag": "v4.84.8"
353
353
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.84.7",
3
+ "version": "4.84.8",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.84.7",
3
+ "version": "4.84.8",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1355,7 +1355,8 @@ Four properties make the command safe to run unconditionally:
1355
1355
  above does, and for the same reason. A merged pull request is not evidence
1356
1356
  on its own: the writer resolves `<baseRefName>` through `.lisa.config.json`
1357
1357
  `deploy.branches` and applies only the role that base earned. A merge into
1358
- the production deploy branch is terminal and closes the item; a merge into a
1358
+ the production deploy branch becomes eligible for terminal completion only
1359
+ after canonical accepted-for-completion proof passes; a merge into a
1359
1360
  branch mapping to a lower env records that env's role and leaves the item
1360
1361
  open; a merge into a branch the project does not deploy at all — an
1361
1362
  integration/stack branch — records nothing, closes nothing, and reports the
@@ -1377,6 +1378,19 @@ If the command refuses, do not close by hand. A refusal means the evidence is
1377
1378
  not there, and a lifecycle step performed by hand is one nothing can verify
1378
1379
  happened.
1379
1380
 
1381
+ `work-item pending-proof` is a normal nonterminal outcome: the merge does not
1382
+ prove the configured whole delivery run, runtime behavior, typed attachments,
1383
+ CONFORMS, canonical Verify usage, exact linkage and acceptance. Keep the item
1384
+ owned/open, finish canonical Verify and `lisa-tracker-evidence`, and use its
1385
+ shipped `publish-completion-proof` producer after actual uploads/readbacks.
1386
+ Then retry canonical completion. Read the sibling skill companion
1387
+ `../lisa-tracker-evidence/references/completion-authorization.md` relative to this
1388
+ skill directory; it is the portable `completion-authorization` reference.
1389
+ Publish an immutable required pending-state journey artifact first; append the
1390
+ real native terminal readback/acceptedAt afterward. Never require the future
1391
+ close event as its own authorization. A configured bot publisher's still-running
1392
+ pinned attempt keeps completion pending until that exact attempt succeeds.
1393
+
1380
1394
  **The backstop, for the ones that still slip:** `lisa-work-item.mjs sweep`
1381
1395
  reports every open item — in the **ready** lane as well as the **claimed** one —
1382
1396
  that a commit on a deploy branch DECLARES via its `Work-Item:` trailer, and
@@ -16,6 +16,11 @@ Apply `lisa-tracker-sync` — **Agent attribution** when composing evidence comm
16
16
 
17
17
  ## Workflow
18
18
 
19
+ The portable accepted-completion contract is this skill's own
20
+ `references/completion-authorization.md` companion. Read that file when preparing
21
+ or publishing completion proof. It ships with the skill even on runtimes that
22
+ omit the plugin rules tree; do not assume a runtime-specific rules directory.
23
+
19
24
  1. Resolve tracker config (same logic as `lisa-tracker-write`).
20
25
  2. Missing / empty → stop and report `"No tracker configured in .lisa.config.json. Run /lisa:setup:jira, /lisa:setup:github, or /lisa:setup:linear first."`
21
26
  3. Before dispatching, update the generated evidence artifact through `lisa-usage-accounting` so the comment body / PR evidence section carries a direct `lisa-verify` usage entry in the canonical `## Lisa Usage` section. If the originating work item's parentage or child refs are already known, prefer `record_and_rollup` so ancestor totals refresh in the same write; otherwise still write the direct entry, and if trustworthy runtime usage is unavailable, write `source: unavailable` with nullable token/cost fields instead of skipping the row.
@@ -24,7 +29,8 @@ Apply `lisa-tracker-sync` — **Agent attribution** when composing evidence comm
24
29
  - `github` → invoke `lisa-github-evidence` with `$ARGUMENTS` verbatim. Arg shape: `<ISSUE_REF> <EVIDENCE_DIR> <PR_NUMBER>` where `ISSUE_REF` is `org/repo#<number>` or a GitHub issue URL.
25
30
  - `linear` → invoke `lisa-linear-evidence` with `$ARGUMENTS` verbatim. Arg shape: `<IDENTIFIER> <EVIDENCE_DIR>` where `IDENTIFIER` is a Linear Issue identifier (e.g., `ENG-123`).
26
31
  - Anything else → stop and report `"Unknown tracker '<value>' in .lisa.config.json. Expected 'jira', 'github', or 'linear'."`
27
- 5. Pass through the vendor skill's output.
32
+ 5. For supported GitHub/Linear production completion, after actual uploads and exact native readbacks, prepare the accepted-for-completion input from the observed source/delivery, schema2 verdicts, actual typed attachment pointers, complete requirement conjunction map, structured CONFORMS report, canonical Verify usage, linkage and explicit acceptance. Apply the shipped `completion-authorization` reference; the executable validates the contract in every installed host. Run `node scripts/lisa-work-item.mjs publish-completion-proof --ref <exact-work-item> --record <evidence-dir>/completion-record.json`. It uploads immutable hash-named acceptance bytes to the implementation repository's `pr-assets`, reads them back and publishes the exact-item native locator. Never construct a locator manually or treat a narrative evidence comment as acceptance. Jira completion remains unsupported.
33
+ 6. Pass through both the vendor output and actual producer category. `published/pending-producer` means the pinned configured automation attempt must finish successfully before completion; do not rewrite the asset after the job or invent a successful future outcome. A User publisher does not require a producer workflow run. Only after accepted publication may the canonical lifecycle owner retry `complete`; pending proof preserves ownership and state and names the Verify/evidence action. Capture actual terminal readback/usage acceptedAt afterward, not as a circular publication prerequisite. A required pending-state journey artifact is immutable Phase-A proof captured before completion; the later actual terminal readback is a separate Phase-B supplement.
28
34
 
29
35
  ## Rules
30
36