@codyswann/lisa 5.1.4 → 5.1.6

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 (87) hide show
  1. package/all/create-only/.github/workflows/continuous-gates.yml +1 -0
  2. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  3. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  4. package/dist/core/upstream-evidence-manifest.js +14 -2
  5. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  6. package/dist/health/template-inspection.d.ts.map +1 -1
  7. package/dist/health/template-inspection.js +1 -1
  8. package/dist/health/template-inspection.js.map +1 -1
  9. package/dist/strategies/package-lisa-dev-engines.d.ts +30 -0
  10. package/dist/strategies/package-lisa-dev-engines.d.ts.map +1 -0
  11. package/dist/strategies/package-lisa-dev-engines.js +118 -0
  12. package/dist/strategies/package-lisa-dev-engines.js.map +1 -0
  13. package/dist/strategies/package-lisa.d.ts +14 -1
  14. package/dist/strategies/package-lisa.d.ts.map +1 -1
  15. package/dist/strategies/package-lisa.js +23 -3
  16. package/dist/strategies/package-lisa.js.map +1 -1
  17. package/package.json +4 -4
  18. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  20. package/plugins/lisa/.codex-plugin/skills/lisa-learnings-audit/SKILL.md +63 -1
  21. package/plugins/lisa/skills/lisa-learnings-audit/SKILL.md +63 -1
  22. package/plugins/lisa-agy/plugin.json +1 -1
  23. package/plugins/lisa-agy/skills/lisa-learnings-audit/SKILL.md +63 -1
  24. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  27. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  31. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-copilot/skills/lisa-learnings-audit/SKILL.md +63 -1
  33. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cursor/skills/lisa-learnings-audit/SKILL.md +63 -1
  35. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  37. package/plugins/lisa-devin/skills/lisa-learnings-audit/SKILL.md +63 -1
  38. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  40. package/plugins/lisa-expo-agy/plugin.json +1 -1
  41. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  45. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  47. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  48. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  52. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  54. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  55. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  59. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  61. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  62. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  66. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-rails-agy/plugin.json +1 -1
  69. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  73. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  76. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  83. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  87. package/plugins/src/base/skills/lisa-learnings-audit/SKILL.md +63 -1
@@ -181,6 +181,10 @@ one exists) must show:
181
181
  alone.
182
182
  - Per skipped candidate: which dedupe hit suppressed it (open ticket URL,
183
183
  done ticket, or rejection date).
184
+ - Per PROMOTE/DEMOTE ticket, the destination-validation record (Ticket
185
+ emission): destinations checked, missing, and created as new; line pointers
186
+ pinned (with the SHA) or dropped; and counts reconciled — or, for a refused
187
+ ticket, the refusal and the mismatch that caused it.
184
188
  - For `nothing-needed`: the thresholds nothing met, in one line.
185
189
 
186
190
  The tickets themselves are the durable artifacts; the report is how a human
@@ -223,6 +227,8 @@ audits the auditor without re-running it.
223
227
  is **advisory**: it returns `rung`, `scope`, `rationale`, and
224
228
  `drafted_artifact`; the gardener decides whether the evidence clears the
225
229
  filing bar and attaches the router's draft to the ticket.
230
+ Before step 4, run the destination-validation check (Ticket emission) on
231
+ every PROMOTE/DEMOTE draft; a draft that fails it is refused, not filed.
226
232
  4. **Emit** (see Ticket emission).
227
233
  5. **Report and record** the run outcome and one-line summary — post the
