@codyswann/lisa 7.1.5 → 8.0.1

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 (661) hide show
  1. package/all/copy-overwrite/scripts/check-npm-publish-landed.mjs +0 -2
  2. package/all/copy-overwrite/scripts/lib/push-timing.mjs +3 -6
  3. package/all/copy-overwrite/scripts/lisa-enforcement-fallback.sh +31 -32
  4. package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +201 -20
  5. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +3 -2
  6. package/dist/cli/admit-cmd.d.ts.map +1 -1
  7. package/dist/cli/admit-cmd.js +16 -10
  8. package/dist/cli/admit-cmd.js.map +1 -1
  9. package/dist/cli/apply.d.ts.map +1 -1
  10. package/dist/cli/apply.js +2 -2
  11. package/dist/cli/apply.js.map +1 -1
  12. package/dist/cli/check-cmd.d.ts.map +1 -1
  13. package/dist/cli/check-cmd.js +8 -4
  14. package/dist/cli/check-cmd.js.map +1 -1
  15. package/dist/cli/doctor-coderabbit.js +2 -2
  16. package/dist/cli/doctor-coderabbit.js.map +1 -1
  17. package/dist/cli/doctor-readiness-supply-chain-python.d.ts +5 -1
  18. package/dist/cli/doctor-readiness-supply-chain-python.d.ts.map +1 -1
  19. package/dist/cli/doctor-readiness-supply-chain-python.js +44 -10
  20. package/dist/cli/doctor-readiness-supply-chain-python.js.map +1 -1
  21. package/dist/cli/doctor-readiness.js +2 -2
  22. package/dist/cli/doctor-readiness.js.map +1 -1
  23. package/dist/cli/doctor-worker-journey.js +2 -2
  24. package/dist/cli/doctor-worker-journey.js.map +1 -1
  25. package/dist/cli/doctor.d.ts.map +1 -1
  26. package/dist/cli/doctor.js +7 -4
  27. package/dist/cli/doctor.js.map +1 -1
  28. package/dist/cli/file-upstream-cmd.d.ts.map +1 -1
  29. package/dist/cli/file-upstream-cmd.js +20 -25
  30. package/dist/cli/file-upstream-cmd.js.map +1 -1
  31. package/dist/cli/gh-cli.d.ts +2 -2
  32. package/dist/cli/gh-cli.d.ts.map +1 -1
  33. package/dist/cli/gh-cli.js +13 -6
  34. package/dist/cli/gh-cli.js.map +1 -1
  35. package/dist/cli/health-cmd.d.ts.map +1 -1
  36. package/dist/cli/health-cmd.js +7 -19
  37. package/dist/cli/health-cmd.js.map +1 -1
  38. package/dist/cli/lisa-test-run-jest-merge.js +5 -5
  39. package/dist/cli/lisa-test-run-jest-merge.js.map +1 -1
  40. package/dist/cli/lisa-test-run.js +8 -4
  41. package/dist/cli/lisa-test-run.js.map +1 -1
  42. package/dist/cli/pr-landing.js +2 -2
  43. package/dist/cli/pr-landing.js.map +1 -1
  44. package/dist/cli/update-check.d.ts.map +1 -1
  45. package/dist/cli/update-check.js +7 -4
  46. package/dist/cli/update-check.js.map +1 -1
  47. package/dist/cli/update-cmd.d.ts.map +1 -1
  48. package/dist/cli/update-cmd.js +7 -4
  49. package/dist/cli/update-cmd.js.map +1 -1
  50. package/dist/cli/worktree-ownership.d.ts.map +1 -1
  51. package/dist/cli/worktree-ownership.js +3 -3
  52. package/dist/cli/worktree-ownership.js.map +1 -1
  53. package/dist/codex/hooks-catalog.d.ts +151 -0
  54. package/dist/codex/hooks-catalog.d.ts.map +1 -0
  55. package/dist/codex/hooks-catalog.js +315 -0
  56. package/dist/codex/hooks-catalog.js.map +1 -0
  57. package/dist/codex/hooks-compatibility.d.ts +14 -0
  58. package/dist/codex/hooks-compatibility.d.ts.map +1 -0
  59. package/dist/codex/hooks-compatibility.js +196 -0
  60. package/dist/codex/hooks-compatibility.js.map +1 -0
  61. package/dist/codex/hooks-installer.d.ts +2 -49
  62. package/dist/codex/hooks-installer.d.ts.map +1 -1
  63. package/dist/codex/hooks-installer.js +5 -546
  64. package/dist/codex/hooks-installer.js.map +1 -1
  65. package/dist/codex/hooks-source-links.d.ts +11 -0
  66. package/dist/codex/hooks-source-links.d.ts.map +1 -0
  67. package/dist/codex/hooks-source-links.js +74 -0
  68. package/dist/codex/hooks-source-links.js.map +1 -0
  69. package/dist/codex/scripts/block-migration-edits.sh +2 -2
  70. package/dist/codex/scripts/block-suppress-directives.sh +3 -3
  71. package/dist/codex/scripts/format-on-edit.sh +2 -2
  72. package/dist/codex/scripts/lint-on-edit.sh +2 -2
  73. package/dist/codex/scripts/lisa-edit-gate.sh +19 -15
  74. package/dist/codex/scripts/rubocop-on-edit.sh +2 -2
  75. package/dist/codex/scripts/sg-scan-on-edit.sh +2 -2
  76. package/dist/configs/coverage-scope.d.ts +0 -23
  77. package/dist/configs/coverage-scope.d.ts.map +1 -1
  78. package/dist/configs/coverage-scope.js +2 -3
  79. package/dist/configs/coverage-scope.js.map +1 -1
  80. package/dist/configs/eslint/base.d.ts +2 -113
  81. package/dist/configs/eslint/base.d.ts.map +1 -1
  82. package/dist/configs/eslint/base.js +2 -165
  83. package/dist/configs/eslint/base.js.map +1 -1
  84. package/dist/configs/eslint/cdk.d.ts.map +1 -1
  85. package/dist/configs/eslint/cdk.js +82 -66
  86. package/dist/configs/eslint/cdk.js.map +1 -1
  87. package/dist/configs/eslint/expo-overrides.d.ts +103 -0
  88. package/dist/configs/eslint/expo-overrides.d.ts.map +1 -0
  89. package/dist/configs/eslint/expo-overrides.js +187 -0
  90. package/dist/configs/eslint/expo-overrides.js.map +1 -0
  91. package/dist/configs/eslint/expo.d.ts +2 -7
  92. package/dist/configs/eslint/expo.d.ts.map +1 -1
  93. package/dist/configs/eslint/expo.js +186 -258
  94. package/dist/configs/eslint/expo.js.map +1 -1
  95. package/dist/configs/eslint/nestjs.d.ts.map +1 -1
  96. package/dist/configs/eslint/nestjs.js +86 -70
  97. package/dist/configs/eslint/nestjs.js.map +1 -1
  98. package/dist/configs/eslint/process-environment-bans.d.ts +41 -0
  99. package/dist/configs/eslint/process-environment-bans.d.ts.map +1 -0
  100. package/dist/configs/eslint/process-environment-bans.js +50 -0
  101. package/dist/configs/eslint/process-environment-bans.js.map +1 -0
  102. package/dist/configs/eslint/shared-rules.d.ts +130 -0
  103. package/dist/configs/eslint/shared-rules.d.ts.map +1 -0
  104. package/dist/configs/eslint/shared-rules.js +233 -0
  105. package/dist/configs/eslint/shared-rules.js.map +1 -0
  106. package/dist/configs/eslint/typescript.d.ts.map +1 -1
  107. package/dist/configs/eslint/typescript.js +2 -4
  108. package/dist/configs/eslint/typescript.js.map +1 -1
  109. package/dist/configs/vitest/base.d.ts +2 -2
  110. package/dist/configs/vitest/base.d.ts.map +1 -1
  111. package/dist/configs/vitest/base.js +5 -5
  112. package/dist/configs/vitest/base.js.map +1 -1
  113. package/dist/configs/vitest/coverage-reports-directory.d.ts.map +1 -1
  114. package/dist/configs/vitest/coverage-reports-directory.js +3 -2
  115. package/dist/configs/vitest/coverage-reports-directory.js.map +1 -1
  116. package/dist/configs/vitest/refusal-announcement.js +2 -2
  117. package/dist/configs/vitest/refusal-announcement.js.map +1 -1
  118. package/dist/core/admission-lock.js +2 -3
  119. package/dist/core/admission-lock.js.map +1 -1
  120. package/dist/core/admission-state.d.ts.map +1 -1
  121. package/dist/core/admission-state.js +11 -5
  122. package/dist/core/admission-state.js.map +1 -1
  123. package/dist/core/admission.d.ts.map +1 -1
  124. package/dist/core/admission.js +2 -2
  125. package/dist/core/admission.js.map +1 -1
  126. package/dist/core/bootstrap-environment.d.ts.map +1 -1
  127. package/dist/core/bootstrap-environment.js +8 -5
  128. package/dist/core/bootstrap-environment.js.map +1 -1
  129. package/dist/core/downstream-names.d.ts.map +1 -1
  130. package/dist/core/downstream-names.js +48 -47
  131. package/dist/core/downstream-names.js.map +1 -1
  132. package/dist/core/effectiveness-store.d.ts.map +1 -1
  133. package/dist/core/effectiveness-store.js +3 -5
  134. package/dist/core/effectiveness-store.js.map +1 -1
  135. package/dist/core/gate-declaration-drift.d.ts.map +1 -1
  136. package/dist/core/gate-declaration-drift.js +46 -27
  137. package/dist/core/gate-declaration-drift.js.map +1 -1
  138. package/dist/core/kane-cli-process.d.ts.map +1 -1
  139. package/dist/core/kane-cli-process.js +46 -33
  140. package/dist/core/kane-cli-process.js.map +1 -1
  141. package/dist/core/kane-cli.d.ts.map +1 -1
  142. package/dist/core/kane-cli.js +3 -4
  143. package/dist/core/kane-cli.js.map +1 -1
  144. package/dist/core/lisa-agent-emit-extra.d.ts +75 -0
  145. package/dist/core/lisa-agent-emit-extra.d.ts.map +1 -0
  146. package/dist/core/lisa-agent-emit-extra.js +231 -0
  147. package/dist/core/lisa-agent-emit-extra.js.map +1 -0
  148. package/dist/core/lisa-agent-emit.d.ts +79 -0
  149. package/dist/core/lisa-agent-emit.d.ts.map +1 -0
  150. package/dist/core/lisa-agent-emit.js +224 -0
  151. package/dist/core/lisa-agent-emit.js.map +1 -0
  152. package/dist/core/lisa-deletions.d.ts +116 -0
  153. package/dist/core/lisa-deletions.d.ts.map +1 -0
  154. package/dist/core/lisa-deletions.js +316 -0
  155. package/dist/core/lisa-deletions.js.map +1 -0
  156. package/dist/core/lisa-file-results.d.ts +58 -0
  157. package/dist/core/lisa-file-results.d.ts.map +1 -0
  158. package/dist/core/lisa-file-results.js +173 -0
  159. package/dist/core/lisa-file-results.js.map +1 -0
  160. package/dist/core/lisa-maintenance.d.ts +139 -0
  161. package/dist/core/lisa-maintenance.d.ts.map +1 -0
  162. package/dist/core/lisa-maintenance.js +324 -0
  163. package/dist/core/lisa-maintenance.js.map +1 -0
  164. package/dist/core/lisa-owned-hash-ledger.d.ts +7 -5
  165. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  166. package/dist/core/lisa-owned-hash-ledger.js +44 -6036
  167. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  168. package/dist/core/lisa-owned-hash-ledger.json +6021 -0
  169. package/dist/core/lisa-plugin-sync.d.ts +96 -0
  170. package/dist/core/lisa-plugin-sync.d.ts.map +1 -0
  171. package/dist/core/lisa-plugin-sync.js +216 -0
  172. package/dist/core/lisa-plugin-sync.js.map +1 -0
  173. package/dist/core/lisa-plugins.d.ts +42 -0
  174. package/dist/core/lisa-plugins.d.ts.map +1 -0
  175. package/dist/core/lisa-plugins.js +155 -0
  176. package/dist/core/lisa-plugins.js.map +1 -0
  177. package/dist/core/lisa-state.d.ts +202 -0
  178. package/dist/core/lisa-state.d.ts.map +1 -0
  179. package/dist/core/lisa-state.js +205 -0
  180. package/dist/core/lisa-state.js.map +1 -0
  181. package/dist/core/lisa-summary-stats.d.ts +74 -0
  182. package/dist/core/lisa-summary-stats.d.ts.map +1 -0
  183. package/dist/core/lisa-summary-stats.js +189 -0
  184. package/dist/core/lisa-summary-stats.js.map +1 -0
  185. package/dist/core/lisa-summary.d.ts +34 -0
  186. package/dist/core/lisa-summary.d.ts.map +1 -0
  187. package/dist/core/lisa-summary.js +144 -0
  188. package/dist/core/lisa-summary.js.map +1 -0
  189. package/dist/core/lisa-templates.d.ts +98 -0
  190. package/dist/core/lisa-templates.d.ts.map +1 -0
  191. package/dist/core/lisa-templates.js +251 -0
  192. package/dist/core/lisa-templates.js.map +1 -0
  193. package/dist/core/lisa.d.ts +14 -903
  194. package/dist/core/lisa.d.ts.map +1 -1
  195. package/dist/core/lisa.js +30 -2275
  196. package/dist/core/lisa.js.map +1 -1
  197. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  198. package/dist/core/plugin-command.d.ts.map +1 -1
  199. package/dist/core/plugin-command.js +117 -61
  200. package/dist/core/plugin-command.js.map +1 -1
  201. package/dist/core/template-ownership.d.ts.map +1 -1
  202. package/dist/core/template-ownership.js +0 -1
  203. package/dist/core/template-ownership.js.map +1 -1
  204. package/dist/core/upstream-attribution-body.d.ts +4 -11
  205. package/dist/core/upstream-attribution-body.d.ts.map +1 -1
  206. package/dist/core/upstream-attribution-body.js +61 -373
  207. package/dist/core/upstream-attribution-body.js.map +1 -1
  208. package/dist/core/upstream-attribution-fields.d.ts +40 -0
  209. package/dist/core/upstream-attribution-fields.d.ts.map +1 -0
  210. package/dist/core/upstream-attribution-fields.js +167 -0
  211. package/dist/core/upstream-attribution-fields.js.map +1 -0
  212. package/dist/core/upstream-attribution-files.d.ts +15 -0
  213. package/dist/core/upstream-attribution-files.d.ts.map +1 -0
  214. package/dist/core/upstream-attribution-files.js +156 -0
  215. package/dist/core/upstream-attribution-files.js.map +1 -0
  216. package/dist/core/upstream-attribution-guards.d.ts +80 -0
  217. package/dist/core/upstream-attribution-guards.d.ts.map +1 -0
  218. package/dist/core/upstream-attribution-guards.js +284 -0
  219. package/dist/core/upstream-attribution-guards.js.map +1 -0
  220. package/dist/core/upstream-evidence-manifest.d.ts +1 -1
  221. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  222. package/dist/core/upstream-evidence-manifest.js +67 -30435
  223. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  224. package/dist/core/upstream-evidence-manifest.json +30520 -0
  225. package/dist/health/agentic-contract.d.ts +94 -0
  226. package/dist/health/agentic-contract.d.ts.map +1 -0
  227. package/dist/health/agentic-contract.js +2 -0
  228. package/dist/health/agentic-contract.js.map +1 -0
  229. package/dist/health/agentic-evidence.d.ts +16 -0
  230. package/dist/health/agentic-evidence.d.ts.map +1 -0
  231. package/dist/health/agentic-evidence.js +213 -0
  232. package/dist/health/agentic-evidence.js.map +1 -0
  233. package/dist/health/agentic.d.ts +11 -74
  234. package/dist/health/agentic.d.ts.map +1 -1
  235. package/dist/health/agentic.js +42 -216
  236. package/dist/health/agentic.js.map +1 -1
  237. package/dist/health/deadline.d.ts +4 -1
  238. package/dist/health/deadline.d.ts.map +1 -1
  239. package/dist/health/deadline.js +4 -3
  240. package/dist/health/deadline.js.map +1 -1
  241. package/dist/health/deterministic-inputs.d.ts.map +1 -1
  242. package/dist/health/deterministic-inputs.js +3 -11
  243. package/dist/health/deterministic-inputs.js.map +1 -1
  244. package/dist/health/deterministic-probes.d.ts +52 -0
  245. package/dist/health/deterministic-probes.d.ts.map +1 -0
  246. package/dist/health/deterministic-probes.js +142 -0
  247. package/dist/health/deterministic-probes.js.map +1 -0
  248. package/dist/health/deterministic.d.ts +2 -25
  249. package/dist/health/deterministic.d.ts.map +1 -1
  250. package/dist/health/deterministic.js +14 -106
  251. package/dist/health/deterministic.js.map +1 -1
  252. package/dist/health/finding-utils.d.ts +4 -3
  253. package/dist/health/finding-utils.d.ts.map +1 -1
  254. package/dist/health/finding-utils.js +4 -4
  255. package/dist/health/finding-utils.js.map +1 -1
  256. package/dist/health/governance-probes.d.ts +29 -24
  257. package/dist/health/governance-probes.d.ts.map +1 -1
  258. package/dist/health/governance-probes.js +29 -25
  259. package/dist/health/governance-probes.js.map +1 -1
  260. package/dist/health/hook-inspection.d.ts +4 -3
  261. package/dist/health/hook-inspection.d.ts.map +1 -1
  262. package/dist/health/hook-inspection.js +17 -11
  263. package/dist/health/hook-inspection.js.map +1 -1
  264. package/dist/health/plugin-inspection.d.ts +6 -4
  265. package/dist/health/plugin-inspection.d.ts.map +1 -1
  266. package/dist/health/plugin-inspection.js +10 -9
  267. package/dist/health/plugin-inspection.js.map +1 -1
  268. package/dist/health/prepare.js +24 -8
  269. package/dist/health/prepare.js.map +1 -1
  270. package/dist/health/project-probes.d.ts +14 -7
  271. package/dist/health/project-probes.d.ts.map +1 -1
  272. package/dist/health/project-probes.js +14 -9
  273. package/dist/health/project-probes.js.map +1 -1
  274. package/dist/health/ruleset-compare.d.ts +30 -0
  275. package/dist/health/ruleset-compare.d.ts.map +1 -0
  276. package/dist/health/ruleset-compare.js +143 -0
  277. package/dist/health/ruleset-compare.js.map +1 -0
  278. package/dist/health/ruleset-config-checks.d.ts +66 -0
  279. package/dist/health/ruleset-config-checks.d.ts.map +1 -0
  280. package/dist/health/ruleset-config-checks.js +190 -0
  281. package/dist/health/ruleset-config-checks.js.map +1 -0
  282. package/dist/health/ruleset-expected.d.ts +39 -0
  283. package/dist/health/ruleset-expected.d.ts.map +1 -0
  284. package/dist/health/ruleset-expected.js +181 -0
  285. package/dist/health/ruleset-expected.js.map +1 -0
  286. package/dist/health/ruleset-gh.d.ts +85 -0
  287. package/dist/health/ruleset-gh.d.ts.map +1 -0
  288. package/dist/health/ruleset-gh.js +177 -0
  289. package/dist/health/ruleset-gh.js.map +1 -0
  290. package/dist/health/ruleset-inspection.d.ts +13 -117
  291. package/dist/health/ruleset-inspection.d.ts.map +1 -1
  292. package/dist/health/ruleset-inspection.js +8 -738
  293. package/dist/health/ruleset-inspection.js.map +1 -1
  294. package/dist/health/ruleset-normalize.d.ts +32 -0
  295. package/dist/health/ruleset-normalize.d.ts.map +1 -0
  296. package/dist/health/ruleset-normalize.js +160 -0
  297. package/dist/health/ruleset-normalize.js.map +1 -0
  298. package/dist/health/template-compose.d.ts +9 -0
  299. package/dist/health/template-compose.d.ts.map +1 -0
  300. package/dist/health/template-compose.js +105 -0
  301. package/dist/health/template-compose.js.map +1 -0
  302. package/dist/health/template-inspection.d.ts +5 -52
  303. package/dist/health/template-inspection.d.ts.map +1 -1
  304. package/dist/health/template-inspection.js +13 -435
  305. package/dist/health/template-inspection.js.map +1 -1
  306. package/dist/health/template-plan.d.ts +33 -0
  307. package/dist/health/template-plan.d.ts.map +1 -0
  308. package/dist/health/template-plan.js +154 -0
  309. package/dist/health/template-plan.js.map +1 -0
  310. package/dist/health/template-shape.d.ts +19 -0
  311. package/dist/health/template-shape.d.ts.map +1 -0
  312. package/dist/health/template-shape.js +122 -0
  313. package/dist/health/template-shape.js.map +1 -0
  314. package/dist/health/workflow-excerpt.d.ts +15 -0
  315. package/dist/health/workflow-excerpt.d.ts.map +1 -0
  316. package/dist/health/workflow-excerpt.js +88 -0
  317. package/dist/health/workflow-excerpt.js.map +1 -0
  318. package/dist/health/workflow-inputs-inspection.d.ts +16 -0
  319. package/dist/health/workflow-inputs-inspection.d.ts.map +1 -0
  320. package/dist/health/workflow-inputs-inspection.js +116 -0
  321. package/dist/health/workflow-inputs-inspection.js.map +1 -0
  322. package/dist/opencode/plugin-templates/block-managed-file-edits.sh +201 -20
  323. package/dist/standards/capture.d.ts.map +1 -1
  324. package/dist/standards/capture.js +73 -25
  325. package/dist/standards/capture.js.map +1 -1
  326. package/dist/standards/contract.d.ts.map +1 -1
  327. package/dist/standards/contract.js +26 -9
  328. package/dist/standards/contract.js.map +1 -1
  329. package/dist/standards/git-state.d.ts.map +1 -1
  330. package/dist/standards/git-state.js +2 -2
  331. package/dist/standards/git-state.js.map +1 -1
  332. package/dist/standards/registry-checks.d.ts +34 -0
  333. package/dist/standards/registry-checks.d.ts.map +1 -0
  334. package/dist/standards/registry-checks.js +137 -0
  335. package/dist/standards/registry-checks.js.map +1 -0
  336. package/dist/standards/registry.d.ts +3 -13
  337. package/dist/standards/registry.d.ts.map +1 -1
  338. package/dist/standards/registry.js +105 -194
  339. package/dist/standards/registry.js.map +1 -1
  340. package/dist/standards/storage.js +8 -10
  341. package/dist/standards/storage.js.map +1 -1
  342. package/dist/strategies/deduplicate-arrays.d.ts +18 -0
  343. package/dist/strategies/deduplicate-arrays.d.ts.map +1 -0
  344. package/dist/strategies/deduplicate-arrays.js +25 -0
  345. package/dist/strategies/deduplicate-arrays.js.map +1 -0
  346. package/dist/strategies/package-lisa-detect.d.ts +10 -0
  347. package/dist/strategies/package-lisa-detect.d.ts.map +1 -0
  348. package/dist/strategies/package-lisa-detect.js +178 -0
  349. package/dist/strategies/package-lisa-detect.js.map +1 -0
  350. package/dist/strategies/package-lisa-direct-floors.d.ts +16 -0
  351. package/dist/strategies/package-lisa-direct-floors.d.ts.map +1 -0
  352. package/dist/strategies/package-lisa-direct-floors.js +37 -0
  353. package/dist/strategies/package-lisa-direct-floors.js.map +1 -0
  354. package/dist/strategies/package-lisa-host-pins.d.ts +43 -0
  355. package/dist/strategies/package-lisa-host-pins.d.ts.map +1 -0
  356. package/dist/strategies/package-lisa-host-pins.js +254 -0
  357. package/dist/strategies/package-lisa-host-pins.js.map +1 -0
  358. package/dist/strategies/package-lisa-manifest-guards.d.ts +59 -0
  359. package/dist/strategies/package-lisa-manifest-guards.d.ts.map +1 -0
  360. package/dist/strategies/package-lisa-manifest-guards.js +234 -0
  361. package/dist/strategies/package-lisa-manifest-guards.js.map +1 -0
  362. package/dist/strategies/package-lisa-pin-alignment.d.ts +34 -0
  363. package/dist/strategies/package-lisa-pin-alignment.d.ts.map +1 -0
  364. package/dist/strategies/package-lisa-pin-alignment.js +106 -0
  365. package/dist/strategies/package-lisa-pin-alignment.js.map +1 -0
  366. package/dist/strategies/package-lisa-script-notes.d.ts +19 -0
  367. package/dist/strategies/package-lisa-script-notes.d.ts.map +1 -0
  368. package/dist/strategies/package-lisa-script-notes.js +145 -0
  369. package/dist/strategies/package-lisa-script-notes.js.map +1 -0
  370. package/dist/strategies/package-lisa-template-apply.d.ts +53 -0
  371. package/dist/strategies/package-lisa-template-apply.d.ts.map +1 -0
  372. package/dist/strategies/package-lisa-template-apply.js +216 -0
  373. package/dist/strategies/package-lisa-template-apply.js.map +1 -0
  374. package/dist/strategies/package-lisa-template-merge.d.ts +42 -0
  375. package/dist/strategies/package-lisa-template-merge.d.ts.map +1 -0
  376. package/dist/strategies/package-lisa-template-merge.js +202 -0
  377. package/dist/strategies/package-lisa-template-merge.js.map +1 -0
  378. package/dist/strategies/package-lisa-types.d.ts +5 -0
  379. package/dist/strategies/package-lisa-types.d.ts.map +1 -1
  380. package/dist/strategies/package-lisa.d.ts +1 -195
  381. package/dist/strategies/package-lisa.d.ts.map +1 -1
  382. package/dist/strategies/package-lisa.js +27 -1333
  383. package/dist/strategies/package-lisa.js.map +1 -1
  384. package/dist/strategies/tagged-merge-sections.d.ts +68 -0
  385. package/dist/strategies/tagged-merge-sections.d.ts.map +1 -0
  386. package/dist/strategies/tagged-merge-sections.js +113 -0
  387. package/dist/strategies/tagged-merge-sections.js.map +1 -0
  388. package/dist/strategies/tagged-merge.d.ts +1 -90
  389. package/dist/strategies/tagged-merge.d.ts.map +1 -1
  390. package/dist/strategies/tagged-merge.js +19 -190
  391. package/dist/strategies/tagged-merge.js.map +1 -1
  392. package/dist/utils/bounded-stream.d.ts +30 -0
  393. package/dist/utils/bounded-stream.d.ts.map +1 -0
  394. package/dist/utils/bounded-stream.js +63 -0
  395. package/dist/utils/bounded-stream.js.map +1 -0
  396. package/dist/utils/fibonacci.d.ts +3 -3
  397. package/dist/utils/fibonacci.d.ts.map +1 -1
  398. package/dist/utils/fibonacci.js +48 -10
  399. package/dist/utils/fibonacci.js.map +1 -1
  400. package/dist/utils/memo.d.ts +25 -0
  401. package/dist/utils/memo.d.ts.map +1 -0
  402. package/dist/utils/memo.js +32 -0
  403. package/dist/utils/memo.js.map +1 -0
  404. package/dist/utils/postinstall-trampoline.d.ts.map +1 -1
  405. package/dist/utils/postinstall-trampoline.js +3 -20
  406. package/dist/utils/postinstall-trampoline.js.map +1 -1
  407. package/dist/utils/process-environment.d.ts +42 -0
  408. package/dist/utils/process-environment.d.ts.map +1 -0
  409. package/dist/utils/process-environment.js +52 -0
  410. package/dist/utils/process-environment.js.map +1 -0
  411. package/dist/utils/resolve-executable.d.ts +89 -0
  412. package/dist/utils/resolve-executable.d.ts.map +1 -0
  413. package/dist/utils/resolve-executable.js +224 -0
  414. package/dist/utils/resolve-executable.js.map +1 -0
  415. package/dist/utils/shell-command-line.d.ts +9 -0
  416. package/dist/utils/shell-command-line.d.ts.map +1 -0
  417. package/dist/utils/shell-command-line.js +43 -0
  418. package/dist/utils/shell-command-line.js.map +1 -0
  419. package/dist/utils/usage-accounting-totals.d.ts +19 -0
  420. package/dist/utils/usage-accounting-totals.d.ts.map +1 -0
  421. package/dist/utils/usage-accounting-totals.js +145 -0
  422. package/dist/utils/usage-accounting-totals.js.map +1 -0
  423. package/dist/utils/usage-accounting.d.ts +2 -14
  424. package/dist/utils/usage-accounting.d.ts.map +1 -1
  425. package/dist/utils/usage-accounting.js +2 -169
  426. package/dist/utils/usage-accounting.js.map +1 -1
  427. package/eslint-plugin-code-organization/__tests__/enforce-statement-order-react-violations.test.js +213 -0
  428. package/eslint-plugin-code-organization/__tests__/enforce-statement-order-valid.test.js +251 -0
  429. package/eslint-plugin-code-organization/__tests__/enforce-statement-order-violations.test.js +222 -0
  430. package/eslint-plugin-code-organization/__tests__/statement-order-tester.js +42 -0
  431. package/eslint-plugin-code-organization/rules/enforce-statement-order.js +6 -8
  432. package/expo/copy-overwrite/jest.setup.ts +11 -10
  433. package/expo/create-only/scripts/zap-baseline.sh +6 -18
  434. package/harper-fabric/create-only/scripts/zap-baseline.sh +7 -9
  435. package/nestjs/create-only/scripts/zap-baseline.sh +6 -7
  436. package/package.json +5 -5
  437. package/phaser/copy-overwrite/.husky/pre-push.verify +2 -0
  438. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  439. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  440. package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  441. package/plugins/lisa/hooks/block-managed-file-edits.sh +201 -20
  442. package/plugins/lisa/hooks/block-masked-exit-status.sh +1 -1
  443. package/plugins/lisa/hooks/block-no-verify.agy.sh +1 -1
  444. package/plugins/lisa/hooks/enforce-verification-gate.sh +1 -2
  445. package/plugins/lisa/hooks/ticket-sync-reminder.sh +2 -17
  446. package/plugins/lisa/hooks/track-plan-sessions.sh +7 -131
  447. package/plugins/lisa/scripts/remote-agent-aws-setup.sh +3 -1
  448. package/plugins/lisa/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  449. package/plugins/lisa-agy/hooks/block-managed-file-edits.sh +201 -20
  450. package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +1 -1
  451. package/plugins/lisa-agy/plugin.json +1 -1
  452. package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +3 -1
  453. package/plugins/lisa-agy/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  454. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  455. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  456. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  457. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  458. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  459. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  460. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  461. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  462. package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +201 -20
  463. package/plugins/lisa-copilot/hooks/block-masked-exit-status.sh +1 -1
  464. package/plugins/lisa-copilot/hooks/enforce-verification-gate.sh +1 -2
  465. package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +3 -1
  466. package/plugins/lisa-copilot/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  467. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  468. package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +201 -20
  469. package/plugins/lisa-cursor/hooks/block-masked-exit-status.sh +1 -1
  470. package/plugins/lisa-cursor/hooks/enforce-verification-gate.sh +1 -2
  471. package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +3 -1
  472. package/plugins/lisa-cursor/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  473. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  474. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  475. package/plugins/lisa-devin/hooks/block-managed-file-edits.sh +201 -20
  476. package/plugins/lisa-devin/hooks/block-masked-exit-status.sh +1 -1
  477. package/plugins/lisa-devin/hooks/enforce-verification-gate.sh +1 -2
  478. package/plugins/lisa-devin/scripts/remote-agent-aws-setup.sh +3 -1
  479. package/plugins/lisa-devin/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  480. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  481. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  482. package/plugins/lisa-expo/.codex-plugin/skills/building-native-ui/references/webgpu-three.md +19 -9
  483. package/plugins/lisa-expo/.codex-plugin/skills/expo-tailwind-setup/SKILL.md +15 -4
  484. package/plugins/lisa-expo/skills/building-native-ui/references/webgpu-three.md +19 -9
  485. package/plugins/lisa-expo/skills/expo-tailwind-setup/SKILL.md +15 -4
  486. package/plugins/lisa-expo-agy/plugin.json +1 -1
  487. package/plugins/lisa-expo-agy/skills/building-native-ui/references/webgpu-three.md +19 -9
  488. package/plugins/lisa-expo-agy/skills/expo-tailwind-setup/SKILL.md +15 -4
  489. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  490. package/plugins/lisa-expo-copilot/skills/building-native-ui/references/webgpu-three.md +19 -9
  491. package/plugins/lisa-expo-copilot/skills/expo-tailwind-setup/SKILL.md +15 -4
  492. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  493. package/plugins/lisa-expo-cursor/skills/building-native-ui/references/webgpu-three.md +19 -9
  494. package/plugins/lisa-expo-cursor/skills/expo-tailwind-setup/SKILL.md +15 -4
  495. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  496. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  497. package/plugins/lisa-expo-devin/skills/building-native-ui/references/webgpu-three.md +19 -9
  498. package/plugins/lisa-expo-devin/skills/expo-tailwind-setup/SKILL.md +15 -4
  499. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  500. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  501. package/plugins/lisa-harper-fabric/hooks/block-generated-artifact-edits.sh +196 -11
  502. package/plugins/lisa-harper-fabric/hooks/enforce-config-extensions.sh +1 -1
  503. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  504. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  505. package/plugins/lisa-harper-fabric-copilot/hooks/block-generated-artifact-edits.sh +196 -11
  506. package/plugins/lisa-harper-fabric-copilot/hooks/enforce-config-extensions.sh +1 -1
  507. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  508. package/plugins/lisa-harper-fabric-cursor/hooks/block-generated-artifact-edits.sh +196 -11
  509. package/plugins/lisa-harper-fabric-cursor/hooks/enforce-config-extensions.sh +1 -1
  510. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  511. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  512. package/plugins/lisa-harper-fabric-devin/hooks/block-generated-artifact-edits.sh +196 -11
  513. package/plugins/lisa-harper-fabric-devin/hooks/enforce-config-extensions.sh +1 -1
  514. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  515. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  516. package/plugins/lisa-nestjs/.codex-plugin/skills/nestjs-rules/SKILL.md +39 -26
  517. package/plugins/lisa-nestjs/.codex-plugin/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  518. package/plugins/lisa-nestjs/hooks/block-migration-edits.sh +1 -1
  519. package/plugins/lisa-nestjs/hooks/lisa-edit-gate.sh +19 -15
  520. package/plugins/lisa-nestjs/skills/nestjs-rules/SKILL.md +39 -26
  521. package/plugins/lisa-nestjs/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  522. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  523. package/plugins/lisa-nestjs-agy/skills/nestjs-rules/SKILL.md +39 -26
  524. package/plugins/lisa-nestjs-agy/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  525. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  526. package/plugins/lisa-nestjs-copilot/hooks/block-migration-edits.sh +1 -1
  527. package/plugins/lisa-nestjs-copilot/hooks/lisa-edit-gate.sh +19 -15
  528. package/plugins/lisa-nestjs-copilot/skills/nestjs-rules/SKILL.md +39 -26
  529. package/plugins/lisa-nestjs-copilot/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  530. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  531. package/plugins/lisa-nestjs-cursor/hooks/block-migration-edits.sh +1 -1
  532. package/plugins/lisa-nestjs-cursor/hooks/lisa-edit-gate.sh +19 -15
  533. package/plugins/lisa-nestjs-cursor/skills/nestjs-rules/SKILL.md +39 -26
  534. package/plugins/lisa-nestjs-cursor/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  535. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  536. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  537. package/plugins/lisa-nestjs-devin/hooks/block-migration-edits.sh +1 -1
  538. package/plugins/lisa-nestjs-devin/hooks/lisa-edit-gate.sh +19 -15
  539. package/plugins/lisa-nestjs-devin/skills/nestjs-rules/SKILL.md +39 -26
  540. package/plugins/lisa-nestjs-devin/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  541. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  542. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  543. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  544. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  545. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  546. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  547. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  548. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  549. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  550. package/plugins/lisa-rails/hooks/lisa-edit-gate.sh +19 -15
  551. package/plugins/lisa-rails/hooks/rubocop-on-edit.sh +2 -2
  552. package/plugins/lisa-rails/hooks/sg-scan-on-edit.sh +3 -3
  553. package/plugins/lisa-rails-agy/plugin.json +1 -1
  554. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  555. package/plugins/lisa-rails-copilot/hooks/lisa-edit-gate.sh +19 -15
  556. package/plugins/lisa-rails-copilot/hooks/rubocop-on-edit.sh +2 -2
  557. package/plugins/lisa-rails-copilot/hooks/sg-scan-on-edit.sh +3 -3
  558. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  559. package/plugins/lisa-rails-cursor/hooks/lisa-edit-gate.sh +19 -15
  560. package/plugins/lisa-rails-cursor/hooks/rubocop-on-edit.sh +2 -2
  561. package/plugins/lisa-rails-cursor/hooks/sg-scan-on-edit.sh +3 -3
  562. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  563. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  564. package/plugins/lisa-rails-devin/hooks/lisa-edit-gate.sh +19 -15
  565. package/plugins/lisa-rails-devin/hooks/rubocop-on-edit.sh +2 -2
  566. package/plugins/lisa-rails-devin/hooks/sg-scan-on-edit.sh +3 -3
  567. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  568. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  569. package/plugins/lisa-typescript/hooks/block-suppress-directives.sh +2 -2
  570. package/plugins/lisa-typescript/hooks/format-on-edit.sh +2 -2
  571. package/plugins/lisa-typescript/hooks/lint-on-edit.sh +2 -2
  572. package/plugins/lisa-typescript/hooks/lisa-edit-gate.sh +19 -15
  573. package/plugins/lisa-typescript/hooks/sg-scan-on-edit.sh +3 -3
  574. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  575. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  576. package/plugins/lisa-typescript-copilot/hooks/block-suppress-directives.sh +2 -2
  577. package/plugins/lisa-typescript-copilot/hooks/format-on-edit.sh +2 -2
  578. package/plugins/lisa-typescript-copilot/hooks/lint-on-edit.sh +2 -2
  579. package/plugins/lisa-typescript-copilot/hooks/lisa-edit-gate.sh +19 -15
  580. package/plugins/lisa-typescript-copilot/hooks/sg-scan-on-edit.sh +3 -3
  581. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  582. package/plugins/lisa-typescript-cursor/hooks/block-suppress-directives.sh +2 -2
  583. package/plugins/lisa-typescript-cursor/hooks/format-on-edit.sh +2 -2
  584. package/plugins/lisa-typescript-cursor/hooks/lint-on-edit.sh +2 -2
  585. package/plugins/lisa-typescript-cursor/hooks/lisa-edit-gate.sh +19 -15
  586. package/plugins/lisa-typescript-cursor/hooks/sg-scan-on-edit.sh +3 -3
  587. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  588. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  589. package/plugins/lisa-typescript-devin/hooks/block-suppress-directives.sh +2 -2
  590. package/plugins/lisa-typescript-devin/hooks/format-on-edit.sh +2 -2
  591. package/plugins/lisa-typescript-devin/hooks/lint-on-edit.sh +2 -2
  592. package/plugins/lisa-typescript-devin/hooks/lisa-edit-gate.sh +19 -15
  593. package/plugins/lisa-typescript-devin/hooks/sg-scan-on-edit.sh +3 -3
  594. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  595. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  596. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  597. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  598. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  599. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  600. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  601. package/plugins/src/base/hooks/block-managed-file-edits.sh +201 -20
  602. package/plugins/src/base/hooks/block-masked-exit-status.sh +1 -1
  603. package/plugins/src/base/hooks/block-no-verify.agy.sh +1 -1
  604. package/plugins/src/base/hooks/enforce-verification-gate.sh +1 -2
  605. package/plugins/src/base/hooks/ticket-sync-reminder.sh +2 -17
  606. package/plugins/src/base/hooks/track-plan-sessions.sh +7 -131
  607. package/plugins/src/base/scripts/remote-agent-aws-setup.sh +3 -1
  608. package/plugins/src/base/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
  609. package/plugins/src/expo/skills/building-native-ui/references/webgpu-three.md +19 -9
  610. package/plugins/src/expo/skills/expo-tailwind-setup/SKILL.md +15 -4
  611. package/plugins/src/harper-fabric/hooks/block-generated-artifact-edits.sh +196 -11
  612. package/plugins/src/harper-fabric/hooks/enforce-config-extensions.sh +1 -1
  613. package/plugins/src/nestjs/hooks/block-migration-edits.sh +1 -1
  614. package/plugins/src/nestjs/hooks/lisa-edit-gate.sh +19 -15
  615. package/plugins/src/nestjs/skills/nestjs-rules/SKILL.md +39 -26
  616. package/plugins/src/nestjs/skills/typeorm-patterns/references/observability-patterns.md +18 -58
  617. package/plugins/src/rails/hooks/lisa-edit-gate.sh +19 -15
  618. package/plugins/src/rails/hooks/rubocop-on-edit.sh +2 -2
  619. package/plugins/src/rails/hooks/sg-scan-on-edit.sh +3 -3
  620. package/plugins/src/typescript/hooks/block-suppress-directives.sh +2 -2
  621. package/plugins/src/typescript/hooks/format-on-edit.sh +2 -2
  622. package/plugins/src/typescript/hooks/lint-on-edit.sh +2 -2
  623. package/plugins/src/typescript/hooks/lisa-edit-gate.sh +19 -15
  624. package/plugins/src/typescript/hooks/sg-scan-on-edit.sh +3 -3
  625. package/scripts/build-plugins.sh +1 -1
  626. package/scripts/check-derived-artifacts.mjs +2 -2
  627. package/scripts/check-generated-artifact-merge-coverage.mjs +45 -4
  628. package/scripts/check-orphan-test-processes.mjs +0 -1
  629. package/scripts/check-self-dependency-pin.mjs +0 -2
  630. package/scripts/claude-remote-setup.sh +12 -7
  631. package/scripts/cleanup-amplify-branches.sh +0 -1
  632. package/scripts/generate-export-surface.mjs +131 -61
  633. package/scripts/generate-lisa-owned-hash-ledger.mjs +87 -102
  634. package/scripts/generate-upstream-evidence-manifest.mjs +56 -49
  635. package/scripts/github-status-check.sh +5 -25
  636. package/scripts/install-claude-plugins.sh +10 -8
  637. package/scripts/lib/merge-generated-json.mjs +274 -0
  638. package/scripts/lib/upstream-manifest-staleness.mjs +38 -34
  639. package/scripts/lib/upstream-public-commits.mjs +35 -18
  640. package/scripts/lisa-commit-and-pr-local.sh +1 -1
  641. package/scripts/lisa-enforcement-fallback.sh +31 -32
  642. package/scripts/lisa-github-environments.sh +5 -1
  643. package/scripts/lisa-github-repo-settings.sh +5 -1
  644. package/scripts/lisa-github-repo-setup.sh +1 -2
  645. package/scripts/lisa-github-rulesets.sh +8 -8
  646. package/scripts/lisa-remote-env/session-start.sh +18 -5
  647. package/scripts/lisa-rollback-release.mjs +0 -2
  648. package/scripts/lisa-update-local.sh +1 -1
  649. package/scripts/merge-generated-artifact.mjs +18 -6
  650. package/scripts/raise-self-dependency-pin.mjs +0 -2
  651. package/scripts/run-artifact-checks.mjs +1 -1
  652. package/scripts/verify-packed-learnings-contract.mjs +36 -3
  653. package/scripts/verify-self-pin-raise.mjs +0 -2
  654. package/typescript/copy-contents/.husky/commit-msg +8 -2
  655. package/typescript/copy-contents/.husky/post-checkout +2 -0
  656. package/typescript/copy-contents/.husky/post-merge +2 -0
  657. package/typescript/copy-contents/.husky/pre-commit +10 -3
  658. package/typescript/copy-contents/.husky/pre-push +29 -16
  659. package/typescript/copy-contents/.husky/prepare-commit-msg +2 -0
  660. package/typescript/create-only/.husky/pre-push.local +2 -0
  661. package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +0 -643
