@codyswann/lisa 8.0.1 → 8.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 (112) hide show
  1. package/all/copy-overwrite/scripts/lib/completion-authorization.mjs +28 -0
  2. package/all/copy-overwrite/scripts/lib/completion-proof-adapters.mjs +21 -0
  3. package/all/copy-overwrite/scripts/lib/completion-proof-projection.mjs +25 -41
  4. package/all/copy-overwrite/scripts/lib/completion-proof-shape.mjs +23 -0
  5. package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +6 -0
  6. package/all/copy-overwrite/scripts/lib/tracker-row-fold.mjs +48 -0
  7. package/all/copy-overwrite/scripts/lib/work-item-estimate-actual.mjs +131 -0
  8. package/all/copy-overwrite/scripts/lib/work-item-estimate-calibration.mjs +16 -33
  9. package/all/copy-overwrite/scripts/lib/work-item-estimate-check.mjs +26 -5
  10. package/all/copy-overwrite/scripts/lib/work-item-estimate-config.mjs +21 -0
  11. package/all/copy-overwrite/scripts/lib/work-item-estimate-tally.mjs +272 -0
  12. package/all/copy-overwrite/scripts/lib/work-item-estimate.mjs +60 -31
  13. package/all/copy-overwrite/scripts/lisa-estimate.mjs +60 -9
  14. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +61 -8
  15. package/dist/core/lisa-owned-hash-ledger.json +88 -4
  16. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  17. package/dist/core/upstream-evidence-manifest.json +32 -17
  18. package/dist/utils/usage-accounting-totals.d.ts.map +1 -1
  19. package/dist/utils/usage-accounting-totals.js +6 -1
  20. package/dist/utils/usage-accounting-totals.js.map +1 -1
  21. package/package.json +4 -4
  22. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  24. package/plugins/lisa/.codex-plugin/skills/lisa-tracker-evidence/SKILL.md +1 -0
  25. package/plugins/lisa/.codex-plugin/skills/lisa-usage-accounting/SKILL.md +2 -1
  26. package/plugins/lisa/.codex-plugin/skills/lisa-usage-accounting/references/estimate.md +49 -0
  27. package/plugins/lisa/rules/reference/work-item-definition-of-ready.md +5 -2
  28. package/plugins/lisa/skills/lisa-tracker-evidence/SKILL.md +1 -0
  29. package/plugins/lisa/skills/lisa-usage-accounting/SKILL.md +2 -1
  30. package/plugins/lisa/skills/lisa-usage-accounting/references/estimate.md +49 -0
  31. package/plugins/lisa-agy/plugin.json +1 -1
  32. package/plugins/lisa-agy/skills/lisa-tracker-evidence/SKILL.md +1 -0
  33. package/plugins/lisa-agy/skills/lisa-usage-accounting/SKILL.md +2 -1
  34. package/plugins/lisa-agy/skills/lisa-usage-accounting/references/estimate.md +49 -0
  35. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  38. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  42. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-copilot/rules/reference/work-item-definition-of-ready.md +5 -2
  44. package/plugins/lisa-copilot/skills/lisa-tracker-evidence/SKILL.md +1 -0
  45. package/plugins/lisa-copilot/skills/lisa-usage-accounting/SKILL.md +2 -1
  46. package/plugins/lisa-copilot/skills/lisa-usage-accounting/references/estimate.md +49 -0
  47. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-cursor/rules/work-item-definition-of-ready-reference.mdc +5 -2
  49. package/plugins/lisa-cursor/skills/lisa-tracker-evidence/SKILL.md +1 -0
  50. package/plugins/lisa-cursor/skills/lisa-usage-accounting/SKILL.md +2 -1
  51. package/plugins/lisa-cursor/skills/lisa-usage-accounting/references/estimate.md +49 -0
  52. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  54. package/plugins/lisa-devin/rules/reference/work-item-definition-of-ready.md +5 -2
  55. package/plugins/lisa-devin/skills/lisa-tracker-evidence/SKILL.md +1 -0
  56. package/plugins/lisa-devin/skills/lisa-usage-accounting/SKILL.md +2 -1
  57. package/plugins/lisa-devin/skills/lisa-usage-accounting/references/estimate.md +49 -0
  58. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  60. package/plugins/lisa-expo-agy/plugin.json +1 -1
  61. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  65. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  67. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  68. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  72. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  74. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  75. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  81. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  82. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  86. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  88. package/plugins/lisa-rails-agy/plugin.json +1 -1
  89. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  93. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  96. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  100. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  103. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  107. package/plugins/src/base/rules/reference/work-item-definition-of-ready.md +5 -2
  108. package/plugins/src/base/skills/lisa-tracker-evidence/SKILL.md +1 -0
  109. package/plugins/src/base/skills/lisa-usage-accounting/SKILL.md +2 -1
  110. package/plugins/src/base/skills/lisa-usage-accounting/references/estimate.md +49 -0
  111. package/scripts/two-channel-couplings.json +1 -1
  112. package/typescript/copy-overwrite/.prettierignore +3 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -195,8 +195,11 @@ missing estimate fails: the claiming agent estimates the item, calibrated