228
234
  outcome, then record **exactly one** run-record line through the CLI (see
@@ -258,6 +264,54 @@ into the always-loaded rules"`, which stamps the auditable `[lisa-human-gate]`
258
264
  marker. Every other build-ready ticket passes `build_ready: true`. The hold is
259
265
  declared, never implied by an omitted flag.
260
266
 
267
+ <!-- destination-validation:start -->
268
+ **Destination and count validation (before filing any PROMOTE / DEMOTE).**
269
+ The router's draft says *where* the builder should make the change and *how
270
+ much* evidence backs it. Neither is trusted until checked, because a ticket
271
+ pointing at a section that does not exist, or quoting a figure its own
272
+ evidence contradicts, sends the builder to re-derive everything by hand.
273
+ Validate against the default branch of the repository the ticket targets,
274
+ and resolve its head `<sha>` once per run:
275
+
276
+ - **This repository** (`project` scope) — run `git fetch origin <default>`
277
+ first, then `git rev-parse origin/<default>` once for the SHA. Read every
278
+ file at that SHA, never at the moving `origin/<default>`:
279
+ `git cat-file -t <sha>:<path>` must print `blob` (a `tree` is a directory,
280
+ not a file), then `git show <sha>:<path>` for its text.
281
+ - **Upstream** (`upstream` scope) — the paths live in `<upstreamRepo>`, not
282
+ this checkout: `gh api repos/<upstreamRepo>/commits/<default> --jq .sha`
283
+ for the SHA, then for each file
284
+ `gh api -H "Accept: application/vnd.github.raw" repos/<upstreamRepo>/contents/<path>?ref=<sha>`,
285
+ which returns the raw text so headings are searchable (the default JSON
286
+ response is base64-encoded). A response that lists entries means the path
287
+ is a directory, not a file.
288
+
289
+ 1. **Destinations** — fetch every file the ticket names as above; for every
290
+ heading or section, search that file for it. A destination that exists is
291
+ cited as existing. A section the builder must *create* is labelled **new**
292
+ in the ticket, never cited as existing. A file that does not exist is
293
+ always listed in `destinations_missing`; it is then either relabelled as a
294
+ **new file** the builder creates (and also listed in `destinations_new`),
295
+ or, if the draft depends on it already existing, the ticket is **refused**.
296
+ 2. **Line pointers** — drop them, or recompute each one against `<sha>` and
297
+ write that SHA beside it ("line 42 at `<sha>`") so anyone can re-check it
298
+ later. Never copy a pointer from the draft unchecked.
299
+ 3. **Counts** — every count the ticket attributes to its cited evidence
300
+ ("12 of 12 entries", "17 occurrences") is recounted from that evidence.
301
+ Template wording such as "all four legs" and pinned line numbers are not
302
+ counts. On any mismatch the ticket is **refused**: it is not filed, and
303
+ neither side is quietly corrected. The mismatch (both figures and where
304
+ each came from) goes in the run report (Proof) so a person can see what
305
+ disagreed.
306
+
307
+ A refused ticket is not a run failure: the run continues with the other
308
+ candidates and reports the refusal in the run report (Proof). Record per
309
+ ticket in the run report (Proof): `destinations_checked`,
310
+ `destinations_missing`, `destinations_new`, `pointers` (`pinned` with
311
+ `pointer_sha`, or `dropped`), and `counts_reconciled: yes`, or
312
+ `refused: <reason>`.
313
+ <!-- destination-validation:end -->
314
+
261
315
  **Per-item tickets — PROMOTE / DEMOTE** (`issue_type: Task`; GitHub trackers
262
316
  carry the `type:Task` label) — one ticket per recommendation, capped by
263
317
  `max_candidates`:
@@ -269,7 +323,10 @@ carry the `type:Task` label) — one ticket per recommendation, capped by
269
323
  owner).
270
324
  - The router's **`drafted_artifact`** verbatim (the lint/hook sketch +
271
325
  diagnostic text, proposed rule text, skill outline, page outline, or
272
- redundancy proof).
326
+ redundancy proof), embedded only after the destination-validation edits
327
+ above are applied to it: a section that does not exist is relabelled
328
+ **new**, each line pointer is dropped or pinned to `<sha>`, and a draft
329
+ whose counts disagree with its evidence is refused rather than embedded.
273
330
  - For **EXECUTABLE-CONTROL** promotions, embed the promotion-contract AC
274
331
  template below **verbatim** (markers included — do not paraphrase, reorder,
275
332
  or partially quote it; it is the single source of truth from the
@@ -474,6 +531,11 @@ exact so nothing regresses:
474
531
  escalated per Escalation with the operator-readable reason; **or**
475
532
  **`approval-requested`** when the run finished and is waiting on a human gate
476
533
  rather than being broken.
534
+ A run that filed nothing because destination-validation (Ticket emission)
535
+ refused every PROMOTE/DEMOTE draft records **`approval-requested`** —
536
+ never `nothing-needed`. Its `--summary` states each mismatch as a question
537
+ for a person ("evidence says 17, draft says 12 — which is right?") and
538
+ says that every run will refuse that draft again until someone answers.
477
539
 
478
540
  The gardener also newly reaches **`policy-obsolete`** — the Retirement
479
541
  condition below tripped and it filed its own teardown proposal. It never
@@ -179,6 +179,10 @@ one exists) must show:
179
179
  alone.
