@codyswann/lisa 8.4.0 → 8.5.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 (178) hide show
  1. package/all/copy-overwrite/scripts/lib/private-key-redaction.d.mts +4 -0
  2. package/all/copy-overwrite/scripts/lib/private-key-redaction.mjs +59 -0
  3. package/all/copy-overwrite/scripts/lisa-gates.mjs +1 -0
  4. package/all/copy-overwrite/scripts/lisa-hooks/block-direct-issue-create.sh +4 -1
  5. package/all/copy-overwrite/scripts/lisa-hooks/worktree-binding-guard.mjs +56 -1
  6. package/all/copy-overwrite/scripts/lisa-run-gates.mjs +17 -14
  7. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +2 -2
  8. package/dist/controls/carrier-edits.d.ts +1 -1
  9. package/dist/controls/carrier-edits.d.ts.map +1 -1
  10. package/dist/controls/carrier-edits.js +13 -3
  11. package/dist/controls/carrier-edits.js.map +1 -1
  12. package/dist/controls/carriers.d.ts.map +1 -1
  13. package/dist/controls/carriers.js +7 -2
  14. package/dist/controls/carriers.js.map +1 -1
  15. package/dist/controls/checks-binding.d.ts.map +1 -1
  16. package/dist/controls/checks-binding.js +13 -7
  17. package/dist/controls/checks-binding.js.map +1 -1
  18. package/dist/controls/commands/attest-before-enforce.d.ts.map +1 -1
  19. package/dist/controls/commands/attest-before-enforce.js +4 -5
  20. package/dist/controls/commands/attest-before-enforce.js.map +1 -1
  21. package/dist/controls/commands/attest-workspace.d.ts.map +1 -1
  22. package/dist/controls/commands/attest-workspace.js +3 -1
  23. package/dist/controls/commands/attest-workspace.js.map +1 -1
  24. package/dist/controls/commands/proof-check.js +1 -1
  25. package/dist/controls/commands/proof-check.js.map +1 -1
  26. package/dist/controls/enforce-entry-outcome.d.ts +2 -1
  27. package/dist/controls/enforce-entry-outcome.d.ts.map +1 -1
  28. package/dist/controls/enforce-entry-outcome.js +17 -15
  29. package/dist/controls/enforce-entry-outcome.js.map +1 -1
  30. package/dist/controls/enforce-points.d.ts +2 -0
  31. package/dist/controls/enforce-points.d.ts.map +1 -1
  32. package/dist/controls/enforce-points.js +4 -1
  33. package/dist/controls/enforce-points.js.map +1 -1
  34. package/dist/controls/enforce-report.d.ts.map +1 -1
  35. package/dist/controls/enforce-report.js +6 -1
  36. package/dist/controls/enforce-report.js.map +1 -1
  37. package/dist/controls/evidence-redact.d.ts.map +1 -1
  38. package/dist/controls/evidence-redact.js +11 -6
  39. package/dist/controls/evidence-redact.js.map +1 -1
  40. package/dist/controls/gates-declaration.d.ts.map +1 -1
  41. package/dist/controls/gates-declaration.js +6 -1
  42. package/dist/controls/gates-declaration.js.map +1 -1
  43. package/dist/controls/proof-copy-preparation.d.ts +33 -0
  44. package/dist/controls/proof-copy-preparation.d.ts.map +1 -0
  45. package/dist/controls/proof-copy-preparation.js +159 -0
  46. package/dist/controls/proof-copy-preparation.js.map +1 -0
  47. package/dist/controls/proof-copy-prepared-state.d.ts +33 -0
  48. package/dist/controls/proof-copy-prepared-state.d.ts.map +1 -0
  49. package/dist/controls/proof-copy-prepared-state.js +117 -0
  50. package/dist/controls/proof-copy-prepared-state.js.map +1 -0
  51. package/dist/controls/proof-copy-workspace.d.ts.map +1 -1
  52. package/dist/controls/proof-copy-workspace.js +17 -4
  53. package/dist/controls/proof-copy-workspace.js.map +1 -1
  54. package/dist/controls/proof-copy.d.ts +5 -0
  55. package/dist/controls/proof-copy.d.ts.map +1 -1
  56. package/dist/controls/proof-copy.js +17 -15
  57. package/dist/controls/proof-copy.js.map +1 -1
  58. package/dist/controls/proof-patch.d.ts +12 -0
  59. package/dist/controls/proof-patch.d.ts.map +1 -1
  60. package/dist/controls/proof-patch.js +28 -0
  61. package/dist/controls/proof-patch.js.map +1 -1
  62. package/dist/controls/proof-preparation-declaration.d.ts +15 -0
  63. package/dist/controls/proof-preparation-declaration.d.ts.map +1 -0
  64. package/dist/controls/proof-preparation-declaration.js +57 -0
  65. package/dist/controls/proof-preparation-declaration.js.map +1 -0
  66. package/dist/controls/proof-tools.d.ts +7 -4
  67. package/dist/controls/proof-tools.d.ts.map +1 -1
  68. package/dist/controls/proof-tools.js +1 -1
  69. package/dist/controls/proof-tools.js.map +1 -1
  70. package/dist/controls/register-drift.d.ts.map +1 -1
  71. package/dist/controls/register-drift.js +4 -3
  72. package/dist/controls/register-drift.js.map +1 -1
  73. package/dist/controls/secret-scan.d.ts.map +1 -1
  74. package/dist/controls/secret-scan.js +7 -5
  75. package/dist/controls/secret-scan.js.map +1 -1
  76. package/dist/controls/secret-shapes.d.ts +7 -7
  77. package/dist/controls/secret-shapes.d.ts.map +1 -1
  78. package/dist/controls/secret-shapes.js +7 -18
  79. package/dist/controls/secret-shapes.js.map +1 -1
  80. package/dist/controls/shipped-parts.d.ts +7 -0
  81. package/dist/controls/shipped-parts.d.ts.map +1 -1
  82. package/dist/controls/shipped-parts.js +17 -0
  83. package/dist/controls/shipped-parts.js.map +1 -1
  84. package/dist/core/lisa-owned-hash-ledger.json +32 -0
  85. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  86. package/dist/core/upstream-evidence-manifest.json +52 -12
  87. package/package.json +4 -4
  88. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  90. package/plugins/lisa/.codex-plugin/skills/lisa-attest/SKILL.md +12 -2
  91. package/plugins/lisa/.codex-plugin/skills/lisa-configure/SKILL.md +19 -6
  92. package/plugins/lisa/hooks/block-direct-issue-create.sh +4 -1
  93. package/plugins/lisa/hooks/worktree-binding-guard.mjs +56 -1
  94. package/plugins/lisa/skills/lisa-attest/SKILL.md +12 -2
  95. package/plugins/lisa/skills/lisa-configure/SKILL.md +19 -6
  96. package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +4 -1
  97. package/plugins/lisa-agy/plugin.json +1 -1
  98. package/plugins/lisa-agy/skills/lisa-attest/SKILL.md +12 -2
  99. package/plugins/lisa-agy/skills/lisa-configure/SKILL.md +19 -6
  100. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  101. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  102. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  103. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  106. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  107. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +4 -1
  109. package/plugins/lisa-copilot/hooks/worktree-binding-guard.mjs +56 -1
  110. package/plugins/lisa-copilot/skills/lisa-attest/SKILL.md +12 -2
  111. package/plugins/lisa-copilot/skills/lisa-configure/SKILL.md +19 -6
  112. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +4 -1
  114. package/plugins/lisa-cursor/hooks/worktree-binding-guard.mjs +56 -1
  115. package/plugins/lisa-cursor/skills/lisa-attest/SKILL.md +12 -2
  116. package/plugins/lisa-cursor/skills/lisa-configure/SKILL.md +19 -6
  117. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  119. package/plugins/lisa-devin/hooks/block-direct-issue-create.sh +4 -1
  120. package/plugins/lisa-devin/hooks/worktree-binding-guard.mjs +56 -1
  121. package/plugins/lisa-devin/skills/lisa-attest/SKILL.md +12 -2
  122. package/plugins/lisa-devin/skills/lisa-configure/SKILL.md +19 -6
  123. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  125. package/plugins/lisa-expo-agy/plugin.json +1 -1
  126. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  127. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  128. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  129. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  130. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  131. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  132. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  133. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  135. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  136. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  137. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  138. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  139. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  140. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  141. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  142. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  143. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  144. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  145. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  146. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  147. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  148. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  149. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  150. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  151. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  152. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  153. package/plugins/lisa-rails-agy/plugin.json +1 -1
  154. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  155. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  156. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  157. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  158. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  159. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  160. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  161. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  162. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  163. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  164. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  165. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  166. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  167. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  168. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  169. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  170. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  171. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  172. package/plugins/src/base/hooks/block-direct-issue-create.sh +4 -1
  173. package/plugins/src/base/hooks/worktree-binding-guard.mjs +56 -1
  174. package/plugins/src/base/skills/lisa-attest/SKILL.md +12 -2
  175. package/plugins/src/base/skills/lisa-configure/SKILL.md +19 -6
  176. package/scripts/lib/phrase-tests/redact.mjs +3 -8
  177. package/scripts/two-channel-couplings.json +1 -1
  178. package/typescript/copy-overwrite/.prettierignore +1 -0
