@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
|
@@ -278,4 +278,7 @@ export function verifyDescriptorAttestation(
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
// Compatibility exports retain ordinary callers without top-level provider work.
|
|
281
|
-
export {
|
|
281
|
+
export {
|
|
282
|
+
verifyCurrentProvider,
|
|
283
|
+
verifyCurrentRun,
|
|
284
|
+
} from "./github-attestation-provider.mjs";
|
|
@@ -100,8 +100,7 @@ export function recordKillMark({ kind, gateId }, deps = {}) {
|
|
|
100
100
|
// `randomBytes`, not `Math.random`: the suffix only has to make two marks
|
|
101
101
|
// written in the same millisecond by the same pid distinct, but a shipped
|
|
102
102
|
// file reaches every downstream project and the shipped ruleset refuses a
|
|
103
|
-
// pseudorandom source on sight rather than judging each call site.
|
|
104
|
-
// what `scratch-owner` already does costs nothing here.
|
|
103
|
+
// pseudorandom source on sight rather than judging each call site.
|
|
105
104
|
const name = `${String(now)}-${String(pid)}-${randomBytes(4).toString("hex")}.json`;
|
|
106
105
|
writeFileSync(
|
|
107
106
|
join(dir, name),
|
|
@@ -48,9 +48,8 @@
|
|
|
48
48
|
* deliberately carries that text is exposed, and only to the same user's
|
|
49
49
|
* sweep; Linux reads whole environ entries and has no such ambiguity.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* reading mirrors `scratch-owner.ts` rather than importing it.
|
|
51
|
+
* Self-contained: the per-test scratch policing this sweep replaced was
|
|
52
|
+
* retired (CodySwannGT/lisa#4602), so nothing here depends on it.
|
|
54
53
|
* @module scripts/lib/lisa-cleanup-sweep-processes
|
|
55
54
|
*/
|
|
56
55
|
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
@@ -73,7 +72,7 @@ const PS_TIMEOUT_MS = 5_000;
|
|
|
73
72
|
/** `ps -E` prints every environment; leave room for a busy desktop. */
|
|
74
73
|
const PS_MAX_BUFFER = 64 * 1024 * 1024;
|
|
75
74
|
|
|
76
|
-
/** Pids per `ps -p` call,
|
|
75
|
+
/** Pids per `ps -p` call, so one argument list stays well under `ARG_MAX`. */
|
|
77
76
|
const PS_BATCH = 256;
|
|
78
77
|
|
|
79
78
|
/** Locale-independent `ps` output, so `lstart` parses the same everywhere. */
|
|
@@ -16,11 +16,7 @@ import { sha256 } from "./github-attestation-verifier.mjs";
|
|
|
16
16
|
import { registryVersion } from "./npm-update-npm.mjs";
|
|
17
17
|
import { discoverSupersession } from "./npm-update-supersession.mjs";
|
|
18
18
|
import { canonicalJson } from "../lisa-automation-provenance.mjs";
|
|
19
|
-
import {
|
|
20
|
-
trackerOf,
|
|
21
|
-
trackerFor,
|
|
22
|
-
refuseUnlessGithub,
|
|
23
|
-
} from "./npm-update-tracker.mjs";
|
|
19
|
+
import { trackerOf, trackerFor } from "./npm-update-tracker.mjs";
|
|
24
20
|
import {
|
|
25
21
|
buildDraft,
|
|
26
22
|
qualityGates,
|
|
@@ -96,7 +92,6 @@ export async function discoverPrior(api, proposal, context) {
|
|
|
96
92
|
);
|
|
97
93
|
if (!found.total_count) return { status: "new" };
|
|
98
94
|
if (context && (found.total_count > 1 || found.items[0].state === "closed")) {
|
|
99
|
-
refuseUnlessGithub(context.config, "supersession");
|
|
100
95
|
return discoverSupersession(api, proposal, found.items, context);
|
|
101
96
|
}
|
|
102
97
|
const issue = await tracker.issue(found.items[0].number);
|
|
@@ -15,11 +15,12 @@ export { destinationSnapshot } from "./npm-update-publication.mjs";
|
|
|
15
15
|
import { persistCheckpoint, recoveryRecord } from "./npm-update-recovery.mjs";
|
|
16
16
|
export { recoveryRecord } from "./npm-update-recovery.mjs";
|
|
17
17
|
import { verifyCurrentProvider } from "./github-attestation-verifier.mjs";
|
|
18
|
-
import { verifyHistoricalProvider } from "./github-attestation-provider.mjs";
|
|
19
18
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
verifyHistoricalProvider,
|
|
20
|
+
verifyHistoricalRun,
|
|
21
|
+
verifyCurrentRun,
|
|
22
|
+
} from "./github-attestation-provider.mjs";
|
|
23
|
+
import { verifySignedWorkItem } from "./npm-update-tracker.mjs";
|
|
23
24
|
import {
|
|
24
25
|
verifyHistoricalDescriptor,
|
|
25
26
|
predictedCommit,
|
|
@@ -46,7 +47,8 @@ async function restoredOrigin(
|
|
|
46
47
|
proposal,
|
|
47
48
|
allocation,
|
|
48
49
|
policy,
|
|
49
|
-
config
|
|
50
|
+
config,
|
|
51
|
+
api
|
|
50
52
|
) {
|
|
51
53
|
const origin = allocation.origin;
|
|
52
54
|
const preview = origin.payload.preview;
|
|
@@ -78,10 +80,16 @@ async function restoredOrigin(
|
|
|
78
80
|
mode: 0o600,
|
|
79
81
|
flag: "wx",
|
|
80
82
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
// A Jira/Linear claim and its time are proved by the adapter (#4873).
|
|
84
|
+
const historical = api.tracker
|
|
85
|
+
? {
|
|
86
|
+
run: verifyHistoricalRun(
|
|
87
|
+
config.automationProvenance,
|
|
88
|
+
preview.descriptor
|
|
89
|
+
),
|
|
90
|
+
claim: await api.tracker.proveClaim(preview.descriptor),
|
|
91
|
+
}
|
|
92
|
+
: verifyHistoricalProvider(config.automationProvenance, preview.descriptor);
|
|
85
93
|
verifyHistoricalDescriptor(
|
|
86
94
|
config.automationProvenance,
|
|
87
95
|
preview.descriptor,
|
|
@@ -111,14 +119,19 @@ async function recoveryPreview({
|
|
|
111
119
|
proposal,
|
|
112
120
|
allocation,
|
|
113
121
|
policy,
|
|
114
|
-
config
|
|
122
|
+
config,
|
|
123
|
+
api
|
|
115
124
|
);
|
|
116
125
|
if (!allocation.origin.complete) {
|
|
117
|
-
|
|
126
|
+
const current = {
|
|
118
127
|
...preview.descriptor,
|
|
119
128
|
runId: process.env.GITHUB_RUN_ID,
|
|
120
129
|
runAttempt: process.env.GITHUB_RUN_ATTEMPT,
|
|
121
|
-
}
|
|
130
|
+
};
|
|
131
|
+
if (api.tracker) {
|
|
132
|
+
verifyCurrentRun(api.policy, current);
|
|
133
|
+
await api.tracker.proveClaim(preview.descriptor);
|
|
134
|
+
} else verifyCurrentProvider(api.policy, current);
|
|
122
135
|
await persistCheckpoint(
|
|
123
136
|
api,
|
|
124
137
|
original.number,
|
|
@@ -201,8 +214,6 @@ export async function prepareAuthorization({
|
|
|
201
214
|
let proposal = suppliedProposal;
|
|
202
215
|
if (allocation.status === "stale-outstanding")
|
|
203
216
|
return { mode: allocation.status, allocation };
|
|
204
|
-
// Resuming a signed origin re-verifies the claim's GitHub chronology (#4873).
|
|
205
|
-
if (allocation.origin) refuseUnlessGithub(config, "signed-origin recovery");
|
|
206
217
|
const restored =
|
|
207
218
|
allocation.origin?.payload.proposal ??
|
|
208
219
|
allocation.originalProposal ??
|
|
@@ -26,7 +26,11 @@ import {
|
|
|
26
26
|
qualityGates,
|
|
27
27
|
} from "./npm-update-leaf.mjs";
|
|
28
28
|
import { sha256 } from "./github-attestation-verifier.mjs";
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
verifyStaleOriginProvider,
|
|
31
|
+
verifyStaleOriginRun,
|
|
32
|
+
} from "./github-attestation-provider.mjs";
|
|
33
|
+
import { managedActor, allocationWorkItem } from "./npm-update-tracker.mjs";
|
|
30
34
|
import {
|
|
31
35
|
observedRunChronology,
|
|
32
36
|
verifyHistoricalDescriptor,
|
|
@@ -107,7 +111,9 @@ export function assertOriginTransport(
|
|
|
107
111
|
digest,
|
|
108
112
|
policy,
|
|
109
113
|
run,
|
|
110
|
-
now = Date.now()
|
|
114
|
+
now = Date.now(),
|
|
115
|
+
managed = user =>
|
|
116
|
+
user?.type === "Bot" && String(user.id) === policy.claimActorId
|
|
111
117
|
) {
|
|
112
118
|
const chronology = observedRunChronology(run, now);
|
|
113
119
|
required(chronology, "invalid original transport chronology");
|
|
@@ -121,8 +127,8 @@ export function assertOriginTransport(
|
|
|
121
127
|
for (const comment of selected) {
|
|
122
128
|
const posted = Date.parse(comment.created_at);
|
|
123
129
|
required(
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
// GitHub: the configured Bot. Jira/Linear: the declared automation account (#4873).
|
|
131
|
+
managed(comment.user) &&
|
|
126
132
|
comment.updated_at === comment.created_at &&
|
|
127
133
|
Number.isFinite(posted) &&
|
|
128
134
|
posted >= start - 60_000 &&
|
|
@@ -152,7 +158,13 @@ async function inspectOrigin(api, issue, payload, oldConfig, current) {
|
|
|
152
158
|
canonicalJson(allocation.evidence) === canonicalJson(evidence) &&
|
|
153
159
|
canonicalJson(allocation.draft) === canonicalJson(draft) &&
|
|
154
160
|
allocation.number === issue.number &&
|
|
155
|
-
allocation.workItem ===
|
|
161
|
+
allocation.workItem ===
|
|
162
|
+
allocationWorkItem(
|
|
163
|
+
api,
|
|
164
|
+
current.config,
|
|
165
|
+
policy.repository,
|
|
166
|
+
issue.number
|
|
167
|
+
),
|
|
156
168
|
"original allocation differs"
|
|
157
169
|
);
|
|
158
170
|
// The current qualified classifier checks present holds; historical config only supplies the original draft.
|
|
@@ -165,8 +177,7 @@ async function inspectOrigin(api, issue, payload, oldConfig, current) {
|
|
|
165
177
|
state.claims.length === 1 &&
|
|
166
178
|
String(state.claims[0].id) === allocation.claimCommentId &&
|
|
167
179
|
sha256(state.claims[0].body) === allocation.claimSha256 &&
|
|
168
|
-
|
|
169
|
-
state.claims[0].user?.type === "Bot",
|
|
180
|
+
(await managedActor(api))(state.claims[0].user),
|
|
170
181
|
"original managed claim changed"
|
|
171
182
|
);
|
|
172
183
|
qualityGates(
|
|
@@ -207,7 +218,15 @@ export function originalDescriptor(checkpoint, old, allocation, authority) {
|
|
|
207
218
|
}
|
|
208
219
|
|
|
209
220
|
/** The original fixed signing purpose and native transport chronology remain mandatory. */
|
|
210
|
-
async function verifyOriginalSubject(
|
|
221
|
+
async function verifyOriginalSubject(
|
|
222
|
+
api,
|
|
223
|
+
checkpoint,
|
|
224
|
+
authority,
|
|
225
|
+
d,
|
|
226
|
+
issue,
|
|
227
|
+
parent
|
|
228
|
+
) {
|
|
229
|
+
const managed = await managedActor(api);
|
|
211
230
|
await withPrivateRoot(async root => {
|
|
212
231
|
const paths = {
|
|
213
232
|
descriptor: join(root, "descriptor.json"),
|
|
@@ -222,12 +241,20 @@ async function verifyOriginalSubject(checkpoint, authority, d, issue, parent) {
|
|
|
222
241
|
mode: 0o600,
|
|
223
242
|
flag: "wx",
|
|
224
243
|
});
|
|
225
|
-
|
|
244
|
+
// A Jira/Linear claim is re-proved by its adapter; GitHub keeps its comment read.
|
|
245
|
+
const observed = api.tracker
|
|
246
|
+
? {
|
|
247
|
+
run: verifyStaleOriginRun(authority, d, parent),
|
|
248
|
+
claim: await api.tracker.proveClaim(d),
|
|
249
|
+
}
|
|
250
|
+
: verifyStaleOriginProvider(authority, d, parent);
|
|
226
251
|
assertOriginTransport(
|
|
227
252
|
issue.comments,
|
|
228
253
|
checkpoint.digest,
|
|
229
254
|
authority,
|
|
230
|
-
observed.run
|
|
255
|
+
observed.run,
|
|
256
|
+
Date.now(),
|
|
257
|
+
managed
|
|
231
258
|
);
|
|
232
259
|
verifyHistoricalDescriptor(
|
|
233
260
|
authority,
|
|
@@ -304,6 +331,13 @@ export async function authenticateStaleOrigin({
|
|
|
304
331
|
inspected.allocation,
|
|
305
332
|
authority
|
|
306
333
|
);
|
|
307
|
-
await verifyOriginalSubject(
|
|
334
|
+
await verifyOriginalSubject(
|
|
335
|
+
api,
|
|
336
|
+
checkpoint,
|
|
337
|
+
authority,
|
|
338
|
+
d,
|
|
339
|
+
issue,
|
|
340
|
+
proposal.parent
|
|
341
|
+
);
|
|
308
342
|
return { ...inspected, checkpoint, oldConfig, descriptor: d };
|
|
309
343
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
targetField,
|
|
17
17
|
} from "./automation-provenance-contract.mjs";
|
|
18
18
|
import { observedRunChronology } from "./github-attestation-recovery.mjs";
|
|
19
|
+
import { cancelOperatorOf } from "./npm-update-policy.mjs";
|
|
19
20
|
import {
|
|
20
21
|
verifiedRole,
|
|
21
22
|
matchSigningTime,
|
|
@@ -115,6 +116,13 @@ export function assertManualCancellation(
|
|
|
115
116
|
return String(actor.id);
|
|
116
117
|
}
|
|
117
118
|
|
|
119
|
+
/** A Jira/Linear record names its work item by key (#4873); a GitHub one by repository#number. */
|
|
120
|
+
const VENDOR_ITEM = /^[A-Z][A-Z0-9]{1,9}-[1-9]\d*$/;
|
|
121
|
+
const VENDOR_ID = /^[A-Za-z0-9-]{1,64}$/;
|
|
122
|
+
function vendorRecord(value) {
|
|
123
|
+
return VENDOR_ITEM.test(value.workItem);
|
|
124
|
+
}
|
|
125
|
+
|
|
118
126
|
/** The closed subject preserves one stale origin and one exact replacement, with no published destination. */
|
|
119
127
|
export function validateCancellation(value, expected) {
|
|
120
128
|
// Only a non-main target is recorded; the final canonical comparison binds it.
|
|
@@ -136,19 +144,21 @@ export function validateCancellation(value, expected) {
|
|
|
136
144
|
value.oldParent !== value.parent &&
|
|
137
145
|
value.oldProposalKey !== value.proposalKey &&
|
|
138
146
|
typeof value.workItem === "string" &&
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
(vendorRecord(value) ||
|
|
148
|
+
(value.workItem.startsWith(`${value.repository}#`) &&
|
|
149
|
+
DECIMAL.test(value.workItem.slice(value.repository.length + 1)))),
|
|
141
150
|
"invalid stale cancellation scope"
|
|
142
151
|
);
|
|
152
|
+
// A Jira/Linear claim id is an opaque tracker comment id; the adapter proves the comment (#4873).
|
|
153
|
+
required(
|
|
154
|
+
typeof value.claimCommentId === "string" &&
|
|
155
|
+
(vendorRecord(value)
|
|
156
|
+
? VENDOR_ID.test(value.claimCommentId)
|
|
157
|
+
: DECIMAL.test(value.claimCommentId)),
|
|
158
|
+
"invalid stale cancellation claim"
|
|
159
|
+
);
|
|
143
160
|
required(
|
|
144
|
-
[
|
|
145
|
-
"repositoryId",
|
|
146
|
-
"ownerId",
|
|
147
|
-
"claimCommentId",
|
|
148
|
-
"operatorId",
|
|
149
|
-
"runId",
|
|
150
|
-
"runAttempt",
|
|
151
|
-
].every(
|
|
161
|
+
["repositoryId", "ownerId", "operatorId", "runId", "runAttempt"].every(
|
|
152
162
|
key => typeof value[key] === "string" && DECIMAL.test(value[key])
|
|
153
163
|
) &&
|
|
154
164
|
[
|
|
@@ -237,7 +247,8 @@ export function cancellationRecord(
|
|
|
237
247
|
leafBodySha256: sha256(origin.allocation.draft.body),
|
|
238
248
|
policySha256: sha256(canonicalJson(authority)),
|
|
239
249
|
npmPolicySha256: proposal.policySha256,
|
|
240
|
-
|
|
250
|
+
// The GitHub login that authorized the cancel; on Jira/Linear the declared cancelOperator.
|
|
251
|
+
maintainer: cancelOperatorOf(config, proposalPolicy(config, proposal)),
|
|
241
252
|
operatorId,
|
|
242
253
|
runId: invocation.runId,
|
|
243
254
|
runAttempt: invocation.runAttempt,
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
policyTarget,
|
|
13
13
|
} from "./npm-update-contract.mjs";
|
|
14
14
|
import { proposalPolicy } from "./automation-provenance-contract.mjs";
|
|
15
|
+
import { cancelOperatorOf } from "./npm-update-policy.mjs";
|
|
16
|
+
import { trackerOf, assertManagedClosure } from "./npm-update-tracker.mjs";
|
|
15
17
|
import { readBytes, readJson, writeJson } from "./npm-update-process.mjs";
|
|
16
18
|
import { assertHostedGate } from "./npm-update-hosted-gate.mjs";
|
|
17
19
|
import { sha256 } from "./github-attestation-verifier.mjs";
|
|
@@ -75,14 +77,16 @@ async function manualAuthority(api, proposal, config, request) {
|
|
|
75
77
|
const run = await api.request(
|
|
76
78
|
`repos/${proposal.repository}/actions/runs/${invocation.runId}/attempts/${invocation.runAttempt}`
|
|
77
79
|
);
|
|
80
|
+
// GitHub: the maintainer's login. Jira/Linear: the declared GitHub cancelOperator (#4873).
|
|
81
|
+
const operator = cancelOperatorOf(config, policy);
|
|
78
82
|
const permission = await api.request(
|
|
79
|
-
`repos/${proposal.repository}/collaborators/${
|
|
83
|
+
`repos/${proposal.repository}/collaborators/${operator}/permission`
|
|
80
84
|
);
|
|
81
85
|
const operatorId = assertManualCancellation(
|
|
82
86
|
run,
|
|
83
87
|
permission,
|
|
84
88
|
api.policy,
|
|
85
|
-
|
|
89
|
+
operator,
|
|
86
90
|
proposal,
|
|
87
91
|
request,
|
|
88
92
|
invocation
|
|
@@ -109,7 +113,7 @@ async function cancellationState(context) {
|
|
|
109
113
|
manualAuthority(api, proposal, config, request)
|
|
110
114
|
);
|
|
111
115
|
const prior = await discoverPrior(api, proposal, { cwd, config });
|
|
112
|
-
const issue = await api.issue(request.number);
|
|
116
|
+
const issue = await trackerOf(api).issue(request.number);
|
|
113
117
|
const origin = await withStage("cancel-origin", () =>
|
|
114
118
|
authenticateStaleOrigin({ api, cwd, issue, proposal, config })
|
|
115
119
|
);
|
|
@@ -228,8 +232,14 @@ export async function finalizeCancellation(context) {
|
|
|
228
232
|
};
|
|
229
233
|
if (!current.recorded)
|
|
230
234
|
await withStage("cancel-checkpoint", () =>
|
|
231
|
-
persistCheckpoint(
|
|
232
|
-
|
|
235
|
+
persistCheckpoint(
|
|
236
|
+
api,
|
|
237
|
+
request.number,
|
|
238
|
+
payload,
|
|
239
|
+
digest,
|
|
240
|
+
() => authorizeCancellation(context, record, paths, state),
|
|
241
|
+
// Only a Jira/Linear host routes the checkpoint through its adapter.
|
|
242
|
+
api.tracker ? context.config : undefined
|
|
233
243
|
)
|
|
234
244
|
);
|
|
235
245
|
const issue = (await authorizeCancellation(context, record, paths, state))
|
|
@@ -241,20 +251,22 @@ export async function finalizeCancellation(context) {
|
|
|
241
251
|
);
|
|
242
252
|
if (issue.state === "open")
|
|
243
253
|
await withStage("cancel-close", () =>
|
|
244
|
-
api.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
254
|
+
api.tracker
|
|
255
|
+
? api.tracker.cancel(request.number)
|
|
256
|
+
: api.request(
|
|
257
|
+
`repos/${proposal.repository}/issues/${request.number}`,
|
|
258
|
+
"PATCH",
|
|
259
|
+
{ state: "closed", state_reason: "not_planned" }
|
|
260
|
+
)
|
|
249
261
|
);
|
|
250
|
-
const closed = await api.issue(request.number);
|
|
262
|
+
const closed = await trackerOf(api).issue(request.number);
|
|
251
263
|
required(
|
|
252
|
-
closed.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
264
|
+
closed.body === issue.body && closed.title === issue.title,
|
|
265
|
+
"cancellation closure readback differs"
|
|
266
|
+
);
|
|
267
|
+
await assertManagedClosure(
|
|
268
|
+
api,
|
|
269
|
+
closed,
|
|
258
270
|
"cancellation closure readback differs"
|
|
259
271
|
);
|
|
260
272
|
await api.main(proposal.parent, proposal.target);
|
|
@@ -37,7 +37,7 @@ function recipesFor(authority) {
|
|
|
37
37
|
"broker controller Node identity differs"
|
|
38
38
|
);
|
|
39
39
|
required(
|
|
40
|
-
graph && Object.keys(graph).length > 0 && Object.keys(graph).length <=
|
|
40
|
+
graph && Object.keys(graph).length > 0 && Object.keys(graph).length <= 256,
|
|
41
41
|
"broker graph is absent or unbounded"
|
|
42
42
|
);
|
|
43
43
|
required(
|
|
@@ -33,11 +33,21 @@ export function controllerSubject(context, phase, pr, proofs = []) {
|
|
|
33
33
|
const { config, policy, proposal, allocation } = context;
|
|
34
34
|
const descriptor = context.descriptor ?? context.preview?.descriptor;
|
|
35
35
|
leafRoles(config, policy.repository, policyTarget(policy));
|
|
36
|
+
const vendor = config.tracker === "jira" || config.tracker === "linear";
|
|
37
|
+
const prefix = vendor
|
|
38
|
+
? `${String(
|
|
39
|
+
config.tracker === "jira"
|
|
40
|
+
? config.jira?.project
|
|
41
|
+
: config.linear?.teamKey
|
|
42
|
+
)
|
|
43
|
+
.trim()
|
|
44
|
+
.toUpperCase()}-`
|
|
45
|
+
: `${policy.repository}#`;
|
|
36
46
|
required(
|
|
37
47
|
proposal.repository === policy.repository &&
|
|
38
48
|
Number.isSafeInteger(allocation.number) &&
|
|
39
49
|
allocation.number > 0 &&
|
|
40
|
-
allocation.workItem === `${
|
|
50
|
+
allocation.workItem === `${prefix}${allocation.number}` &&
|
|
41
51
|
descriptor?.parent === proposal.parent &&
|
|
42
52
|
descriptor.workItem === allocation.workItem &&
|
|
43
53
|
descriptor.claimCommentId === allocation.claimCommentId,
|
|
@@ -72,6 +82,8 @@ export function controllerSubject(context, phase, pr, proofs = []) {
|
|
|
72
82
|
pr: pr === null ? null : { number: String(pr.number), url: pr.html_url },
|
|
73
83
|
proofs,
|
|
74
84
|
...targetField(proposal),
|
|
85
|
+
// Only a Jira/Linear subject names its key, so a GitHub subject keeps its exact shape (#4873).
|
|
86
|
+
...(vendor ? { workItem: allocation.workItem } : {}),
|
|
75
87
|
};
|
|
76
88
|
createGhRequests(subject);
|
|
77
89
|
return subject;
|
|
@@ -211,6 +223,12 @@ function canonicalRecipe(context, authority) {
|
|
|
211
223
|
GH_HOST: "github.com",
|
|
212
224
|
GITHUB_REPOSITORY: context.policy.repository,
|
|
213
225
|
GIT_TERMINAL_PROMPT: "0",
|
|
226
|
+
// A Jira/Linear item is bound offline: this broker holds no tracker
|
|
227
|
+
// credential by design, and the claim is proved by the adapter at
|
|
228
|
+
// checkpoint and again before publication (#4873).
|
|
229
|
+
...(["jira", "linear"].includes(context.config.tracker)
|
|
230
|
+
? { LISA_WORK_ITEM_VERIFY: "trailer" }
|
|
231
|
+
: {}),
|
|
214
232
|
},
|
|
215
233
|
};
|
|
216
234
|
}
|
|
@@ -100,7 +100,8 @@ export function controllerGraph(graph, routes = []) {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
required(
|
|
103
|
-
|
|
103
|
+
// 256, like the helper graph: at 128 the managed inventory sat at the cap.
|
|
104
|
+
Object.keys(expected).length <= 256,
|
|
104
105
|
"configured helper/configuration closure exceeds bound"
|
|
105
106
|
);
|
|
106
107
|
return expected;
|
|
@@ -293,6 +293,11 @@ export async function gateProposal(context) {
|
|
|
293
293
|
GIT_COMMITTER_EMAIL: MAIL,
|
|
294
294
|
GIT_AUTHOR_DATE: `${preview.epoch} +0000`,
|
|
295
295
|
GIT_COMMITTER_DATE: `${preview.epoch} +0000`,
|
|
296
|
+
// The gate holds no Jira/Linear credential (dependency code runs here),
|
|
297
|
+
// so the hooks bind that key offline; the adapter proves the claim (#4873).
|
|
298
|
+
...(["jira", "linear"].includes(context.config?.tracker)
|
|
299
|
+
? { LISA_WORK_ITEM_VERIFY: "trailer" }
|
|
300
|
+
: {}),
|
|
296
301
|
};
|
|
297
302
|
const branch = await withStage("gate-stage", () =>
|
|
298
303
|
stageProposal(scoped, env)
|
|
@@ -29,6 +29,10 @@ const PHASES = [
|
|
|
29
29
|
const ID = /^[1-9]\d*$/;
|
|
30
30
|
const REPO = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}\/[A-Za-z0-9_.-]{1,100}$/;
|
|
31
31
|
const decimal = value => typeof value === "string" && ID.test(value);
|
|
32
|
+
/** A Jira/Linear subject (#4873): its key, an opaque claim id and a vendor maintainer id. */
|
|
33
|
+
const VENDOR_ITEM = /^[A-Z][A-Z0-9]{1,9}-[1-9]\d*$/;
|
|
34
|
+
const VENDOR_ID = /^[A-Za-z0-9][A-Za-z0-9:-]{0,127}$/;
|
|
35
|
+
const vendorOf = subject => Object.hasOwn(subject ?? {}, "workItem");
|
|
32
36
|
const key = args => canonicalJson(args);
|
|
33
37
|
const api = endpoint => ["api", "--hostname", "github.com", endpoint];
|
|
34
38
|
import { recoveryPage } from "./npm-update-gh-grants.mjs";
|
|
@@ -50,7 +54,10 @@ function checkedSubject(subject) {
|
|
|
50
54
|
"proofs",
|
|
51
55
|
// Only a non-main target is named, so a main subject keeps its exact shape.
|
|
52
56
|
...optionalTargetFields(subject ?? {}),
|
|
57
|
+
// Only a Jira/Linear subject names its work item, so a GitHub subject keeps its exact shape.
|
|
58
|
+
...(vendorOf(subject) ? ["workItem"] : []),
|
|
53
59
|
]);
|
|
60
|
+
const vendor = vendorOf(subject);
|
|
54
61
|
required(
|
|
55
62
|
PHASES.includes(subject.phase) &&
|
|
56
63
|
REPO.test(subject.repository) &&
|
|
@@ -59,7 +66,13 @@ function checkedSubject(subject) {
|
|
|
59
66
|
[".", ".."].includes(value.split("/")[1])
|
|
60
67
|
) &&
|
|
61
68
|
decimal(subject.issue) &&
|
|
62
|
-
|
|
69
|
+
(vendor
|
|
70
|
+
? VENDOR_ITEM.test(subject.workItem) &&
|
|
71
|
+
subject.workItem.endsWith(`-${subject.issue}`) &&
|
|
72
|
+
typeof subject.claim === "string" &&
|
|
73
|
+
VENDOR_ID.test(subject.claim) &&
|
|
74
|
+
subject.tracker === subject.repository
|
|
75
|
+
: decimal(subject.claim)) &&
|
|
63
76
|
/^lisa\/npm-[a-f0-9]{64}$/.test(subject.branch) &&
|
|
64
77
|
/^[a-f0-9]{40}$/.test(subject.parent),
|
|
65
78
|
"invalid closed GH subject"
|
|
@@ -78,7 +91,9 @@ function checkedSubject(subject) {
|
|
|
78
91
|
"invalid GH PR identity"
|
|
79
92
|
);
|
|
80
93
|
required(
|
|
81
|
-
/^[A-Za-z0-9][A-Za-z0-9-]{0,38}
|
|
94
|
+
(vendor ? VENDOR_ID : /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/).test(
|
|
95
|
+
subject.maintainer
|
|
96
|
+
) &&
|
|
82
97
|
Array.isArray(subject.proofs) &&
|
|
83
98
|
subject.proofs.length <= 2 &&
|
|
84
99
|
(subject.phase !== STAGE_PHASE || subject.proofs.length === 0),
|
|
@@ -97,21 +112,23 @@ function checkedSubject(subject) {
|
|
|
97
112
|
|
|
98
113
|
/** Read families use the same literal constructors as the canonical shipped callers. */
|
|
99
114
|
function ordinaryRequests(subject) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
// A Jira/Linear item is never read through GitHub: only the code-host reads remain.
|
|
116
|
+
const records = [{ kind: "plain", args: ["--version"] }];
|
|
117
|
+
if (!vendorOf(subject))
|
|
118
|
+
records.push(
|
|
119
|
+
{
|
|
120
|
+
kind: "plain",
|
|
121
|
+
args: githubIssueViewArgs(subject.tracker, subject.issue),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
kind: "hierarchy",
|
|
125
|
+
args: githubHierarchyArgs(
|
|
126
|
+
{ repository: subject.tracker },
|
|
127
|
+
subject.issue,
|
|
128
|
+
null
|
|
129
|
+
),
|
|
130
|
+
}
|
|
131
|
+
);
|
|
115
132
|
if (subject.phase !== STAGE_PHASE)
|
|
116
133
|
records.push({
|
|
117
134
|
kind: "plain",
|
|
@@ -121,7 +138,7 @@ function ordinaryRequests(subject) {
|
|
|
121
138
|
subject.repository
|
|
122
139
|
),
|
|
123
140
|
});
|
|
124
|
-
if (subject.phase === BACKLINK_PHASE)
|
|
141
|
+
if (subject.phase === BACKLINK_PHASE && !vendorOf(subject))
|
|
125
142
|
records.push({
|
|
126
143
|
kind: "comments",
|
|
127
144
|
args: githubBacklinkListArgs(subject.tracker, subject.issue),
|
|
@@ -137,12 +154,18 @@ function proofRequests(subject) {
|
|
|
137
154
|
`repos/${repository}`,
|
|
138
155
|
`repos/${repository}/git/ref/heads/${targetBranch(subject)}`,
|
|
139
156
|
`repos/${repository}/actions/runs/${subject.origin.runId}/attempts/${subject.origin.runAttempt}`,
|
|
140
|
-
|
|
157
|
+
// A Jira/Linear claim is proved by its adapter outside the hooks (#4873).
|
|
158
|
+
...(vendorOf(subject)
|
|
159
|
+
? []
|
|
160
|
+
: [`repos/${subject.tracker}/issues/comments/${subject.claim}`]),
|
|
141
161
|
];
|
|
162
|
+
// A Jira/Linear recovery reads no GitHub leaf or assignee: the adapter proves those (#4873).
|
|
142
163
|
if (subject.recovery)
|
|
143
164
|
endpoints.push(
|
|
144
165
|
`repos/${repository}/actions/runs/${subject.recovery.runId}/attempts/${subject.recovery.runAttempt}`,
|
|
145
|
-
|
|
166
|
+
...(vendorOf(subject)
|
|
167
|
+
? []
|
|
168
|
+
: [`repos/${repository}/issues/${subject.issue}`]),
|
|
146
169
|
`repos/${repository}/git/matching-refs/heads/${subject.branch}`
|
|
147
170
|
);
|
|
148
171
|
const records = endpoints.map(endpoint => ({
|
|
@@ -152,16 +175,20 @@ function proofRequests(subject) {
|
|
|
152
175
|
if (subject.recovery)
|
|
153
176
|
records.push(
|
|
154
177
|
{ kind: "recovery-page", page: 1, args: recoveryPage(subject, 1) },
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
178
|
+
...(vendorOf(subject)
|
|
179
|
+
? []
|
|
180
|
+
: [
|
|
181
|
+
{
|
|
182
|
+
kind: "plain",
|
|
183
|
+
args: [
|
|
184
|
+
"api",
|
|
185
|
+
"--hostname",
|
|
186
|
+
"github.com",
|
|
187
|
+
"--include",
|
|
188
|
+
`repos/${repository}/assignees/${subject.maintainer}`,
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
])
|
|
165
192
|
);
|
|
166
193
|
for (const proof of subject.proofs)
|
|
167
194
|
records.push(proofRequest(subject, proof));
|