180
180
  - Per skipped candidate: which dedupe hit suppressed it (open ticket URL,
181
181
  done ticket, or rejection date).
182
+ - Per PROMOTE/DEMOTE ticket, the destination-validation record (Ticket
183
+ emission): destinations checked, missing, and created as new; line pointers
184
+ pinned (with the SHA) or dropped; and counts reconciled — or, for a refused
185
+ ticket, the refusal and the mismatch that caused it.
182
186
  - For `nothing-needed`: the thresholds nothing met, in one line.
183
187
 
184
188
  The tickets themselves are the durable artifacts; the report is how a human
@@ -221,6 +225,8 @@ audits the auditor without re-running it.
221
225
  is **advisory**: it returns `rung`, `scope`, `rationale`, and
222
226
  `drafted_artifact`; the gardener decides whether the evidence clears the
223
227
  filing bar and attaches the router's draft to the ticket.
228
+ Before step 4, run the destination-validation check (Ticket emission) on
229
+ every PROMOTE/DEMOTE draft; a draft that fails it is refused, not filed.
224
230
  4. **Emit** (see Ticket emission).
225
231
  5. **Report and record** the run outcome and one-line summary — post the
226
232
  outcome, then record **exactly one** run-record line through the CLI (see
@@ -256,6 +262,54 @@ into the always-loaded rules"`, which stamps the auditable `[lisa-human-gate]`
256
262
  marker. Every other build-ready ticket passes `build_ready: true`. The hold is
257
263
  declared, never implied by an omitted flag.
258
264
 
265
+ <!-- destination-validation:start -->
266
+ **Destination and count validation (before filing any PROMOTE / DEMOTE).**
267
+ The router's draft says *where* the builder should make the change and *how
268
+ much* evidence backs it. Neither is trusted until checked, because a ticket
269
+ pointing at a section that does not exist, or quoting a figure its own
270
+ evidence contradicts, sends the builder to re-derive everything by hand.
271
+ Validate against the default branch of the repository the ticket targets,
272
+ and resolve its head `<sha>` once per run:
273
+
274
+ - **This repository** (`project` scope) — run `git fetch origin <default>`
275
+ first, then `git rev-parse origin/<default>` once for the SHA. Read every
276
+ file at that SHA, never at the moving `origin/<default>`:
277
+ `git cat-file -t <sha>:<path>` must print `blob` (a `tree` is a directory,
278
+ not a file), then `git show <sha>:<path>` for its text.
279
+ - **Upstream** (`upstream` scope) — the paths live in `<upstreamRepo>`, not
280
+ this checkout: `gh api repos/<upstreamRepo>/commits/<default> --jq .sha`
281
+ for the SHA, then for each file
282
+ `gh api -H "Accept: application/vnd.github.raw" repos/<upstreamRepo>/contents/<path>?ref=<sha>`,
283
+ which returns the raw text so headings are searchable (the default JSON
284
+ response is base64-encoded). A response that lists entries means the path
285
+ is a directory, not a file.
286
+
287
+ 1. **Destinations** — fetch every file the ticket names as above; for every
288
+ heading or section, search that file for it. A destination that exists is
289
+ cited as existing. A section the builder must *create* is labelled **new**
290
+ in the ticket, never cited as existing. A file that does not exist is
291
+ always listed in `destinations_missing`; it is then either relabelled as a
292
+ **new file** the builder creates (and also listed in `destinations_new`),
293
+ or, if the draft depends on it already existing, the ticket is **refused**.
294
+ 2. **Line pointers** — drop them, or recompute each one against `<sha>` and
295
+ write that SHA beside it ("line 42 at `<sha>`") so anyone can re-check it
296
+ later. Never copy a pointer from the draft unchecked.
297
+ 3. **Counts** — every count the ticket attributes to its cited evidence
298
+ ("12 of 12 entries", "17 occurrences") is recounted from that evidence.
299
+ Template wording such as "all four legs" and pinned line numbers are not
300
+ counts. On any mismatch the ticket is **refused**: it is not filed, and
301
+ neither side is quietly corrected. The mismatch (both figures and where
302
+ each came from) goes in the run report (Proof) so a person can see what
303
+ disagreed.
304
+
305
+ A refused ticket is not a run failure: the run continues with the other
306
+ candidates and reports the refusal in the run report (Proof). Record per
307
+ ticket in the run report (Proof): `destinations_checked`,
308
+ `destinations_missing`, `destinations_new`, `pointers` (`pinned` with
309
+ `pointer_sha`, or `dropped`), and `counts_reconciled: yes`, or
310
+ `refused: <reason>`.
311
+ <!-- destination-validation:end -->
312
+
259
313
  **Per-item tickets — PROMOTE / DEMOTE** (`issue_type: Task`; GitHub trackers
260
314
  carry the `type:Task` label) — one ticket per recommendation, capped by
261
315
  `max_candidates`:
@@ -267,7 +321,10 @@ carry the `type:Task` label) — one ticket per recommendation, capped by
267
321
  owner).
