@codyswann/lisa 7.1.5 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/copy-overwrite/scripts/check-npm-publish-landed.mjs +0 -2
- package/all/copy-overwrite/scripts/lib/push-timing.mjs +3 -6
- package/all/copy-overwrite/scripts/lisa-enforcement-fallback.sh +31 -32
- package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +201 -20
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +3 -2
- package/dist/cli/admit-cmd.d.ts.map +1 -1
- package/dist/cli/admit-cmd.js +16 -10
- package/dist/cli/admit-cmd.js.map +1 -1
- package/dist/cli/apply.d.ts.map +1 -1
- package/dist/cli/apply.js +2 -2
- package/dist/cli/apply.js.map +1 -1
- package/dist/cli/check-cmd.d.ts.map +1 -1
- package/dist/cli/check-cmd.js +8 -4
- package/dist/cli/check-cmd.js.map +1 -1
- package/dist/cli/doctor-coderabbit.js +2 -2
- package/dist/cli/doctor-coderabbit.js.map +1 -1
- package/dist/cli/doctor-readiness-supply-chain-python.d.ts +5 -1
- package/dist/cli/doctor-readiness-supply-chain-python.d.ts.map +1 -1
- package/dist/cli/doctor-readiness-supply-chain-python.js +44 -10
- package/dist/cli/doctor-readiness-supply-chain-python.js.map +1 -1
- package/dist/cli/doctor-readiness.js +2 -2
- package/dist/cli/doctor-readiness.js.map +1 -1
- package/dist/cli/doctor-worker-journey.js +2 -2
- package/dist/cli/doctor-worker-journey.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/file-upstream-cmd.d.ts.map +1 -1
- package/dist/cli/file-upstream-cmd.js +20 -25
- package/dist/cli/file-upstream-cmd.js.map +1 -1
- package/dist/cli/gh-cli.d.ts +2 -2
- package/dist/cli/gh-cli.d.ts.map +1 -1
- package/dist/cli/gh-cli.js +13 -6
- package/dist/cli/gh-cli.js.map +1 -1
- package/dist/cli/health-cmd.d.ts.map +1 -1
- package/dist/cli/health-cmd.js +7 -19
- package/dist/cli/health-cmd.js.map +1 -1
- package/dist/cli/lisa-test-run-jest-merge.js +5 -5
- package/dist/cli/lisa-test-run-jest-merge.js.map +1 -1
- package/dist/cli/lisa-test-run.js +8 -4
- package/dist/cli/lisa-test-run.js.map +1 -1
- package/dist/cli/pr-landing.js +2 -2
- package/dist/cli/pr-landing.js.map +1 -1
- package/dist/cli/update-check.d.ts.map +1 -1
- package/dist/cli/update-check.js +7 -4
- package/dist/cli/update-check.js.map +1 -1
- package/dist/cli/update-cmd.d.ts.map +1 -1
- package/dist/cli/update-cmd.js +7 -4
- package/dist/cli/update-cmd.js.map +1 -1
- package/dist/cli/worktree-ownership.d.ts.map +1 -1
- package/dist/cli/worktree-ownership.js +3 -3
- package/dist/cli/worktree-ownership.js.map +1 -1
- package/dist/codex/hooks-catalog.d.ts +151 -0
- package/dist/codex/hooks-catalog.d.ts.map +1 -0
- package/dist/codex/hooks-catalog.js +315 -0
- package/dist/codex/hooks-catalog.js.map +1 -0
- package/dist/codex/hooks-compatibility.d.ts +14 -0
- package/dist/codex/hooks-compatibility.d.ts.map +1 -0
- package/dist/codex/hooks-compatibility.js +196 -0
- package/dist/codex/hooks-compatibility.js.map +1 -0
- package/dist/codex/hooks-installer.d.ts +2 -49
- package/dist/codex/hooks-installer.d.ts.map +1 -1
- package/dist/codex/hooks-installer.js +5 -546
- package/dist/codex/hooks-installer.js.map +1 -1
- package/dist/codex/hooks-source-links.d.ts +11 -0
- package/dist/codex/hooks-source-links.d.ts.map +1 -0
- package/dist/codex/hooks-source-links.js +74 -0
- package/dist/codex/hooks-source-links.js.map +1 -0
- package/dist/codex/scripts/block-migration-edits.sh +2 -2
- package/dist/codex/scripts/block-suppress-directives.sh +3 -3
- package/dist/codex/scripts/format-on-edit.sh +2 -2
- package/dist/codex/scripts/lint-on-edit.sh +2 -2
- package/dist/codex/scripts/lisa-edit-gate.sh +19 -15
- package/dist/codex/scripts/rubocop-on-edit.sh +2 -2
- package/dist/codex/scripts/sg-scan-on-edit.sh +2 -2
- package/dist/configs/coverage-scope.d.ts +0 -23
- package/dist/configs/coverage-scope.d.ts.map +1 -1
- package/dist/configs/coverage-scope.js +2 -3
- package/dist/configs/coverage-scope.js.map +1 -1
- package/dist/configs/eslint/base.d.ts +2 -113
- package/dist/configs/eslint/base.d.ts.map +1 -1
- package/dist/configs/eslint/base.js +2 -165
- package/dist/configs/eslint/base.js.map +1 -1
- package/dist/configs/eslint/cdk.d.ts.map +1 -1
- package/dist/configs/eslint/cdk.js +82 -66
- package/dist/configs/eslint/cdk.js.map +1 -1
- package/dist/configs/eslint/expo-overrides.d.ts +103 -0
- package/dist/configs/eslint/expo-overrides.d.ts.map +1 -0
- package/dist/configs/eslint/expo-overrides.js +187 -0
- package/dist/configs/eslint/expo-overrides.js.map +1 -0
- package/dist/configs/eslint/expo.d.ts +2 -7
- package/dist/configs/eslint/expo.d.ts.map +1 -1
- package/dist/configs/eslint/expo.js +186 -258
- package/dist/configs/eslint/expo.js.map +1 -1
- package/dist/configs/eslint/nestjs.d.ts.map +1 -1
- package/dist/configs/eslint/nestjs.js +86 -70
- package/dist/configs/eslint/nestjs.js.map +1 -1
- package/dist/configs/eslint/process-environment-bans.d.ts +41 -0
- package/dist/configs/eslint/process-environment-bans.d.ts.map +1 -0
- package/dist/configs/eslint/process-environment-bans.js +50 -0
- package/dist/configs/eslint/process-environment-bans.js.map +1 -0
- package/dist/configs/eslint/shared-rules.d.ts +130 -0
- package/dist/configs/eslint/shared-rules.d.ts.map +1 -0
- package/dist/configs/eslint/shared-rules.js +233 -0
- package/dist/configs/eslint/shared-rules.js.map +1 -0
- package/dist/configs/eslint/typescript.d.ts.map +1 -1
- package/dist/configs/eslint/typescript.js +2 -4
- package/dist/configs/eslint/typescript.js.map +1 -1
- package/dist/configs/vitest/base.d.ts +2 -2
- package/dist/configs/vitest/base.d.ts.map +1 -1
- package/dist/configs/vitest/base.js +5 -5
- package/dist/configs/vitest/base.js.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.d.ts.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.js +3 -2
- package/dist/configs/vitest/coverage-reports-directory.js.map +1 -1
- package/dist/configs/vitest/refusal-announcement.js +2 -2
- package/dist/configs/vitest/refusal-announcement.js.map +1 -1
- package/dist/core/admission-lock.js +2 -3
- package/dist/core/admission-lock.js.map +1 -1
- package/dist/core/admission-state.d.ts.map +1 -1
- package/dist/core/admission-state.js +11 -5
- package/dist/core/admission-state.js.map +1 -1
- package/dist/core/admission.d.ts.map +1 -1
- package/dist/core/admission.js +2 -2
- package/dist/core/admission.js.map +1 -1
- package/dist/core/bootstrap-environment.d.ts.map +1 -1
- package/dist/core/bootstrap-environment.js +8 -5
- package/dist/core/bootstrap-environment.js.map +1 -1
- package/dist/core/downstream-names.d.ts.map +1 -1
- package/dist/core/downstream-names.js +48 -47
- package/dist/core/downstream-names.js.map +1 -1
- package/dist/core/effectiveness-store.d.ts.map +1 -1
- package/dist/core/effectiveness-store.js +3 -5
- package/dist/core/effectiveness-store.js.map +1 -1
- package/dist/core/gate-declaration-drift.d.ts.map +1 -1
- package/dist/core/gate-declaration-drift.js +46 -27
- package/dist/core/gate-declaration-drift.js.map +1 -1
- package/dist/core/kane-cli-process.d.ts.map +1 -1
- package/dist/core/kane-cli-process.js +46 -33
- package/dist/core/kane-cli-process.js.map +1 -1
- package/dist/core/kane-cli.d.ts.map +1 -1
- package/dist/core/kane-cli.js +3 -4
- package/dist/core/kane-cli.js.map +1 -1
- package/dist/core/lisa-agent-emit-extra.d.ts +75 -0
- package/dist/core/lisa-agent-emit-extra.d.ts.map +1 -0
- package/dist/core/lisa-agent-emit-extra.js +231 -0
- package/dist/core/lisa-agent-emit-extra.js.map +1 -0
- package/dist/core/lisa-agent-emit.d.ts +79 -0
- package/dist/core/lisa-agent-emit.d.ts.map +1 -0
- package/dist/core/lisa-agent-emit.js +224 -0
- package/dist/core/lisa-agent-emit.js.map +1 -0
- package/dist/core/lisa-deletions.d.ts +116 -0
- package/dist/core/lisa-deletions.d.ts.map +1 -0
- package/dist/core/lisa-deletions.js +316 -0
- package/dist/core/lisa-deletions.js.map +1 -0
- package/dist/core/lisa-file-results.d.ts +58 -0
- package/dist/core/lisa-file-results.d.ts.map +1 -0
- package/dist/core/lisa-file-results.js +173 -0
- package/dist/core/lisa-file-results.js.map +1 -0
- package/dist/core/lisa-maintenance.d.ts +139 -0
- package/dist/core/lisa-maintenance.d.ts.map +1 -0
- package/dist/core/lisa-maintenance.js +324 -0
- package/dist/core/lisa-maintenance.js.map +1 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts +7 -5
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +44 -6036
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.json +6021 -0
- package/dist/core/lisa-plugin-sync.d.ts +96 -0
- package/dist/core/lisa-plugin-sync.d.ts.map +1 -0
- package/dist/core/lisa-plugin-sync.js +216 -0
- package/dist/core/lisa-plugin-sync.js.map +1 -0
- package/dist/core/lisa-plugins.d.ts +42 -0
- package/dist/core/lisa-plugins.d.ts.map +1 -0
- package/dist/core/lisa-plugins.js +155 -0
- package/dist/core/lisa-plugins.js.map +1 -0
- package/dist/core/lisa-state.d.ts +202 -0
- package/dist/core/lisa-state.d.ts.map +1 -0
- package/dist/core/lisa-state.js +205 -0
- package/dist/core/lisa-state.js.map +1 -0
- package/dist/core/lisa-summary-stats.d.ts +74 -0
- package/dist/core/lisa-summary-stats.d.ts.map +1 -0
- package/dist/core/lisa-summary-stats.js +189 -0
- package/dist/core/lisa-summary-stats.js.map +1 -0
- package/dist/core/lisa-summary.d.ts +34 -0
- package/dist/core/lisa-summary.d.ts.map +1 -0
- package/dist/core/lisa-summary.js +144 -0
- package/dist/core/lisa-summary.js.map +1 -0
- package/dist/core/lisa-templates.d.ts +98 -0
- package/dist/core/lisa-templates.d.ts.map +1 -0
- package/dist/core/lisa-templates.js +251 -0
- package/dist/core/lisa-templates.js.map +1 -0
- package/dist/core/lisa.d.ts +14 -903
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +30 -2275
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/plugin-command.d.ts.map +1 -1
- package/dist/core/plugin-command.js +117 -61
- package/dist/core/plugin-command.js.map +1 -1
- package/dist/core/template-ownership.d.ts.map +1 -1
- package/dist/core/template-ownership.js +0 -1
- package/dist/core/template-ownership.js.map +1 -1
- package/dist/core/upstream-attribution-body.d.ts +4 -11
- package/dist/core/upstream-attribution-body.d.ts.map +1 -1
- package/dist/core/upstream-attribution-body.js +61 -373
- package/dist/core/upstream-attribution-body.js.map +1 -1
- package/dist/core/upstream-attribution-fields.d.ts +40 -0
- package/dist/core/upstream-attribution-fields.d.ts.map +1 -0
- package/dist/core/upstream-attribution-fields.js +167 -0
- package/dist/core/upstream-attribution-fields.js.map +1 -0
- package/dist/core/upstream-attribution-files.d.ts +15 -0
- package/dist/core/upstream-attribution-files.d.ts.map +1 -0
- package/dist/core/upstream-attribution-files.js +156 -0
- package/dist/core/upstream-attribution-files.js.map +1 -0
- package/dist/core/upstream-attribution-guards.d.ts +80 -0
- package/dist/core/upstream-attribution-guards.d.ts.map +1 -0
- package/dist/core/upstream-attribution-guards.js +284 -0
- package/dist/core/upstream-attribution-guards.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +67 -30435
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.json +30520 -0
- package/dist/health/agentic-contract.d.ts +94 -0
- package/dist/health/agentic-contract.d.ts.map +1 -0
- package/dist/health/agentic-contract.js +2 -0
- package/dist/health/agentic-contract.js.map +1 -0
- package/dist/health/agentic-evidence.d.ts +16 -0
- package/dist/health/agentic-evidence.d.ts.map +1 -0
- package/dist/health/agentic-evidence.js +213 -0
- package/dist/health/agentic-evidence.js.map +1 -0
- package/dist/health/agentic.d.ts +11 -74
- package/dist/health/agentic.d.ts.map +1 -1
- package/dist/health/agentic.js +42 -216
- package/dist/health/agentic.js.map +1 -1
- package/dist/health/deadline.d.ts +4 -1
- package/dist/health/deadline.d.ts.map +1 -1
- package/dist/health/deadline.js +4 -3
- package/dist/health/deadline.js.map +1 -1
- package/dist/health/deterministic-inputs.d.ts.map +1 -1
- package/dist/health/deterministic-inputs.js +3 -11
- package/dist/health/deterministic-inputs.js.map +1 -1
- package/dist/health/deterministic-probes.d.ts +52 -0
- package/dist/health/deterministic-probes.d.ts.map +1 -0
- package/dist/health/deterministic-probes.js +142 -0
- package/dist/health/deterministic-probes.js.map +1 -0
- package/dist/health/deterministic.d.ts +2 -25
- package/dist/health/deterministic.d.ts.map +1 -1
- package/dist/health/deterministic.js +14 -106
- package/dist/health/deterministic.js.map +1 -1
- package/dist/health/finding-utils.d.ts +4 -3
- package/dist/health/finding-utils.d.ts.map +1 -1
- package/dist/health/finding-utils.js +4 -4
- package/dist/health/finding-utils.js.map +1 -1
- package/dist/health/governance-probes.d.ts +29 -24
- package/dist/health/governance-probes.d.ts.map +1 -1
- package/dist/health/governance-probes.js +29 -25
- package/dist/health/governance-probes.js.map +1 -1
- package/dist/health/hook-inspection.d.ts +4 -3
- package/dist/health/hook-inspection.d.ts.map +1 -1
- package/dist/health/hook-inspection.js +17 -11
- package/dist/health/hook-inspection.js.map +1 -1
- package/dist/health/plugin-inspection.d.ts +6 -4
- package/dist/health/plugin-inspection.d.ts.map +1 -1
- package/dist/health/plugin-inspection.js +10 -9
- package/dist/health/plugin-inspection.js.map +1 -1
- package/dist/health/prepare.js +24 -8
- package/dist/health/prepare.js.map +1 -1
- package/dist/health/project-probes.d.ts +14 -7
- package/dist/health/project-probes.d.ts.map +1 -1
- package/dist/health/project-probes.js +14 -9
- package/dist/health/project-probes.js.map +1 -1
- package/dist/health/ruleset-compare.d.ts +30 -0
- package/dist/health/ruleset-compare.d.ts.map +1 -0
- package/dist/health/ruleset-compare.js +143 -0
- package/dist/health/ruleset-compare.js.map +1 -0
- package/dist/health/ruleset-config-checks.d.ts +66 -0
- package/dist/health/ruleset-config-checks.d.ts.map +1 -0
- package/dist/health/ruleset-config-checks.js +190 -0
- package/dist/health/ruleset-config-checks.js.map +1 -0
- package/dist/health/ruleset-expected.d.ts +39 -0
- package/dist/health/ruleset-expected.d.ts.map +1 -0
- package/dist/health/ruleset-expected.js +181 -0
- package/dist/health/ruleset-expected.js.map +1 -0
- package/dist/health/ruleset-gh.d.ts +85 -0
- package/dist/health/ruleset-gh.d.ts.map +1 -0
- package/dist/health/ruleset-gh.js +177 -0
- package/dist/health/ruleset-gh.js.map +1 -0
- package/dist/health/ruleset-inspection.d.ts +13 -117
- package/dist/health/ruleset-inspection.d.ts.map +1 -1
- package/dist/health/ruleset-inspection.js +8 -738
- package/dist/health/ruleset-inspection.js.map +1 -1
- package/dist/health/ruleset-normalize.d.ts +32 -0
- package/dist/health/ruleset-normalize.d.ts.map +1 -0
- package/dist/health/ruleset-normalize.js +160 -0
- package/dist/health/ruleset-normalize.js.map +1 -0
- package/dist/health/template-compose.d.ts +9 -0
- package/dist/health/template-compose.d.ts.map +1 -0
- package/dist/health/template-compose.js +105 -0
- package/dist/health/template-compose.js.map +1 -0
- package/dist/health/template-inspection.d.ts +5 -52
- package/dist/health/template-inspection.d.ts.map +1 -1
- package/dist/health/template-inspection.js +13 -435
- package/dist/health/template-inspection.js.map +1 -1
- package/dist/health/template-plan.d.ts +33 -0
- package/dist/health/template-plan.d.ts.map +1 -0
- package/dist/health/template-plan.js +154 -0
- package/dist/health/template-plan.js.map +1 -0
- package/dist/health/template-shape.d.ts +19 -0
- package/dist/health/template-shape.d.ts.map +1 -0
- package/dist/health/template-shape.js +122 -0
- package/dist/health/template-shape.js.map +1 -0
- package/dist/health/workflow-excerpt.d.ts +15 -0
- package/dist/health/workflow-excerpt.d.ts.map +1 -0
- package/dist/health/workflow-excerpt.js +88 -0
- package/dist/health/workflow-excerpt.js.map +1 -0
- package/dist/health/workflow-inputs-inspection.d.ts +16 -0
- package/dist/health/workflow-inputs-inspection.d.ts.map +1 -0
- package/dist/health/workflow-inputs-inspection.js +116 -0
- package/dist/health/workflow-inputs-inspection.js.map +1 -0
- package/dist/opencode/plugin-templates/block-managed-file-edits.sh +201 -20
- package/dist/standards/capture.d.ts.map +1 -1
- package/dist/standards/capture.js +73 -25
- package/dist/standards/capture.js.map +1 -1
- package/dist/standards/contract.d.ts.map +1 -1
- package/dist/standards/contract.js +26 -9
- package/dist/standards/contract.js.map +1 -1
- package/dist/standards/git-state.d.ts.map +1 -1
- package/dist/standards/git-state.js +2 -2
- package/dist/standards/git-state.js.map +1 -1
- package/dist/standards/registry-checks.d.ts +34 -0
- package/dist/standards/registry-checks.d.ts.map +1 -0
- package/dist/standards/registry-checks.js +137 -0
- package/dist/standards/registry-checks.js.map +1 -0
- package/dist/standards/registry.d.ts +3 -13
- package/dist/standards/registry.d.ts.map +1 -1
- package/dist/standards/registry.js +105 -194
- package/dist/standards/registry.js.map +1 -1
- package/dist/standards/storage.js +8 -10
- package/dist/standards/storage.js.map +1 -1
- package/dist/strategies/deduplicate-arrays.d.ts +18 -0
- package/dist/strategies/deduplicate-arrays.d.ts.map +1 -0
- package/dist/strategies/deduplicate-arrays.js +25 -0
- package/dist/strategies/deduplicate-arrays.js.map +1 -0
- package/dist/strategies/package-lisa-detect.d.ts +10 -0
- package/dist/strategies/package-lisa-detect.d.ts.map +1 -0
- package/dist/strategies/package-lisa-detect.js +178 -0
- package/dist/strategies/package-lisa-detect.js.map +1 -0
- package/dist/strategies/package-lisa-direct-floors.d.ts +16 -0
- package/dist/strategies/package-lisa-direct-floors.d.ts.map +1 -0
- package/dist/strategies/package-lisa-direct-floors.js +37 -0
- package/dist/strategies/package-lisa-direct-floors.js.map +1 -0
- package/dist/strategies/package-lisa-host-pins.d.ts +43 -0
- package/dist/strategies/package-lisa-host-pins.d.ts.map +1 -0
- package/dist/strategies/package-lisa-host-pins.js +254 -0
- package/dist/strategies/package-lisa-host-pins.js.map +1 -0
- package/dist/strategies/package-lisa-manifest-guards.d.ts +59 -0
- package/dist/strategies/package-lisa-manifest-guards.d.ts.map +1 -0
- package/dist/strategies/package-lisa-manifest-guards.js +234 -0
- package/dist/strategies/package-lisa-manifest-guards.js.map +1 -0
- package/dist/strategies/package-lisa-pin-alignment.d.ts +34 -0
- package/dist/strategies/package-lisa-pin-alignment.d.ts.map +1 -0
- package/dist/strategies/package-lisa-pin-alignment.js +106 -0
- package/dist/strategies/package-lisa-pin-alignment.js.map +1 -0
- package/dist/strategies/package-lisa-script-notes.d.ts +19 -0
- package/dist/strategies/package-lisa-script-notes.d.ts.map +1 -0
- package/dist/strategies/package-lisa-script-notes.js +145 -0
- package/dist/strategies/package-lisa-script-notes.js.map +1 -0
- package/dist/strategies/package-lisa-template-apply.d.ts +53 -0
- package/dist/strategies/package-lisa-template-apply.d.ts.map +1 -0
- package/dist/strategies/package-lisa-template-apply.js +216 -0
- package/dist/strategies/package-lisa-template-apply.js.map +1 -0
- package/dist/strategies/package-lisa-template-merge.d.ts +42 -0
- package/dist/strategies/package-lisa-template-merge.d.ts.map +1 -0
- package/dist/strategies/package-lisa-template-merge.js +202 -0
- package/dist/strategies/package-lisa-template-merge.js.map +1 -0
- package/dist/strategies/package-lisa-types.d.ts +5 -0
- package/dist/strategies/package-lisa-types.d.ts.map +1 -1
- package/dist/strategies/package-lisa.d.ts +1 -195
- package/dist/strategies/package-lisa.d.ts.map +1 -1
- package/dist/strategies/package-lisa.js +27 -1333
- package/dist/strategies/package-lisa.js.map +1 -1
- package/dist/strategies/tagged-merge-sections.d.ts +68 -0
- package/dist/strategies/tagged-merge-sections.d.ts.map +1 -0
- package/dist/strategies/tagged-merge-sections.js +113 -0
- package/dist/strategies/tagged-merge-sections.js.map +1 -0
- package/dist/strategies/tagged-merge.d.ts +1 -90
- package/dist/strategies/tagged-merge.d.ts.map +1 -1
- package/dist/strategies/tagged-merge.js +19 -190
- package/dist/strategies/tagged-merge.js.map +1 -1
- package/dist/utils/bounded-stream.d.ts +30 -0
- package/dist/utils/bounded-stream.d.ts.map +1 -0
- package/dist/utils/bounded-stream.js +63 -0
- package/dist/utils/bounded-stream.js.map +1 -0
- package/dist/utils/fibonacci.d.ts +3 -3
- package/dist/utils/fibonacci.d.ts.map +1 -1
- package/dist/utils/fibonacci.js +48 -10
- package/dist/utils/fibonacci.js.map +1 -1
- package/dist/utils/memo.d.ts +25 -0
- package/dist/utils/memo.d.ts.map +1 -0
- package/dist/utils/memo.js +32 -0
- package/dist/utils/memo.js.map +1 -0
- package/dist/utils/postinstall-trampoline.d.ts.map +1 -1
- package/dist/utils/postinstall-trampoline.js +3 -20
- package/dist/utils/postinstall-trampoline.js.map +1 -1
- package/dist/utils/process-environment.d.ts +42 -0
- package/dist/utils/process-environment.d.ts.map +1 -0
- package/dist/utils/process-environment.js +52 -0
- package/dist/utils/process-environment.js.map +1 -0
- package/dist/utils/resolve-executable.d.ts +89 -0
- package/dist/utils/resolve-executable.d.ts.map +1 -0
- package/dist/utils/resolve-executable.js +224 -0
- package/dist/utils/resolve-executable.js.map +1 -0
- package/dist/utils/shell-command-line.d.ts +9 -0
- package/dist/utils/shell-command-line.d.ts.map +1 -0
- package/dist/utils/shell-command-line.js +43 -0
- package/dist/utils/shell-command-line.js.map +1 -0
- package/dist/utils/usage-accounting-totals.d.ts +19 -0
- package/dist/utils/usage-accounting-totals.d.ts.map +1 -0
- package/dist/utils/usage-accounting-totals.js +145 -0
- package/dist/utils/usage-accounting-totals.js.map +1 -0
- package/dist/utils/usage-accounting.d.ts +2 -14
- package/dist/utils/usage-accounting.d.ts.map +1 -1
- package/dist/utils/usage-accounting.js +2 -169
- package/dist/utils/usage-accounting.js.map +1 -1
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order-react-violations.test.js +213 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order-valid.test.js +251 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order-violations.test.js +222 -0
- package/eslint-plugin-code-organization/__tests__/statement-order-tester.js +42 -0
- package/eslint-plugin-code-organization/rules/enforce-statement-order.js +6 -8
- package/expo/copy-overwrite/jest.setup.ts +11 -10
- package/expo/create-only/scripts/zap-baseline.sh +6 -18
- package/harper-fabric/create-only/scripts/zap-baseline.sh +7 -9
- package/nestjs/create-only/scripts/zap-baseline.sh +6 -7
- package/package.json +5 -5
- package/phaser/copy-overwrite/.husky/pre-push.verify +2 -0
- 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-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa/hooks/block-no-verify.agy.sh +1 -1
- package/plugins/lisa/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa/hooks/ticket-sync-reminder.sh +2 -17
- package/plugins/lisa/hooks/track-plan-sessions.sh +7 -131
- package/plugins/lisa/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-agy/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-agy/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- 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/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-copilot/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa-copilot/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-copilot/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-cursor/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa-cursor/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-cursor/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-devin/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa-devin/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa-devin/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-devin/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo/.codex-plugin/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-agy/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-agy/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-copilot/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-cursor/skills/expo-tailwind-setup/SKILL.md +15 -4
- 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-expo-devin/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-devin/skills/expo-tailwind-setup/SKILL.md +15 -4
- 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/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric/hooks/enforce-config-extensions.sh +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-copilot/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric-copilot/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric-cursor/hooks/enforce-config-extensions.sh +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-harper-fabric-devin/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric-devin/hooks/enforce-config-extensions.sh +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/.codex-plugin/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs/.codex-plugin/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-agy/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs-copilot/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs-copilot/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-copilot/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs-cursor/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs-cursor/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-cursor/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- 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-nestjs-devin/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs-devin/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs-devin/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-devin/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- 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/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails-copilot/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails-copilot/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails-cursor/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails-cursor/hooks/sg-scan-on-edit.sh +3 -3
- 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-rails-devin/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails-devin/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails-devin/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript-copilot/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript-copilot/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript-copilot/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript-copilot/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript-cursor/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript-cursor/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript-cursor/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript-cursor/hooks/sg-scan-on-edit.sh +3 -3
- 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-typescript-devin/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript-devin/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript-devin/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript-devin/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript-devin/hooks/sg-scan-on-edit.sh +3 -3
- 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/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/src/base/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/src/base/hooks/block-no-verify.agy.sh +1 -1
- package/plugins/src/base/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/src/base/hooks/ticket-sync-reminder.sh +2 -17
- package/plugins/src/base/hooks/track-plan-sessions.sh +7 -131
- package/plugins/src/base/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/src/base/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/src/expo/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/src/expo/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/src/harper-fabric/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/src/harper-fabric/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/src/nestjs/hooks/block-migration-edits.sh +1 -1
- package/plugins/src/nestjs/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/src/nestjs/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/src/nestjs/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/src/rails/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/src/rails/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/src/rails/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/src/typescript/hooks/block-suppress-directives.sh +2 -2
- package/plugins/src/typescript/hooks/format-on-edit.sh +2 -2
- package/plugins/src/typescript/hooks/lint-on-edit.sh +2 -2
- package/plugins/src/typescript/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/src/typescript/hooks/sg-scan-on-edit.sh +3 -3
- package/scripts/build-plugins.sh +1 -1
- package/scripts/check-derived-artifacts.mjs +2 -2
- package/scripts/check-generated-artifact-merge-coverage.mjs +45 -4
- package/scripts/check-orphan-test-processes.mjs +0 -1
- package/scripts/check-self-dependency-pin.mjs +0 -2
- package/scripts/claude-remote-setup.sh +12 -7
- package/scripts/cleanup-amplify-branches.sh +0 -1
- package/scripts/generate-export-surface.mjs +131 -61
- package/scripts/generate-lisa-owned-hash-ledger.mjs +87 -102
- package/scripts/generate-upstream-evidence-manifest.mjs +56 -49
- package/scripts/github-status-check.sh +5 -25
- package/scripts/install-claude-plugins.sh +10 -8
- package/scripts/lib/merge-generated-json.mjs +274 -0
- package/scripts/lib/upstream-manifest-staleness.mjs +38 -34
- package/scripts/lib/upstream-public-commits.mjs +35 -18
- package/scripts/lisa-commit-and-pr-local.sh +1 -1
- package/scripts/lisa-enforcement-fallback.sh +31 -32
- package/scripts/lisa-github-environments.sh +5 -1
- package/scripts/lisa-github-repo-settings.sh +5 -1
- package/scripts/lisa-github-repo-setup.sh +1 -2
- package/scripts/lisa-github-rulesets.sh +8 -8
- package/scripts/lisa-remote-env/session-start.sh +18 -5
- package/scripts/lisa-rollback-release.mjs +0 -2
- package/scripts/lisa-update-local.sh +1 -1
- package/scripts/merge-generated-artifact.mjs +18 -6
- package/scripts/raise-self-dependency-pin.mjs +0 -2
- package/scripts/run-artifact-checks.mjs +1 -1
- package/scripts/verify-packed-learnings-contract.mjs +36 -3
- package/scripts/verify-self-pin-raise.mjs +0 -2
- package/typescript/copy-contents/.husky/commit-msg +8 -2
- package/typescript/copy-contents/.husky/post-checkout +2 -0
- package/typescript/copy-contents/.husky/post-merge +2 -0
- package/typescript/copy-contents/.husky/pre-commit +10 -3
- package/typescript/copy-contents/.husky/pre-push +29 -16
- package/typescript/copy-contents/.husky/prepare-commit-msg +2 -0
- package/typescript/create-only/.husky/pre-push.local +2 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +0 -643
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PackageJsonPlan, ResolvedPackageLisaTemplate } from "./package-lisa-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Rewrite literal `overrides`/`resolutions` entries into npm's `"$name"`
|
|
4
|
+
* self-reference form when the overridden package is also a direct dependency.
|
|
5
|
+
* @remarks
|
|
6
|
+
* npm rejects a manifest with `EOVERRIDE` when an `overrides`/`resolutions` key
|
|
7
|
+
* that is also a direct dependency carries a literal version instead of the
|
|
8
|
+
* `"$name"` self-reference — e.g. a security remediation force-bumping
|
|
9
|
+
* `prettier` in `overrides` while `prettier` stays a direct devDependency. npm
|
|
10
|
+
* runs this validation before doing anything, so the broken manifest fails every
|
|
11
|
+
* `npx`/`npm` invocation in the project directory (including plugin MCP servers
|
|
12
|
+
* spawned via `npx`), not just installs. Normalizing to `$name` — the same form
|
|
13
|
+
* Lisa's own templates use (e.g. `"vite": "$vite"`) — resolves the override
|
|
14
|
+
* against the direct dependency and satisfies npm, healing a hand-injected or
|
|
15
|
+
* agent-injected override on the next apply without touching the project by hand.
|
|
16
|
+
*
|
|
17
|
+
* Only top-level string entries are rewritten: those are what trigger EOVERRIDE.
|
|
18
|
+
* Existing `$name` references and nested (parent-scoped) override objects are
|
|
19
|
+
* left untouched. Overrides for packages that are NOT direct dependencies are
|
|
20
|
+
* also left as literals — those are legitimate transitive pins.
|
|
21
|
+
* @param pkg - Merged package.json about to be persisted
|
|
22
|
+
* @param fileName - Basename used in error messages
|
|
23
|
+
* @throws {JsonMergeError} when a rewrite would make the effective override wider
|
|
24
|
+
* than the literal constraint it replaced.
|
|
25
|
+
* @returns Planned package.json plus operator-visible notes.
|
|
26
|
+
*/
|
|
27
|
+
export declare function planSelfReferencingOverrideNormalization(pkg: Record<string, unknown>, fileName: string): PackageJsonPlan;
|
|
28
|
+
/**
|
|
29
|
+
* Collect the distinct `$name` references across the given sections (typically
|
|
30
|
+
* overrides and resolutions).
|
|
31
|
+
* @param sections - Values to scan
|
|
32
|
+
* @returns Set of referenced package names (without the leading `$`)
|
|
33
|
+
*/
|
|
34
|
+
export declare function collectDollarReferences(sections: readonly unknown[]): Set<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Collect top-level literal override keys that may later normalize to `$name`.
|
|
37
|
+
* @param sections - Override/resolution sections to inspect
|
|
38
|
+
* @returns Set of package names with non-empty literal string entries
|
|
39
|
+
*/
|
|
40
|
+
export declare function collectLiteralOverrideNames(sections: readonly unknown[]): Set<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Refuse to persist a package.json npm could not install. Single choke point:
|
|
43
|
+
* every path that writes a manifest runs this, so a new writer cannot pick up
|
|
44
|
+
* one half of the validation and miss the other.
|
|
45
|
+
* @param pkg - Merged package.json about to be written
|
|
46
|
+
* @param fileName - Basename used in error messages
|
|
47
|
+
* @throws {JsonMergeError} when the manifest carries an unresolvable `$name`
|
|
48
|
+
*/
|
|
49
|
+
export declare function assertManifestIsInstallable(pkg: Record<string, unknown>, fileName: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Count the literal version floors a resolved template would write.
|
|
52
|
+
*
|
|
53
|
+
* A `$name` entry is not counted: it carries no floor of its own, so it can
|
|
54
|
+
* never be the thing a host range resolves below.
|
|
55
|
+
* @param template - Fully resolved package.lisa.json template
|
|
56
|
+
* @returns Number of literal entries across force.overrides and force.resolutions
|
|
57
|
+
*/
|
|
58
|
+
export declare function countTemplateFloors(template: ResolvedPackageLisaTemplate): number;
|
|
59
|
+
//# sourceMappingURL=package-lisa-manifest-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-manifest-guards.d.ts","sourceRoot":"","sources":["../../src/strategies/package-lisa-manifest-guards.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,eAAe,EACf,2BAA2B,EAC5B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wCAAwC,CACtD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,MAAM,GACf,eAAe,CA6BjB;AA0ED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAC3B,GAAG,CAAC,MAAM,CAAC,CAEb;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAC3B,GAAG,CAAC,MAAM,CAAC,CAWb;AA2FD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,MAAM,GACf,IAAI,CAGN;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,2BAA2B,GACpC,MAAM,CASR"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file package-lisa-manifest-guards.ts
|
|
3
|
+
* @description Override normalization and installability guards the
|
|
4
|
+
* package-lisa strategy runs on every manifest before it is persisted.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
import { asRecord, auditSelfReferenceRewrites, collectDirectDependencyNames, describeSelfReferenceRemedy, DIRECT_DEPENDENCY_SECTIONS, OVERRIDE_SECTIONS, } from "../core/override-floors.js";
|
|
8
|
+
import { JsonMergeError } from "../errors/index.js";
|
|
9
|
+
/**
|
|
10
|
+
* Rewrite literal `overrides`/`resolutions` entries into npm's `"$name"`
|
|
11
|
+
* self-reference form when the overridden package is also a direct dependency.
|
|
12
|
+
* @remarks
|
|
13
|
+
* npm rejects a manifest with `EOVERRIDE` when an `overrides`/`resolutions` key
|
|
14
|
+
* that is also a direct dependency carries a literal version instead of the
|
|
15
|
+
* `"$name"` self-reference — e.g. a security remediation force-bumping
|
|
16
|
+
* `prettier` in `overrides` while `prettier` stays a direct devDependency. npm
|
|
17
|
+
* runs this validation before doing anything, so the broken manifest fails every
|
|
18
|
+
* `npx`/`npm` invocation in the project directory (including plugin MCP servers
|
|
19
|
+
* spawned via `npx`), not just installs. Normalizing to `$name` — the same form
|
|
20
|
+
* Lisa's own templates use (e.g. `"vite": "$vite"`) — resolves the override
|
|
21
|
+
* against the direct dependency and satisfies npm, healing a hand-injected or
|
|
22
|
+
* agent-injected override on the next apply without touching the project by hand.
|
|
23
|
+
*
|
|
24
|
+
* Only top-level string entries are rewritten: those are what trigger EOVERRIDE.
|
|
25
|
+
* Existing `$name` references and nested (parent-scoped) override objects are
|
|
26
|
+
* left untouched. Overrides for packages that are NOT direct dependencies are
|
|
27
|
+
* also left as literals — those are legitimate transitive pins.
|
|
28
|
+
* @param pkg - Merged package.json about to be persisted
|
|
29
|
+
* @param fileName - Basename used in error messages
|
|
30
|
+
* @throws {JsonMergeError} when a rewrite would make the effective override wider
|
|
31
|
+
* than the literal constraint it replaced.
|
|
32
|
+
* @returns Planned package.json plus operator-visible notes.
|
|
33
|
+
*/
|
|
34
|
+
export function planSelfReferencingOverrideNormalization(pkg, fileName) {
|
|
35
|
+
const audit = auditSelfReferenceRewrites(pkg);
|
|
36
|
+
const refused = audit.conflicts[0];
|
|
37
|
+
if (refused !== undefined) {
|
|
38
|
+
throw new JsonMergeError(fileName, formatSelfReferenceRefusal(refused));
|
|
39
|
+
}
|
|
40
|
+
if (audit.rewritable.length === 0) {
|
|
41
|
+
return { packageJson: pkg, notes: [] };
|
|
42
|
+
}
|
|
43
|
+
const sections = OVERRIDE_SECTIONS.flatMap(section => {
|
|
44
|
+
const rewrites = audit.rewritable.filter(rewrite => rewrite.section === section);
|
|
45
|
+
if (rewrites.length === 0) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const normalized = Object.fromEntries(Object.entries(asRecord(pkg[section])).map(([name, value]) => rewrites.some(rewrite => rewrite.name === name)
|
|
49
|
+
? [name, `$${name}`]
|
|
50
|
+
: [name, value]));
|
|
51
|
+
return [[section, normalized]];
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
packageJson: { ...pkg, ...Object.fromEntries(sections) },
|
|
55
|
+
notes: audit.rewritable.map(formatSelfReferenceRewriteNote),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Explain a refused `$name` rewrite, ending with a remedy Lisa has TESTED.
|
|
60
|
+
* @remarks
|
|
61
|
+
* The old message ended "Pin the direct dependency to <the override> or choose
|
|
62
|
+
* a direct range that is no wider" — advice naming no concrete range which, for
|
|
63
|
+
* a bounded floor, is not satisfiable by the obvious reading of it. An operator
|
|
64
|
+
* who follows a refusal's own instructions and is refused a second time
|
|
65
|
+
* concludes the guard is broken rather than the range wrong
|
|
66
|
+
* (CodySwannGT/lisa#3191), which is how a correct security control gets routed
|
|
67
|
+
* around. The replacement names ONE range and has run it back through the same
|
|
68
|
+
* predicate that produced the refusal.
|
|
69
|
+
* @param conflict - The conflict that stopped the apply
|
|
70
|
+
* @returns Human-readable refusal naming both ranges and the verified raise
|
|
71
|
+
*/
|
|
72
|
+
function formatSelfReferenceRefusal(conflict) {
|
|
73
|
+
const remedy = describeSelfReferenceRemedy(conflict);
|
|
74
|
+
if (conflict.verdict === "unprovable") {
|
|
75
|
+
return (`${conflict.section}.${conflict.name} cannot be rewritten to ` +
|
|
76
|
+
`"$${conflict.name}" because Lisa cannot prove the direct dependency ` +
|
|
77
|
+
`range ${JSON.stringify(conflict.directRange)} is no wider than the ` +
|
|
78
|
+
`literal override ${JSON.stringify(conflict.floorRange)}. ${remedy}`);
|
|
79
|
+
}
|
|
80
|
+
return (`${conflict.section}.${conflict.name} would widen if rewritten to ` +
|
|
81
|
+
`"$${conflict.name}": the literal override ` +
|
|
82
|
+
`${JSON.stringify(conflict.floorRange)} would resolve to direct ` +
|
|
83
|
+
`dependency range ${JSON.stringify(conflict.directRange)}. ${remedy}`);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Format the operator-visible explanation for a safe `$name` rewrite.
|
|
87
|
+
* @param rewrite - Rewrite metadata
|
|
88
|
+
* @returns Human-readable note for apply output
|
|
89
|
+
*/
|
|
90
|
+
function formatSelfReferenceRewriteNote(rewrite) {
|
|
91
|
+
return (`Normalized ${rewrite.section}.${rewrite.name}: replaced literal ` +
|
|
92
|
+
`${JSON.stringify(rewrite.floorRange)} with "$${rewrite.name}" ` +
|
|
93
|
+
`resolving to direct dependency range ` +
|
|
94
|
+
`${JSON.stringify(rewrite.directRange)}.`);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Recursively collect every `$name` reference found in a single JSON value. npm
|
|
98
|
+
* overrides/resolutions use a `"$name"` string value to mean "resolve to the
|
|
99
|
+
* version of the direct dependency `name`", and the reference may appear at any
|
|
100
|
+
* nesting depth (npm allows nested override objects).
|
|
101
|
+
* @param value - JSON value to scan
|
|
102
|
+
* @returns Referenced package names (without the leading `$`), possibly with dups
|
|
103
|
+
*/
|
|
104
|
+
function collectRefsFromValue(value) {
|
|
105
|
+
if (typeof value === "string") {
|
|
106
|
+
const match = /^\$(.+)$/.exec(value);
|
|
107
|
+
return match?.[1] !== undefined ? [match[1]] : [];
|
|
108
|
+
}
|
|
109
|
+
if (Array.isArray(value)) {
|
|
110
|
+
return value.flatMap(collectRefsFromValue);
|
|
111
|
+
}
|
|
112
|
+
if (value !== null && typeof value === "object") {
|
|
113
|
+
return Object.values(value).flatMap(collectRefsFromValue);
|
|
114
|
+
}
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Collect the distinct `$name` references across the given sections (typically
|
|
119
|
+
* overrides and resolutions).
|
|
120
|
+
* @param sections - Values to scan
|
|
121
|
+
* @returns Set of referenced package names (without the leading `$`)
|
|
122
|
+
*/
|
|
123
|
+
export function collectDollarReferences(sections) {
|
|
124
|
+
return new Set(sections.flatMap(collectRefsFromValue));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Collect top-level literal override keys that may later normalize to `$name`.
|
|
128
|
+
* @param sections - Override/resolution sections to inspect
|
|
129
|
+
* @returns Set of package names with non-empty literal string entries
|
|
130
|
+
*/
|
|
131
|
+
export function collectLiteralOverrideNames(sections) {
|
|
132
|
+
return new Set(sections.flatMap(section => {
|
|
133
|
+
const entries = asRecord(section);
|
|
134
|
+
return Object.entries(entries).flatMap(([name, value]) => typeof value === "string" && value.length > 0 && !value.startsWith("$")
|
|
135
|
+
? [name]
|
|
136
|
+
: []);
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Fail the apply when the merged package.json carries a `$name` self-reference
|
|
141
|
+
* in overrides/resolutions without the backing direct dependency. Writing such
|
|
142
|
+
* a file leaves a dangling $ref that passes local checks but breaks `npm ci` in
|
|
143
|
+
* CI only. Throwing here surfaces the misconfiguration at apply time instead.
|
|
144
|
+
* @param pkg - Merged package.json about to be written
|
|
145
|
+
* @param fileName - Basename used in the error message
|
|
146
|
+
* @throws {JsonMergeError} when any `$name` reference lacks a matching direct dep
|
|
147
|
+
*/
|
|
148
|
+
function assertNoDanglingDollarRefs(pkg, fileName) {
|
|
149
|
+
const referenced = collectDollarReferences([pkg.overrides, pkg.resolutions]);
|
|
150
|
+
if (referenced.size === 0) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const directDeps = collectDirectDependencyNames(pkg);
|
|
154
|
+
const missing = Array.from(referenced).filter(name => !directDeps.has(name));
|
|
155
|
+
if (missing.length === 0) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const refs = missing.map(name => `$${name}`).join(", ");
|
|
159
|
+
const isPlural = missing.length > 1;
|
|
160
|
+
throw new JsonMergeError(fileName, `Dangling ${refs} in overrides/resolutions: a "$name" self-reference ` +
|
|
161
|
+
`requires "name" to be a direct dependency, but ${missing.join(", ")} ` +
|
|
162
|
+
`${isPlural ? "are" : "is"} not present in ` +
|
|
163
|
+
`dependencies/devDependencies. Add a force.devDependencies entry for ` +
|
|
164
|
+
`${isPlural ? "each" : "it"} in package.lisa.json, or drop the reference.`);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Fail the apply when a dependency section carries an unsubstituted `$name`
|
|
168
|
+
* placeholder instead of a version range.
|
|
169
|
+
* @remarks
|
|
170
|
+
* `$name` is real npm syntax, but only as an `overrides`/`resolutions` value,
|
|
171
|
+
* where it means "resolve to the version of the direct dependency `name`".
|
|
172
|
+
* A dependency section is not one of those places: npm reads the value as a
|
|
173
|
+
* literal dist-tag and refuses the whole manifest before doing any work —
|
|
174
|
+
* `EINVALIDTAGNAME: Invalid tag name "$tar" of package "tar@$tar"`. Every
|
|
175
|
+
* `npm`/`npx` in the project directory fails from then on, including the
|
|
176
|
+
* plugin MCP servers Lisa spawns via `npx`.
|
|
177
|
+
*
|
|
178
|
+
* So a `$name` here is never a self-reference npm will resolve; it is a
|
|
179
|
+
* placeholder something failed to substitute. Throwing at apply time keeps the
|
|
180
|
+
* failure attached to the thing that caused it, instead of leaving an
|
|
181
|
+
* uninstallable manifest for whoever runs the next install to discover.
|
|
182
|
+
*
|
|
183
|
+
* This also catches the reference-to-a-reference case the dangling-$ref guard
|
|
184
|
+
* cannot: that check is presence-only, so `dependencies.tar = "$tar"` reads as
|
|
185
|
+
* a valid backing dependency for `overrides.tar = "$tar"` even though npm can
|
|
186
|
+
* resolve neither. Only dependency sections are inspected — `scripts` values
|
|
187
|
+
* like `$npm_execpath` are shell variables and are left alone.
|
|
188
|
+
* @param pkg - Merged package.json about to be written
|
|
189
|
+
* @param fileName - Basename used in the error message
|
|
190
|
+
* @throws {JsonMergeError} when any dependency section value is a `$name` token
|
|
191
|
+
*/
|
|
192
|
+
function assertNoUnsubstitutedDollarTokens(pkg, fileName) {
|
|
193
|
+
const offenders = DIRECT_DEPENDENCY_SECTIONS.flatMap(section => Object.entries(asRecord(pkg[section])).flatMap(([name, value]) => typeof value === "string" && value.startsWith("$")
|
|
194
|
+
? [`${section}.${name} = ${JSON.stringify(value)}`]
|
|
195
|
+
: []));
|
|
196
|
+
if (offenders.length === 0) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const isPlural = offenders.length > 1;
|
|
200
|
+
throw new JsonMergeError(fileName, `Unsubstituted placeholder${isPlural ? "s" : ""} in dependency ` +
|
|
201
|
+
`${isPlural ? "sections" : "section"}: ${offenders.join(", ")}. ` +
|
|
202
|
+
`A "$name" value is only valid inside overrides/resolutions, where npm ` +
|
|
203
|
+
`resolves it to the version of the direct dependency "name". In ` +
|
|
204
|
+
`dependencies/devDependencies/optionalDependencies/peerDependencies npm ` +
|
|
205
|
+
`reads it as a literal version tag and rejects the whole manifest with ` +
|
|
206
|
+
`EINVALIDTAGNAME, so every npm and npx command in the project fails. ` +
|
|
207
|
+
`Replace ${isPlural ? "each placeholder" : "the placeholder"} with a real ` +
|
|
208
|
+
`version range.`);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Refuse to persist a package.json npm could not install. Single choke point:
|
|
212
|
+
* every path that writes a manifest runs this, so a new writer cannot pick up
|
|
213
|
+
* one half of the validation and miss the other.
|
|
214
|
+
* @param pkg - Merged package.json about to be written
|
|
215
|
+
* @param fileName - Basename used in error messages
|
|
216
|
+
* @throws {JsonMergeError} when the manifest carries an unresolvable `$name`
|
|
217
|
+
*/
|
|
218
|
+
export function assertManifestIsInstallable(pkg, fileName) {
|
|
219
|
+
assertNoUnsubstitutedDollarTokens(pkg, fileName);
|
|
220
|
+
assertNoDanglingDollarRefs(pkg, fileName);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Count the literal version floors a resolved template would write.
|
|
224
|
+
*
|
|
225
|
+
* A `$name` entry is not counted: it carries no floor of its own, so it can
|
|
226
|
+
* never be the thing a host range resolves below.
|
|
227
|
+
* @param template - Fully resolved package.lisa.json template
|
|
228
|
+
* @returns Number of literal entries across force.overrides and force.resolutions
|
|
229
|
+
*/
|
|
230
|
+
export function countTemplateFloors(template) {
|
|
231
|
+
return OVERRIDE_SECTIONS.reduce((total, section) => total +
|
|
232
|
+
Object.values(asRecord(template.force[section])).filter(value => typeof value === "string" && !value.startsWith("$")).length, 0);
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=package-lisa-manifest-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-manifest-guards.js","sourceRoot":"","sources":["../../src/strategies/package-lisa-manifest-guards.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,wCAAwC,CACtD,GAA4B,EAC5B,QAAgB;IAEhB,MAAM,KAAK,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,CA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CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PackageJsonPlan } from "./package-lisa-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Make the host's `@codyswann/lisa` pin name the version doing the applying.
|
|
4
|
+
* @remarks
|
|
5
|
+
* An apply writes templates that call into the package's own API, so the
|
|
6
|
+
* applied version and the INSTALLED version are two halves of one thing. When
|
|
7
|
+
* they drift, a config file calls an export the installed package does not have
|
|
8
|
+
* and every run of the tool that loads it dies at config load — while the apply
|
|
9
|
+
* itself reports success, and `postinstall`'s `tsc || true` swallows the only
|
|
10
|
+
* local signal. The failure then surfaces at the next
|
|
11
|
+
* lint run, detached from the apply that caused it (#2953).
|
|
12
|
+
*
|
|
13
|
+
* A range is rewritten as readily as an exact pin, and deliberately so: a caret
|
|
14
|
+
* range ADMITS the applying version without requiring it, so a lockfile still
|
|
15
|
+
* resolving an older build produces exactly the skew this closes.
|
|
16
|
+
*
|
|
17
|
+
* Lisa applying to its own repository never reaches here: that path is
|
|
18
|
+
* restricted to security pins, and a package cannot depend on itself.
|
|
19
|
+
*
|
|
20
|
+
* The consequence, recorded because it was twice discovered rather than read
|
|
21
|
+
* (#3768): Lisa's own manifest DOES carry a `@codyswann/lisa` devDependency —
|
|
22
|
+
* the fixture its templates resolve against — and this phase is the only thing
|
|
23
|
+
* that would keep such a pin current. Skipping it here means **the single
|
|
24
|
+
* repository whose pin no automation will ever correct is the one that ships
|
|
25
|
+
* the automation.** That pin rotted two majors twice, in #2279 and again in
|
|
26
|
+
* #3662, each time found only because somebody read a version string. The
|
|
27
|
+
* reader that replaces them is `scripts/check-self-dependency-pin.mjs`, run as
|
|
28
|
+
* a required CI step; this exemption stays as written, and is now watched.
|
|
29
|
+
* @param packageJson - The manifest as the merge phases left it
|
|
30
|
+
* @param applyingVersion - Version of the Lisa performing this apply
|
|
31
|
+
* @returns The manifest with the pin aligned, plus operator-visible notes
|
|
32
|
+
*/
|
|
33
|
+
export declare function alignLisaPin(packageJson: Record<string, unknown>, applyingVersion: string): PackageJsonPlan;
|
|
34
|
+
//# sourceMappingURL=package-lisa-pin-alignment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-pin-alignment.d.ts","sourceRoot":"","sources":["../../src/strategies/package-lisa-pin-alignment.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAmD/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,eAAe,EAAE,MAAM,GACtB,eAAe,CA4BjB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file package-lisa-pin-alignment.ts
|
|
3
|
+
* @description Phase 5 of the package-lisa apply: make the host's
|
|
4
|
+
* `@codyswann/lisa` pin name the version performing the apply.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
import { asRecord } from "../core/override-floors.js";
|
|
8
|
+
import { LISA_PACKAGE_NAME } from "../core/self-apply.js";
|
|
9
|
+
/**
|
|
10
|
+
* Dependency sections a host may declare `@codyswann/lisa` in, most-specific
|
|
11
|
+
* first: a runtime dependency is the unusual choice, so finding one there means
|
|
12
|
+
* the host meant it.
|
|
13
|
+
*/
|
|
14
|
+
const LISA_PIN_SECTIONS = ["dependencies", "devDependencies"];
|
|
15
|
+
/** Where a pin goes on a host that does not have one yet. */
|
|
16
|
+
const DEFAULT_LISA_PIN_SECTION = "devDependencies";
|
|
17
|
+
/**
|
|
18
|
+
* Specs that name a LOCATION rather than a registry version.
|
|
19
|
+
* @remarks
|
|
20
|
+
* `file:` / `link:` / `portal:` / `workspace:` and the git forms all mean
|
|
21
|
+
* somebody is developing against a checkout instead of a release. Replacing one
|
|
22
|
+
* with a version number breaks that setup, so the apply reports the skew rather
|
|
23
|
+
* than resolving it — which is the branch the second acceptance scenario is
|
|
24
|
+
* about.
|
|
25
|
+
*/
|
|
26
|
+
const NON_REGISTRY_SPEC = /^(?:file|link|portal|workspace|git|git\+[a-z]+|github|https?|npm):/i;
|
|
27
|
+
/**
|
|
28
|
+
* Does this spec point at a location rather than name a registry version?
|
|
29
|
+
* @param spec - The version spec the host declared
|
|
30
|
+
* @returns True when the spec resolves outside the registry
|
|
31
|
+
*/
|
|
32
|
+
function isNonRegistrySpec(spec) {
|
|
33
|
+
return NON_REGISTRY_SPEC.test(spec);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Where the host declares its Lisa pin, and what it currently says.
|
|
37
|
+
* @param packageJson - The manifest as the merge phases left it
|
|
38
|
+
* @returns The section to write into and the spec already there, if any
|
|
39
|
+
*/
|
|
40
|
+
function locateLisaPin(packageJson) {
|
|
41
|
+
const declared = LISA_PIN_SECTIONS.map(section => ({
|
|
42
|
+
section,
|
|
43
|
+
current: asRecord(packageJson[section])[LISA_PACKAGE_NAME],
|
|
44
|
+
})).find(found => typeof found.current === "string");
|
|
45
|
+
return declared === undefined
|
|
46
|
+
? { section: DEFAULT_LISA_PIN_SECTION, current: undefined }
|
|
47
|
+
: { section: declared.section, current: declared.current };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Make the host's `@codyswann/lisa` pin name the version doing the applying.
|
|
51
|
+
* @remarks
|
|
52
|
+
* An apply writes templates that call into the package's own API, so the
|
|
53
|
+
* applied version and the INSTALLED version are two halves of one thing. When
|
|
54
|
+
* they drift, a config file calls an export the installed package does not have
|
|
55
|
+
* and every run of the tool that loads it dies at config load — while the apply
|
|
56
|
+
* itself reports success, and `postinstall`'s `tsc || true` swallows the only
|
|
57
|
+
* local signal. The failure then surfaces at the next
|
|
58
|
+
* lint run, detached from the apply that caused it (#2953).
|
|
59
|
+
*
|
|
60
|
+
* A range is rewritten as readily as an exact pin, and deliberately so: a caret
|
|
61
|
+
* range ADMITS the applying version without requiring it, so a lockfile still
|
|
62
|
+
* resolving an older build produces exactly the skew this closes.
|
|
63
|
+
*
|
|
64
|
+
* Lisa applying to its own repository never reaches here: that path is
|
|
65
|
+
* restricted to security pins, and a package cannot depend on itself.
|
|
66
|
+
*
|
|
67
|
+
* The consequence, recorded because it was twice discovered rather than read
|
|
68
|
+
* (#3768): Lisa's own manifest DOES carry a `@codyswann/lisa` devDependency —
|
|
69
|
+
* the fixture its templates resolve against — and this phase is the only thing
|
|
70
|
+
* that would keep such a pin current. Skipping it here means **the single
|
|
71
|
+
* repository whose pin no automation will ever correct is the one that ships
|
|
72
|
+
* the automation.** That pin rotted two majors twice, in #2279 and again in
|
|
73
|
+
* #3662, each time found only because somebody read a version string. The
|
|
74
|
+
* reader that replaces them is `scripts/check-self-dependency-pin.mjs`, run as
|
|
75
|
+
* a required CI step; this exemption stays as written, and is now watched.
|
|
76
|
+
* @param packageJson - The manifest as the merge phases left it
|
|
77
|
+
* @param applyingVersion - Version of the Lisa performing this apply
|
|
78
|
+
* @returns The manifest with the pin aligned, plus operator-visible notes
|
|
79
|
+
*/
|
|
80
|
+
export function alignLisaPin(packageJson, applyingVersion) {
|
|
81
|
+
const { section, current } = locateLisaPin(packageJson);
|
|
82
|
+
if (current === applyingVersion)
|
|
83
|
+
return { packageJson, notes: [] };
|
|
84
|
+
if (current !== undefined && isNonRegistrySpec(current)) {
|
|
85
|
+
return {
|
|
86
|
+
packageJson,
|
|
87
|
+
notes: [
|
|
88
|
+
`Left ${LISA_PACKAGE_NAME} at "${current}", which points at a local copy rather than a release, but this apply is ${applyingVersion}. If that copy is older, the files just written may call something it does not have and every lint run will fail before it checks anything.`,
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const note = current === undefined
|
|
93
|
+
? `Added ${LISA_PACKAGE_NAME} ${applyingVersion} to ${section}. The files this apply just wrote come from ${applyingVersion} and call into it, so install it before your next lint run.`
|
|
94
|
+
: `Pinned ${LISA_PACKAGE_NAME} to ${applyingVersion}; it was ${current}. The files this apply just wrote come from ${applyingVersion} and call into it, so the two have to be the same version — install it before your next lint run.`;
|
|
95
|
+
return {
|
|
96
|
+
packageJson: {
|
|
97
|
+
...packageJson,
|
|
98
|
+
[section]: {
|
|
99
|
+
...asRecord(packageJson[section]),
|
|
100
|
+
[LISA_PACKAGE_NAME]: applyingVersion,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
notes: [note],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=package-lisa-pin-alignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-pin-alignment.js","sourceRoot":"","sources":["../../src/strategies/package-lisa-pin-alignment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,cAAc,EAAE,iBAAiB,CAAU,CAAC;AAEvE,6DAA6D;AAC7D,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,iBAAiB,GACrB,qEAAqE,CAAC;AAExE;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,WAAoC;IAIzD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjD,OAAO;QACP,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC;KAC3D,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,KAAK,CAAC,OAAO,KAAK,QAA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js";
|
|
2
|
+
/**
|
|
3
|
+
* Report what an apply did to the host's scripts, and what it left inert.
|
|
4
|
+
* @remarks
|
|
5
|
+
* The defect this answers was invisible rather than wrong-looking. One script
|
|
6
|
+
* value changed inside a `package.json` diff dominated by key reordering, and
|
|
7
|
+
* nothing said so, so five chained CI gates became dead code while the Lint
|
|
8
|
+
* check kept reporting green.
|
|
9
|
+
*
|
|
10
|
+
* Every key of the host's `scripts` is walked. Deliberately not a curated list
|
|
11
|
+
* of interesting names: the review that nearly shipped this defect compared a
|
|
12
|
+
* GUESSED subset and concluded "ordering only". A subset is not a method.
|
|
13
|
+
* @param projectJson - The host manifest as it was before the apply
|
|
14
|
+
* @param packageJson - The manifest the apply is about to write
|
|
15
|
+
* @param template - Resolved template, for the reserved-base pairing
|
|
16
|
+
* @returns Operator-readable lines, empty when nothing was lost
|
|
17
|
+
*/
|
|
18
|
+
export declare function describeScriptChanges(projectJson: Record<string, unknown>, packageJson: Record<string, unknown>, template: ResolvedPackageLisaTemplate): readonly string[];
|
|
19
|
+
//# sourceMappingURL=package-lisa-script-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-script-notes.d.ts","sourceRoot":"","sources":["../../src/strategies/package-lisa-script-notes.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AA6B3E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,QAAQ,EAAE,2BAA2B,GACpC,SAAS,MAAM,EAAE,CAQnB"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file package-lisa-script-notes.ts
|
|
3
|
+
* @description Phase 6 of the package-lisa apply: operator notes naming every
|
|
4
|
+
* host script the apply replaced or removed, and every Lisa gate nothing runs.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
import { asRecord } from "../core/override-floors.js";
|
|
8
|
+
/** The package.json section whose overwrites are reported to the operator. */
|
|
9
|
+
const SCRIPTS_SECTION = "scripts";
|
|
10
|
+
/**
|
|
11
|
+
* Suffix naming the Lisa-owned half of a split script.
|
|
12
|
+
*
|
|
13
|
+
* A governed gate is shipped as a PAIR: `lint:lisa` carries Lisa's own command
|
|
14
|
+
* and stays in `force`, so a host can neither delete nor weaken it; `lint` is
|
|
15
|
+
* only a `defaults` entry invoking it, so the host owns the composition point
|
|
16
|
+
* and anything chained onto it survives every apply.
|
|
17
|
+
*/
|
|
18
|
+
const RESERVED_BASE_SUFFIX = ":lisa";
|
|
19
|
+
/** How much of a script value an operator note quotes before eliding. */
|
|
20
|
+
const NOTE_VALUE_BUDGET = 140;
|
|
21
|
+
/**
|
|
22
|
+
* Quote a script value for an operator note without flooding the terminal.
|
|
23
|
+
* @param value - The script value being quoted
|
|
24
|
+
* @returns The value, elided past the note budget
|
|
25
|
+
*/
|
|
26
|
+
function quoteScript(value) {
|
|
27
|
+
return value.length <= NOTE_VALUE_BUDGET
|
|
28
|
+
? `"${value}"`
|
|
29
|
+
: `"${value.slice(0, NOTE_VALUE_BUDGET)}…"`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Report what an apply did to the host's scripts, and what it left inert.
|
|
33
|
+
* @remarks
|
|
34
|
+
* The defect this answers was invisible rather than wrong-looking. One script
|
|
35
|
+
* value changed inside a `package.json` diff dominated by key reordering, and
|
|
36
|
+
* nothing said so, so five chained CI gates became dead code while the Lint
|
|
37
|
+
* check kept reporting green.
|
|
38
|
+
*
|
|
39
|
+
* Every key of the host's `scripts` is walked. Deliberately not a curated list
|
|
40
|
+
* of interesting names: the review that nearly shipped this defect compared a
|
|
41
|
+
* GUESSED subset and concluded "ordering only". A subset is not a method.
|
|
42
|
+
* @param projectJson - The host manifest as it was before the apply
|
|
43
|
+
* @param packageJson - The manifest the apply is about to write
|
|
44
|
+
* @param template - Resolved template, for the reserved-base pairing
|
|
45
|
+
* @returns Operator-readable lines, empty when nothing was lost
|
|
46
|
+
*/
|
|
47
|
+
export function describeScriptChanges(projectJson, packageJson, template) {
|
|
48
|
+
const before = asRecord(projectJson[SCRIPTS_SECTION]);
|
|
49
|
+
const after = asRecord(packageJson[SCRIPTS_SECTION]);
|
|
50
|
+
const adopted = asRecord(template.adopt[SCRIPTS_SECTION]);
|
|
51
|
+
return [
|
|
52
|
+
...describeOverwrittenScripts(before, after, adopted),
|
|
53
|
+
...describeUnrunGates(after, template),
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Was this host value one Lisa itself wrote into that key?
|
|
58
|
+
* @param adopted - The resolved adopt list for the scripts section
|
|
59
|
+
* @param name - Script name being reported on
|
|
60
|
+
* @param hostValue - The value the host carried before the apply
|
|
61
|
+
* @returns True when the value is Lisa's own rather than the host's work
|
|
62
|
+
*/
|
|
63
|
+
function isLisaAuthored(adopted, name, hostValue) {
|
|
64
|
+
const recognised = adopted[name];
|
|
65
|
+
return Array.isArray(recognised) && recognised.includes(hostValue);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Name every host script value this apply replaced or deleted.
|
|
69
|
+
* @remarks
|
|
70
|
+
* A value on the `adopt` list is Lisa's own, so replacing it discards nothing
|
|
71
|
+
* of the host's and must not be reported as a loss. That is not cosmetic: the
|
|
72
|
+
* split hands six gate names back at once, so loss-shaped wording there puts
|
|
73
|
+
* six false alarms in front of every operator on their first upgrade and a
|
|
74
|
+
* REAL loss stops standing out — the precise failure this change exists to
|
|
75
|
+
* end. Those keys get a handover line instead, because the operator does need
|
|
76
|
+
* to learn that the composition point is now theirs to extend.
|
|
77
|
+
* @param before - The host's scripts before the apply
|
|
78
|
+
* @param after - The scripts the apply is about to write
|
|
79
|
+
* @param adopted - Resolved adopt list, naming the values Lisa authored
|
|
80
|
+
* @returns One line per script whose host value did not survive
|
|
81
|
+
*/
|
|
82
|
+
function describeOverwrittenScripts(before, after, adopted) {
|
|
83
|
+
return Object.entries(before).flatMap(([name, hostValue]) => {
|
|
84
|
+
if (typeof hostValue !== "string")
|
|
85
|
+
return [];
|
|
86
|
+
const applied = after[name];
|
|
87
|
+
if (applied === hostValue)
|
|
88
|
+
return [];
|
|
89
|
+
if (applied === undefined) {
|
|
90
|
+
return [
|
|
91
|
+
`Removed scripts.${name}; it ran ${quoteScript(hostValue)}. Nothing in your project runs that any more.`,
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
if (typeof applied !== "string")
|
|
95
|
+
return [];
|
|
96
|
+
const base = `${name}${RESERVED_BASE_SUFFIX}`;
|
|
97
|
+
// The handover wording names the reserved base, so it is only truthful
|
|
98
|
+
// when the value being written actually invokes one.
|
|
99
|
+
if (isLisaAuthored(adopted, name, hostValue) && applied.includes(base)) {
|
|
100
|
+
return [
|
|
101
|
+
`Moved Lisa's ${name} checks into scripts.${base}; scripts.${name} now calls it, so anything you add there survives the next apply.`,
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
return [
|
|
105
|
+
`Replaced scripts.${name}: it ran ${quoteScript(hostValue)} and now runs ${quoteScript(applied)}.`,
|
|
106
|
+
];
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Name every Lisa gate the host's own composition point does not run.
|
|
111
|
+
* @remarks
|
|
112
|
+
* `lint:lisa` being force-installed proves the gate EXISTS; it proves nothing
|
|
113
|
+
* about whether anything invokes it, and CI invokes `lint`. A host is free to
|
|
114
|
+
* decline a gate, but declining it silently is the failure mode this whole
|
|
115
|
+
* change is about, so the apply says which gate went unrun.
|
|
116
|
+
*
|
|
117
|
+
* A composition point that inlines Lisa's current base verbatim — the shape
|
|
118
|
+
* every host was left in before the split existed — does run the gate, so it is
|
|
119
|
+
* not warned about. It is nudged instead: an inlined copy stops tracking the
|
|
120
|
+
* template the next time the base changes.
|
|
121
|
+
* @param after - The scripts the apply is about to write
|
|
122
|
+
* @param template - Resolved template carrying the forced reserved bases
|
|
123
|
+
* @returns One line per gate nothing invokes, plus migration nudges
|
|
124
|
+
*/
|
|
125
|
+
function describeUnrunGates(after, template) {
|
|
126
|
+
const forcedScripts = asRecord(asRecord(template.force)[SCRIPTS_SECTION]);
|
|
127
|
+
return Object.keys(forcedScripts).flatMap(base => {
|
|
128
|
+
if (!base.endsWith(RESERVED_BASE_SUFFIX))
|
|
129
|
+
return [];
|
|
130
|
+
const composed = base.slice(0, -RESERVED_BASE_SUFFIX.length);
|
|
131
|
+
const hostValue = after[composed];
|
|
132
|
+
if (typeof hostValue !== "string" || hostValue.includes(base))
|
|
133
|
+
return [];
|
|
134
|
+
const baseValue = forcedScripts[base];
|
|
135
|
+
if (typeof baseValue === "string" && hostValue.includes(baseValue)) {
|
|
136
|
+
return [
|
|
137
|
+
`Kept your scripts.${composed}. It spells out Lisa's ${composed} checks instead of calling ${base}, so it will not pick up changes to them; run ${base} from it to stay current.`,
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
return [
|
|
141
|
+
`Kept your scripts.${composed}, but nothing invokes ${base}, so Lisa's ${composed} checks do not run. Add ${base} to scripts.${composed} to turn them back on.`,
|
|
142
|
+
];
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=package-lisa-script-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-script-notes.js","sourceRoot":"","sources":["../../src/strategies/package-lisa-script-notes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGtD,8EAA8E;AAC9E,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAErC,yEAAyE;AACzE,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9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