@@ -442,6 +442,56 @@ function applyCd(current, target) {
442
442
  }
443
443
  }
444
444
 
445
+ const PYTHON_STRING = String.raw`(?:"[^"\\]*"|'[^'\\]*')`;
446
+ const PYTHON_BYTES = `b${PYTHON_STRING}`;
447
+ const PYTHON_NAME = "[A-Za-z_][A-Za-z0-9_]*";
448
+ const PYTHON_BYTES_ASSIGNMENT = new RegExp(
449
+ String.raw`^(${PYTHON_NAME})[ \t]*=[ \t]*${PYTHON_BYTES}$`,
450
+ "u"
451
+ );
452
+ const PYTHON_BYTES_COMPARISON = new RegExp(
453
+ String.raw`^assert[ \t]+(${PYTHON_NAME})\.replace\([ \t]*${PYTHON_BYTES}[ \t]*,[ \t]*${PYTHON_BYTES}[ \t]*\)[ \t]*==[ \t]*(${PYTHON_NAME})$`,
454
+ "u"
455
+ );
456
+ const PYTHON_LITERAL_GIT_CALL = new RegExp(
457
+ String.raw`^subprocess\.check_output\(\[[ \t]*(?:"git"|'git')(?:[ \t]*,[ \t]*${PYTHON_STRING})*[ \t]*\](?:[ \t]*,[ \t]*cwd[ \t]*=[ \t]*b?${PYTHON_STRING})?[ \t]*\)$`,
458
+ "u"
459
+ );
460
+
461
+ /**
462
+ * Ignore the literals of a bounded Python source-byte comparison. The script
463
+ * can assign two bytes values and compare one replacement with the other.
464
+ * Optional literal Git subprocess calls remain visible to the path scanner.
465
+ * Any additional Python statement keeps the full source under inspection.
466
+ * @param {string} text - The bounded source read from the script
467
+ * @returns {string} The source to inspect for directory paths
468
+ */
469
+ function pythonSourceForPathScan(text) {
470
+ const lines = text
471
+ .split(/\r\n?|\n/u)
472
+ .map(line => line.trim())
473
+ .filter(line => line !== "" && !line.startsWith("#"));
474
+ const importsSubprocess = lines[0] === "import subprocess";
475
+ const [first, second, assertion, ...calls] = lines.slice(
476
+ importsSubprocess ? 1 : 0
477
+ );
478
+ const before = PYTHON_BYTES_ASSIGNMENT.exec(first ?? "")?.[1];
479
+ const after = PYTHON_BYTES_ASSIGNMENT.exec(second ?? "")?.[1];
480
+ const compared = PYTHON_BYTES_COMPARISON.exec(assertion ?? "");
481
+ if (
482
+ before === undefined ||
483
+ after === undefined ||
484
+ before === after ||
485
+ compared?.[1] !== before ||
486
+ compared[2] !== after ||
487
+ (calls.length > 0 && !importsSubprocess) ||
488
+ !calls.every(line => PYTHON_LITERAL_GIT_CALL.test(line))
489
+ ) {
490
+ return text;
491
+ }
492
+ return calls.join("\n");
493
+ }
494
+
445
495
  /**
446
496
  * The foreign worktree an executed script reaches, or null.
447
497
  *
@@ -532,7 +582,12 @@ function scriptReachingForeignTree(payload, bound) {
532
582
  // Not a readable file: nothing was executed that this can read.
533
583
  continue;
534
584
  }
535
- const foreign = foreignTreeIn(text, bound, cwd);
585
+ const program = tokenise(segment)[0]?.split("/").at(-1);
586
+ const inspected =
587
+ program === "python" || program === "python3"
588
+ ? pythonSourceForPathScan(text)
589
+ : text;
590
+ const foreign = foreignTreeIn(inspected, bound, cwd);
536
591
  if (foreign) return { script: path, foreign };
537
592
  }
538
593
  return null;
@@ -129,6 +129,13 @@ For a before-enforce run, go from here to "The before-enforce run".
129
129
  **Needs:** the repository root. **Hands on:** one result for each declared check, and three
130
130
  written files.
131
131
 
132
+ Read the committed `controls.proof_copy.prepare` in `.lisa.config.json` before
133
+ running a proof. If commands are declared and the operator has yet to approve
134
+ this repository and command list, show the exact arguments and ask once before
135
+ the first run. Say that the commands run in the temporary copy and can use this
136
+ machine's network and credentials. Reuse approval recorded by configure for the
137
+ same list. Apply the same rule before a `--before-enforce` run.
138
+
132
139
  ```bash
133
140
  lisa controls attest --json
134
141
  ```
@@ -146,8 +153,11 @@ A proof is two test changes, kept as patch files: one that breaks the check's ru
146
153
  does not. At commit and at push a check is only started when the change touches the check's own
147
154
  folder. So each test change has to edit a file inside the check's own folder: one that edits a
148
155
  file anywhere else never starts the check, and that half reads `unknown` (not started), never a
149
- pass. When an entry is `unknown` for that reason, say so: the test change is in the wrong place,
150
- and the configure step (`/lisa:configure`) is where it is corrected.
156
+ pass. When an entry is `unknown` for that reason, say so and send it back to
157
+ `/lisa:configure` to correct the test change. If the reason is an unavailable
158
+ dependency or hook, read the detail for what is still missing after any declared
159
+ preparation. A preparation failure ends the command before it produces an
160
+ entry verdict.
151
161
 
152
162
  An entry that is `unproved` because a test change is missing (`reason` is `half-missing`) has
153
163
  nothing wrong with its check: the two test changes were never written for it, or only one was. The
@@ -431,13 +431,26 @@ is written, remove the scratch folder. Nothing of it is left in the repository.
431
431
 
432
432
  **4. Have the pairs tried.**
433
433
 
434
+ If a fresh clone needs dependencies, generated output or a hook manager, propose
435
+ the argument lists for `controls.proof_copy.prepare` in `.lisa.config.json`. Use
436
+ the repository's lockfile, declared package manager and hook configuration to
437
+ identify the commands. For example, a Bun project with Lefthook may need
438
+ `[["bun", "install", "--frozen-lockfile"], ["./node_modules/.bin/lefthook", "install"]]`.
439
+ Record the approved commands in the committed config before trying the pairs.
440
+
441
+ Before the first run that uses those commands, show their exact arguments and
442
+ ask the operator once. For example, “May I run these setup commands in the
443
+ temporary copy? They can use this machine's network and credentials.” Carry
444
+ the answer into the attest handoff for the same repository and command list.
445
+ Ask again only if the command list changes.
446
+
434
447
  ```bash
435
448
  lisa controls proof-check
436
449
  ```
437
450
 
438
451
  It puts each change on the last commit in a temporary copy, runs the check's own command on it
439
- there, and removes the copy. It changes nothing in the repository, it installs nothing, and it
440
- works with uncommitted work in place. It prints one JSON document; read `parts`, one entry per
452
+ there, and removes the copy. The configured preparation runs once in that copy before the
453
+ checks. It works with uncommitted work in place and leaves the repository files alone. It prints one JSON document; read `parts`, one entry per
441
454
  declared part:
442
455
 
443
456
  | `result` | Meaning | What you do |
@@ -455,10 +468,10 @@ declared part:
455
468
  Repeat until every part that declares a pair reads `ready`. Ground rule 9 holds throughout: you
456
469
  change the test changes, never the check.
457
470
 
458
- The temporary copy holds the last commit and nothing git ignores. A tool that only runs with files
459
- the working copy has and the commit does not (installed dependencies, built output) cannot run
460
- there, and reads as not started, or as failing on the clean change without its failure text. Do not
461
- install anything and do not commit anything to get around that.
471
+ The temporary copy starts from the last commit. If a check needs dependencies or generated files,
472
+ configure and obtain approval for `controls.proof_copy.prepare` as described above, then rerun
473
+ `proof-check`. Without suitable preparation, the check may fail to start or fail on the clean
474
+ change. Keep installed dependencies and generated output out of the commit.
462
475
 
463
476
  When a pair cannot be made ready honestly (the tool is not installed on this machine, it cannot run
464
477
  in a copy of the last commit, or the check does not catch what it was assumed to catch), delete its
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "8.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -729,11 +729,14 @@ HTTP_CLIS = {"curl", "http", "httpie", "wget"}
729
729
  # and permitting something we demonstrably cannot read. Deliberately narrower
730
730
  # than "mentions a tracker CLI" so an ordinary unparseable command
731
731
  # (`echo 'it's fine`) still passes.
732
+ # The GitHub collection can create an issue. A complete numeric member path
733
+ # identifies an existing issue. Keep the fallback for other route forms and
734
+ # for independent creation signatures appearing alongside a member path.
732
735
  UNPARSEABLE_CREATION = re.compile(
733
736
  r"\b(?:gh|jira|linear)\b[^\n]*?\bissue\b[^\n]*?\bcreate\b"
734
737
  r"|\bacli\b[^\n]*?\b(?:workitem|issue)s?\b[^\n]*?\bcreate\b"
735
738
  r"|\bcreateIssue\b|\bissueCreate\b"
736
- r"|repos/[^/\s]+/[^/\s]+/issues"
739
+ r"|repos/[^/\s]+/[^/\s]+/issues\b(?!/[0-9]+(?:$|[\s'\"`.,);?#]))"
737
740
  r"|atlassian\.net/rest/api/[^/\s]+/issue",
738
741
  re.IGNORECASE,
739
742
  )
@@ -442,6 +442,56 @@ function applyCd(current, target) {
442
442
  }
443
443
  }
444
444
 
445
+ const PYTHON_STRING = String.raw`(?:"[^"\\]*"|'[^'\\]*')`;
446
+ const PYTHON_BYTES = `b${PYTHON_STRING}`;
447
+ const PYTHON_NAME = "[A-Za-z_][A-Za-z0-9_]*";
448
+ const PYTHON_BYTES_ASSIGNMENT = new RegExp(
449
+ String.raw`^(${PYTHON_NAME})[ \t]*=[ \t]*${PYTHON_BYTES}$`,
450
+ "u"
451
+ );
452
+ const PYTHON_BYTES_COMPARISON = new RegExp(
453
+ String.raw`^assert[ \t]+(${PYTHON_NAME})\.replace\([ \t]*${PYTHON_BYTES}[ \t]*,[ \t]*${PYTHON_BYTES}[ \t]*\)[ \t]*==[ \t]*(${PYTHON_NAME})$`,
454
+ "u"
455
+ );
456
+ const PYTHON_LITERAL_GIT_CALL = new RegExp(
457
+ String.raw`^subprocess\.check_output\(\[[ \t]*(?:"git"|'git')(?:[ \t]*,[ \t]*${PYTHON_STRING})*[ \t]*\](?:[ \t]*,[ \t]*cwd[ \t]*=[ \t]*b?${PYTHON_STRING})?[ \t]*\)$`,
458
+ "u"
459
+ );
460
+
461
+ /**
462
+ * Ignore the literals of a bounded Python source-byte comparison. The script
463
+ * can assign two bytes values and compare one replacement with the other.
464
+ * Optional literal Git subprocess calls remain visible to the path scanner.
465
+ * Any additional Python statement keeps the full source under inspection.
466
+ * @param {string} text - The bounded source read from the script
467
+ * @returns {string} The source to inspect for directory paths
468
+ */
469
+ function pythonSourceForPathScan(text) {
470
+ const lines = text
471
+ .split(/\r\n?|\n/u)
472
+ .map(line => line.trim())
473
+ .filter(line => line !== "" && !line.startsWith("#"));
474
+ const importsSubprocess = lines[0] === "import subprocess";
475
+ const [first, second, assertion, ...calls] = lines.slice(
476
+ importsSubprocess ? 1 : 0
477
+ );
478
+ const before = PYTHON_BYTES_ASSIGNMENT.exec(first ?? "")?.[1];
479
+ const after = PYTHON_BYTES_ASSIGNMENT.exec(second ?? "")?.[1];
480
+ const compared = PYTHON_BYTES_COMPARISON.exec(assertion ?? "");
481
+ if (
482
+ before === undefined ||
483
+ after === undefined ||
484
+ before === after ||
485
+ compared?.[1] !== before ||
486
+ compared[2] !== after ||
487
+ (calls.length > 0 && !importsSubprocess) ||
488
+ !calls.every(line => PYTHON_LITERAL_GIT_CALL.test(line))
489
+ ) {
490
+ return text;
491
+ }
492
+ return calls.join("\n");
493
+ }
494
+
445
495
  /**
446
496
  * The foreign worktree an executed script reaches, or null.
447
497
  *
@@ -532,7 +582,12 @@ function scriptReachingForeignTree(payload, bound) {
532
582
  // Not a readable file: nothing was executed that this can read.
533
583
  continue;
534
584
  }
535
- const foreign = foreignTreeIn(text, bound, cwd);
585
+ const program = tokenise(segment)[0]?.split("/").at(-1);
586
+ const inspected =
587
+ program === "python" || program === "python3"
588
+ ? pythonSourceForPathScan(text)
589
+ : text;
590
+ const foreign = foreignTreeIn(inspected, bound, cwd);
536
591
  if (foreign) return { script: path, foreign };
537
592
  }
538
593
  return null;
@@ -129,6 +129,13 @@ For a before-enforce run, go from here to "The before-enforce run".
129
129
  **Needs:** the repository root. **Hands on:** one result for each declared check, and three
130
130
  written files.
131
131
 
132
+ Read the committed `controls.proof_copy.prepare` in `.lisa.config.json` before
133
+ running a proof. If commands are declared and the operator has yet to approve
134
+ this repository and command list, show the exact arguments and ask once before
135
+ the first run. Say that the commands run in the temporary copy and can use this
136
+ machine's network and credentials. Reuse approval recorded by configure for the
137
+ same list. Apply the same rule before a `--before-enforce` run.
138
+
132
139
  ```bash
133
140
  lisa controls attest --json
134
141
  ```
@@ -146,8 +153,11 @@ A proof is two test changes, kept as patch files: one that breaks the check's ru
146
153
  does not. At commit and at push a check is only started when the change touches the check's own
147
154
  folder. So each test change has to edit a file inside the check's own folder: one that edits a
148
155
  file anywhere else never starts the check, and that half reads `unknown` (not started), never a
149
- pass. When an entry is `unknown` for that reason, say so: the test change is in the wrong place,
150
- and the configure step (`/lisa:configure`) is where it is corrected.
156
+ pass. When an entry is `unknown` for that reason, say so and send it back to
157
+ `/lisa:configure` to correct the test change. If the reason is an unavailable
158
+ dependency or hook, read the detail for what is still missing after any declared
159
+ preparation. A preparation failure ends the command before it produces an
160
+ entry verdict.
151
161
 
152
162
  An entry that is `unproved` because a test change is missing (`reason` is `half-missing`) has
153
163
  nothing wrong with its check: the two test changes were never written for it, or only one was. The
@@ -431,13 +431,26 @@ is written, remove the scratch folder. Nothing of it is left in the repository.
431
431
 
432
432
  **4. Have the pairs tried.**
433
433
 
434
+ If a fresh clone needs dependencies, generated output or a hook manager, propose
435
+ the argument lists for `controls.proof_copy.prepare` in `.lisa.config.json`. Use
436
+ the repository's lockfile, declared package manager and hook configuration to
437
+ identify the commands. For example, a Bun project with Lefthook may need
438
+ `[["bun", "install", "--frozen-lockfile"], ["./node_modules/.bin/lefthook", "install"]]`.
439
+ Record the approved commands in the committed config before trying the pairs.
440
+
441
+ Before the first run that uses those commands, show their exact arguments and
442
+ ask the operator once. For example, “May I run these setup commands in the
443
+ temporary copy? They can use this machine's network and credentials.” Carry
444
+ the answer into the attest handoff for the same repository and command list.
445
+ Ask again only if the command list changes.
446
+
434
447
  ```bash
435
448
  lisa controls proof-check
436
449
  ```
437
450
 
438
451
  It puts each change on the last commit in a temporary copy, runs the check's own command on it
439
- there, and removes the copy. It changes nothing in the repository, it installs nothing, and it
440
- works with uncommitted work in place. It prints one JSON document; read `parts`, one entry per
452
+ there, and removes the copy. The configured preparation runs once in that copy before the
453
+ checks. It works with uncommitted work in place and leaves the repository files alone. It prints one JSON document; read `parts`, one entry per
441
454
  declared part:
442
455
 
443
456
  | `result` | Meaning | What you do |
@@ -455,10 +468,10 @@ declared part:
455
468
  Repeat until every part that declares a pair reads `ready`. Ground rule 9 holds throughout: you
456
469
  change the test changes, never the check.
457
470
 
458
- The temporary copy holds the last commit and nothing git ignores. A tool that only runs with files
459
- the working copy has and the commit does not (installed dependencies, built output) cannot run
460
- there, and reads as not started, or as failing on the clean change without its failure text. Do not
461
- install anything and do not commit anything to get around that.
471
+ The temporary copy starts from the last commit. If a check needs dependencies or generated files,
472
+ configure and obtain approval for `controls.proof_copy.prepare` as described above, then rerun
473
+ `proof-check`. Without suitable preparation, the check may fail to start or fail on the clean
474
+ change. Keep installed dependencies and generated output out of the commit.
462
475
 
463
476
  When a pair cannot be made ready honestly (the tool is not installed on this machine, it cannot run
464
477
  in a copy of the last commit, or the check does not catch what it was assumed to catch), delete its
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "8.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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.4.0",
3
+ "version": "8.5.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"