268
322
  - The router's **`drafted_artifact`** verbatim (the lint/hook sketch +
269
323
  diagnostic text, proposed rule text, skill outline, page outline, or
270
- redundancy proof).
324
+ redundancy proof), embedded only after the destination-validation edits
325
+ above are applied to it: a section that does not exist is relabelled
326
+ **new**, each line pointer is dropped or pinned to `<sha>`, and a draft
327
+ whose counts disagree with its evidence is refused rather than embedded.
271
328
  - For **EXECUTABLE-CONTROL** promotions, embed the promotion-contract AC
272
329
  template below **verbatim** (markers included — do not paraphrase, reorder,
273
330
  or partially quote it; it is the single source of truth from the
@@ -472,6 +529,11 @@ exact so nothing regresses:
472
529
  escalated per Escalation with the operator-readable reason; **or**
473
530
  **`approval-requested`** when the run finished and is waiting on a human gate
474
531
  rather than being broken.
532
+ A run that filed nothing because destination-validation (Ticket emission)
533
+ refused every PROMOTE/DEMOTE draft records **`approval-requested`** —
534
+ never `nothing-needed`. Its `--summary` states each mismatch as a question
535
+ for a person ("evidence says 17, draft says 12 — which is right?") and
536
+ says that every run will refuse that draft again until someone answers.
475
537
 
476
538
  The gardener also newly reaches **`policy-obsolete`** — the Retirement
477
539
  condition below tripped and it filed its own teardown proposal. It never
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -179,6 +179,10 @@ one exists) must show:
179
179
  alone.
180
180
  - Per skipped candidate: which dedupe hit suppressed it (open ticket URL,
181
181
  done ticket, or rejection date).
182
+ - Per PROMOTE/DEMOTE ticket, the destination-validation record (Ticket
183
+ emission): destinations checked, missing, and created as new; line pointers
184
+ pinned (with the SHA) or dropped; and counts reconciled — or, for a refused
185
+ ticket, the refusal and the mismatch that caused it.
182
186
  - For `nothing-needed`: the thresholds nothing met, in one line.
183
187
 
184
188
  The tickets themselves are the durable artifacts; the report is how a human
@@ -221,6 +225,8 @@ audits the auditor without re-running it.
221
225
  is **advisory**: it returns `rung`, `scope`, `rationale`, and
222
226
  `drafted_artifact`; the gardener decides whether the evidence clears the
223
227
  filing bar and attaches the router's draft to the ticket.
228
+ Before step 4, run the destination-validation check (Ticket emission) on
229
+ every PROMOTE/DEMOTE draft; a draft that fails it is refused, not filed.
224
230
  4. **Emit** (see Ticket emission).
225
231
  5. **Report and record** the run outcome and one-line summary — post the