195
195
  against comparable finished items, and writes it before any work. If
196
196
  estimating itself fails, the work still goes ahead: the item stays claimed, the
197
197
  result records `estimate_outcome: failed` with the reason, and a plain-English
198
- comment on the item says why (`lisa-track` step 4). It is `N/A` when the
199
- project turns the requirement off. Nobody is ever asked for an estimate.
198
+ comment on the item says why (`lisa-track` step 4). At done time
199
+ `lisa-work-item complete` refuses the item until its usage ledger has an entry
200
+ and the section shows that ledger's actual tokens and cost beside the estimate
201
+ (`lisa-estimate.mjs tally`). It is `N/A` when the project turns the
202
+ requirement off. Nobody is ever asked for an estimate.
200
203
 
201
204
  ## Relationship to the lifecycle
202
205
 
@@ -23,6 +23,7 @@ omit the plugin rules tree; do not assume a runtime-specific rules directory.
23
23
  Then, when an installed stack plugin ships a `journey-guidance` skill (the Expo and Rails plugins do), invoke it and carry its guidance — how the stack names its evidence files — into the vendor skill below. It is tracker-neutral, so it applies to `jira`, `github`, and `linear` alike. When no stack plugin ships one, continue with the base behaviour; that is not an error.
24
24
  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."`
25
25
  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.
26
+ Then, unless `workItem.estimate.required` is `false`, tally the actual beside the estimate: run `node scripts/lisa-estimate.mjs tally --body-file <work-item-body.md>` (add one `--usage-file <comment.md>` for every comment on the item that holds a usage ledger, the evidence comment included), write the printed body back to the work item through `lisa-tracker-write`, read it back, and run `node scripts/lisa-estimate.mjs check --phase done --body-file <stored-body.md>` with the same `--usage-file` flags the tally got, so the check reads the ledgers the tally counted. `lisa-work-item complete` refuses an item whose tally is missing or stale. See the usage-accounting skill's `references/estimate.md`.
26
27
  4. Dispatch:
27
28
  - `jira` → invoke `lisa-jira-evidence` with `$ARGUMENTS` verbatim. Arg shape: `<TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>`.
28
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.
@@ -195,7 +195,8 @@ failures into a generic "usage update failed."
195
195
  A work item's token estimate and recommended model live in their own managed `## Lisa Estimate`
196
196
  section, beside this ledger, never inside it. The contract, config (`workItem.estimate`) and
197
197
  pricing are in the [estimate reference](references/estimate.md); render and check the section
198
- with `node scripts/lisa-estimate.mjs`.
198
+ with `node scripts/lisa-estimate.mjs`. At done, `lisa-estimate.mjs tally` copies this ledger's
199
+ rollup total into that section as the actual; it reads the ledger and never writes to it.
199
200
 
200
201
  ## Rules
201
202
 
@@ -91,4 +91,53 @@ goes into the section. Items whose actual is unknown or partial — no ledger, a
91
91
  the sum of only the known runs. With
92
92
  no usable history the range is unchanged and the basis says "no calibration history".
