@codyswann/lisa 5.4.0 → 5.6.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.
- package/README.md +60 -3
- package/all/copy-contents/gitignore +16 -0
- package/all/copy-contents/scripts/lisa-mutation.sh +4 -6
- package/all/copy-overwrite/scripts/fetch-test-access-map.d.mts +71 -0
- package/all/copy-overwrite/scripts/fetch-test-access-map.mjs +674 -0
- package/all/copy-overwrite/scripts/lib/affected-tests.mjs +818 -0
- package/all/copy-overwrite/scripts/lib/automation-provenance-local.mjs +48 -3
- package/all/copy-overwrite/scripts/lib/build-marker.mjs +410 -0
- package/all/copy-overwrite/scripts/lib/gate-pass-cache.mjs +537 -0
- package/all/copy-overwrite/scripts/lib/github-attestation-provider.mjs +68 -0
- package/all/copy-overwrite/scripts/lib/github-attestation-recovery.mjs +25 -10
- package/all/copy-overwrite/scripts/lib/github-attestation-verifier.mjs +4 -1
- package/all/copy-overwrite/scripts/lib/kill-marks.mjs +1 -2
- package/all/copy-overwrite/scripts/lib/lisa-cleanup-sweep-processes.mjs +3 -4
- package/all/copy-overwrite/scripts/lib/npm-update-allocate.mjs +1 -6
- package/all/copy-overwrite/scripts/lib/npm-update-authorization.mjs +25 -14
- package/all/copy-overwrite/scripts/lib/npm-update-cancel-origin.mjs +45 -11
- package/all/copy-overwrite/scripts/lib/npm-update-cancellation-proof.mjs +22 -11
- package/all/copy-overwrite/scripts/lib/npm-update-cancellation.mjs +29 -17
- package/all/copy-overwrite/scripts/lib/npm-update-controller-broker.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/npm-update-controller-factory.mjs +19 -1
- package/all/copy-overwrite/scripts/lib/npm-update-gate-hooks.mjs +2 -1
- package/all/copy-overwrite/scripts/lib/npm-update-gate.mjs +5 -0
- package/all/copy-overwrite/scripts/lib/npm-update-gh-requests.mjs +57 -30
- package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +9 -1
- package/all/copy-overwrite/scripts/lib/npm-update-hosted-hook.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/npm-update-leaf.mjs +6 -1
- package/all/copy-overwrite/scripts/lib/npm-update-policy.mjs +38 -0
- package/all/copy-overwrite/scripts/lib/npm-update-publication.mjs +21 -3
- package/all/copy-overwrite/scripts/lib/npm-update-publish.mjs +13 -1
- package/all/copy-overwrite/scripts/lib/npm-update-recovery.mjs +29 -4
- package/all/copy-overwrite/scripts/lib/npm-update-supersession.mjs +21 -7
- package/all/copy-overwrite/scripts/lib/npm-update-tool-launcher.mjs +1 -1
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-cancel.mjs +139 -0
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-jira.mjs +149 -19
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-linear.mjs +72 -17
- package/all/copy-overwrite/scripts/lib/npm-update-tracker-wire.mjs +102 -12
- package/all/copy-overwrite/scripts/lib/npm-update-tracker.mjs +91 -13
- package/all/copy-overwrite/scripts/lib/push-admission.mjs +158 -0
- package/all/copy-overwrite/scripts/lib/push-gate-defaults.d.mts +34 -0
- package/all/copy-overwrite/scripts/lib/push-gate-defaults.mjs +147 -0
- package/all/copy-overwrite/scripts/lib/push-timing.mjs +323 -0
- package/all/copy-overwrite/scripts/lib/rspec-selection.mjs +672 -0
- package/all/copy-overwrite/scripts/lisa-affected-tests.mjs +566 -0
- package/all/copy-overwrite/scripts/lisa-automation-provenance.mjs +35 -8
- package/all/copy-overwrite/scripts/lisa-gates.mjs +29 -0
- package/all/copy-overwrite/scripts/lisa-lint-staged-preflight.mjs +10 -1
- package/all/copy-overwrite/scripts/lisa-npm-updater.mjs +8 -5
- package/all/copy-overwrite/scripts/lisa-push-timing-report.mjs +153 -0
- package/all/copy-overwrite/scripts/lisa-rspec-select.mjs +982 -0
- package/all/copy-overwrite/scripts/lisa-run-gates.mjs +231 -6
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +148 -41
- package/all/deletions.json +11 -2
- package/cdk/create-only/vitest.config.local.ts +1 -7
- package/cdk/package-lisa/package.lisa.json +4 -4
- package/dist/cli/admit-cmd.d.ts +21 -0
- package/dist/cli/admit-cmd.d.ts.map +1 -0
- package/dist/cli/admit-cmd.js +142 -0
- package/dist/cli/admit-cmd.js.map +1 -0
- package/dist/cli/check-cmd.d.ts +72 -0
- package/dist/cli/check-cmd.d.ts.map +1 -0
- package/dist/cli/check-cmd.js +316 -0
- package/dist/cli/check-cmd.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +6 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lisa-test-run-admission.d.ts +18 -0
- package/dist/cli/lisa-test-run-admission.d.ts.map +1 -0
- package/dist/cli/lisa-test-run-admission.js +62 -0
- package/dist/cli/lisa-test-run-admission.js.map +1 -0
- package/dist/cli/lisa-test-run-payload.d.ts +37 -0
- package/dist/cli/lisa-test-run-payload.d.ts.map +1 -0
- package/dist/cli/lisa-test-run-payload.js +55 -0
- package/dist/cli/lisa-test-run-payload.js.map +1 -0
- package/dist/cli/lisa-test-run-shard-files.d.ts +89 -0
- package/dist/cli/lisa-test-run-shard-files.d.ts.map +1 -0
- package/dist/cli/lisa-test-run-shard-files.js +239 -0
- package/dist/cli/lisa-test-run-shard-files.js.map +1 -0
- package/dist/cli/lisa-test-run-shard.d.ts +6 -2
- package/dist/cli/lisa-test-run-shard.d.ts.map +1 -1
- package/dist/cli/lisa-test-run-shard.js +25 -13
- package/dist/cli/lisa-test-run-shard.js.map +1 -1
- package/dist/cli/lisa-test-run.d.ts +1 -1
- package/dist/cli/lisa-test-run.d.ts.map +1 -1
- package/dist/cli/lisa-test-run.js +47 -10
- package/dist/cli/lisa-test-run.js.map +1 -1
- package/dist/cli/update-check-hook.d.ts.map +1 -1
- package/dist/cli/update-check-hook.js +3 -0
- package/dist/cli/update-check-hook.js.map +1 -1
- package/dist/configs/vitest/base.d.ts +58 -135
- package/dist/configs/vitest/base.d.ts.map +1 -1
- package/dist/configs/vitest/base.js +76 -228
- package/dist/configs/vitest/base.js.map +1 -1
- package/dist/configs/vitest/cdk.d.ts.map +1 -1
- package/dist/configs/vitest/cdk.js +3 -2
- package/dist/configs/vitest/cdk.js.map +1 -1
- package/dist/configs/vitest/coverage-include-global-setup.d.ts.map +1 -1
- package/dist/configs/vitest/coverage-include-global-setup.js +3 -4
- package/dist/configs/vitest/coverage-include-global-setup.js.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.d.ts +27 -5
- package/dist/configs/vitest/coverage-reports-directory.d.ts.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.js +47 -10
- package/dist/configs/vitest/coverage-reports-directory.js.map +1 -1
- package/dist/configs/vitest/harper-fabric.d.ts.map +1 -1
- package/dist/configs/vitest/harper-fabric.js +3 -2
- package/dist/configs/vitest/harper-fabric.js.map +1 -1
- package/dist/configs/vitest/nestjs.d.ts.map +1 -1
- package/dist/configs/vitest/nestjs.js +3 -2
- package/dist/configs/vitest/nestjs.js.map +1 -1
- package/dist/configs/vitest/phaser.d.ts.map +1 -1
- package/dist/configs/vitest/phaser.js +3 -2
- package/dist/configs/vitest/phaser.js.map +1 -1
- package/dist/configs/vitest/refusal-announcement.d.ts +51 -0
- package/dist/configs/vitest/refusal-announcement.d.ts.map +1 -0
- package/dist/configs/vitest/refusal-announcement.js +97 -0
- package/dist/configs/vitest/refusal-announcement.js.map +1 -0
- package/dist/configs/vitest/socket-safe-temp-base.d.ts +3 -4
- package/dist/configs/vitest/socket-safe-temp-base.d.ts.map +1 -1
- package/dist/configs/vitest/socket-safe-temp-base.js +7 -6
- package/dist/configs/vitest/socket-safe-temp-base.js.map +1 -1
- package/dist/configs/vitest/typescript.d.ts.map +1 -1
- package/dist/configs/vitest/typescript.js +3 -2
- package/dist/configs/vitest/typescript.js.map +1 -1
- package/dist/core/admission-decision.d.ts +110 -0
- package/dist/core/admission-decision.d.ts.map +1 -0
- package/dist/core/admission-decision.js +91 -0
- package/dist/core/admission-decision.js.map +1 -0
- package/dist/core/admission-lock.d.ts +69 -0
- package/dist/core/admission-lock.d.ts.map +1 -0
- package/dist/core/admission-lock.js +278 -0
- package/dist/core/admission-lock.js.map +1 -0
- package/dist/core/admission-settings.d.ts +69 -0
- package/dist/core/admission-settings.d.ts.map +1 -0
- package/dist/core/admission-settings.js +204 -0
- package/dist/core/admission-settings.js.map +1 -0
- package/dist/core/admission-state.d.ts +50 -0
- package/dist/core/admission-state.d.ts.map +1 -0
- package/dist/core/admission-state.js +168 -0
- package/dist/core/admission-state.js.map +1 -0
- package/dist/core/admission.d.ts +70 -0
- package/dist/core/admission.d.ts.map +1 -0
- package/dist/core/admission.js +205 -0
- package/dist/core/admission.js.map +1 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +440 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/project-config-push-gate.d.ts +66 -0
- package/dist/core/project-config-push-gate.d.ts.map +1 -0
- package/dist/core/project-config-push-gate.js +82 -0
- package/dist/core/project-config-push-gate.js.map +1 -0
- package/dist/core/project-config.d.ts +4 -0
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +14 -9
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +234 -146
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/expo/package-lisa/package.lisa.json +2 -2
- package/harper-fabric/package-lisa/package.lisa.json +4 -4
- package/nestjs/create-only/vitest.config.local.ts +1 -7
- package/nestjs/package-lisa/package.lisa.json +4 -4
- package/npm-package/package-lisa/package.lisa.json +4 -4
- package/package.json +12 -11
- package/phaser/package-lisa/package.lisa.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-agy/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-copilot/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-cursor/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/lisa-devin/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/lisa-devin/skills/lisa-implement/SKILL.md +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-drive-pr-to-merge/SKILL.md +16 -3
- package/plugins/src/base/skills/lisa-git-submit-pr/SKILL.md +1 -1
- package/plugins/src/base/skills/lisa-implement/SKILL.md +1 -1
- package/rails/copy-overwrite/Gemfile.lisa +8 -0
- package/rails/copy-overwrite/lefthook.yml +25 -11
- package/rails/copy-overwrite/scripts/lisa-rails-gates.mjs +686 -0
- package/rails/copy-overwrite/scripts/lisa-rspec-shards.mjs +2 -2
- package/rails/copy-overwrite/scripts/lisa_crystalball_recorder.rb +239 -0
- package/rails/copy-overwrite/scripts/lisa_rspec_partial_coverage.rb +83 -0
- package/scripts/build-unless-marked.mjs +83 -0
- package/scripts/check-plugins-sync.sh +22 -5
- package/scripts/classify-markdown-assertions.mjs +141 -0
- package/scripts/integration-shard-build.mjs +143 -0
- package/scripts/lib/history-scanner-suites.mjs +19 -0
- package/scripts/lib/markdown-assertions/classify.mjs +289 -0
- package/scripts/lib/markdown-assertions/context.mjs +53 -0
- package/scripts/lib/markdown-assertions/corpus.mjs +222 -0
- package/scripts/lib/markdown-assertions/manifest-cull.mjs +86 -0
- package/scripts/lib/markdown-assertions/record-setup.mjs +265 -0
- package/scripts/lib/markdown-assertions/record.mjs +115 -0
- package/scripts/lib/markdown-assertions/record.vitest.config.mjs +24 -0
- package/scripts/lib/markdown-assertions/sites.mjs +273 -0
- package/scripts/lib/markdown-assertions/test-cull.mjs +768 -0
- package/scripts/lib/markdown-assertions/tokens.mjs +158 -0
- package/scripts/lib/shell-guard-trace.mjs +6 -0
- package/scripts/lib/test-access-map-setup.mjs +40 -0
- package/scripts/lib/test-access-map-tracer.mjs +205 -0
- package/scripts/lib/test-access-map.d.mts +72 -0
- package/scripts/lib/test-access-map.mjs +395 -0
- package/scripts/lib/test-timings-reporter.d.mts +17 -0
- package/scripts/lib/test-timings-reporter.mjs +99 -0
- package/scripts/plan-integration-shards.mjs +300 -0
- package/scripts/test-timing-report.d.mts +41 -0
- package/scripts/test-timing-report.mjs +361 -0
- package/scripts/two-channel-couplings.json +132 -36
- package/scripts/verify-npm-advisories-4333.mjs +3 -12
- package/typescript/copy-overwrite/.prettierignore +13 -0
- package/typescript/create-only/vitest.config.local.ts +1 -7
- package/typescript/package-lisa/package.lisa.json +4 -4
- package/all/copy-overwrite/scripts/lisa-scratch-run.sh +0 -1078
- package/dist/cli/lisa-test-run-bootstrap.d.ts +0 -3
- package/dist/cli/lisa-test-run-bootstrap.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-bootstrap.js +0 -229
- package/dist/cli/lisa-test-run-bootstrap.js.map +0 -1
- package/dist/cli/lisa-test-run-ipc.d.ts +0 -49
- package/dist/cli/lisa-test-run-ipc.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-ipc.js +0 -226
- package/dist/cli/lisa-test-run-ipc.js.map +0 -1
- package/dist/cli/lisa-test-run-process-group.d.ts +0 -30
- package/dist/cli/lisa-test-run-process-group.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-process-group.js +0 -140
- package/dist/cli/lisa-test-run-process-group.js.map +0 -1
- package/dist/cli/lisa-test-run-reaper.d.ts +0 -3
- package/dist/cli/lisa-test-run-reaper.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-reaper.js +0 -195
- package/dist/cli/lisa-test-run-reaper.js.map +0 -1
- package/dist/cli/lisa-test-run-runtime.d.ts +0 -46
- package/dist/cli/lisa-test-run-runtime.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-runtime.js +0 -123
- package/dist/cli/lisa-test-run-runtime.js.map +0 -1
- package/dist/cli/lisa-test-run-supervisor.d.ts +0 -13
- package/dist/cli/lisa-test-run-supervisor.d.ts.map +0 -1
- package/dist/cli/lisa-test-run-supervisor.js +0 -265
- package/dist/cli/lisa-test-run-supervisor.js.map +0 -1
- package/dist/configs/vitest/fleet-admission-global-setup.d.ts +0 -34
- package/dist/configs/vitest/fleet-admission-global-setup.d.ts.map +0 -1
- package/dist/configs/vitest/fleet-admission-global-setup.js +0 -123
- package/dist/configs/vitest/fleet-admission-global-setup.js.map +0 -1
- package/dist/configs/vitest/fleet-admission.d.ts +0 -129
- package/dist/configs/vitest/fleet-admission.d.ts.map +0 -1
- package/dist/configs/vitest/fleet-admission.js +0 -239
- package/dist/configs/vitest/fleet-admission.js.map +0 -1
- package/dist/configs/vitest/scratch-authority.d.ts +0 -25
- package/dist/configs/vitest/scratch-authority.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-authority.js +0 -107
- package/dist/configs/vitest/scratch-authority.js.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup-programs.d.ts +0 -5
- package/dist/configs/vitest/scratch-bound-cleanup-programs.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup-programs.js +0 -219
- package/dist/configs/vitest/scratch-bound-cleanup-programs.js.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup.d.ts +0 -28
- package/dist/configs/vitest/scratch-bound-cleanup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-bound-cleanup.js +0 -155
- package/dist/configs/vitest/scratch-bound-cleanup.js.map +0 -1
- package/dist/configs/vitest/scratch-bound-root-cleanup.d.ts +0 -17
- package/dist/configs/vitest/scratch-bound-root-cleanup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-bound-root-cleanup.js +0 -149
- package/dist/configs/vitest/scratch-bound-root-cleanup.js.map +0 -1
- package/dist/configs/vitest/scratch-global-setup.d.ts +0 -258
- package/dist/configs/vitest/scratch-global-setup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-global-setup.js +0 -505
- package/dist/configs/vitest/scratch-global-setup.js.map +0 -1
- package/dist/configs/vitest/scratch-leak-setup.d.ts +0 -2
- package/dist/configs/vitest/scratch-leak-setup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-leak-setup.js +0 -108
- package/dist/configs/vitest/scratch-leak-setup.js.map +0 -1
- package/dist/configs/vitest/scratch-namespace-authority.d.ts +0 -80
- package/dist/configs/vitest/scratch-namespace-authority.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-namespace-authority.js +0 -291
- package/dist/configs/vitest/scratch-namespace-authority.js.map +0 -1
- package/dist/configs/vitest/scratch-owner.d.ts +0 -131
- package/dist/configs/vitest/scratch-owner.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-owner.js +0 -297
- package/dist/configs/vitest/scratch-owner.js.map +0 -1
- package/dist/configs/vitest/scratch-route-profile.d.ts +0 -46
- package/dist/configs/vitest/scratch-route-profile.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-route-profile.js +0 -233
- package/dist/configs/vitest/scratch-route-profile.js.map +0 -1
- package/dist/configs/vitest/scratch-run-root-compatibility.d.ts +0 -33
- package/dist/configs/vitest/scratch-run-root-compatibility.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-run-root-compatibility.js +0 -137
- package/dist/configs/vitest/scratch-run-root-compatibility.js.map +0 -1
- package/dist/configs/vitest/scratch-run-root-intent.d.ts +0 -66
- package/dist/configs/vitest/scratch-run-root-intent.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-run-root-intent.js +0 -183
- package/dist/configs/vitest/scratch-run-root-intent.js.map +0 -1
- package/dist/configs/vitest/scratch-setup.d.ts +0 -46
- package/dist/configs/vitest/scratch-setup.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-setup.js +0 -226
- package/dist/configs/vitest/scratch-setup.js.map +0 -1
- package/dist/configs/vitest/scratch-supervision-intent.d.ts +0 -8
- package/dist/configs/vitest/scratch-supervision-intent.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-supervision-intent.js +0 -125
- package/dist/configs/vitest/scratch-supervision-intent.js.map +0 -1
- package/dist/configs/vitest/scratch-supervision-protocol.d.ts +0 -12
- package/dist/configs/vitest/scratch-supervision-protocol.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-supervision-protocol.js +0 -230
- package/dist/configs/vitest/scratch-supervision-protocol.js.map +0 -1
- package/dist/configs/vitest/scratch-supervision.d.ts +0 -69
- package/dist/configs/vitest/scratch-supervision.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-supervision.js +0 -244
- package/dist/configs/vitest/scratch-supervision.js.map +0 -1
- package/dist/configs/vitest/scratch-sweep.d.ts +0 -66
- package/dist/configs/vitest/scratch-sweep.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-sweep.js +0 -82
- package/dist/configs/vitest/scratch-sweep.js.map +0 -1
- package/dist/configs/vitest/scratch-tmpdir-trust.d.ts +0 -48
- package/dist/configs/vitest/scratch-tmpdir-trust.d.ts.map +0 -1
- package/dist/configs/vitest/scratch-tmpdir-trust.js +0 -194
- package/dist/configs/vitest/scratch-tmpdir-trust.js.map +0 -1
- package/dist/configs/vitest/scratch.d.ts +0 -19
- package/dist/configs/vitest/scratch.d.ts.map +0 -1
- package/dist/configs/vitest/scratch.js +0 -34
- package/dist/configs/vitest/scratch.js.map +0 -1
- package/dist/configs/vitest/synthesis-scratch-reclaim.d.ts +0 -86
- package/dist/configs/vitest/synthesis-scratch-reclaim.d.ts.map +0 -1
- package/dist/configs/vitest/synthesis-scratch-reclaim.js +0 -226
- package/dist/configs/vitest/synthesis-scratch-reclaim.js.map +0 -1
|
@@ -10,14 +10,11 @@
|
|
|
10
10
|
* @module npm-updater
|
|
11
11
|
*/
|
|
12
12
|
import { required, operatorRefusal } from "./npm-update-invariants.mjs";
|
|
13
|
+
import { backlinkBody } from "../lisa-work-item.mjs";
|
|
13
14
|
import { verifyCurrentRun } from "./github-attestation-provider.mjs";
|
|
14
15
|
import { JiraTracker } from "./npm-update-tracker-jira.mjs";
|
|
15
16
|
import { LinearTracker } from "./npm-update-tracker-linear.mjs";
|
|
16
17
|
|
|
17
|
-
/** The operator-approved sentence for every Jira/Linear phase that is not supported yet. */
|
|
18
|
-
export const FOLLOWUP_SENTENCE =
|
|
19
|
-
"The npm updater can file and claim Jira and Linear work items, but it cannot yet check their claims, publish the pull request or cancel them. That support is tracked in CodySwannGT/lisa#4873. Projects that track work in GitHub are fully supported today.";
|
|
20
|
-
|
|
21
18
|
/** Today's GitHub calls, unchanged in endpoint, method, body and order. */
|
|
22
19
|
export function githubTracker(api, repository) {
|
|
23
20
|
const repo = () => repository ?? api.policy.repository;
|
|
@@ -110,6 +107,80 @@ export function trustedHumanActorIds(config) {
|
|
|
110
107
|
return config.github.trustedHumanActorIds ?? [];
|
|
111
108
|
}
|
|
112
109
|
|
|
110
|
+
/**
|
|
111
|
+
* A held Jira/Linear item whose project never named who may release holds can
|
|
112
|
+
* never be released, so say that instead of the generic hold refusal (#4873).
|
|
113
|
+
* The hold itself still stands: an absent list trusts no one.
|
|
114
|
+
*/
|
|
115
|
+
export function refuseUnreleasableHold(config, held) {
|
|
116
|
+
const tracker = config.tracker;
|
|
117
|
+
if (
|
|
118
|
+
held &&
|
|
119
|
+
(tracker === "jira" || tracker === "linear") &&
|
|
120
|
+
!Array.isArray(config[tracker]?.trustedHumanActorIds)
|
|
121
|
+
)
|
|
122
|
+
throw operatorRefusal(
|
|
123
|
+
"tracker hold trust list is absent",
|
|
124
|
+
`This work item is held for a person, and ${tracker}.trustedHumanActorIds is not set in .lisa.config.json, so no release comment can lift the hold. List the ${tracker === "jira" ? "Jira accountIds" : "Linear user ids"} of the people allowed to release holds, then rerun.`
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A synchronous test for "the automation wrote this". GitHub: the configured
|
|
130
|
+
* Bot. Jira/Linear: the credential's own account, already required to be the
|
|
131
|
+
* declared claimActorRef (#4873).
|
|
132
|
+
*/
|
|
133
|
+
export async function managedActor(api) {
|
|
134
|
+
if (!api.tracker)
|
|
135
|
+
return user =>
|
|
136
|
+
user?.type === "Bot" && String(user.id) === api.policy.claimActorId;
|
|
137
|
+
const id = await api.tracker.actorId();
|
|
138
|
+
return user => typeof user?.id === "string" && user.id === id;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The one work item reference an allocation of this tracker may carry. */
|
|
142
|
+
export function allocationWorkItem(api, config, repository, number) {
|
|
143
|
+
return api.tracker
|
|
144
|
+
? expectedWorkItem(config, number)
|
|
145
|
+
: `${repository}#${number}`;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The one closure check every cancellation path shares. GitHub: closed as
|
|
150
|
+
* not_planned by the configured Bot. Jira/Linear: closed into the canceled
|
|
151
|
+
* status or state, and the changelog or history shows the automation made that
|
|
152
|
+
* move (#4873). `reason` keeps each caller's original refusal.
|
|
153
|
+
*/
|
|
154
|
+
export async function assertManagedClosure(api, issue, reason) {
|
|
155
|
+
required(
|
|
156
|
+
issue.state === "closed" &&
|
|
157
|
+
issue.state_reason === "not_planned" &&
|
|
158
|
+
(api.tracker ||
|
|
159
|
+
(issue.closed_by?.type === "Bot" &&
|
|
160
|
+
String(issue.closed_by.id) === api.policy.claimActorId)),
|
|
161
|
+
reason
|
|
162
|
+
);
|
|
163
|
+
if (api.tracker) await api.tracker.assertCancelled(issue.number);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Publish-time tracker authority for Jira/Linear (#4873): the live claim by the
|
|
168
|
+
* automation identity (returned for the origin chronology), one owner who is the
|
|
169
|
+
* maintainer, and that owner still assignable. GitHub hosts return undefined;
|
|
170
|
+
* their claim is read from GitHub by the provider proof.
|
|
171
|
+
*/
|
|
172
|
+
export async function trackerPublishAuthority(api, descriptor, policy, issue) {
|
|
173
|
+
if (!api.tracker) return undefined;
|
|
174
|
+
const claim = await api.tracker.proveClaim(descriptor);
|
|
175
|
+
required(
|
|
176
|
+
issue.assignees.length === 1 &&
|
|
177
|
+
issue.assignees[0].login === policy.maintainer,
|
|
178
|
+
"current recovery leaf or owner differs"
|
|
179
|
+
);
|
|
180
|
+
await api.tracker.assignable(policy.maintainer);
|
|
181
|
+
return claim;
|
|
182
|
+
}
|
|
183
|
+
|
|
113
184
|
/** An api without an attached adapter is a GitHub-tracked host, exactly as before. */
|
|
114
185
|
export function trackerOf(api, repository) {
|
|
115
186
|
return api.tracker ?? githubTracker(api, repository);
|
|
@@ -137,15 +208,6 @@ export function createTracker(config, env, transport = globalThis.fetch) {
|
|
|
137
208
|
: new LinearTracker(config, env, transport);
|
|
138
209
|
}
|
|
139
210
|
|
|
140
|
-
/** Every unsupported Jira/Linear step stops before its first write, in words the operator can act on. */
|
|
141
|
-
export function refuseUnlessGithub(config, step) {
|
|
142
|
-
if (config.tracker !== "github")
|
|
143
|
-
throw operatorRefusal(
|
|
144
|
-
`${step} is not supported for this tracker yet`,
|
|
145
|
-
FOLLOWUP_SENTENCE
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
211
|
/** The one reference grammar a tracker's signed artifacts may carry. */
|
|
150
212
|
export function expectedWorkItem(config, number) {
|
|
151
213
|
required(Number.isSafeInteger(number) && number > 0, "invalid work item");
|
|
@@ -171,6 +233,22 @@ export function verifySignedWorkItem(config, allocation, preview) {
|
|
|
171
233
|
);
|
|
172
234
|
}
|
|
173
235
|
|
|
236
|
+
/**
|
|
237
|
+
* The managed PR backlink on a Jira/Linear work item, written by the declared
|
|
238
|
+
* automation identity and read back exactly. A rerun finds it and writes nothing.
|
|
239
|
+
*/
|
|
240
|
+
export async function vendorBacklink(tracker, number, prUrl) {
|
|
241
|
+
const body = backlinkBody(prUrl);
|
|
242
|
+
const present = async () => {
|
|
243
|
+
for (const comment of await tracker.comments(number))
|
|
244
|
+
if (comment.body === body && (await tracker.isManagedActor(comment.user)))
|
|
245
|
+
return true;
|
|
246
|
+
return false;
|
|
247
|
+
};
|
|
248
|
+
if (!(await present())) await tracker.backlinkComment(number, body);
|
|
249
|
+
required(await present(), "work item backlink readback differs");
|
|
250
|
+
}
|
|
251
|
+
|
|
174
252
|
/** Checkpoint authority for Jira/Linear: the live GitHub run plus the claim proved on the tracker. */
|
|
175
253
|
export async function proveTrackerProvider(api, descriptor, config) {
|
|
176
254
|
const tracker = trackerFor(api, api.policy, config);
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// This file is managed by Lisa and IS replaced on each `lisa` run.
|
|
2
|
+
// Do not edit directly — durable changes belong upstream in Lisa.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Route the push gate's heavy steps through headroom admission
|
|
6
|
+
* (CodySwannGT/lisa#4596).
|
|
7
|
+
*
|
|
8
|
+
* When `.lisa.config.json` sets `pushGate.admission: true`, the gate runner
|
|
9
|
+
* runs `code-style-slow` (`lint:slow`), `type-correctness` (`typecheck`) and the
|
|
10
|
+
* build-once step through `lisa admit`, which starts them only when the machine
|
|
11
|
+
* has headroom for them and refuses — never silently starts — once the wait
|
|
12
|
+
* bound expires (5 minutes inside `git push`). Test suites are admitted by
|
|
13
|
+
* `lisa-test-run` itself, so test gates are not wrapped here.
|
|
14
|
+
*
|
|
15
|
+
* With the switch off nothing here changes a command, and heavy steps start
|
|
16
|
+
* immediately exactly as before.
|
|
17
|
+
*
|
|
18
|
+
* Windows is not wrapped: the admitted command is handed over as one
|
|
19
|
+
* POSIX-quoted shell string, and the gate runner's Windows route runs commands
|
|
20
|
+
* through `cmd.exe`. The gap is printed when the switch is on there.
|
|
21
|
+
* @module lib/push-admission
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
24
|
+
import { join } from "node:path";
|
|
25
|
+
|
|
26
|
+
/** Gates, by id, that are heavy enough to admit, and the workers each declares. */
|
|
27
|
+
export const ADMITTED_GATES = Object.freeze({
|
|
28
|
+
"code-style-slow": 2,
|
|
29
|
+
"type-correctness": 1,
|
|
30
|
+
"build-once": 2,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/** Value of `LISA_ADMISSION_CONTEXT` that tells admission it is inside a push. */
|
|
34
|
+
export const PUSH_CONTEXT = "push";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Read and validate `pushGate.admission` from a parsed `.lisa.config.json`.
|
|
38
|
+
*
|
|
39
|
+
* Refused rather than defaulted on a wrong type, exactly as `lisa apply`
|
|
40
|
+
* refuses it, so apply and push cannot disagree.
|
|
41
|
+
* @param {Record<string, unknown>|null|undefined} config Parsed config.
|
|
42
|
+
* @returns {boolean} Whether admission is on (default `false`).
|
|
43
|
+
* @throws {Error} When `pushGate` or `pushGate.admission` has the wrong type.
|
|
44
|
+
*/
|
|
45
|
+
export function admissionEnabled(config) {
|
|
46
|
+
const pushGate = config?.pushGate;
|
|
47
|
+
if (pushGate === undefined) return false;
|
|
48
|
+
if (
|
|
49
|
+
pushGate === null ||
|
|
50
|
+
typeof pushGate !== "object" ||
|
|
51
|
+
Array.isArray(pushGate)
|
|
52
|
+
) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`pushGate is ${JSON.stringify(pushGate)}; expected an object such as ` +
|
|
55
|
+
`{ "admission": true }.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const { admission } = pushGate;
|
|
59
|
+
if (admission === undefined) return false;
|
|
60
|
+
if (typeof admission !== "boolean") {
|
|
61
|
+
throw new Error(
|
|
62
|
+
`pushGate.admission is ${JSON.stringify(admission)}; expected true or false.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return admission;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The installed Lisa CLI, as a shell prefix.
|
|
70
|
+
*
|
|
71
|
+
* Lisa itself runs its own build (`node dist/index.js`); a host runs the
|
|
72
|
+
* package it installed (`node_modules/.bin/lisa`).
|
|
73
|
+
* @param {string} cwd Project root.
|
|
74
|
+
* @returns {string|null} The prefix, or null when no CLI is installed.
|
|
75
|
+
*/
|
|
76
|
+
export function lisaCliPrefix(cwd) {
|
|
77
|
+
try {
|
|
78
|
+
const manifest = JSON.parse(
|
|
79
|
+
readFileSync(join(cwd, "package.json"), "utf8")
|
|
80
|
+
);
|
|
81
|
+
if (
|
|
82
|
+
manifest?.name === "@codyswann/lisa" &&
|
|
83
|
+
existsSync(join(cwd, "dist", "index.js"))
|
|
84
|
+
) {
|
|
85
|
+
return "node dist/index.js";
|
|
86
|
+
}
|
|
87
|
+
} catch {
|
|
88
|
+
// No readable manifest: fall through to the installed binary.
|
|
89
|
+
}
|
|
90
|
+
const bin = join(cwd, "node_modules", ".bin", "lisa");
|
|
91
|
+
return existsSync(bin) ? "node_modules/.bin/lisa" : null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Quote one string for a POSIX shell.
|
|
96
|
+
* @param {string} text Text to quote.
|
|
97
|
+
* @returns {string} Single-quoted text.
|
|
98
|
+
*/
|
|
99
|
+
export function shellQuote(text) {
|
|
100
|
+
const escaped = text.replaceAll("'", "'\\''");
|
|
101
|
+
return `'${escaped}'`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The command a heavy gate runs under admission.
|
|
106
|
+
* @param {string} prefix Lisa CLI prefix.
|
|
107
|
+
* @param {number} workers Declared workers.
|
|
108
|
+
* @param {string} command The gate's own command.
|
|
109
|
+
* @returns {string} The admitted command.
|
|
110
|
+
*/
|
|
111
|
+
export function admittedCommand(prefix, workers, command) {
|
|
112
|
+
return `${prefix} admit --workers ${workers} -- ${shellQuote(command)}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Wrap a gate executor so heavy gates run through `lisa admit`.
|
|
117
|
+
* @param {(command: string, gate?: {id?: string}) => object} exec Executor.
|
|
118
|
+
* @param {object} options Options.
|
|
119
|
+
* @param {boolean} options.enabled Whether `pushGate.admission` is on.
|
|
120
|
+
* @param {string} [options.cwd] Project root.
|
|
121
|
+
* @param {string} [options.platform] Platform, for the Windows gap.
|
|
122
|
+
* @param {(line: string) => void} [options.out] Where notices go.
|
|
123
|
+
* @param {(cwd: string) => string|null} [options.cli] CLI resolver.
|
|
124
|
+
* @returns {(command: string, gate?: {id?: string}) => object} The executor to use.
|
|
125
|
+
*/
|
|
126
|
+
export function withAdmission(
|
|
127
|
+
exec,
|
|
128
|
+
{
|
|
129
|
+
enabled,
|
|
130
|
+
cwd = process.cwd(),
|
|
131
|
+
platform = process.platform,
|
|
132
|
+
out = line => console.log(line),
|
|
133
|
+
cli = lisaCliPrefix,
|
|
134
|
+
}
|
|
135
|
+
) {
|
|
136
|
+
if (!enabled) return exec;
|
|
137
|
+
if (platform === "win32") {
|
|
138
|
+
out(
|
|
139
|
+
"⚠️ pushGate.admission is on, but the gate runner does not admit heavy " +
|
|
140
|
+
"steps on Windows; they start immediately."
|
|
141
|
+
);
|
|
142
|
+
return exec;
|
|
143
|
+
}
|
|
144
|
+
const prefix = cli(cwd);
|
|
145
|
+
if (prefix === null) {
|
|
146
|
+
out(
|
|
147
|
+
"⚠️ pushGate.admission is on, but no Lisa CLI is installed here " +
|
|
148
|
+
"(node_modules/.bin/lisa); heavy steps start without admission."
|
|
149
|
+
);
|
|
150
|
+
return exec;
|
|
151
|
+
}
|
|
152
|
+
return (command, gate) => {
|
|
153
|
+
const workers = ADMITTED_GATES[gate?.id ?? ""];
|
|
154
|
+
return workers === undefined || !command
|
|
155
|
+
? exec(command, gate)
|
|
156
|
+
: exec(admittedCommand(prefix, workers, command), gate);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// This file is managed by Lisa and IS replaced on each `lisa` run.
|
|
2
|
+
// Do not edit directly — durable changes belong upstream in Lisa.
|
|
3
|
+
|
|
4
|
+
/** What a TypeScript project gets when it does not say. */
|
|
5
|
+
export declare const TYPESCRIPT_PUSH_GATE_DEFAULTS: Readonly<{
|
|
6
|
+
cache: true;
|
|
7
|
+
admission: true;
|
|
8
|
+
affectedTests: true;
|
|
9
|
+
affectedCoverage: "changed-files";
|
|
10
|
+
}>;
|
|
11
|
+
/** What a Rails project gets when it does not say. */
|
|
12
|
+
export declare const RAILS_PUSH_GATE_DEFAULTS: Readonly<{
|
|
13
|
+
cache: true;
|
|
14
|
+
admission: true;
|
|
15
|
+
affectedTests: true;
|
|
16
|
+
affectedCoverage: "changed-files";
|
|
17
|
+
}>;
|
|
18
|
+
export declare function isRailsProject(root: string): boolean;
|
|
19
|
+
export declare function isTypeScriptProject(root: string): boolean;
|
|
20
|
+
export declare function pushGateDefaultsFor(
|
|
21
|
+
root: string
|
|
22
|
+
): Readonly<Record<string, unknown>>;
|
|
23
|
+
export declare function withPushGateDefaults<
|
|
24
|
+
T extends Readonly<Record<string, unknown>>,
|
|
25
|
+
>(
|
|
26
|
+
config: T | null | undefined,
|
|
27
|
+
root: string
|
|
28
|
+
): T & { readonly pushGate?: unknown };
|
|
29
|
+
export declare function withDefaults<
|
|
30
|
+
T extends Readonly<Record<string, unknown>>,
|
|
31
|
+
>(
|
|
32
|
+
config: T | null | undefined,
|
|
33
|
+
defaults: Readonly<Record<string, unknown>>
|
|
34
|
+
): T & { readonly pushGate?: unknown };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// This file is managed by Lisa and IS replaced on each `lisa` run.
|
|
2
|
+
// Do not edit directly — durable changes belong upstream in Lisa.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `pushGate` defaults a project gets without writing them
|
|
6
|
+
* (CodySwannGT/lisa#4611).
|
|
7
|
+
*
|
|
8
|
+
* Lisa proved the smart push gate on itself behind explicit `pushGate`
|
|
9
|
+
* switches, all off by default. TypeScript hosts get it switched on through
|
|
10
|
+
* this file. The default depends on the project's stack and is worked out when
|
|
11
|
+
* the push runs, so `lisa apply` writes nothing into a host's
|
|
12
|
+
* `.lisa.config.json` and an existing host needs no migration. Anything the
|
|
13
|
+
* host sets explicitly wins, `false` included.
|
|
14
|
+
*
|
|
15
|
+
* TypeScript defaults:
|
|
16
|
+
*
|
|
17
|
+
* - `cache: true`: an unchanged tree re-pushes from remembered passes.
|
|
18
|
+
* - `admission: true`: heavy runs wait for machine headroom.
|
|
19
|
+
* - `affectedTests: true`: the unit run narrows to the tests a change can
|
|
20
|
+
* reach, and runs everything whenever that could be wrong.
|
|
21
|
+
* - `affectedCoverage: "changed-files"`: a narrowed run with coverage on
|
|
22
|
+
* holds every changed source file to the coverage floors on its own. That
|
|
23
|
+
* keeps coverage enforced at push. It falls back to the full measured suite
|
|
24
|
+
* when it cannot hold the files, for example when there is no
|
|
25
|
+
* `vitest.thresholds.json` or no test reaches a changed file.
|
|
26
|
+
* - `buildOnce` is NOT defaulted on. In Lisa a push built two or three times,
|
|
27
|
+
* and build-once removes the repeats. A host's push gates do not build at
|
|
28
|
+
* all, so a build-once step would add a full build to every push, a fully
|
|
29
|
+
* cached re-push included. A host whose push steps do build can still set
|
|
30
|
+
* `buildOnce: true`.
|
|
31
|
+
*
|
|
32
|
+
* Rails defaults (CodySwannGT/lisa#4612, #4613) are the same four switches:
|
|
33
|
+
* the pass cache and admission for `scripts/lisa-rails-gates.mjs`, and
|
|
34
|
+
* affected-spec selection with `changed-files` coverage for
|
|
35
|
+
* `scripts/lisa-rspec-select.mjs`. A Rails project is one with `bin/rails` or
|
|
36
|
+
* `config/application.rb`, as `src/detection/detectors/rails.ts` judges it.
|
|
37
|
+
* Rails is checked first, so a Rails app that also carries a `tsconfig.json`
|
|
38
|
+
* gets the Rails table; the two tables agree today.
|
|
39
|
+
*
|
|
40
|
+
* Other stacks get no defaults here. This file is the one place every stack's
|
|
41
|
+
* `pushGate` defaults live; the TypeScript and Rails runners, `lisa check` and
|
|
42
|
+
* `lisa-test-run`'s admission all read them through it.
|
|
43
|
+
*
|
|
44
|
+
* This file is plain `.mjs` and runs before any build, so it cannot import
|
|
45
|
+
* `src/detection/`. It mirrors `src/detection/detectors/typescript.ts`: a
|
|
46
|
+
* TypeScript project has a root `tsconfig.json`, or `typescript` in
|
|
47
|
+
* `package.json` dependencies or devDependencies. `src/core/push-gate-defaults.ts`
|
|
48
|
+
* holds the same table for the CLI, and a unit test keeps the two in step.
|
|
49
|
+
* @module push-gate-defaults
|
|
50
|
+
*/
|
|
51
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
52
|
+
import { join } from "node:path";
|
|
53
|
+
|
|
54
|
+
/** What a TypeScript project gets when it does not say. */
|
|
55
|
+
export const TYPESCRIPT_PUSH_GATE_DEFAULTS = Object.freeze({
|
|
56
|
+
cache: true,
|
|
57
|
+
admission: true,
|
|
58
|
+
affectedTests: true,
|
|
59
|
+
affectedCoverage: "changed-files",
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/** What a Rails project gets when it does not say. */
|
|
63
|
+
export const RAILS_PUSH_GATE_DEFAULTS = Object.freeze({
|
|
64
|
+
cache: true,
|
|
65
|
+
admission: true,
|
|
66
|
+
affectedTests: true,
|
|
67
|
+
affectedCoverage: "changed-files",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Whether `root` is a Rails project: `bin/rails`, else `config/application.rb`.
|
|
72
|
+
* @param {string} root Project root.
|
|
73
|
+
* @returns {boolean} True for a Rails project.
|
|
74
|
+
*/
|
|
75
|
+
export function isRailsProject(root) {
|
|
76
|
+
return (
|
|
77
|
+
existsSync(join(root, "bin", "rails")) ||
|
|
78
|
+
existsSync(join(root, "config", "application.rb"))
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Whether `root` is a TypeScript project, judged as `src/detection` judges it.
|
|
84
|
+
* @param {string} root Project root.
|
|
85
|
+
* @returns {boolean} True for a TypeScript project.
|
|
86
|
+
*/
|
|
87
|
+
export function isTypeScriptProject(root) {
|
|
88
|
+
if (existsSync(join(root, "tsconfig.json"))) return true;
|
|
89
|
+
let manifest;
|
|
90
|
+
try {
|
|
91
|
+
manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
92
|
+
} catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return (
|
|
96
|
+
manifest?.dependencies?.typescript !== undefined ||
|
|
97
|
+
manifest?.devDependencies?.typescript !== undefined
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The defaults for the project at `root`.
|
|
103
|
+
* @param {string} root Project root.
|
|
104
|
+
* @returns {Readonly<Record<string, unknown>>} Defaults (empty when none apply).
|
|
105
|
+
*/
|
|
106
|
+
export function pushGateDefaultsFor(root) {
|
|
107
|
+
if (isRailsProject(root)) return RAILS_PUSH_GATE_DEFAULTS;
|
|
108
|
+
return isTypeScriptProject(root) ? TYPESCRIPT_PUSH_GATE_DEFAULTS : {};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* A parsed `.lisa.config.json` with the stack's `pushGate` defaults filled in
|
|
113
|
+
* under the project's own keys.
|
|
114
|
+
*
|
|
115
|
+
* A malformed `pushGate` (null, an array, a string) is returned untouched, so
|
|
116
|
+
* the readers still refuse it with their own message rather than having a
|
|
117
|
+
* default hide the typo. The input is never modified.
|
|
118
|
+
* @param {Record<string, unknown>|null|undefined} config Parsed config.
|
|
119
|
+
* @param {string} root Project root.
|
|
120
|
+
* @returns {Record<string, unknown>} The config the push gate should read.
|
|
121
|
+
*/
|
|
122
|
+
export function withPushGateDefaults(config, root) {
|
|
123
|
+
return withDefaults(config, pushGateDefaultsFor(root));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* A parsed `.lisa.config.json` with the given `pushGate` defaults filled in
|
|
128
|
+
* under the project's own keys, by the same rules as
|
|
129
|
+
* {@link withPushGateDefaults}. For a caller that already knows the stack.
|
|
130
|
+
* @param {Record<string, unknown>|null|undefined} config Parsed config.
|
|
131
|
+
* @param {Readonly<Record<string, unknown>>} defaults The stack's defaults.
|
|
132
|
+
* @returns {Record<string, unknown>} The config with defaults applied.
|
|
133
|
+
*/
|
|
134
|
+
export function withDefaults(config, defaults) {
|
|
135
|
+
const base = config && typeof config === "object" ? config : {};
|
|
136
|
+
const declared = base.pushGate;
|
|
137
|
+
const malformed =
|
|
138
|
+
declared !== undefined &&
|
|
139
|
+
(declared === null ||
|
|
140
|
+
typeof declared !== "object" ||
|
|
141
|
+
Array.isArray(declared));
|
|
142
|
+
if (malformed) return base;
|
|
143
|
+
if (Object.keys(defaults).length === 0) return base;
|
|
144
|
+
// Spreading an absent block adds nothing, so no `?? {}` is needed (and the
|
|
145
|
+
// shipped fixer would strip one).
|
|
146
|
+
return { ...base, pushGate: { ...defaults, ...declared } };
|
|
147
|
+
}
|