226
232
  outcome, then record **exactly one** run-record line through the CLI (see
@@ -256,6 +262,54 @@ into the always-loaded rules"`, which stamps the auditable `[lisa-human-gate]`
256
262
  marker. Every other build-ready ticket passes `build_ready: true`. The hold is
257
263
  declared, never implied by an omitted flag.
258
264
 
265
+ <!-- destination-validation:start -->
266
+ **Destination and count validation (before filing any PROMOTE / DEMOTE).**
267
+ The router's draft says *where* the builder should make the change and *how
268
+ much* evidence backs it. Neither is trusted until checked, because a ticket
269
+ pointing at a section that does not exist, or quoting a figure its own
270
+ evidence contradicts, sends the builder to re-derive everything by hand.
271
+ Validate against the default branch of the repository the ticket targets,
272
+ and resolve its head `<sha>` once per run:
273
+
274
+ - **This repository** (`project` scope) — run `git fetch origin <default>`
275
+ first, then `git rev-parse origin/<default>` once for the SHA. Read every
276
+ file at that SHA, never at the moving `origin/<default>`:
277
+ `git cat-file -t <sha>:<path>` must print `blob` (a `tree` is a directory,
278
+ not a file), then `git show <sha>:<path>` for its text.
279
+ - **Upstream** (`upstream` scope) — the paths live in `<upstreamRepo>`, not
280
+ this checkout: `gh api repos/<upstreamRepo>/commits/<default> --jq .sha`
281
+ for the SHA, then for each file
282
+ `gh api -H "Accept: application/vnd.github.raw" repos/<upstreamRepo>/contents/<path>?ref=<sha>`,
283
+ which returns the raw text so headings are searchable (the default JSON
284
+ response is base64-encoded). A response that lists entries means the path
285
+ is a directory, not a file.
286
+
287
+ 1. **Destinations** — fetch every file the ticket names as above; for every
288
+ heading or section, search that file for it. A destination that exists is
289
+ cited as existing. A section the builder must *create* is labelled **new**
290
+ in the ticket, never cited as existing. A file that does not exist is
291
+ always listed in `destinations_missing`; it is then either relabelled as a
292
+ **new file** the builder creates (and also listed in `destinations_new`),
293
+ or, if the draft depends on it already existing, the ticket is **refused**.
294
+ 2. **Line pointers** — drop them, or recompute each one against `<sha>` and
295
+ write that SHA beside it ("line 42 at `<sha>`") so anyone can re-check it
296
+ later. Never copy a pointer from the draft unchecked.
297
+ 3. **Counts** — every count the ticket attributes to its cited evidence
298
+ ("12 of 12 entries", "17 occurrences") is recounted from that evidence.
299
+ Template wording such as "all four legs" and pinned line numbers are not
300
+ counts. On any mismatch the ticket is **refused**: it is not filed, and
301
+ neither side is quietly corrected. The mismatch (both figures and where
302
+ each came from) goes in the run report (Proof) so a person can see what
303
+ disagreed.
304
+
305
+ A refused ticket is not a run failure: the run continues with the other
306
+ candidates and reports the refusal in the run report (Proof). Record per
307
+ ticket in the run report (Proof): `destinations_checked`,
308
+ `destinations_missing`, `destinations_new`, `pointers` (`pinned` with
309
+ `pointer_sha`, or `dropped`), and `counts_reconciled: yes`, or
310
+ `refused: <reason>`.
311
+ <!-- destination-validation:end -->
312
+
259
313
  **Per-item tickets — PROMOTE / DEMOTE** (`issue_type: Task`; GitHub trackers
260
314
  carry the `type:Task` label) — one ticket per recommendation, capped by
261
315
  `max_candidates`:
@@ -267,7 +321,10 @@ carry the `type:Task` label) — one ticket per recommendation, capped by
267
321
  owner).
268
322
  - The router's **`drafted_artifact`** verbatim (the lint/hook sketch +
269
323
  diagnostic text, proposed rule text, skill outline, page outline, or
270
- redundancy proof).
324
+ redundancy proof), embedded only after the destination-validation edits
325
+ above are applied to it: a section that does not exist is relabelled
326
+ **new**, each line pointer is dropped or pinned to `<sha>`, and a draft
327
+ whose counts disagree with its evidence is refused rather than embedded.
271
328
  - For **EXECUTABLE-CONTROL** promotions, embed the promotion-contract AC