@@ -0,0 +1,66 @@
1
+ import { type HealthRuleset } from "./ruleset-gh.js";
2
+ import { type RequiredCheck } from "./ruleset-normalize.js";
3
+ /**
4
+ * Read configured required-check opt-outs without exposing their values.
5
+ * @param config - Safe project config
6
+ * @returns The contexts the repository drops
7
+ */
8
+ export declare function droppedChecks(config: Readonly<Record<string, unknown>>): ReadonlySet<string>;
9
+ /**
10
+ * Read the per-repo required-check opt-INs for one ruleset.
11
+ *
12
+ * Mirrors `add_config_required_checks` in scripts/lisa-github-rulesets.sh. A
13
+ * repository-specific high-signal check cannot live in a shared template — host
14
+ * projects would inherit a context they never report, and a required check that
15
+ * never reports blocks every pull request (#2476). It is declared per repo
16
+ * instead, and this reader is what keeps `lisa health` from calling the
17
+ * resulting live ruleset "drifted".
18
+ *
19
+ * Both keys are read. `requiredChecks` is the declarative one; `addRequiredChecks`
20
+ * is the additive one it replaced, still honoured so an installed project keeps
21
+ * reporting truthfully until it renames the key. Reading only the new name
22
+ * would make every not-yet-migrated repository's live ruleset read as drifted,
23
+ * which is a false alarm whose obvious fix is deleting a real requirement.
24
+ * @param config - Safe project config
25
+ * @param rulesetName - Ruleset whose opt-ins to read
26
+ * @returns The checks the repository adds to that ruleset
27
+ */
28
+ export declare function addedChecks(config: Readonly<Record<string, unknown>>, rulesetName: string): readonly RequiredCheck[];
29
+ /**
30
+ * Derive the Actions contexts required run gates post through the quality
31
+ * workflow. Awaited gates remain in the generated base ruleset so their
32
+ * external integration pin is preserved rather than replaced with Actions.
33
+ * @param lisaRoot - Lisa package root holding the shipped templates
34
+ * @param config - Safe project config
35
+ * @returns Required checks the run gates post
36
+ */
37
+ export declare function derivedRunGateChecks(lisaRoot: string, config: Readonly<Record<string, unknown>>): Promise<readonly RequiredCheck[]>;
38
+ /**
39
+ * Attribute one normalized context to the declaration that supplied it.
40
+ * @param context - Required status context
41
+ * @param configured - Per-repository configured checks
42
+ * @param derived - Checks derived from run-gate declarations
43
+ * @param template - Shipped template source path
44
+ * @returns The declaration that requires the context
45
+ */
46
+ export declare function enforcementSource(context: string, configured: readonly RequiredCheck[], derived: readonly RequiredCheck[], template: string): string;
47
+ /**
48
+ * The `base` ruleset the applier will generate for this project.
49
+ *
50
+ * `all/github-rulesets/base.json` was deleted: seven of its fields duplicated
51
+ * the `policy` block, four more could not be declared at all, and it pinned two
52
+ * vendor status checks every repository inherited. The applier builds the
53
+ * payload from config now, so a health reader that only walked
54
+ * `<type>/github-rulesets/` would go blind to the one ruleset that carries a
55
+ * repository's branch protection — and report its live contexts as owned by
56
+ * nobody.
57
+ *
58
+ * Loaded from the installed Lisa package at runtime rather than reimplemented
59
+ * here. A second implementation of the payload is the exact defect this
60
+ * replaced: two writers for one setting, with nothing comparing them.
61
+ * @param lisaRoot - Lisa package root
62
+ * @param config - Safe project config
63
+ * @returns The generated ruleset, or nothing when the generator is unavailable
64
+ */
65
+ export declare function generatedBaseRuleset(lisaRoot: string, config: Readonly<Record<string, unknown>>): Promise<readonly HealthRuleset[]>;
66
+ //# sourceMappingURL=ruleset-config-checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleset-config-checks.d.ts","sourceRoot":"","sources":["../../src/health/ruleset-config-checks.ts"],"names":[],"mappings":"AASA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AA+ChC;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,WAAW,CAAC,MAAM,CAAC,CAWrB;AAuBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,WAAW,EAAE,MAAM,GAClB,SAAS,aAAa,EAAE,CAiB1B;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CA6BnC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,OAAO,EAAE,SAAS,aAAa,EAAE,EACjC,QAAQ,EAAE,MAAM,GACf,MAAM,CAOR;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAiBnC"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * The required checks a project's own configuration contributes to its
3
+ * expected rulesets: per-repository opt-ins and opt-outs, run-gate contexts,
4
+ * and the generated `base` ruleset.
5
+ * @module health/ruleset-config-checks
6
+ */
7
+ import path from "node:path";
8
+ import { pathToFileURL } from "node:url";
9
+ import { projectRuleset } from "./ruleset-gh.js";
10
+ import { ACTIONS_INTEGRATION_ID, } from "./ruleset-normalize.js";
11
+ const QUALITY_WORKFLOW_NAME = "🔍 Quality Checks";
12
+ /** The declarative key, and the additive one it replaced. */
13
+ const CHECK_KEYS = ["requiredChecks", "addRequiredChecks"];
14
+ /** Where a per-repo required-check opt-in is declared. */
15
+ const CONFIGURED_CHECK_SOURCE = ".lisa.config.json → github.rulesets.requiredChecks";
16
+ /** Where a required run-gate context is declared. */
17
+ const DERIVED_RUN_GATE_SOURCE = ".lisa.config.json → gates (derived run-gate context)";
18
+ /**
19
+ * Read `github.rulesets` from a project config.
20
+ * @param config - Safe project config
21
+ * @returns The rulesets object, or undefined when absent or malformed
22
+ */
23
+ function rulesetsConfig(config) {
24
+ const github = config.github;
25
+ const rulesets = github !== null && typeof github === "object" && !Array.isArray(github)
26
+ ? Reflect.get(github, "rulesets")
27
+ : undefined;
28
+ return rulesets !== null &&
29
+ typeof rulesets === "object" &&
30
+ !Array.isArray(rulesets)
31
+ ? rulesets
32
+ : undefined;
33
+ }
34
+ /**
35
+ * Read the run-gate declarations without the runner block.
36
+ * @param config - Safe project config
37
+ * @returns The declared gates
38
+ */
39
+ function declaredGates(config) {
40
+ const { runner: _runner, ...gates } = (config.gates ?? {});
41
+ return gates;
42
+ }
43
+ /**
44
+ * Read configured required-check opt-outs without exposing their values.
45
+ * @param config - Safe project config
46
+ * @returns The contexts the repository drops
47
+ */
48
+ export function droppedChecks(config) {
49
+ const rulesets = rulesetsConfig(config);
50
+ const dropped = rulesets === undefined
51
+ ? undefined
52
+ : Reflect.get(rulesets, "dropRequiredChecks");
53
+ return new Set(Array.isArray(dropped)
54
+ ? dropped.filter(item => typeof item === "string")
55
+ : []);
56
+ }
57
+ /**
58
+ * Project one declared opt-in into a required check.
59
+ * @param entry - Untrusted declaration entry
60
+ * @returns The check, or nothing when the entry names no context
61
+ */
62
+ function declaredCheck(entry) {
63
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
64
+ return [];
65
+ }
66
+ const context = Reflect.get(entry, "context");
67
+ if (typeof context !== "string")
68
+ return [];
69
+ const integration = Reflect.get(entry, "integration_id");
70
+ return [
71
+ {
72
+ context,
73
+ integration_id: typeof integration === "number" ? integration : ACTIONS_INTEGRATION_ID,
74
+ },
75
+ ];
76
+ }
77
+ /**
78
+ * Read the per-repo required-check opt-INs for one ruleset.
79
+ *
80
+ * Mirrors `add_config_required_checks` in scripts/lisa-github-rulesets.sh. A
81
+ * repository-specific high-signal check cannot live in a shared template — host
82
+ * projects would inherit a context they never report, and a required check that
83
+ * never reports blocks every pull request (#2476). It is declared per repo
84
+ * instead, and this reader is what keeps `lisa health` from calling the
85
+ * resulting live ruleset "drifted".
86
+ *
87
+ * Both keys are read. `requiredChecks` is the declarative one; `addRequiredChecks`
88
+ * is the additive one it replaced, still honoured so an installed project keeps
89
+ * reporting truthfully until it renames the key. Reading only the new name
90
+ * would make every not-yet-migrated repository's live ruleset read as drifted,
91
+ * which is a false alarm whose obvious fix is deleting a real requirement.
92
+ * @param config - Safe project config
93
+ * @param rulesetName - Ruleset whose opt-ins to read
94
+ * @returns The checks the repository adds to that ruleset
95
+ */
96
+ export function addedChecks(config, rulesetName) {
97
+ const rulesets = rulesetsConfig(config);
98
+ const declarations = rulesets === undefined
99
+ ? []
100
+ : CHECK_KEYS.map(key => Reflect.get(rulesets, key));
101
+ const forRuleset = declarations
102
+ .map(additions => additions !== null &&
103
+ typeof additions === "object" &&
104
+ !Array.isArray(additions)
105
+ ? Reflect.get(additions, rulesetName)
106
+ : undefined)
107
+ .find(entry => Array.isArray(entry));
108
+ if (!Array.isArray(forRuleset))
109
+ return [];
110
+ return forRuleset.flatMap(declaredCheck);
111
+ }
112
+ /**
113
+ * Derive the Actions contexts required run gates post through the quality
114
+ * workflow. Awaited gates remain in the generated base ruleset so their
115
+ * external integration pin is preserved rather than replaced with Actions.
116
+ * @param lisaRoot - Lisa package root holding the shipped templates
117
+ * @param config - Safe project config
118
+ * @returns Required checks the run gates post
119
+ */
120
+ export async function derivedRunGateChecks(lisaRoot, config) {
121
+ const entry = pathToFileURL(path.join(lisaRoot, "all", "copy-overwrite", "scripts", "lisa-gates.mjs")).href;
122
+ const loaded = await import(entry).catch(() => null);
123
+ if (typeof loaded?.contextsFor !== "function")
124
+ return [];
125
+ const gates = declaredGates(config);
126
+ try {
127
+ const contexts = loaded.contextsFor(gates, {
128
+ moment: "pull-request",
129
+ workflowName: QUALITY_WORKFLOW_NAME,
130
+ mode: "run",
131
+ });
132
+ if (!Array.isArray(contexts))
133
+ return [];
134
+ return contexts.flatMap(context => typeof context === "string"
135
+ ? [{ context, integration_id: ACTIONS_INTEGRATION_ID }]
136
+ : []);
137
+ }
138
+ catch {
139
+ return [];
140
+ }
141
+ }
142
+ /**
143
+ * Attribute one normalized context to the declaration that supplied it.
144
+ * @param context - Required status context
145
+ * @param configured - Per-repository configured checks
146
+ * @param derived - Checks derived from run-gate declarations
147
+ * @param template - Shipped template source path
148
+ * @returns The declaration that requires the context
149
+ */
150
+ export function enforcementSource(context, configured, derived, template) {
151
+ if (configured.some(check => check.context === context)) {
152
+ return CONFIGURED_CHECK_SOURCE;
153
+ }
154
+ return derived.some(check => check.context === context)
155
+ ? DERIVED_RUN_GATE_SOURCE
156
+ : template;
157
+ }
158
+ /**
159
+ * The `base` ruleset the applier will generate for this project.
160
+ *
161
+ * `all/github-rulesets/base.json` was deleted: seven of its fields duplicated
162
+ * the `policy` block, four more could not be declared at all, and it pinned two
163
+ * vendor status checks every repository inherited. The applier builds the
164
+ * payload from config now, so a health reader that only walked
165
+ * `<type>/github-rulesets/` would go blind to the one ruleset that carries a
166
+ * repository's branch protection — and report its live contexts as owned by
167
+ * nobody.
168
+ *
169
+ * Loaded from the installed Lisa package at runtime rather than reimplemented
170
+ * here. A second implementation of the payload is the exact defect this
171
+ * replaced: two writers for one setting, with nothing comparing them.
172
+ * @param lisaRoot - Lisa package root
173
+ * @param config - Safe project config
174
+ * @returns The generated ruleset, or nothing when the generator is unavailable
175
+ */
176
+ export async function generatedBaseRuleset(lisaRoot, config) {
177
+ const entry = pathToFileURL(path.join(lisaRoot, "scripts", "lisa-ruleset-payload.mjs")).href;
178
+ const loaded = await import(entry).catch(() => null);
179
+ const build = loaded?.buildRulesetPayload;
180
+ if (typeof build !== "function")
181
+ return [];
182
+ const gates = declaredGates(config);
183
+ try {
184
+ return [projectRuleset(build({ gates, policy: config.policy ?? {} }))];
185
+ }
186
+ catch {
187
+ return [];
188
+ }
189
+ }
190
+ //# sourceMappingURL=ruleset-config-checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleset-config-checks.js","sourceRoot":"","sources":["../../src/health/ruleset-config-checks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAClD,6DAA6D;AAC7D,MAAM,UAAU,GAAG,CAAC,gBAAgB,EAAE,mBAAmB,CAAU,CAAC;AACpE,0DAA0D;AAC1D,MAAM,uBAAuB,GAC3B,oDAAoD,CAAC;AACvD,qDAAqD;AACrD,MAAM,uBAAuB,GAC3B,sDAAsD,CAAC;AAEzD;;;;GAIG;AACH,SAAS,cAAc,CACrB,MAAyC;IAEzC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;I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OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC;QACrD,CAAC,CAAC,uBAAuB;QACzB,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,MAAyC;IAEzC,MAAM,KAAK,GAAG,aAAa,CACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,0BAA0B,CAAC,CAC3D,CAAC,IAAI,CAAC;IACP,MAAM,MAAM,GAAG,MACb,MAAM,CAAC,KAAK,CAGb,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACpB,MAAM,KAAK,GAAG,MAAM,EAAE,mBAAmB,CAAC;IAC1C,IAAI,OAAO,KAAK,KAAK,UAAU;QAAE,OAAO,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC;QACH,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { ProjectType } from "../core/config.js";
2
+ import type { EnforcedContext } from "../core/gate-declaration-drift.js";
3
+ import { type HealthRuleset } from "./ruleset-gh.js";
4
+ /**
5
+ * Read expected material rulesets after the same per-project normalization as apply.
6
+ * @param lisaRoot - Lisa package root
7
+ * @param projectRoot - Canonical host root
8
+ * @param types - Canonically ordered project types
9
+ * @param config - Safe project config
10
+ * @returns Expected rulesets sorted by name
11
+ */
12
+ export declare function expectedRulesets(lisaRoot: string, projectRoot: string, types: readonly ProjectType[], config: Readonly<Record<string, unknown>>): Promise<readonly HealthRuleset[]>;
13
+ /**
14
+ * The required status contexts one project's ruleset templates name, with the
15
+ * file each requirement was read from.
16
+ *
17
+ * `expectedRulesets` already normalizes templates the way apply does, but it
18
+ * answers with whole ruleset documents and loses which file said what. The
19
+ * declaration comparison has to name the template file — "this context is
20
+ * required and no declaration asks for it" is not actionable without it — so
21
+ * this walk keeps the attribution instead.
22
+ *
23
+ * Returning an empty list is meaningful and must not be read as "nothing is
24
+ * enforced": callers treat an empty result as a source they could not reach,
25
+ * because a comparison against nothing reports every declaration as unenforced.
26
+ * @param lisaRoot - Lisa package root
27
+ * @param projectRoot - Canonical host root
28
+ * @param types - Canonically ordered project types
29
+ * @param config - Safe project config
30
+ * @returns Required contexts with their ruleset and source file
31
+ */
32
+ export declare function expectedRequiredContexts(lisaRoot: string, projectRoot: string, types: readonly ProjectType[], config: Readonly<Record<string, unknown>>): Promise<readonly EnforcedContext[]>;
33
+ /**
34
+ * The required status contexts a live ruleset payload names.
35
+ * @param actual - Rulesets as the repository actually holds them
36
+ * @returns Required contexts with their ruleset, sorted
37
+ */
38
+ export declare function liveRequiredContexts(actual: readonly HealthRuleset[]): readonly EnforcedContext[];
39
+ //# sourceMappingURL=ruleset-expected.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleset-expected.d.ts","sourceRoot":"","sources":["../../src/health/ruleset-expected.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAUzE,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAsJzB;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAkBnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACxC,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CA4BrC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,SAAS,eAAe,EAAE,CAW5B"}
@@ -0,0 +1,181 @@
1
+ /**
2
+ * The rulesets — and the required contexts they enforce — a project should
3
+ * hold, read from Lisa's generated base ruleset and shipped templates after
4
+ * the same per-project normalization the applier performs.
5
+ *
6
+ * Templates are walked most-general first (`all`, then each detected type);
7
+ * a later ruleset of the same name replaces an earlier one, so the most
8
+ * specific stack wins.
9
+ * @module health/ruleset-expected
10
+ */
11
+ import { readFile } from "node:fs/promises";
12
+ import path from "node:path";
13
+ import { listFilesRecursive } from "../utils/file-operations.js";
14
+ import { projectPathKind } from "./read-only-fs.js";
15
+ import { addedChecks, derivedRunGateChecks, droppedChecks, enforcementSource, generatedBaseRuleset, } from "./ruleset-config-checks.js";
16
+ import { projectRuleset, sortedCopy, } from "./ruleset-gh.js";
17
+ import { normalizedProjectRules, requiredStatusChecksByContext, } from "./ruleset-normalize.js";
18
+ /** Where the `base` ruleset comes from now that no template ships it. */
19
+ const GENERATED_BASE_SOURCE = ".lisa.config.json (generated base ruleset)";
20
+ /** Where a live requirement was read from. */
21
+ const LIVE_CHECK_SOURCE = "the repository's live rulesets";
22
+ /**
23
+ * Report whether an error is a missing-path error.
24
+ * @param error - Caught error
25
+ * @returns True for ENOENT
26
+ */
27
+ function isMissing(error) {
28
+ return error.code === "ENOENT";
29
+ }
30
+ /**
31
+ * Parse template files in order, stopping at the first one that vanished —
32
+ * the original walk caught that inside the per-type loop and kept what it had.
33
+ * @param files - Template files in listing order
34
+ * @returns Each file with its parsed document
35
+ */
36
+ async function readUntilMissing(files) {
37
+ const [file, ...rest] = files;
38
+ if (file === undefined)
39
+ return [];
40
+ const text = await readFile(file, "utf8").catch((error) => {
41
+ if (isMissing(error))
42
+ return undefined;
43
+ throw error;
44
+ });
45
+ if (text === undefined)
46
+ return [];
47
+ const parsed = JSON.parse(text);
48
+ return [{ file, parsed }, ...(await readUntilMissing(rest))];
49
+ }
50
+ /**
51
+ * Read the ruleset templates one project type ships, absent directories empty.
52
+ * @param lisaRoot - Lisa package root
53
+ * @param type - `all` or a project type
54
+ * @returns Parsed templates in listing order
55
+ */
56
+ async function readTypeTemplates(lisaRoot, type) {
57
+ const directory = path.join(lisaRoot, type, "github-rulesets");
58
+ const files = await listFilesRecursive(directory).catch((error) => {
59
+ if (isMissing(error))
60
+ return [];
61
+ throw error;
62
+ });
63
+ return readUntilMissing(files);
64
+ }
65
+ /**
66
+ * Read the templates for every type, sequentially and most-general first.
67
+ * @param lisaRoot - Lisa package root
68
+ * @param types - Remaining types to read, in order
69
+ * @returns Parsed templates in walk order
70
+ */
71
+ async function readAllTemplates(lisaRoot, types) {
72
+ const [type, ...rest] = types;
73
+ if (type === undefined)
74
+ return [];
75
+ const templates = await readTypeTemplates(lisaRoot, type);
76
+ return [...templates, ...(await readAllTemplates(lisaRoot, rest))];
77
+ }
78
+ /**
79
+ * Normalize one parsed ruleset document against the repository's facts.
80
+ * @param parsed - Parsed ruleset document
81
+ * @param config - Safe project config
82
+ * @param normalization - Derived checks, workflow presence and dropped contexts
83
+ * @param template - Lisa-relative template path, or undefined for the base
84
+ * @returns The normalized source
85
+ */
86
+ function normalizeSource(parsed, config, normalization, template) {
87
+ const projected = projectRuleset(parsed);
88
+ const added = addedChecks(config, projected.name);
89
+ return {
90
+ projected,
91
+ added,
92
+ rules: normalizedProjectRules(projected, added, normalization),
93
+ template,
94
+ };
95
+ }
96
+ /**
97
+ * Collect every expected ruleset in walk order, normalized as apply does.
98
+ * @param lisaRoot - Lisa package root
99
+ * @param projectRoot - Canonical host root
100
+ * @param types - Canonically ordered project types
101
+ * @param config - Safe project config
102
+ * @returns The normalization facts and every normalized source
103
+ */
104
+ async function normalizedSources(lisaRoot, projectRoot, types, config) {
105
+ const hasWorkflows = (await projectPathKind(projectRoot, path.join(".github", "workflows"))) ===
106
+ "directory";
107
+ const dropped = droppedChecks(config);
108
+ const derived = await derivedRunGateChecks(lisaRoot, config);
109
+ const normalization = { derived, hasWorkflows, dropped };
110
+ const base = await generatedBaseRuleset(lisaRoot, config);
111
+ const templates = await readAllTemplates(lisaRoot, ["all", ...types]);
112
+ const sources = [
113
+ ...base.map(parsed => normalizeSource(parsed, config, normalization, undefined)),
114
+ ...templates.map(({ file, parsed }) => normalizeSource(parsed, config, normalization, path.relative(lisaRoot, file).split(path.sep).join(path.posix.sep))),
115
+ ];
116
+ return { normalization, sources };
117
+ }
118
+ /**
119
+ * Read expected material rulesets after the same per-project normalization as apply.
120
+ * @param lisaRoot - Lisa package root
121
+ * @param projectRoot - Canonical host root
122
+ * @param types - Canonically ordered project types
123
+ * @param config - Safe project config
124
+ * @returns Expected rulesets sorted by name
125
+ */
126
+ export async function expectedRulesets(lisaRoot, projectRoot, types, config) {
127
+ const { sources } = await normalizedSources(lisaRoot, projectRoot, types, config);
128
+ const byName = new Map(sources
129
+ .filter(source => !Array.isArray(source.rules) || source.rules.length > 0)
130
+ .map(source => [
131
+ source.projected.name,
132
+ { ...source.projected, rules: source.rules },
133
+ ]));
134
+ return sortedCopy([...byName.values()], (left, right) => left.name.localeCompare(right.name));
135
+ }
136
+ /**
137
+ * The required status contexts one project's ruleset templates name, with the
138
+ * file each requirement was read from.
139
+ *
140
+ * `expectedRulesets` already normalizes templates the way apply does, but it
141
+ * answers with whole ruleset documents and loses which file said what. The
142
+ * declaration comparison has to name the template file — "this context is
143
+ * required and no declaration asks for it" is not actionable without it — so
144
+ * this walk keeps the attribution instead.
145
+ *
146
+ * Returning an empty list is meaningful and must not be read as "nothing is
147
+ * enforced": callers treat an empty result as a source they could not reach,
148
+ * because a comparison against nothing reports every declaration as unenforced.
149
+ * @param lisaRoot - Lisa package root
150
+ * @param projectRoot - Canonical host root
151
+ * @param types - Canonically ordered project types
152
+ * @param config - Safe project config
153
+ * @returns Required contexts with their ruleset and source file
154
+ */
155
+ export async function expectedRequiredContexts(lisaRoot, projectRoot, types, config) {
156
+ const { normalization, sources } = await normalizedSources(lisaRoot, projectRoot, types, config);
157
+ const byName = new Map(sources.map(source => [
158
+ source.projected.name,
159
+ [...requiredStatusChecksByContext(source.rules).keys()].map(context => ({
160
+ context,
161
+ ruleset: source.projected.name,
162
+ source: source.template === undefined
163
+ ? GENERATED_BASE_SOURCE
164
+ : enforcementSource(context, source.added, normalization.derived, source.template),
165
+ })),
166
+ ]));
167
+ return sortedCopy([...byName.values()].flat(), (left, right) => left.context.localeCompare(right.context));
168
+ }
169
+ /**
170
+ * The required status contexts a live ruleset payload names.
171
+ * @param actual - Rulesets as the repository actually holds them
172
+ * @returns Required contexts with their ruleset, sorted
173
+ */
174
+ export function liveRequiredContexts(actual) {
175
+ return sortedCopy(actual.flatMap(ruleset => [...requiredStatusChecksByContext(ruleset.rules).keys()].map(context => ({
176
+ context,
177
+ ruleset: ruleset.name,
178
+ source: LIVE_CHECK_SOURCE,
179
+ }))), (left, right) => left.context.localeCompare(right.context));
180
+ }
181
+ //# sourceMappingURL=ruleset-expected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleset-expected.js","sourceRoot":"","sources":["../../src/health/ruleset-expected.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,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,KAAK,EACZ,aAAa,CAAC,OAAO,EACrB,MAAM,CAAC,QAAQ,CAChB;SACR,CAAC,CAAC;KACJ,CAAC,CACH,CAAC;IACF,OAAO,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC7D,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAC1C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAgC;IAEhC,OAAO,UAAU,CACf,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CACvB,CAAC,GAAG,6BAA6B,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACvE,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,MAAM,EAAE,iBAAiB;KAC1B,CAAC,CAAC,CACJ,EACD,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAC3D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The largest page the platform returns for a list. The ruleset list is asked
3
+ * for at this size, and an answer this long may be cut off.
4
+ *
5
+ * This is the one bound on how many rulesets are read, and it is the same
6
+ * one `readLivePolicy` in `lisa-reconcile-policy.mjs` applies. The two must
7
+ * agree: `lisa controls protect` reads the rulesets with that script before a
8
+ * change and with this reader after it, and a list the first read accepted
9
+ * and the second refused left every change on such a repository reported as
10
+ * not confirmed. `tests/unit/controls/protect-many-rulesets.test.ts` holds
11
+ * the two to the same line.
12
+ */
13
+ export declare const RULESET_PAGE_SIZE = 100;
14
+ /** Material ruleset fields health compares. */
15
+ export interface HealthRuleset {
16
+ readonly name: string;
17
+ readonly target: unknown;
18
+ readonly enforcement: unknown;
19
+ readonly conditions: unknown;
20
+ readonly rules: unknown;
21
+ }
22
+ /**
23
+ * Injectable structured ruleset reader. Implementations must honor `signal`
24
+ * and release any owned handles before settling.
25
+ */
26
+ export type RulesetReader = (owner: string, repo: string, projectRoot: string, timeoutMs: number, signal: AbortSignal) => Promise<readonly HealthRuleset[]>;
27
+ /**
28
+ * Return a sorted copy without mutating caller-owned input.
29
+ * @param items - Caller-owned items
30
+ * @param compare - Stable comparator
31
+ * @returns A new array holding the items in comparator order
32
+ */
33
+ export declare function sortedCopy<T>(items: readonly T[], compare: (left: T, right: T) => number): readonly T[];
34
+ /**
35
+ * Run one fixed-argv bounded gh read, answering its stdout.
36
+ *
37
+ * Text rather than JSON, because not every bounded read this package makes is
38
+ * one JSON document: `gh api --paginate` emits one array PER PAGE, so a
39
+ * paginated read is a stream of values and its `--jq` output is lines. Shared
40
+ * so there is one `gh` invocation site in this package rather than a second
41
+ * one beside it.
42
+ * @param argv - gh arguments after the executable
43
+ * @param cwd - Working directory for the command
44
+ * @param timeoutMs - Bound for the external command, in milliseconds
45
+ * @param signal - Cancellation shared with the health deadline
46
+ * @returns The command's standard output
47
+ */
48
+ export declare function readGhText(argv: readonly string[], cwd: string, timeoutMs: number, signal: AbortSignal): Promise<string>;
49
+ /**
50
+ * Validate and project one detailed GitHub ruleset response.
51
+ * @param candidate - Untrusted ruleset document
52
+ * @returns The material fields health compares
53
+ */
54
+ export declare function projectRuleset(candidate: unknown): HealthRuleset;
55
+ /**
56
+ * One bounded JSON read of the hosting platform, as fixed `gh` arguments.
57
+ * Every argument list a ruleset reader passes is a `GET`.
58
+ */
59
+ export type RulesetJsonReader = (argv: readonly string[], cwd: string, timeoutMs: number, signal: AbortSignal) => Promise<unknown>;
60
+ /**
61
+ * Tell whether a ruleset list of some length can be taken for the whole list.
62
+ *
63
+ * The list is asked for one page at a time, at the largest page the platform
64
+ * gives. A page that comes back full cannot be told from a list that goes
65
+ * on, so only a shorter one is the whole list. A caller that is about to
66
+ * make the list longer asks this first, about the length it would then have.
67
+ * @param length - How many rulesets the list holds, or would hold
68
+ * @returns True when a list of that length is the whole list
69
+ */
70
+ export declare function isWholeRulesetList(length: number): boolean;
71
+ /**
72
+ * Build a detailed ruleset reader over one JSON read function.
73
+ *
74
+ * The walk — list the rulesets, read each one's detail, keep the material
75
+ * fields, sort by name — is the same whoever makes the requests. A caller
76
+ * that has to account for every request it sends (`lisa controls protect`
77
+ * reads the settings back after changing them) hands in its own read function
78
+ * and gets this walk rather than a second copy of it.
79
+ * @param readJson - Makes one read and answers the parsed document
80
+ * @returns A reader that walks the rulesets through `readJson`
81
+ */
82
+ export declare function rulesetReaderOver(readJson: RulesetJsonReader): RulesetReader;
83
+ /** Default fixed-argv detailed GitHub ruleset reader. */
84
+ export declare const readGithubRulesets: RulesetReader;
85
+ //# sourceMappingURL=ruleset-gh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruleset-gh.d.ts","sourceRoot":"","sources":["../../src/health/ruleset-gh.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAQrC,+CAA+C;AAC/C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;AAEvC;;;;;GAKG;AACH,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