@codyswann/lisa 7.1.4 → 8.0.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 (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 -30420
  223. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  224. package/dist/core/upstream-evidence-manifest.json +30518 -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 +4 -4
  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
@@ -8,12 +8,13 @@
8
8
  * By using comment tags as section markers, Lisa can govern critical configs (CI/CD scripts,
9
9
  * required dependencies) while projects retain freedom to customize other areas.
10
10
  */
11
- /* eslint-disable max-lines -- Large complex strategy with many helper methods */
12
11
  import * as fse from "fs-extra";
13
12
  import { copyFile } from "node:fs/promises";
14
13
  import { ensureParentDir } from "../utils/file-operations.js";
15
14
  import { readJson, writeJson } from "../utils/json-utils.js";
16
15
  import { JsonMergeError } from "../errors/index.js";
16
+ import { deduplicateArrays } from "./deduplicate-arrays.js";
17
+ import { findAndExtractDestinationSection, getDestinationObject, hasNestedTags, isOpeningTag, isPlainObject, isTagKey, parseOpeningTag, parseTaggedSections, } from "./tagged-merge-sections.js";
17
18
  /**
18
19
  * Implements tagged merge strategy for JSON files with comment-based section control
19
20
  * @remarks
@@ -38,11 +39,6 @@ export class TaggedMergeStrategy {
38
39
  mergeJson(source, destination) {
39
40
  return this.mergeWithTags(source, destination);
40
41
  }
41
- /**
42
- * Regex pattern for parsing opening tags
43
- * @remarks Captures behavior (force|defaults|merge) and category name for routing to appropriate merge logic
44
- */
45
- tagPattern = /^\/\/lisa-(force|defaults|merge)-(.+)$/;
46
42
  /**
47
43
  * Apply tagged merge strategy to a JSON file
48
44
  * @param sourcePath - Absolute path to Lisa template JSON file with tags
@@ -50,7 +46,7 @@ export class TaggedMergeStrategy {
50
46
  * @param relativePath - Project-relative path for logging
51
47
  * @param context - Strategy context with config and backup functions
52
48
  * @returns Operation result indicating copied, skipped, or merged action
53
- * @throws JsonMergeError if source or destination JSON cannot be parsed
49
+ * @throws {JsonMergeError} if source or destination JSON cannot be parsed
54
50
  * @remarks
55
51
  * When destination doesn't exist, copies source directly. When destination exists,
56
52
  * performs tagged merge preserving project customizations outside tagged sections.
@@ -99,19 +95,19 @@ export class TaggedMergeStrategy {
99
95
  * This ensures governance while preserving project-specific additions outside tagged regions.
100
96
  */
101
97
  mergeWithTags(source, dest) {
102
- const sourceTags = this.parseTaggedSections(source);
98
+ const sourceTags = parseTaggedSections(source);
103
99
  const result = {};
104
100
  const processed = new Set();
105
101
  const processedTags = new Set();
106
102
  // First, process top-level tags
107
103
  for (const key in source) {
108
- if (this.isOpeningTag(key)) {
104
+ if (isOpeningTag(key)) {
109
105
  this.processTaggedSection(key, source, dest, sourceTags, result, processed, processedTags);
110
106
  }
111
107
  }
112
108
  // Second, process unprocessed objects that might have nested tags
113
109
  for (const key in source) {
114
- if (!processed.has(key) && !this.isTagKey(key)) {
110
+ if (!processed.has(key) && !isTagKey(key)) {
115
111
  this.processNestedTaggedObject(key, source, dest, result, processed);
116
112
  }
117
113
  }
@@ -129,46 +125,18 @@ export class TaggedMergeStrategy {
129
125
  */
130
126
  processNestedTaggedObject(key, source, dest, result, processed) {
131
127
  const sourceValue = source[key];
132
- if (!this.isPlainObject(sourceValue)) {
128
+ if (!isPlainObject(sourceValue)) {
133
129
  return;
134
130
  }
135
131
  const sourceObj = sourceValue;
136
- if (!this.hasNestedTags(sourceObj)) {
132
+ if (!hasNestedTags(sourceObj)) {
137
133
  return;
138
134
  }
139
- const destObj = this.getDestinationObject(dest, key);
135
+ const destObj = getDestinationObject(dest, key);
140
136
  const mergedObj = this.mergeObjectWithNestedTags(sourceObj, destObj);
141
137
  result[key] = mergedObj;
142
138
  processed.add(key);
143
139
  }
144
- /**
145
- * Check if a value is a plain object (not array, null, or primitive)
146
- * @param value - Value to check
147
- * @returns True if value is a plain object
148
- */
149
- isPlainObject(value) {
150
- return typeof value === "object" && value !== null && !Array.isArray(value);
151
- }
152
- /**
153
- * Check if an object contains any nested tags
154
- * @param obj - Object to check
155
- * @returns True if object has opening tags as properties
156
- */
157
- hasNestedTags(obj) {
158
- return Object.keys(obj).some(k => this.isOpeningTag(k));
159
- }
160
- /**
161
- * Get the destination object for a key, or empty object if not found
162
- * @param dest - Destination object
163
- * @param key - Key to look for
164
- * @returns Destination object or empty object
165
- */
166
- getDestinationObject(dest, key) {
167
- const destValue = dest[key];
168
- return this.isPlainObject(destValue)
169
- ? destValue
170
- : {};
171
- }
172
140
  /**
173
141
  * Merge an object that may contain nested tags
174
142
  * @param source - Source object potentially containing tags
@@ -176,22 +144,20 @@ export class TaggedMergeStrategy {
176
144
  * @returns Merged object with tags applied appropriately
177
145
  */
178
146
  mergeObjectWithNestedTags(source, dest) {
179
- const sourceTags = this.parseTaggedSections(source);
147
+ const sourceTags = parseTaggedSections(source);
180
148
  const result = {};
181
149
  const processed = new Set();
182
150
  const processedTags = new Set();
183
151
  // Process tagged sections within this object
184
152
  for (const key in source) {
185
- if (this.isOpeningTag(key)) {
153
+ if (isOpeningTag(key)) {
186
154
  this.processTaggedSection(key, source, dest, sourceTags, result, processed, processedTags);
187
155
  }
188
156
  }
189
157
  this.addUnprocessedContent(result, dest, processed, processedTags);
190
158
  // Add remaining tags from source
191
159
  for (const key in source) {
192
- if (this.isTagKey(key) &&
193
- !processedTags.has(key) &&
194
- !processed.has(key)) {
160
+ if (isTagKey(key) && !processedTags.has(key) && !processed.has(key)) {
195
161
  result[key] = source[key];
196
162
  }
197
163
  }
@@ -210,9 +176,7 @@ export class TaggedMergeStrategy {
210
176
  */
211
177
  addUnprocessedContent(result, dest, processed, processedTags) {
212
178
  for (const key in dest) {
213
- if (!processed.has(key) &&
214
- !processedTags.has(key) &&
215
- !this.isTagKey(key)) {
179
+ if (!processed.has(key) && !processedTags.has(key) && !isTagKey(key)) {
216
180
  result[key] = dest[key];
217
181
  }
218
182
  }
@@ -229,9 +193,7 @@ export class TaggedMergeStrategy {
229
193
  */
230
194
  addUnprocessedTags(result, source, processedTags, processed) {
231
195
  for (const key in source) {
232
- if (this.isTagKey(key) &&
233
- !processedTags.has(key) &&
234
- !processed.has(key)) {
196
+ if (isTagKey(key) && !processedTags.has(key) && !processed.has(key)) {
235
197
  result[key] = source[key];
236
198
  }
237
199
  }
@@ -252,11 +214,10 @@ export class TaggedMergeStrategy {
252
214
  * duplicate handling in subsequent steps.
253
215
  */
254
216
  processTaggedSection(key, source, dest, sourceTags, result, processed, processedTags) {
255
- const tagMatch = this.tagPattern.exec(key);
256
- if (!tagMatch || !tagMatch[2])
217
+ const tag = parseOpeningTag(key);
218
+ if (tag === undefined)
257
219
  return;
258
- const behavior = tagMatch[1];
259
- const category = tagMatch[2];
220
+ const { behavior, category } = tag;
260
221
  const section = sourceTags.get(key);
261
222
  if (!section)
262
223
  return;
@@ -280,34 +241,6 @@ export class TaggedMergeStrategy {
280
241
  processed.add(key);
281
242
  processed.add(section.closeKey);
282
243
  }
283
- /**
284
- * Parse JSON object to extract all tagged sections with their boundaries
285
- * @param obj - JSON object to parse for tag markers
286
- * @returns Map of opening tag keys to section info (behavior, category, content keys, close key)
287
- * @remarks
288
- * Relies on JSON key ordering being preserved (standard in modern JS engines).
289
- * Skips sections without matching closing tags to handle malformed input gracefully.
290
- */
291
- parseTaggedSections(obj) {
292
- const sections = new Map();
293
- const keys = Object.keys(obj);
294
- keys.forEach((key, i) => {
295
- if (!this.isOpeningTag(key))
296
- return;
297
- const match = this.tagPattern.exec(key);
298
- if (!match || !match[2])
299
- return;
300
- const behavior = match[1];
301
- const category = match[2];
302
- const closeKey = `//end-lisa-${behavior}-${category}`;
303
- const closeIndex = keys.indexOf(closeKey);
304
- if (closeIndex === -1)
305
- return;
306
- const contentKeys = keys.slice(i + 1, closeIndex);
307
- sections.set(key, { behavior, category, contentKeys, closeKey });
308
- });
309
- return sections;
310
- }
311
244
  /**
312
245
  * Apply force behavior: Lisa's section replaces project's entirely
313
246
  * @param result - Result object being built
@@ -353,7 +286,7 @@ export class TaggedMergeStrategy {
353
286
  * @param category - Tag category name
354
287
  */
355
288
  addDefaultsContent(result, source, dest, section, category) {
356
- const destSection = this.findAndExtractDestinationSection(dest, section, category);
289
+ const destSection = findAndExtractDestinationSection(dest, section, category);
357
290
  if (destSection && destSection.contentKeys.length > 0) {
358
291
  for (const key of destSection.contentKeys) {
359
292
  if (key in dest) {
@@ -365,19 +298,6 @@ export class TaggedMergeStrategy {
365
298
  this.addSourceContent(result, source, section.contentKeys);
366
299
  }
367
300
  }
368
- /**
369
- * Locate and extract the matching tagged section from destination JSON
370
- * @param dest - Project JSON to search for matching tags
371
- * @param section - Source section info containing behavior type
372
- * @param category - Tag category name to match
373
- * @returns Extracted section info if found, undefined if project lacks the section
374
- */
375
- findAndExtractDestinationSection(dest, section, category) {
376
- const destSectionStart = this.findSectionStart(dest, section.behavior, category);
377
- return destSectionStart
378
- ? this.extractSectionContent(dest, destSectionStart, section.behavior, category)
379
- : undefined;
380
- }
381
301
  /**
382
302
  * Copy content keys from source template to result
383
303
  * @param result - Result object being built
@@ -408,7 +328,7 @@ export class TaggedMergeStrategy {
408
328
  const sourceValue = source[key];
409
329
  const destValue = dest[key];
410
330
  if (Array.isArray(sourceValue) && Array.isArray(destValue)) {
411
- result[key] = this.deduplicateArrays(sourceValue, destValue);
331
+ result[key] = deduplicateArrays(sourceValue, destValue);
412
332
  }
413
333
  else if (sourceValue !== undefined) {
414
334
  result[key] = sourceValue;
@@ -419,96 +339,5 @@ export class TaggedMergeStrategy {
419
339
  }
420
340
  result[section.closeKey] = source[section.closeKey];
421
341
  }
422
- /**
423
- * Combine two arrays, removing duplicates while preserving order
424
- * @param sourceArray - Lisa template array (items added first)
425
- * @param destArray - Project array (unique items added after)
426
- * @returns Combined array with source items first, then project's unique additions
427
- * @remarks
428
- * Uses JSON.stringify for value equality, so objects/arrays with same content
429
- * are considered duplicates. This allows deduplicating complex items like
430
- * package names with version specifiers.
431
- */
432
- deduplicateArrays(sourceArray, destArray) {
433
- const seen = new Set();
434
- const result = [];
435
- for (const item of sourceArray) {
436
- const key = JSON.stringify(item);
437
- if (!seen.has(key)) {
438
- seen.add(key);
439
- result.push(item);
440
- }
441
- }
442
- for (const item of destArray) {
443
- const key = JSON.stringify(item);
444
- if (!seen.has(key)) {
445
- seen.add(key);
446
- result.push(item);
447
- }
448
- }
449
- return result;
450
- }
451
- /**
452
- * Test if a key is an opening tag (matches `//lisa-<behavior>-<category>` format)
453
- * @param key - JSON key to test
454
- * @returns True if key matches the opening tag pattern
455
- */
456
- isOpeningTag(key) {
457
- return this.tagPattern.test(key);
458
- }
459
- /**
460
- * Test if a key is any tag-like comment key (starts with `//`)
461
- * @param key - JSON key to test
462
- * @returns True if key is a JSON comment (convention used for documentation/tags)
463
- */
464
- isTagKey(key) {
465
- return key.startsWith("//");
466
- }
467
- /**
468
- * Find opening tag key for a given behavior and category in an object
469
- * @param obj - Object to search for the tag
470
- * @param behavior - Tag behavior type (force, defaults, merge)
471
- * @param category - Tag category name
472
- * @returns Tag key string if found, undefined if object lacks this tag
473
- */
474
- findSectionStart(obj, behavior, category) {
475
- const tagKey = `//lisa-${behavior}-${category}`;
476
- return tagKey in obj ? tagKey : undefined;
477
- }
478
- /**
479
- * Extract section boundaries and content keys between opening and closing tags
480
- * @param obj - Object containing the tagged section
481
- * @param startKey - Opening tag key that marks section start
482
- * @param behavior - Tag behavior type (for constructing close key)
483
- * @param category - Tag category name (for constructing close key)
484
- * @returns Complete section info including content keys between tags
485
- */
486
- extractSectionContent(obj, startKey, behavior, category) {
487
- const closeKey = `//end-lisa-${behavior}-${category}`;
488
- const keys = Object.keys(obj);
489
- const startIndex = keys.indexOf(startKey);
490
- const closeIndex = keys.indexOf(closeKey);
491
- const contentKeys = this.extractContentKeysFromRange(startIndex, closeIndex, keys);
492
- return {
493
- behavior,
494
- category,
495
- contentKeys,
496
- closeKey,
497
- };
498
- }
499
- /**
500
- * Extract keys between opening and closing tag indices
501
- * @param startIndex - Index of opening tag in keys array
502
- * @param closeIndex - Index of closing tag in keys array
503
- * @param keys - Ordered array of all keys in the object
504
- * @returns Array of content keys between the tags, empty if indices invalid
505
- */
506
- extractContentKeysFromRange(startIndex, closeIndex, keys) {
507
- if (startIndex === -1 || closeIndex === -1 || startIndex >= closeIndex) {
508
- return [];
509
- }
510
- return keys.slice(startIndex + 1, closeIndex);
511
- }
512
342
  }
513
- /* eslint-enable max-lines -- End of TaggedMergeStrategy */
514
343
  //# sourceMappingURL=tagged-merge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tagged-merge.js","sourceRoot":"","sources":["../../src/strategies/tagged-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,iFAAiF;AACjF,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,mBAAmB;IACrB,IAAI,GAAG,cAAuB,CAAC;IAExC;;;;;OAKG;IACH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C;IAED;;;;;;;;;;;OAWG;IACK,iBAAiB,CACvB,MAA+B,EAC/B,MAA+B,EAC/B,IAA6B,EAC7B,OAAmB,EACnB,QAAgB;QAEhB,MAAM,OAAO,GAAG,UAAU,OAAO,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAElC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACtC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAE5B,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3D,MAAM,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;YAC1D,CAAC;iBAAM,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBACrC,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;YAC5B,CAAC;iBAAM,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @file bounded-stream.ts
3
+ * @description Collects an untrusted async byte stream under a chunk-count cap
4
+ * and an aggregate byte cap, failing as soon as either is exceeded.
5
+ *
6
+ * The CLI entry points that read JSON from standard input share this so the
7
+ * bounds are enforced the same way everywhere. Each byte is copied once, into
8
+ * the final buffer; the list of chunk references is rebuilt per chunk, which
9
+ * is quadratic in the chunk count but bounded by the chunk cap.
10
+ * @module utils
11
+ */
12
+ /** The caps a bounded read enforces and the errors it raises when crossed. */
13
+ export interface StreamBounds {
14
+ /** Most chunks the stream may deliver. */
15
+ readonly maxChunks: number;
16
+ /** Most bytes the stream may deliver in total. */
17
+ readonly maxBytes: number;
18
+ /** Error message when the chunk cap is crossed. */
19
+ readonly tooManyChunksMessage: string;
20
+ /** Error message when the byte cap is crossed. */
21
+ readonly tooLargeMessage: string;
22
+ }
23
+ /**
24
+ * Reads an async byte stream to completion under the given caps.
25
+ * @param stream - Untrusted input chunks
26
+ * @param bounds - Chunk and byte caps, with the error raised for each
27
+ * @returns Every byte the stream delivered
28
+ */
29
+ export declare function readBoundedBytes(stream: AsyncIterable<Buffer | string>, bounds: StreamBounds): Promise<Buffer>;
30
+ //# sourceMappingURL=bounded-stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-stream.d.ts","sourceRoot":"","sources":["../../src/utils/bounded-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,kDAAkD;IAClD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAiDD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,EACtC,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,MAAM,CAAC,CAcjB"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @file bounded-stream.ts
3
+ * @description Collects an untrusted async byte stream under a chunk-count cap
4
+ * and an aggregate byte cap, failing as soon as either is exceeded.
5
+ *
6
+ * The CLI entry points that read JSON from standard input share this so the
7
+ * bounds are enforced the same way everywhere. Each byte is copied once, into
8
+ * the final buffer; the list of chunk references is rebuilt per chunk, which
9
+ * is quadratic in the chunk count but bounded by the chunk cap.
10
+ * @module utils
11
+ */
12
+ /**
13
+ * Accepts one chunk, or throws when it crosses a cap.
14
+ * @param collected - What has been accepted so far
15
+ * @param rawChunk - The chunk as the stream delivered it
16
+ * @param bounds - Caps and error messages for this read
17
+ * @returns What has been accepted including this chunk
18
+ */
19
+ function accept(collected, rawChunk, bounds) {
20
+ if (collected.chunks.length + 1 > bounds.maxChunks) {
21
+ throw new Error(bounds.tooManyChunksMessage);
22
+ }
23
+ const chunk = Buffer.from(rawChunk);
24
+ const totalBytes = collected.totalBytes + chunk.byteLength;
25
+ if (totalBytes > bounds.maxBytes)
26
+ throw new Error(bounds.tooLargeMessage);
27
+ return { chunks: [...collected.chunks, chunk], totalBytes };
28
+ }
29
+ /**
30
+ * Pulls chunks until the stream ends, carrying what was accepted as the
31
+ * argument. Each step continues after an await, so the call stack does not
32
+ * build up across chunks; what does grow, by one pending promise per chunk, is
33
+ * the chain of awaiting steps, and the chunk cap bounds it.
34
+ * @param iterator - The stream's iterator
35
+ * @param collected - What has been accepted so far
36
+ * @param bounds - Caps and error messages for this read
37
+ * @returns Everything the stream delivered
38
+ */
39
+ async function drain(iterator, collected, bounds) {
40
+ const next = await iterator.next();
41
+ if (next.done === true)
42
+ return collected;
43
+ return drain(iterator, accept(collected, next.value, bounds), bounds);
44
+ }
45
+ /**
46
+ * Reads an async byte stream to completion under the given caps.
47
+ * @param stream - Untrusted input chunks
48
+ * @param bounds - Chunk and byte caps, with the error raised for each
49
+ * @returns Every byte the stream delivered
50
+ */
51
+ export async function readBoundedBytes(stream, bounds) {
52
+ const iterator = stream[Symbol.asyncIterator]();
53
+ try {
54
+ const { chunks, totalBytes } = await drain(iterator, { chunks: [], totalBytes: 0 }, bounds);
55
+ return Buffer.concat(chunks, totalBytes);
56
+ }
57
+ catch (error) {
58
+ // Release the source as `for await` did when the loop body threw.
59
+ await iterator.return?.();
60
+ throw error;
61
+ }
62
+ }
63
+ //# sourceMappingURL=bounded-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-stream.js","sourceRoot":"","sources":["../../src/utils/bounded-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoBH;;;;;;GAMG;AACH,SAAS,MAAM,CACb,SAAoB,EACpB,QAAyB,EACzB,MAAoB;IAEpB,IAAI,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IAC3D,IAAI,UAAU,GAAG,MAAM,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;AAC9D,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,UAAU,KAAK,CAClB,QAAwC,EACxC,SAAoB,EACpB,MAAoB;IAEpB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACzC,OAAO,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACxE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAsC,EACtC,MAAoB;IAEpB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;IAChD,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,KAAK,CACxC,QAAQ,EACR,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,EAC7B,MAAM,CACP,CAAC;QACF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kEAAkE;QAClE,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -9,10 +9,10 @@
9
9
  /**
10
10
  * Infinite generator yielding the Fibonacci sequence as BigInts.
11
11
  *
12
- * Uses a two-element pair to track consecutive values, yielding the leading
13
- * element on each iteration and advancing the pair forward. Each call returns
14
- * an independent iterator, so multiple consumers never interfere.
12
+ * Each call returns an independent iterator, so multiple consumers never
13
+ * interfere.
15
14
  * @yields The next Fibonacci number (0n, 1n, 1n, 2n, 3n, 5n, …)
15
+ * @returns Never; the sequence is infinite
16
16
  * @example
17
17
  * ```typescript
18
18
  * const gen = fibonacciGenerator();
@@ -1 +1 @@
1
- {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAiB,kBAAkB,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CASvE;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,MAYrC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,SAAS,MAAM,EASjE,CAAC"}
1
+ {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4DH;;;;;;;;;;;;;GAaG;AACH,wBAAiB,kBAAkB,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAEvE;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,MAYrC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,SAAS,MAAM,EASjE,CAAC"}
@@ -6,13 +6,57 @@
6
6
  * fibonacciGenerator, keeping the recurrence relation in a single place.
7
7
  * @module utils
8
8
  */
9
+ /** How many values each step of the generator expands at once. */
10
+ const BLOCK = 1024;
11
+ /**
12
+ * F(-1), F(0), F(1), … F(BLOCK + 1): the coefficients that expand a pair of
13
+ * consecutive Fibonacci values into the block that follows it.
14
+ * @param row - The coefficients built so far, starting from F(-1), F(0)
15
+ * @returns The full coefficient row
16
+ */
17
+ function coefficientRow(row = [1n, 0n]) {
18
+ if (row.length === BLOCK + 3)
19
+ return row;
20
+ return coefficientRow([...row, (row.at(-1) ?? 0n) + (row.at(-2) ?? 0n)]);
21
+ }
22
+ const COEFFICIENTS = coefficientRow();
23
+ /**
24
+ * The value `offset` places after a pair of consecutive Fibonacci values:
25
+ * F(k + offset) = F(k)·F(offset − 1) + F(k + 1)·F(offset).
26
+ * @param current - F(k)
27
+ * @param following - F(k + 1)
28
+ * @param offset - Distance from k, between 0 and BLOCK + 1
29
+ * @returns F(k + offset)
30
+ */
31
+ function ahead(current, following, offset) {
32
+ return (current * (COEFFICIENTS[offset] ?? 0n) +
33
+ following * (COEFFICIENTS[offset + 1] ?? 0n));
34
+ }
35
+ /**
36
+ * Yields the sequence from a pair of consecutive values onward. The pair is
37
+ * the recurrence's whole state, so it travels as the parameters: each step
38
+ * yields one block derived from the pair, then continues from the pair that
39
+ * follows the block. Each block adds one level of `yield*` delegation, so the
40
+ * depth at position n is about n / BLOCK. One value per level overflowed the
41
+ * stack near 5,000 values when measured; a block of 1,024 moves that limit out
42
+ * about a thousandfold, to positions in the millions, which are values of
43
+ * millions of bits. The bound is real but far beyond any practical use.
44
+ * @param current - F(k)
45
+ * @param following - F(k + 1)
46
+ * @yields F(k), F(k + 1), …
47
+ * @returns Never; the sequence is infinite
48
+ */
49
+ function* fibonacciFrom(current, following) {
50
+ yield* Array.from({ length: BLOCK }, (_, offset) => ahead(current, following, offset));
51
+ return yield* fibonacciFrom(ahead(current, following, BLOCK), ahead(current, following, BLOCK + 1));
52
+ }
9
53
  /**
10
54
  * Infinite generator yielding the Fibonacci sequence as BigInts.
11
55
  *
12
- * Uses a two-element pair to track consecutive values, yielding the leading
13
- * element on each iteration and advancing the pair forward. Each call returns
14
- * an independent iterator, so multiple consumers never interfere.
56
+ * Each call returns an independent iterator, so multiple consumers never
57
+ * interfere.
15
58
  * @yields The next Fibonacci number (0n, 1n, 1n, 2n, 3n, 5n, …)
59
+ * @returns Never; the sequence is infinite
16
60
  * @example
17
61
  * ```typescript
18
62
  * const gen = fibonacciGenerator();
@@ -21,13 +65,7 @@
21
65
  * ```
22
66
  */
23
67
  export function* fibonacciGenerator() {
24
- /* eslint-disable functional/no-let -- generator requires mutable pair to track consecutive Fibonacci values */
25
- let pair = [0n, 1n];
26
- /* eslint-enable functional/no-let -- re-enable after generator state declaration */
27
- for (;;) {
28
- yield pair[0];
29
- pair = [pair[1], pair[0] + pair[1]];
30
- }
68
+ return yield* fibonacciFrom(0n, 1n);
31
69
  }
32
70
  /**
33
71
  * Returns the nth Fibonacci number (0-indexed) as a BigInt.
@@ -1 +1 @@
1
- {"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,SAAS,CAAC,CAAC,kBAAkB;IACjC,+GAA+G;IAC/G,IA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C,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @file memo.ts
3
+ * @description A memo table for pure computations.
4
+ *
5
+ * Caching the answer of a pure function changes how long the answer takes,
6
+ * never the answer, so the mutation is confined to this one class instead of
7
+ * being spread through the modules that need a cache.
8
+ * @module utils
9
+ */
10
+ /**
11
+ * Remembers the result of a pure computation per key. A computation that
12
+ * returns `undefined` is never remembered, so it runs again on the next call.
13
+ */
14
+ export declare class Memo<K, V> {
15
+ /** Where answers are kept. */
16
+ private readonly store;
17
+ /**
18
+ * Returns the remembered answer for a key, computing and remembering it on a miss.
19
+ * @param key - The input the answer depends on
20
+ * @param compute - The pure computation that produces the answer
21
+ * @returns The answer for `key`
22
+ */
23
+ resolve(key: K, compute: (key: K) => V): V;
24
+ }
25
+ //# sourceMappingURL=memo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/utils/memo.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,qBAAa,IAAI,CAAC,CAAC,EAAE,CAAC;IACpB,8BAA8B;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IAEzC;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;CAO3C"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @file memo.ts
3
+ * @description A memo table for pure computations.
4
+ *
5
+ * Caching the answer of a pure function changes how long the answer takes,
6
+ * never the answer, so the mutation is confined to this one class instead of
7
+ * being spread through the modules that need a cache.
8
+ * @module utils
9
+ */
10
+ /**
11
+ * Remembers the result of a pure computation per key. A computation that
12
+ * returns `undefined` is never remembered, so it runs again on the next call.
13
+ */
14
+ export class Memo {
15
+ /** Where answers are kept. */
16
+ store = new Map();
17
+ /**
18
+ * Returns the remembered answer for a key, computing and remembering it on a miss.
19
+ * @param key - The input the answer depends on
20
+ * @param compute - The pure computation that produces the answer
21
+ * @returns The answer for `key`
22
+ */
23
+ resolve(key, compute) {
24
+ const remembered = this.store.get(key);
25
+ if (remembered !== undefined)
26
+ return remembered;
27
+ const value = compute(key);
28
+ this.store.set(key, value);
29
+ return value;
30
+ }
31
+ }
32
+ //# sourceMappingURL=memo.js.map