272
329
  template below **verbatim** (markers included — do not paraphrase, reorder,
273
330
  or partially quote it; it is the single source of truth from the
@@ -472,6 +529,11 @@ exact so nothing regresses:
472
529
  escalated per Escalation with the operator-readable reason; **or**
473
530
  **`approval-requested`** when the run finished and is waiting on a human gate
474
531
  rather than being broken.
532
+ A run that filed nothing because destination-validation (Ticket emission)
533
+ refused every PROMOTE/DEMOTE draft records **`approval-requested`** —
534
+ never `nothing-needed`. Its `--summary` states each mismatch as a question
535
+ for a person ("evidence says 17, draft says 12 — which is right?") and
536
+ says that every run will refuse that draft again until someone answers.
475
537
 
476
538
  The gardener also newly reaches **`policy-obsolete`** — the Retirement
477
539
  condition below tripped and it filed its own teardown proposal. It never
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
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-cdk",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -179,6 +179,10 @@ one exists) must show:
179
179
  alone.
180
180
  - Per skipped candidate: which dedupe hit suppressed it (open ticket URL,
181
181
  done ticket, or rejection date).
182
+ - Per PROMOTE/DEMOTE ticket, the destination-validation record (Ticket
183
+ emission): destinations checked, missing, and created as new; line pointers
184
+ pinned (with the SHA) or dropped; and counts reconciled — or, for a refused
185
+ ticket, the refusal and the mismatch that caused it.
182
186
  - For `nothing-needed`: the thresholds nothing met, in one line.
183
187
 
184
188
  The tickets themselves are the durable artifacts; the report is how a human
@@ -221,6 +225,8 @@ audits the auditor without re-running it.
221
225
  is **advisory**: it returns `rung`, `scope`, `rationale`, and
222
226
  `drafted_artifact`; the gardener decides whether the evidence clears the
223
227
  filing bar and attaches the router's draft to the ticket.
228
+ Before step 4, run the destination-validation check (Ticket emission) on
229
+ every PROMOTE/DEMOTE draft; a draft that fails it is refused, not filed.
224
230
  4. **Emit** (see Ticket emission).
225
231
  5. **Report and record** the run outcome and one-line summary — post the
226
232
  outcome, then record **exactly one** run-record line through the CLI (see
@@ -256,6 +262,54 @@ into the always-loaded rules"`, which stamps the auditable `[lisa-human-gate]`
256
262
  marker. Every other build-ready ticket passes `build_ready: true`. The hold is
257
263
  declared, never implied by an omitted flag.
258
264
 
265
+ <!-- destination-validation:start -->
266
+ **Destination and count validation (before filing any PROMOTE / DEMOTE).**
267
+ The router's draft says *where* the builder should make the change and *how
268
+ much* evidence backs it. Neither is trusted until checked, because a ticket
269
+ pointing at a section that does not exist, or quoting a figure its own
270
+ evidence contradicts, sends the builder to re-derive everything by hand.
271
+ Validate against the default branch of the repository the ticket targets,
272
+ and resolve its head `<sha>` once per run:
273
+
274
+ - **This repository** (`project` scope) — run `git fetch origin <default>`
275
+ first, then `git rev-parse origin/<default>` once for the SHA. Read every
276
+ file at that SHA, never at the moving `origin/<default>`:
277
+ `git cat-file -t <sha>:<path>` must print `blob` (a `tree` is a directory,
278
+ not a file), then `git show <sha>:<path>` for its text.
279
+ - **Upstream** (`upstream` scope) — the paths live in `<upstreamRepo>`, not
280
+ this checkout: `gh api repos/<upstreamRepo>/commits/<default> --jq .sha`
281
+ for the SHA, then for each file
282
+ `gh api -H "Accept: application/vnd.github.raw" repos/<upstreamRepo>/contents/<path>?ref=<sha>`,
283
+ which returns the raw text so headings are searchable (the default JSON
284
+ response is base64-encoded). A response that lists entries means the path
285
+ is a directory, not a file.
286
+
287
+ 1. **Destinations** — fetch every file the ticket names as above; for every
288
+ heading or section, search that file for it. A destination that exists is
289
+ cited as existing. A section the builder must *create* is labelled **new**
290
+ in the ticket, never cited as existing. A file that does not exist is
291
+ always listed in `destinations_missing`; it is then either relabelled as a
292
+ **new file** the builder creates (and also listed in `destinations_new`),
293
+ or, if the draft depends on it already existing, the ticket is **refused**.
294
+ 2. **Line pointers** — drop them, or recompute each one against `<sha>` and
295
+ write that SHA beside it ("line 42 at `<sha>`") so anyone can re-check it
296
+ later. Never copy a pointer from the draft unchecked.
297
+ 3. **Counts** — every count the ticket attributes to its cited evidence
298
+ ("12 of 12 entries", "17 occurrences") is recounted from that evidence.
299
+ Template wording such as "all four legs" and pinned line numbers are not
300
+ counts. On any mismatch the ticket is **refused**: it is not filed, and
301
+ neither side is quietly corrected. The mismatch (both figures and where
302
+ each came from) goes in the run report (Proof) so a person can see what
303
+ disagreed.
304
+
305
+ A refused ticket is not a run failure: the run continues with the other
306
+ candidates and reports the refusal in the run report (Proof). Record per
307
+ ticket in the run report (Proof): `destinations_checked`,
308
+ `destinations_missing`, `destinations_new`, `pointers` (`pinned` with
309
+ `pointer_sha`, or `dropped`), and `counts_reconciled: yes`, or
310
+ `refused: <reason>`.
311
+ <!-- destination-validation:end -->
312
+
259
313
  **Per-item tickets — PROMOTE / DEMOTE** (`issue_type: Task`; GitHub trackers
260
314
  carry the `type:Task` label) — one ticket per recommendation, capped by
261
315
  `max_candidates`:
@@ -267,7 +321,10 @@ carry the `type:Task` label) — one ticket per recommendation, capped by
267
321
  owner).