93
93
 
94
+ ## Done: the actual beside the estimate
95
+
96
+ When the work is done, the section also shows what it really cost (CodySwannGT/lisa#4956). The
97
+ actual is the item's `## Lisa Usage` ledgers, on the body and on any comment — the same ledger
98
+ every flow already records into, not a second one. Each distinct run is counted once, by its entry
99
+ id, wherever it is recorded: a comment that repeats the body's runs and adds its own Verify run adds
100
+ only that run. Child work arrives as each ledger's aggregate; the total is `unknown` only when two
101
+ ledgers share some, but not all, of the same child runs, because that aggregate cannot be split:
102
+
103
+ ```markdown
104
+ | Estimate | 2M–4M | $3.14–$6.28 USD | claude-opus-5-5 |
105
+ | Actual | 3M | $4.71 USD | — |
106
+
107
+ Actual: the Lisa Usage ledger total over 2 usage entries (source: observed); 1x the estimate's midpoint.
108
+
109
+ <!-- lisa:estimate-actual tokens=3000000 cost=4.71 currency=USD sources=observed entries=2 ratio=1 -->
110
+ ```
111
+
112
+ After the Verify usage entry is written (`lisa-tracker-evidence` step 3) and before the accepted
113
+ completion proof is published, tally it and write the body back:
114
+
115
+ ```bash
116
+ node scripts/lisa-estimate.mjs tally --body-file <body.md> [--usage-file <comment.md>]...
117
+ node scripts/lisa-estimate.mjs check --phase done --body-file <stored-body.md> [--usage-file <comment.md>]...
118
+ ```
119
+
120
+ Pass every comment that holds a ledger, each with its own `--usage-file`, to both commands. `complete`
121
+ reads every comment, so the check must read the same ledgers the tally counted. A total that any run
122
+ leaves unknown (`unavailable` telemetry, a `measured-subset` entry, a child run with no token count
123
+ or no cost) is shown as
124
+ `unknown`, never as zero, never as the sum of only the known runs, and never guessed. A `## Lisa
125
+ Usage` section that cannot be read in full (an entry or rollup token the parser refuses or cannot
126
+ match) is never dropped: it makes every total `unknown` and names `unreadable-ledger` among the
127
+ sources, until the section is repaired through `lisa-usage-accounting`. A section without a rollup
128
+ token still has its direct entries counted. An item that
129
+ reached done with no estimate shows `none recorded` in the estimate row rather than an invented
130
+ range.
131
+
132
+ `lisa-work-item complete` enforces it: when `required` is true, it refuses (as `pending-proof`) an
133
+ item with no usage entry, with no tally, or with a tally that no longer matches the ledger. The
134
+ estimate section is machine-owned metadata, so rewriting it does not change the specification
135
+ digest the accepted completion proof is bound to. Only the exact lines `lisa-estimate` writes are
136
+ left out; every other line a person adds inside it still counts, even one that starts with
137
+ `Actual:` or `Basis:`.
138
+
139
+ ## When the config is off
140
+
141
+ Nothing about estimates blocks. Every check reports `N/A`, and `complete` skips the done gate.
142
+
94
143
  The recommended model is recorded only. It does not choose which model or agent runs the work.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -200,8 +200,11 @@ missing estimate fails: the claiming agent estimates the item, calibrated
200
200
  against comparable finished items, and writes it before any work. If
201
201
  estimating itself fails, the work still goes ahead: the item stays claimed, the
202
202
  result records `estimate_outcome: failed` with the reason, and a plain-English
203
- comment on the item says why (`lisa-track` step 4). It is `N/A` when the
204
- project turns the requirement off. Nobody is ever asked for an estimate.
203
+ comment on the item says why (`lisa-track` step 4). At done time
204
+ `lisa-work-item complete` refuses the item until its usage ledger has an entry
205
+ and the section shows that ledger's actual tokens and cost beside the estimate
206
+ (`lisa-estimate.mjs tally`). It is `N/A` when the project turns the
207
+ requirement off. Nobody is ever asked for an estimate.
205
208
 
206
209
  ## Relationship to the lifecycle
207
210
 
@@ -23,6 +23,7 @@ omit the plugin rules tree; do not assume a runtime-specific rules directory.
23
23
  Then, when an installed stack plugin ships a `journey-guidance` skill (the Expo and Rails plugins do), invoke it and carry its guidance — how the stack names its evidence files — into the vendor skill below. It is tracker-neutral, so it applies to `jira`, `github`, and `linear` alike. When no stack plugin ships one, continue with the base behaviour; that is not an error.
24
24
  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."`
25
25
  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.
26
+ Then, unless `workItem.estimate.required` is `false`, tally the actual beside the estimate: run `node scripts/lisa-estimate.mjs tally --body-file <work-item-body.md>` (add one `--usage-file <comment.md>` for every comment on the item that holds a usage ledger, the evidence comment included), write the printed body back to the work item through `lisa-tracker-write`, read it back, and run `node scripts/lisa-estimate.mjs check --phase done --body-file <stored-body.md>` with the same `--usage-file` flags the tally got, so the check reads the ledgers the tally counted. `lisa-work-item complete` refuses an item whose tally is missing or stale. See the usage-accounting skill's `references/estimate.md`.
26
27
  4. Dispatch:
27
28
  - `jira` → invoke `lisa-jira-evidence` with `$ARGUMENTS` verbatim. Arg shape: `<TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>`.
28
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.
@@ -195,7 +195,8 @@ failures into a generic "usage update failed."
195
195
  A work item's token estimate and recommended model live in their own managed `## Lisa Estimate`
196
196
  section, beside this ledger, never inside it. The contract, config (`workItem.estimate`) and
197
197
  pricing are in the [estimate reference](references/estimate.md); render and check the section
198
- with `node scripts/lisa-estimate.mjs`.
198
+ with `node scripts/lisa-estimate.mjs`. At done, `lisa-estimate.mjs tally` copies this ledger's
199
+ rollup total into that section as the actual; it reads the ledger and never writes to it.
199
200
 
200
201
  ## Rules
201
202
 
@@ -91,4 +91,53 @@ goes into the section. Items whose actual is unknown or partial — no ledger, a
91
91
  the sum of only the known runs. With
92
92
  no usable history the range is unchanged and the basis says "no calibration history".
93
93
 
94
+ ## Done: the actual beside the estimate
95
+
96
+ When the work is done, the section also shows what it really cost (CodySwannGT/lisa#4956). The
97
+ actual is the item's `## Lisa Usage` ledgers, on the body and on any comment — the same ledger
98
+ every flow already records into, not a second one. Each distinct run is counted once, by its entry
99
+ id, wherever it is recorded: a comment that repeats the body's runs and adds its own Verify run adds
100
+ only that run. Child work arrives as each ledger's aggregate; the total is `unknown` only when two
101
+ ledgers share some, but not all, of the same child runs, because that aggregate cannot be split:
102
+
103
+ ```markdown
104
+ | Estimate | 2M–4M | $3.14–$6.28 USD | claude-opus-5-5 |
105
+ | Actual | 3M | $4.71 USD | — |
106
+
107
+ Actual: the Lisa Usage ledger total over 2 usage entries (source: observed); 1x the estimate's midpoint.
108
+
109
+ <!-- lisa:estimate-actual tokens=3000000 cost=4.71 currency=USD sources=observed entries=2 ratio=1 -->
110
+ ```
111
+
112
+ After the Verify usage entry is written (`lisa-tracker-evidence` step 3) and before the accepted
113
+ completion proof is published, tally it and write the body back:
114
+
115
+ ```bash
116
+ node scripts/lisa-estimate.mjs tally --body-file <body.md> [--usage-file <comment.md>]...
117
+ node scripts/lisa-estimate.mjs check --phase done --body-file <stored-body.md> [--usage-file <comment.md>]...
118
+ ```
119
+
120
+ Pass every comment that holds a ledger, each with its own `--usage-file`, to both commands. `complete`
121
+ reads every comment, so the check must read the same ledgers the tally counted. A total that any run
122
+ leaves unknown (`unavailable` telemetry, a `measured-subset` entry, a child run with no token count
123
+ or no cost) is shown as
124
+ `unknown`, never as zero, never as the sum of only the known runs, and never guessed. A `## Lisa
125
+ Usage` section that cannot be read in full (an entry or rollup token the parser refuses or cannot
126
+ match) is never dropped: it makes every total `unknown` and names `unreadable-ledger` among the
127
+ sources, until the section is repaired through `lisa-usage-accounting`. A section without a rollup
128
+ token still has its direct entries counted. An item that
129
+ reached done with no estimate shows `none recorded` in the estimate row rather than an invented
130
+ range.
131
+
132
+ `lisa-work-item complete` enforces it: when `required` is true, it refuses (as `pending-proof`) an
133
+ item with no usage entry, with no tally, or with a tally that no longer matches the ledger. The
134
+ estimate section is machine-owned metadata, so rewriting it does not change the specification
135
+ digest the accepted completion proof is bound to. Only the exact lines `lisa-estimate` writes are
136
+ left out; every other line a person adds inside it still counts, even one that starts with
137
+ `Actual:` or `Basis:`.
138
+
139
+ ## When the config is off
140
+
141
+ Nothing about estimates blocks. Every check reports `N/A`, and `complete` skips the done gate.
142
+
94
143
  The recommended model is recorded only. It does not choose which model or agent runs the work.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "8.0.1",
3
+ "version": "8.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": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -195,8 +195,11 @@ missing estimate fails: the claiming agent estimates the item, calibrated
195
195
  against comparable finished items, and writes it before any work. If
196
196
  estimating itself fails, the work still goes ahead: the item stays claimed, the
197
197
  result records `estimate_outcome: failed` with the reason, and a plain-English
198
- comment on the item says why (`lisa-track` step 4). It is `N/A` when the
199
- project turns the requirement off. Nobody is ever asked for an estimate.
198
+ comment on the item says why (`lisa-track` step 4). At done time
199
+ `lisa-work-item complete` refuses the item until its usage ledger has an entry
200
+ and the section shows that ledger's actual tokens and cost beside the estimate
201
+ (`lisa-estimate.mjs tally`). It is `N/A` when the project turns the
202
+ requirement off. Nobody is ever asked for an estimate.
200
203
 
201
204
  ## Relationship to the lifecycle
202
205
 
@@ -23,6 +23,7 @@ omit the plugin rules tree; do not assume a runtime-specific rules directory.
23
23
  Then, when an installed stack plugin ships a `journey-guidance` skill (the Expo and Rails plugins do), invoke it and carry its guidance — how the stack names its evidence files — into the vendor skill below. It is tracker-neutral, so it applies to `jira`, `github`, and `linear` alike. When no stack plugin ships one, continue with the base behaviour; that is not an error.
24
24
  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."`
25
25
  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.
26
+ Then, unless `workItem.estimate.required` is `false`, tally the actual beside the estimate: run `node scripts/lisa-estimate.mjs tally --body-file <work-item-body.md>` (add one `--usage-file <comment.md>` for every comment on the item that holds a usage ledger, the evidence comment included), write the printed body back to the work item through `lisa-tracker-write`, read it back, and run `node scripts/lisa-estimate.mjs check --phase done --body-file <stored-body.md>` with the same `--usage-file` flags the tally got, so the check reads the ledgers the tally counted. `lisa-work-item complete` refuses an item whose tally is missing or stale. See the usage-accounting skill's `references/estimate.md`.
26
27
  4. Dispatch:
27
28
  - `jira` → invoke `lisa-jira-evidence` with `$ARGUMENTS` verbatim. Arg shape: `<TICKET_ID> <EVIDENCE_DIR> <PR_NUMBER>`.
28
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.
@@ -195,7 +195,8 @@ failures into a generic "usage update failed."
195
195
  A work item's token estimate and recommended model live in their own managed `## Lisa Estimate`
196
196
  section, beside this ledger, never inside it. The contract, config (`workItem.estimate`) and
197
197
  pricing are in the [estimate reference](references/estimate.md); render and check the section
198
- with `node scripts/lisa-estimate.mjs`.
198
+ with `node scripts/lisa-estimate.mjs`. At done, `lisa-estimate.mjs tally` copies this ledger's
199
+ rollup total into that section as the actual; it reads the ledger and never writes to it.
199
200
 
200
201
  ## Rules
201
202
 
@@ -91,4 +91,53 @@ goes into the section. Items whose actual is unknown or partial — no ledger, a
91
91
  the sum of only the known runs. With
92
92
  no usable history the range is unchanged and the basis says "no calibration history".
93
93
 
94
+ ## Done: the actual beside the estimate
95
+
96
+ When the work is done, the section also shows what it really cost (CodySwannGT/lisa#4956). The
97
+ actual is the item's `## Lisa Usage` ledgers, on the body and on any comment — the same ledger
98
+ every flow already records into, not a second one. Each distinct run is counted once, by its entry
99
+ id, wherever it is recorded: a comment that repeats the body's runs and adds its own Verify run adds
100
+ only that run. Child work arrives as each ledger's aggregate; the total is `unknown` only when two
101
+ ledgers share some, but not all, of the same child runs, because that aggregate cannot be split:
102
+
103
+ ```markdown
104
+ | Estimate | 2M–4M | $3.14–$6.28 USD | claude-opus-5-5 |
105
+ | Actual | 3M | $4.71 USD | — |
106
+
107
+ Actual: the Lisa Usage ledger total over 2 usage entries (source: observed); 1x the estimate's midpoint.
108
+
109
+ <!-- lisa:estimate-actual tokens=3000000 cost=4.71 currency=USD sources=observed entries=2 ratio=1 -->
110
+ ```
111
+
112
+ After the Verify usage entry is written (`lisa-tracker-evidence` step 3) and before the accepted
113
+ completion proof is published, tally it and write the body back:
114
+
115
+ ```bash
116
+ node scripts/lisa-estimate.mjs tally --body-file <body.md> [--usage-file <comment.md>]...
117
+ node scripts/lisa-estimate.mjs check --phase done --body-file <stored-body.md> [--usage-file <comment.md>]...
118
+ ```
119
+
120
+ Pass every comment that holds a ledger, each with its own `--usage-file`, to both commands. `complete`
121
+ reads every comment, so the check must read the same ledgers the tally counted. A total that any run
122
+ leaves unknown (`unavailable` telemetry, a `measured-subset` entry, a child run with no token count
123
+ or no cost) is shown as
124
+ `unknown`, never as zero, never as the sum of only the known runs, and never guessed. A `## Lisa
125
+ Usage` section that cannot be read in full (an entry or rollup token the parser refuses or cannot
126
+ match) is never dropped: it makes every total `unknown` and names `unreadable-ledger` among the
127
+ sources, until the section is repaired through `lisa-usage-accounting`. A section without a rollup
128
+ token still has its direct entries counted. An item that
129
+ reached done with no estimate shows `none recorded` in the estimate row rather than an invented
130
+ range.
131
+
132
+ `lisa-work-item complete` enforces it: when `required` is true, it refuses (as `pending-proof`) an
133
+ item with no usage entry, with no tally, or with a tally that no longer matches the ledger. The
134
+ estimate section is machine-owned metadata, so rewriting it does not change the specification
135
+ digest the accepted completion proof is bound to. Only the exact lines `lisa-estimate` writes are
136
+ left out; every other line a person adds inside it still counts, even one that starts with
137
+ `Actual:` or `Basis:`.
138
+
139
+ ## When the config is off
140
+
141
+ Nothing about estimates blocks. Every check reports `N/A`, and `complete` skips the done gate.
142
+
94
143
  The recommended model is recorded only. It does not choose which model or agent runs the work.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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-expo",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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-harper-fabric",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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-harper-fabric",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (hand-written migration warning)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills and a hand-written migration warning hook.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (hand-written migration warning)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (hand-written migration warning)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (hand-written migration warning)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (hand-written migration warning)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (hand-written migration warning)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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-rails",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
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": "8.0.1",
3
+ "version": "8.1.0",
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"