@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,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file lisa-deletions.ts
|
|
3
|
+
* @description Manifest-driven deletions, gated by ownership and announced to the operator. One layer of the `Lisa` orchestrator; each layer
|
|
4
|
+
* extends the one below it so the apply pipeline reads as one class while no
|
|
5
|
+
* single module carries the whole pipeline.
|
|
6
|
+
* @module core
|
|
7
|
+
*/
|
|
8
|
+
import * as fse from "fs-extra";
|
|
9
|
+
import { readFile } from "node:fs/promises";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
import { basisAuthorisesDeletion, resolveDeletionBasis, } from "./deletion-basis.js";
|
|
12
|
+
import { findLocalWorkflowReferences } from "./workflow-reference-guard.js";
|
|
13
|
+
import { findHostReferences, isShippedVersion, readRegularFile, retiredDigests, stillProved, } from "./retire-unmodified.js";
|
|
14
|
+
import { classifyWorkflowForDeletion, describeRefusal, isWorkflowDeletionPath, } from "./workflow-deletion-ownership.js";
|
|
15
|
+
import { LisaTemplates } from "./lisa-templates.js";
|
|
16
|
+
/**
|
|
17
|
+
* Manifest-driven deletions, gated by ownership and announced to the operator.
|
|
18
|
+
*/
|
|
19
|
+
export class LisaDeletions extends LisaTemplates {
|
|
20
|
+
/**
|
|
21
|
+
* Pre-compute the set of paths marked for deletion across "all" and every
|
|
22
|
+
* detected project type. This runs before strategy processing so the copy
|
|
23
|
+
* strategies can skip creating files that are about to be deleted anyway.
|
|
24
|
+
*
|
|
25
|
+
* Motivating case: CDK inherits typescript/create-only, which ships
|
|
26
|
+
* `jest.thresholds.json`. CDK's own `deletions.json` then removes it.
|
|
27
|
+
* Without this gate, Lisa would create it and delete it in the same apply,
|
|
28
|
+
* which causes ENOENT errors for any concurrent file-watcher/linter that
|
|
29
|
+
* observed the briefly-existing file.
|
|
30
|
+
*
|
|
31
|
+
* The `keep` list in a deletions.json (e.g., expo keeps
|
|
32
|
+
* `zap-baseline-expo.yml`) is honored — paths in `keep` are not treated as
|
|
33
|
+
* pending-deletions, so they will still be created by upstream strategies.
|
|
34
|
+
* @returns Promise that resolves once pending deletions have been collected
|
|
35
|
+
*/
|
|
36
|
+
async loadPendingDeletions() {
|
|
37
|
+
const pending = new Set();
|
|
38
|
+
for (const type of ["all", ...this.detectedTypes]) {
|
|
39
|
+
const paths = await this.readPendingDeletionsForType(type);
|
|
40
|
+
for (const p of paths) {
|
|
41
|
+
pending.add(path.normalize(p));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
this.pendingDeletions = pending;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read the set of paths a single type's deletions.json will delete,
|
|
48
|
+
* filtered by the type's `keep` list. Returns an empty array when the file
|
|
49
|
+
* is missing or malformed — a bad file cannot block strategy processing;
|
|
50
|
+
* any validation errors are surfaced later by processDeletions itself.
|
|
51
|
+
* @param type - Project type (e.g., "all", "cdk", "typescript")
|
|
52
|
+
* @returns Array of relative paths marked for deletion
|
|
53
|
+
*/
|
|
54
|
+
async readPendingDeletionsForType(type) {
|
|
55
|
+
const deletionsPath = path.join(this.config.lisaDir, type, "deletions.json");
|
|
56
|
+
if (!(await fse.pathExists(deletionsPath))) {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const content = await readFile(deletionsPath, "utf-8");
|
|
61
|
+
const deletions = JSON.parse(content);
|
|
62
|
+
if (!Array.isArray(deletions.paths)) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
const keepSet = new Set(deletions.keep ?? []);
|
|
66
|
+
return deletions.paths.filter(p => !keepSet.has(p));
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Process deletions from deletions.json files
|
|
74
|
+
*/
|
|
75
|
+
async processDeletions() {
|
|
76
|
+
const { logger } = this.deps;
|
|
77
|
+
// Process deletions for "all" and each detected type
|
|
78
|
+
const typesToProcess = ["all", ...this.detectedTypes];
|
|
79
|
+
for (const type of typesToProcess) {
|
|
80
|
+
const deletionsPath = path.join(this.config.lisaDir, type, "deletions.json");
|
|
81
|
+
if (await fse.pathExists(deletionsPath)) {
|
|
82
|
+
logger.info(`Processing deletions for ${type}...`);
|
|
83
|
+
await this.processDeletionsFile(deletionsPath);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Process a single deletions.json file
|
|
89
|
+
* @param deletionsPath - Path to the deletions.json file
|
|
90
|
+
*/
|
|
91
|
+
async processDeletionsFile(deletionsPath) {
|
|
92
|
+
const { logger } = this.deps;
|
|
93
|
+
try {
|
|
94
|
+
const content = await readFile(deletionsPath, "utf-8");
|
|
95
|
+
const deletions = JSON.parse(content);
|
|
96
|
+
if (!Array.isArray(deletions.paths)) {
|
|
97
|
+
logger.warn(`Invalid deletions.json format: paths must be an array`);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const keepSet = new Set(deletions.keep ?? []);
|
|
101
|
+
for (const relativePath of deletions.paths) {
|
|
102
|
+
if (keepSet.has(relativePath)) {
|
|
103
|
+
logger.info(`Kept (protected): ${relativePath}`);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
// "I cannot tell" is a THIRD answer, and it has to be, or the uncertain
|
|
107
|
+
// case gets silently resolved as one of the other two. A manifest that
|
|
108
|
+
// does not say why a path may go does not authorise removing it: the
|
|
109
|
+
// cheap error is keeping a file, because a path wrongly kept is visible
|
|
110
|
+
// and fixable while a path wrongly deleted is gone from someone else's
|
|
111
|
+
// repository with no undo (CodySwannGT/lisa#3700).
|
|
112
|
+
//
|
|
113
|
+
// This is the runtime fail-safe, and it is deliberately not the same
|
|
114
|
+
// mechanism as the authoring check. That one refuses an unclassified
|
|
115
|
+
// entry at commit time; this one protects a consumer whatever manifest
|
|
116
|
+
// they happen to have, including one authored before either existed.
|
|
117
|
+
const basis = resolveDeletionBasis(deletions, relativePath);
|
|
118
|
+
if (!basisAuthorisesDeletion(basis)) {
|
|
119
|
+
const notice = `Kept (no declared basis): ${relativePath} — the manifest lists this path but does not say why it may be removed, so it was not.`;
|
|
120
|
+
logger.warn(notice);
|
|
121
|
+
// Recorded, not merely logged. This is the fail-closed branch, and on
|
|
122
|
+
// the install path a branch whose only account of itself goes to a
|
|
123
|
+
// hidden stream is indistinguishable from one that never ran
|
|
124
|
+
// (CodySwannGT/lisa#4071).
|
|
125
|
+
this.deletionNotices.push(notice);
|
|
126
|
+
this.counters.skipped++;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
await this.processSingleDeletion(relativePath, deletions.force?.[relativePath], retiredDigests(deletions, relativePath));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
134
|
+
logger.warn(`Failed to process deletions file: ${message}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Process a single deletion path
|
|
139
|
+
* @param relativePath - Relative path to delete
|
|
140
|
+
* @param forcedReason - Why this removal overrides the workflow ownership gate, when it does
|
|
141
|
+
* @param shipped - Digests of every version Lisa shipped, when the manifest retires this path only while unmodified
|
|
142
|
+
*/
|
|
143
|
+
async processSingleDeletion(relativePath, forcedReason, shipped = null) {
|
|
144
|
+
const { logger } = this.deps;
|
|
145
|
+
const normalizedRelativePath = path.normalize(relativePath);
|
|
146
|
+
if (this.projectLearningsTemplateRegistered &&
|
|
147
|
+
normalizedRelativePath === this.projectLearningsFile) {
|
|
148
|
+
logger.info(`Kept (host-owned project learnings): ${relativePath}`);
|
|
149
|
+
this.counters.skipped++;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const targetPath = path.join(this.config.destDir, relativePath);
|
|
153
|
+
const resolvedTarget = path.resolve(targetPath);
|
|
154
|
+
const resolvedDest = path.resolve(this.config.destDir);
|
|
155
|
+
// Explicit guard: disallow deleting the project root itself
|
|
156
|
+
if (resolvedTarget === resolvedDest) {
|
|
157
|
+
logger.warn(`Skipping deletion of project root directory: ${relativePath || "."}`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Safety check: only allow paths strictly inside destDir
|
|
161
|
+
if (!resolvedTarget.startsWith(resolvedDest + path.sep)) {
|
|
162
|
+
logger.warn(`Skipping deletion outside project directory: ${relativePath}`);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (this.ignorePatterns.shouldIgnore(relativePath)) {
|
|
166
|
+
logger.info(`Kept ${this.lisaignoreSuffix}: ${relativePath}`);
|
|
167
|
+
this.counters.ignored++;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (!(await fse.pathExists(targetPath))) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const referencing = await findLocalWorkflowReferences(this.config.destDir, relativePath);
|
|
174
|
+
if (referencing.length > 0) {
|
|
175
|
+
logger.warn(`Kept (still called locally by ${referencing.join(", ")}): ${relativePath}`);
|
|
176
|
+
this.counters.skipped++;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
await this.deleteIfOwned(targetPath, relativePath, forcedReason, shipped);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Apply the ownership proof a deletion needs, then delete.
|
|
183
|
+
*
|
|
184
|
+
* A path the manifest retires only while unmodified is proved by its bytes
|
|
185
|
+
* (`mayRetireUnmodified`); every other path keeps the workflow ownership
|
|
186
|
+
* gate. A `force` reason outranks both, as it always has.
|
|
187
|
+
* @param targetPath - Absolute path to remove
|
|
188
|
+
* @param relativePath - Repo-relative path, as the manifest spelled it
|
|
189
|
+
* @param forcedReason - Why this removal overrides the ownership gate, when it does
|
|
190
|
+
* @param shipped - Digests of every version Lisa shipped, when retired only while unmodified
|
|
191
|
+
*/
|
|
192
|
+
async deleteIfOwned(targetPath, relativePath, forcedReason, shipped) {
|
|
193
|
+
const retiring = forcedReason === undefined && shipped !== null;
|
|
194
|
+
const allowed = retiring
|
|
195
|
+
? await this.mayRetireUnmodified(targetPath, relativePath, shipped)
|
|
196
|
+
: await this.mayDeleteWorkflow(targetPath, relativePath, forcedReason);
|
|
197
|
+
if (!allowed)
|
|
198
|
+
return;
|
|
199
|
+
await this.performDeletion(targetPath, relativePath, retiring ? "an unedited copy of a file Lisa retired" : forcedReason);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Decide whether a path the manifest retires only while unmodified may go.
|
|
203
|
+
*
|
|
204
|
+
* The proof is the file's own bytes: a copy equal to a version Lisa shipped
|
|
205
|
+
* holds nothing of the consumer's, whatever ownership header it carries —
|
|
206
|
+
* see `core/retire-unmodified`. That proof stands in for the workflow
|
|
207
|
+
* ownership gate, which would otherwise refuse every create-only seed. It
|
|
208
|
+
* does not stand in for "nothing calls it", so a path the consumer's own
|
|
209
|
+
* scripts or workflows still name is kept too.
|
|
210
|
+
*
|
|
211
|
+
* Every refusal is recorded as a notice, because a retired file left in
|
|
212
|
+
* place is the consumer's to remove and they can only do that if told.
|
|
213
|
+
* @param targetPath - Absolute path of the file on disk
|
|
214
|
+
* @param relativePath - Repo-relative path the manifest named
|
|
215
|
+
* @param shipped - Digests of every version Lisa shipped at this path
|
|
216
|
+
* @returns Whether the deletion may proceed
|
|
217
|
+
*/
|
|
218
|
+
async mayRetireUnmodified(targetPath, relativePath, shipped) {
|
|
219
|
+
const keep = (reason) => {
|
|
220
|
+
const notice = `Kept ${relativePath} — ${reason}`;
|
|
221
|
+
this.deps.logger.warn(notice);
|
|
222
|
+
this.deletionNotices.push(notice);
|
|
223
|
+
this.counters.skipped++;
|
|
224
|
+
return false;
|
|
225
|
+
};
|
|
226
|
+
const proof = await readRegularFile(targetPath);
|
|
227
|
+
if (proof === null) {
|
|
228
|
+
return keep("Lisa retired this path, but it is not a readable file here, so Lisa cannot prove it is the copy Lisa shipped. Remove it yourself if you no longer use it.");
|
|
229
|
+
}
|
|
230
|
+
if (!isShippedVersion(proof.bytes, shipped)) {
|
|
231
|
+
return keep("Lisa retired this file, but your copy differs from every version Lisa shipped, so it may hold your changes. Delete it yourself once you no longer need it.");
|
|
232
|
+
}
|
|
233
|
+
const references = await findHostReferences(this.config.destDir, relativePath);
|
|
234
|
+
if (references === null) {
|
|
235
|
+
return keep("Lisa retired this file, but could not read your package.json or workflows to check that nothing still uses it. Delete it yourself once you have checked.");
|
|
236
|
+
}
|
|
237
|
+
if (references.length > 0) {
|
|
238
|
+
return keep(`Lisa retired this file, but ${references.join(", ")} still names it. Remove that reference, then delete the file.`);
|
|
239
|
+
}
|
|
240
|
+
// The proof is re-checked last, immediately before removal: a file
|
|
241
|
+
// replaced or edited while references were read is not the one proved.
|
|
242
|
+
if (!(await stillProved(targetPath, proof))) {
|
|
243
|
+
return keep("Lisa retired this file, but it changed while Lisa was checking it, so it was left in place. Re-run lisa apply, or delete it yourself.");
|
|
244
|
+
}
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Remove a path every guard has cleared, and say so.
|
|
249
|
+
*
|
|
250
|
+
* The announcement is not incidental to the removal — under
|
|
251
|
+
* CodySwannGT/lisa#3656 it is half the fix, so it is emitted on the same
|
|
252
|
+
* statement path that does the deleting and cannot be skipped while the
|
|
253
|
+
* removal still happens.
|
|
254
|
+
* @param targetPath - Absolute path to remove
|
|
255
|
+
* @param relativePath - Repo-relative path, as the manifest spelled it
|
|
256
|
+
* @param forcedReason - Why this removal overrode the ownership gate, when it did
|
|
257
|
+
*/
|
|
258
|
+
async performDeletion(targetPath, relativePath, forcedReason) {
|
|
259
|
+
const { logger } = this.deps;
|
|
260
|
+
const verb = this.config.dryRun ? "Would delete" : "Deleted";
|
|
261
|
+
const because = forcedReason === undefined ? "" : ` — ${forcedReason}`;
|
|
262
|
+
const notice = `${verb}: ${relativePath}${because}`;
|
|
263
|
+
if (this.config.dryRun) {
|
|
264
|
+
logger.dry(notice);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
await fse.remove(targetPath);
|
|
268
|
+
logger.success(notice);
|
|
269
|
+
}
|
|
270
|
+
this.counters.deleted++;
|
|
271
|
+
this.deletionNotices.push(notice);
|
|
272
|
+
this.deletedPaths.push(relativePath);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Decide whether a `.github/workflows/` deletion target is Lisa's to remove.
|
|
276
|
+
*
|
|
277
|
+
* A deletions manifest names paths, never bytes, so on its own it cannot tell
|
|
278
|
+
* a retired Lisa workflow from an unrelated file a consumer authored at the
|
|
279
|
+
* same path. The file's own ownership header can, and every workflow Lisa
|
|
280
|
+
* ships carries one — see `core/workflow-deletion-ownership` for why that
|
|
281
|
+
* header is the signal and the hash ledger is not.
|
|
282
|
+
*
|
|
283
|
+
* Unreadable is treated as unattributable rather than as an error: a
|
|
284
|
+
* directory, a permissions failure, or bytes that are not text all mean Lisa
|
|
285
|
+
* has no proof, and the safe response to no proof is to leave it alone.
|
|
286
|
+
*
|
|
287
|
+
* A manifest may override the gate per path by giving a reason in its
|
|
288
|
+
* `force` map. That exists because two workflow removals already shipped on
|
|
289
|
+
* owner rulings against files that were actively harmful (#3590, #3599), and
|
|
290
|
+
* those have to reach an edited copy too. The override does not buy silence:
|
|
291
|
+
* a forced removal is announced with its reason attached, which is more than
|
|
292
|
+
* the unforced path used to manage.
|
|
293
|
+
* @param targetPath - Absolute path of the file on disk
|
|
294
|
+
* @param relativePath - Repo-relative path the manifest named
|
|
295
|
+
* @param forcedReason - Why this removal overrides the gate, when it does
|
|
296
|
+
* @returns Whether the deletion may proceed
|
|
297
|
+
*/
|
|
298
|
+
async mayDeleteWorkflow(targetPath, relativePath, forcedReason) {
|
|
299
|
+
if (!isWorkflowDeletionPath(relativePath) || forcedReason !== undefined) {
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
const contents = await this.tryReadFile(targetPath);
|
|
303
|
+
const verdict = contents === null
|
|
304
|
+
? { kind: "unattributable" }
|
|
305
|
+
: classifyWorkflowForDeletion(contents);
|
|
306
|
+
if (verdict.kind === "lisa-managed") {
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
const notice = `Kept ${relativePath} — ${describeRefusal(verdict)}.`;
|
|
310
|
+
this.deps.logger.warn(notice);
|
|
311
|
+
this.deletionNotices.push(notice);
|
|
312
|
+
this.counters.skipped++;
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
//# sourceMappingURL=lisa-deletions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lisa-deletions.js","sourceRoot":"","sources":["../../src/core/lisa-deletions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,aAAa,E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,2BAA2B,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,QAAQ,YAAY,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;QACrE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file lisa-file-results.ts
|
|
3
|
+
* @description Counting and reporting the outcome of each template file operation. One layer of the `Lisa` orchestrator; each layer
|
|
4
|
+
* extends the one below it so the apply pipeline reads as one class while no
|
|
5
|
+
* single module carries the whole pipeline.
|
|
6
|
+
* @module core
|
|
7
|
+
*/
|
|
8
|
+
import type { FileOperationResult } from "./config.js";
|
|
9
|
+
import { LisaSummary } from "./lisa-summary.js";
|
|
10
|
+
/**
|
|
11
|
+
* Counting and reporting the outcome of each template file operation.
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class LisaFileResults extends LisaSummary {
|
|
14
|
+
/**
|
|
15
|
+
* Update counters based on operation result
|
|
16
|
+
* @param result Operation result to count
|
|
17
|
+
*/
|
|
18
|
+
protected updateCounters(result: FileOperationResult): void;
|
|
19
|
+
/**
|
|
20
|
+
* Log a message using appropriate logger method
|
|
21
|
+
* @param dryMsg Message for dry run mode
|
|
22
|
+
* @param successMsg Message for success mode
|
|
23
|
+
*/
|
|
24
|
+
protected logMessage(dryMsg: string, successMsg: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Log operation result
|
|
27
|
+
* @param result Result to log
|
|
28
|
+
*/
|
|
29
|
+
protected logResult(result: FileOperationResult): void;
|
|
30
|
+
/**
|
|
31
|
+
* Log an optional operation note.
|
|
32
|
+
* @param result Operation result that may carry an operator-readable note
|
|
33
|
+
*/
|
|
34
|
+
protected logNote(result: FileOperationResult): void;
|
|
35
|
+
/**
|
|
36
|
+
* Emit a "would skip"/"skipped" log line in a single place so all the skip
|
|
37
|
+
* branches in `shouldProcessFile` stay symmetric.
|
|
38
|
+
* @param dryReason - Reason text for dry-run mode
|
|
39
|
+
* @param relativePath - Path being skipped
|
|
40
|
+
* @param applyMessage - Message to log when not in dry-run mode
|
|
41
|
+
*/
|
|
42
|
+
protected logSkip(dryReason: string, relativePath: string, applyMessage: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Show diff between two files
|
|
45
|
+
* @param sourcePath Source file path
|
|
46
|
+
* @param destPath Destination file path
|
|
47
|
+
*/
|
|
48
|
+
protected showDiff(sourcePath: string, destPath: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Handle overwrite prompt for conflicting files
|
|
51
|
+
* @param relativePath Relative path of the file
|
|
52
|
+
* @param sourcePath Source file path
|
|
53
|
+
* @param destPath Destination file path
|
|
54
|
+
* @returns True if user approves overwrite
|
|
55
|
+
*/
|
|
56
|
+
protected handleOverwritePrompt(relativePath: string, sourcePath: string, destPath: string): Promise<boolean>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=lisa-file-results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lisa-file-results.d.ts","sourceRoot":"","sources":["../../src/core/lisa-file-results.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,8BAAsB,eAAgB,SAAQ,WAAW;IACvD;;;OAGG;IACH,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAsC3D;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAK9D;;;OAGG;IACH,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAyEtD;;;OAGG;IACH,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAMpD;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,CACf,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,IAAI;IASP;;;;OAIG;cACa,QAAQ,CACtB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAahB;;;;;;OAMG;cACa,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC;CAoBpB"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { LisaSummary } from "./lisa-summary.js";
|
|
2
|
+
/**
|
|
3
|
+
* Counting and reporting the outcome of each template file operation.
|
|
4
|
+
*/
|
|
5
|
+
export class LisaFileResults extends LisaSummary {
|
|
6
|
+
/**
|
|
7
|
+
* Update counters based on operation result
|
|
8
|
+
* @param result Operation result to count
|
|
9
|
+
*/
|
|
10
|
+
updateCounters(result) {
|
|
11
|
+
switch (result.action) {
|
|
12
|
+
case "copied":
|
|
13
|
+
case "created":
|
|
14
|
+
this.counters.copied++;
|
|
15
|
+
break;
|
|
16
|
+
case "skipped":
|
|
17
|
+
this.counters.skipped++;
|
|
18
|
+
break;
|
|
19
|
+
case "stale":
|
|
20
|
+
this.counters.stale++;
|
|
21
|
+
this.stalePaths.push(result.relativePath);
|
|
22
|
+
break;
|
|
23
|
+
case "host-ahead":
|
|
24
|
+
this.counters.hostAhead++;
|
|
25
|
+
this.hostAheadNotes.push(result.note ?? `${result.relativePath}: kept your copy.`);
|
|
26
|
+
break;
|
|
27
|
+
case "shadowed":
|
|
28
|
+
this.counters.shadowed++;
|
|
29
|
+
this.shadowedNotes.push(result.note ??
|
|
30
|
+
`${result.relativePath}: not written — it would outrank your own config.`);
|
|
31
|
+
break;
|
|
32
|
+
case "overwritten":
|
|
33
|
+
this.counters.overwritten++;
|
|
34
|
+
break;
|
|
35
|
+
case "appended":
|
|
36
|
+
this.counters.appended++;
|
|
37
|
+
break;
|
|
38
|
+
case "merged":
|
|
39
|
+
this.counters.merged++;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Log a message using appropriate logger method
|
|
45
|
+
* @param dryMsg Message for dry run mode
|
|
46
|
+
* @param successMsg Message for success mode
|
|
47
|
+
*/
|
|
48
|
+
logMessage(dryMsg, successMsg) {
|
|
49
|
+
const { logger } = this.deps;
|
|
50
|
+
this.config.dryRun ? logger.dry(dryMsg) : logger.success(successMsg);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Log operation result
|
|
54
|
+
* @param result Result to log
|
|
55
|
+
*/
|
|
56
|
+
logResult(result) {
|
|
57
|
+
switch (result.action) {
|
|
58
|
+
case "copied":
|
|
59
|
+
this.logMessage(`Would copy: ${result.relativePath}`, `Copied: ${result.relativePath}`);
|
|
60
|
+
this.logNote(result);
|
|
61
|
+
break;
|
|
62
|
+
case "created":
|
|
63
|
+
this.logMessage(`Would create: ${result.relativePath}`, `Created: ${result.relativePath}`);
|
|
64
|
+
break;
|
|
65
|
+
case "skipped":
|
|
66
|
+
// Silent about the file itself — nothing changed, and naming every
|
|
67
|
+
// untouched path would bury the run. But a note attached to a skipped
|
|
68
|
+
// result is not about the write: it is what the apply FOUND, such as a
|
|
69
|
+
// governed gate the project's own script no longer invokes. That
|
|
70
|
+
// condition persists across applies and reaches this branch on every
|
|
71
|
+
// one of them, so dropping it here is how a finding becomes permanently
|
|
72
|
+
// invisible.
|
|
73
|
+
this.logNote(result);
|
|
74
|
+
break;
|
|
75
|
+
case "stale":
|
|
76
|
+
this.deps.logger.warn(this.config.dryRun
|
|
77
|
+
? `Out of date, would not be updated: ${result.relativePath}`
|
|
78
|
+
: `Out of date, not updated: ${result.relativePath}`);
|
|
79
|
+
break;
|
|
80
|
+
case "host-ahead":
|
|
81
|
+
this.deps.logger.warn(this.config.dryRun
|
|
82
|
+
? `Would keep your copy: ${result.relativePath}`
|
|
83
|
+
: `Kept your copy: ${result.relativePath}`);
|
|
84
|
+
break;
|
|
85
|
+
case "shadowed":
|
|
86
|
+
// Warn, not info: the file is absent by design, and an operator who
|
|
87
|
+
// later wonders why the template never arrived needs this line to have
|
|
88
|
+
// been visible at the time.
|
|
89
|
+
this.deps.logger.warn(this.config.dryRun
|
|
90
|
+
? `Would not write, your own config takes precedence: ${result.relativePath}`
|
|
91
|
+
: `Not written, your own config takes precedence: ${result.relativePath}`);
|
|
92
|
+
this.logNote(result);
|
|
93
|
+
break;
|
|
94
|
+
case "overwritten":
|
|
95
|
+
this.logMessage(`Would prompt to overwrite: ${result.relativePath}`, `Overwritten: ${result.relativePath}`);
|
|
96
|
+
break;
|
|
97
|
+
case "appended": {
|
|
98
|
+
const msg = `Appended ${result.linesAdded} lines to: ${result.relativePath}`;
|
|
99
|
+
this.logMessage(`Would ${msg}`, msg);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
case "merged":
|
|
103
|
+
this.logMessage(`Would merge: ${result.relativePath}`, `Merged: ${result.relativePath}`);
|
|
104
|
+
if (result.note !== undefined) {
|
|
105
|
+
this.logNote(result);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Log an optional operation note.
|
|
112
|
+
* @param result Operation result that may carry an operator-readable note
|
|
113
|
+
*/
|
|
114
|
+
logNote(result) {
|
|
115
|
+
if (result.note !== undefined) {
|
|
116
|
+
this.deps.logger.info(result.note);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Emit a "would skip"/"skipped" log line in a single place so all the skip
|
|
121
|
+
* branches in `shouldProcessFile` stay symmetric.
|
|
122
|
+
* @param dryReason - Reason text for dry-run mode
|
|
123
|
+
* @param relativePath - Path being skipped
|
|
124
|
+
* @param applyMessage - Message to log when not in dry-run mode
|
|
125
|
+
*/
|
|
126
|
+
logSkip(dryReason, relativePath, applyMessage) {
|
|
127
|
+
const { logger } = this.deps;
|
|
128
|
+
if (this.config.dryRun) {
|
|
129
|
+
logger.dry(`Would skip (${dryReason}): ${relativePath}`);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
logger.info(`${applyMessage}: ${relativePath}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Show diff between two files
|
|
137
|
+
* @param sourcePath Source file path
|
|
138
|
+
* @param destPath Destination file path
|
|
139
|
+
*/
|
|
140
|
+
async showDiff(sourcePath, destPath) {
|
|
141
|
+
const { spawn } = await import("node:child_process");
|
|
142
|
+
return new Promise(resolve => {
|
|
143
|
+
console.log("--- Differences ---");
|
|
144
|
+
const diff = spawn("diff", [destPath, sourcePath], { stdio: "inherit" });
|
|
145
|
+
diff.on("close", () => {
|
|
146
|
+
console.log("-------------------");
|
|
147
|
+
resolve();
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Handle overwrite prompt for conflicting files
|
|
153
|
+
* @param relativePath Relative path of the file
|
|
154
|
+
* @param sourcePath Source file path
|
|
155
|
+
* @param destPath Destination file path
|
|
156
|
+
* @returns True if user approves overwrite
|
|
157
|
+
*/
|
|
158
|
+
async handleOverwritePrompt(relativePath, sourcePath, destPath) {
|
|
159
|
+
const { logger, prompter } = this.deps;
|
|
160
|
+
const decision = await prompter.promptOverwrite(relativePath);
|
|
161
|
+
if (decision === "diff") {
|
|
162
|
+
// Show diff and re-prompt
|
|
163
|
+
await this.showDiff(sourcePath, destPath);
|
|
164
|
+
return this.handleOverwritePrompt(relativePath, sourcePath, destPath);
|
|
165
|
+
}
|
|
166
|
+
if (decision === "yes") {
|
|
167
|
+
logger.info(`Auto-accepting overwrite (non-interactive): ${relativePath}`);
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=lisa-file-results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lisa-file-results.js","sourceRoot":"","sources":["../../src/core/lisa-file-results.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAgB,eAAgB,SAAQ,WAAW;IACvD;;;OAGG;IACO,cAAc,CAAC,MAA2B;QAClD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS;gBACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACvB,MAAM;YACR,KAAK,SAAS;gBACZ,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACxB,MAAM;YACR,KAAK,OAAO;gBACV,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC1C,MAAM;YACR,KAAK,YAAY;gBACf,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;gBAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CACtB,MAAM,CAAC,IAAI,IAAI,GAAG,MAAM,CAAC,YAAY,mBAAmB,CACzD,CAAC;gBACF,MAAM;YACR,KAAK,UAAU;gBACb,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CACrB,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