268
322
  - The router's **`drafted_artifact`** verbatim (the lint/hook sketch +
269
323
  diagnostic text, proposed rule text, skill outline, page outline, or
270
- redundancy proof).
324
+ redundancy proof), embedded only after the destination-validation edits
325
+ above are applied to it: a section that does not exist is relabelled
326
+ **new**, each line pointer is dropped or pinned to `<sha>`, and a draft
327
+ whose counts disagree with its evidence is refused rather than embedded.
271
328
  - For **EXECUTABLE-CONTROL** promotions, embed the promotion-contract AC
272
329
  template below **verbatim** (markers included — do not paraphrase, reorder,
273
330
  or partially quote it; it is the single source of truth from the
@@ -472,6 +529,11 @@ exact so nothing regresses:
472
529
  escalated per Escalation with the operator-readable reason; **or**
473
530
  **`approval-requested`** when the run finished and is waiting on a human gate
474
531
  rather than being broken.
532
+ A run that filed nothing because destination-validation (Ticket emission)
533
+ refused every PROMOTE/DEMOTE draft records **`approval-requested`** —
534
+ never `nothing-needed`. Its `--summary` states each mismatch as a question
535
+ for a person ("evidence says 17, draft says 12 — which is right?") and
536
+ says that every run will refuse that draft again until someone answers.
475
537
 
476
538
  The gardener also newly reaches **`policy-obsolete`** — the Retirement
477
539
  condition below tripped and it filed its own teardown proposal. It never
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -179,6 +179,10 @@ one exists) must show:
179
179
  alone.
180
180
  - Per skipped candidate: which dedupe hit suppressed it (open ticket URL,
181
181
  done ticket, or rejection date).
182
+ - Per PROMOTE/DEMOTE ticket, the destination-validation record (Ticket
183
+ emission): destinations checked, missing, and created as new; line pointers
184
+ pinned (with the SHA) or dropped; and counts reconciled — or, for a refused
185
+ ticket, the refusal and the mismatch that caused it.
182
186
  - For `nothing-needed`: the thresholds nothing met, in one line.
183
187
 
184
188
  The tickets themselves are the durable artifacts; the report is how a human
@@ -221,6 +225,8 @@ audits the auditor without re-running it.
221
225
  is **advisory**: it returns `rung`, `scope`, `rationale`, and
222
226
  `drafted_artifact`; the gardener decides whether the evidence clears the
223
227
  filing bar and attaches the router's draft to the ticket.
228
+ Before step 4, run the destination-validation check (Ticket emission) on
229
+ every PROMOTE/DEMOTE draft; a draft that fails it is refused, not filed.
224
230
  4. **Emit** (see Ticket emission).
225
231
  5. **Report and record** the run outcome and one-line summary — post the
226
232
  outcome, then record **exactly one** run-record line through the CLI (see
@@ -256,6 +262,54 @@ into the always-loaded rules"`, which stamps the auditable `[lisa-human-gate]`
256
262
  marker. Every other build-ready ticket passes `build_ready: true`. The hold is
257
263
  declared, never implied by an omitted flag.
258
264
 
265
+ <!-- destination-validation:start -->
266
+ **Destination and count validation (before filing any PROMOTE / DEMOTE).**
267
+ The router's draft says *where* the builder should make the change and *how
268
+ much* evidence backs it. Neither is trusted until checked, because a ticket
269
+ pointing at a section that does not exist, or quoting a figure its own
270
+ evidence contradicts, sends the builder to re-derive everything by hand.
271
+ Validate against the default branch of the repository the ticket targets,
272
+ and resolve its head `<sha>` once per run:
273
+
274
+ - **This repository** (`project` scope) — run `git fetch origin <default>`
275
+ first, then `git rev-parse origin/<default>` once for the SHA. Read every
276
+ file at that SHA, never at the moving `origin/<default>`:
277
+ `git cat-file -t <sha>:<path>` must print `blob` (a `tree` is a directory,
278
+ not a file), then `git show <sha>:<path>` for its text.
279
+ - **Upstream** (`upstream` scope) — the paths live in `<upstreamRepo>`, not
280
+ this checkout: `gh api repos/<upstreamRepo>/commits/<default> --jq .sha`
281
+ for the SHA, then for each file
282
+ `gh api -H "Accept: application/vnd.github.raw" repos/<upstreamRepo>/contents/<path>?ref=<sha>`,
283
+ which returns the raw text so headings are searchable (the default JSON
284
+ response is base64-encoded). A response that lists entries means the path
285
+ is a directory, not a file.
286
+
287
+ 1. **Destinations** — fetch every file the ticket names as above; for every
288
+ heading or section, search that file for it. A destination that exists is
289
+ cited as existing. A section the builder must *create* is labelled **new**
290
+ in the ticket, never cited as existing. A file that does not exist is
291
+ always listed in `destinations_missing`; it is then either relabelled as a
292
+ **new file** the builder creates (and also listed in `destinations_new`),
293
+ or, if the draft depends on it already existing, the ticket is **refused**.
294
+ 2. **Line pointers** — drop them, or recompute each one against `<sha>` and
295
+ write that SHA beside it ("line 42 at `<sha>`") so anyone can re-check it
296
+ later. Never copy a pointer from the draft unchecked.
297
+ 3. **Counts** — every count the ticket attributes to its cited evidence
298
+ ("12 of 12 entries", "17 occurrences") is recounted from that evidence.
299
+ Template wording such as "all four legs" and pinned line numbers are not
300
+ counts. On any mismatch the ticket is **refused**: it is not filed, and
301
+ neither side is quietly corrected. The mismatch (both figures and where
302
+ each came from) goes in the run report (Proof) so a person can see what
303
+ disagreed.
304
+
305
+ A refused ticket is not a run failure: the run continues with the other
306
+ candidates and reports the refusal in the run report (Proof). Record per
307
+ ticket in the run report (Proof): `destinations_checked`,
308
+ `destinations_missing`, `destinations_new`, `pointers` (`pinned` with
309
+ `pointer_sha`, or `dropped`), and `counts_reconciled: yes`, or
310
+ `refused: <reason>`.
311
+ <!-- destination-validation:end -->
312
+
259
313
  **Per-item tickets — PROMOTE / DEMOTE** (`issue_type: Task`; GitHub trackers
260
314
  carry the `type:Task` label) — one ticket per recommendation, capped by
261
315
  `max_candidates`:
@@ -267,7 +321,10 @@ carry the `type:Task` label) — one ticket per recommendation, capped by
267
321
  owner).
268
322
  - The router's **`drafted_artifact`** verbatim (the lint/hook sketch +
269
323
  diagnostic text, proposed rule text, skill outline, page outline, or
270
- redundancy proof).
324
+ redundancy proof), embedded only after the destination-validation edits
325
+ above are applied to it: a section that does not exist is relabelled
326
+ **new**, each line pointer is dropped or pinned to `<sha>`, and a draft
327
+ whose counts disagree with its evidence is refused rather than embedded.
271
328
  - For **EXECUTABLE-CONTROL** promotions, embed the promotion-contract AC
272
329
  template below **verbatim** (markers included — do not paraphrase, reorder,
273
330
  or partially quote it; it is the single source of truth from the
@@ -472,6 +529,11 @@ exact so nothing regresses:
472
529
  escalated per Escalation with the operator-readable reason; **or**
473
530
  **`approval-requested`** when the run finished and is waiting on a human gate
474
531
  rather than being broken.
532
+ A run that filed nothing because destination-validation (Ticket emission)
533
+ refused every PROMOTE/DEMOTE draft records **`approval-requested`** —
534
+ never `nothing-needed`. Its `--summary` states each mismatch as a question
535
+ for a person ("evidence says 17, draft says 12 — which is right?") and
536
+ says that every run will refuse that draft again until someone answers.
475
537
 
476
538
  The gardener also newly reaches **`policy-obsolete`** — the Retirement
477
539
  condition below tripped and it filed its own teardown proposal. It never
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "5.1.4",
3
+ "version": "5.1.6",
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": "5.1.4",
3
+ "version": "5.1.6",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"