@codyswann/lisa 2.341.7 → 2.342.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.
Files changed (84) hide show
  1. package/all/copy-overwrite/scripts/lisa-floor-collisions.mjs +38 -6
  2. package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +44 -13
  3. package/all/create-only/scripts/remote-agent-aws-setup.sh +8 -1
  4. package/dist/cli/apply.d.ts.map +1 -1
  5. package/dist/cli/apply.js +34 -4
  6. package/dist/cli/apply.js.map +1 -1
  7. package/dist/cli/shared-options.d.ts +9 -1
  8. package/dist/cli/shared-options.d.ts.map +1 -1
  9. package/dist/cli/shared-options.js +22 -0
  10. package/dist/cli/shared-options.js.map +1 -1
  11. package/dist/core/config.d.ts +36 -0
  12. package/dist/core/config.d.ts.map +1 -1
  13. package/dist/core/config.js +32 -0
  14. package/dist/core/config.js.map +1 -1
  15. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  16. package/dist/core/upstream-evidence-manifest.js +10 -7
  17. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  18. package/dist/opencode/plugin-templates/parity-safety-net.sh +44 -13
  19. package/dist/strategies/copy-overwrite.d.ts +16 -0
  20. package/dist/strategies/copy-overwrite.d.ts.map +1 -1
  21. package/dist/strategies/copy-overwrite.js +30 -1
  22. package/dist/strategies/copy-overwrite.js.map +1 -1
  23. package/package.json +1 -1
  24. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa/hooks/parity-safety-net.sh +44 -13
  27. package/plugins/lisa/hooks/threshold-ratchet.mjs +39 -5
  28. package/plugins/lisa-agy/hooks/parity-safety-net.sh +44 -13
  29. package/plugins/lisa-agy/plugin.json +1 -1
  30. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  32. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  33. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-copilot/hooks/parity-safety-net.sh +44 -13
  37. package/plugins/lisa-copilot/hooks/threshold-ratchet.mjs +39 -5
  38. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-cursor/hooks/parity-safety-net.sh +44 -13
  40. package/plugins/lisa-cursor/hooks/threshold-ratchet.mjs +39 -5
  41. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-expo-agy/plugin.json +1 -1
  44. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  48. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  49. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  53. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  54. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  59. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  64. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-rails-agy/plugin.json +1 -1
  69. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  73. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  74. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  78. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  79. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  81. package/plugins/src/base/hooks/parity-safety-net.sh +44 -13
  82. package/plugins/src/base/hooks/threshold-ratchet.mjs +39 -5
  83. package/rails/copy-overwrite/scripts/check-threshold-ratchet.mjs +39 -5
  84. package/typescript/copy-overwrite/scripts/check-threshold-ratchet.mjs +39 -5
@@ -47,19 +47,51 @@ const DEPENDENCY_SECTIONS = [
47
47
  "peerDependencies",
48
48
  ];
49
49
 
50
+ /**
51
+ * Lowest version a single disjunction branch permits.
52
+ *
53
+ * An upper-bound-only branch (`<2.0.0`, `<=2.0.0`) has no floor: it permits
54
+ * everything beneath the bound, so its lower bound is zero. Every other form
55
+ * used in practice (`>=1.2.3`, `^1.2.3`, `~1.2.3`, `1.2.3`, `>=1.2.3 <2`)
56
+ * leads with its lower bound.
57
+ * @param {string} branch One branch of a `||` range.
58
+ * @returns {number[]|null} [major, minor, patch], or null when there is none.
59
+ */
60
+ function branchLowerBound(branch) {
61
+ const trimmed = branch.trim();
62
+ if (trimmed === "") return null;
63
+ if (/^<=?\s*\d/.test(trimmed)) return [0, 0, 0];
64
+ const match = /(\d+)\.(\d+)\.(\d+)/.exec(trimmed);
65
+ return match ? match.slice(1, 4).map(Number) : null;
66
+ }
67
+
50
68
  /**
51
69
  * Lowest version a range permits, as a comparable tuple.
52
70
  *
53
- * Deliberately crude: it reads the first version in the spec, which is the
54
- * lower bound for every form used in practice (`>=1.2.3`, `^1.2.3`, `~1.2.3`,
55
- * `1.2.3`, `>=1.2.3 <2`). A spec carrying no version `*`, `workspace:*`,
56
- * `latest` has no floor to compare and returns null.
71
+ * Reading only the first version in the spec was wrong in a direction that
72
+ * matters: for `^2.0.0 || ^1.9.0` it reported 2.0.0, a floor HIGHER than the
73
+ * range actually permits, and the caller's `compare(target, floor) >= 0` then
74
+ * skipped a genuine collision. A floor read too high is a false negative in a
75
+ * security check, so every branch is measured and the lowest wins.
76
+ *
77
+ * An alias spec (`npm:other-pkg@^1.2.3`) versions a different package
78
+ * entirely; its number cannot be compared against a floor for this name, so it
79
+ * returns null rather than a misleading answer. A spec carrying no version —
80
+ * `*`, `workspace:*`, `latest` — has no floor either.
57
81
  * @param {string} spec A version range.
58
82
  * @returns {number[]|null} [major, minor, patch], or null when there is none.
59
83
  */
60
84
  export function lowestPermitted(spec) {
61
- const match = /(\d+)\.(\d+)\.(\d+)/.exec(spec ?? "");
62
- return match ? match.slice(1, 4).map(Number) : null;
85
+ const raw = spec ?? "";
86
+ if (/^\s*npm:/i.test(raw)) return null;
87
+ const bounds = raw
88
+ .split("||")
89
+ .map(branchLowerBound)
90
+ .filter(bound => bound !== null);
91
+ if (bounds.length === 0) return null;
92
+ return bounds.reduce((lowest, bound) =>
93
+ compare(bound, lowest) < 0 ? bound : lowest
94
+ );
63
95
  }
64
96
 
65
97
  /**
@@ -172,16 +172,6 @@ case "$command_str" in
172
172
  ;;
173
173
  esac
174
174
 
175
- # matches / matches_cs run an ERE against the guarded command text. matches is
176
- # case-insensitive (the default for these guards); matches_cs is case-SENSITIVE
177
- # for guards where flag case is meaningful (`git branch -d` vs `-D`).
178
- matches() {
179
- printf '%s' "$command_for_guards" | grep -Eiq -- "$1"
180
- }
181
- matches_cs() {
182
- printf '%s' "$command_for_guards" | grep -Eq -- "$1"
183
- }
184
-
185
175
  # Normalize bash line-continuations (a trailing backslash + newline → space)
186
176
  # before segmenting the command. Without this, "git push --force origin
187
177
  # \<newline>main" splits into a segment matching --force but not `main`, letting a
@@ -190,6 +180,28 @@ matches_cs() {
190
180
  normalized_command_str="$(printf '%s' "$command_for_guards" \
191
181
  | awk '{ if (sub(/\\$/, "")) printf "%s ", $0; else print }')"
192
182
 
183
+ # matches / matches_cs run an ERE against the guarded command text. matches is
184
+ # case-insensitive (the default for these guards); matches_cs is case-SENSITIVE
185
+ # for guards where flag case is meaningful (`git branch -d` vs `-D`).
186
+ #
187
+ # Both read the NORMALIZED text. They used to read $command_for_guards, so only
188
+ # the two segment-walking guards (rm, git push) were protected against line
189
+ # continuations and every guard expressed through these helpers could be evaded
190
+ # by breaking the command across lines:
191
+ #
192
+ # git reset --hard \
193
+ # origin/main
194
+ #
195
+ # The patterns match on intermediate whitespace, and an embedded "\<newline>" is
196
+ # not whitespace to grep -E, so the anchor failed to span the break. Defined
197
+ # after the normalization above so the value exists when these are first called.
198
+ matches() {
199
+ printf '%s' "$normalized_command_str" | grep -Eiq -- "$1"
200
+ }
201
+ matches_cs() {
202
+ printf '%s' "$normalized_command_str" | grep -Eq -- "$1"
203
+ }
204
+
193
205
  # Shared ERE fragments. GIT_TOKENS walks over intermediate argv tokens without
194
206
  # crossing a statement separator, so a flag in a LATER statement can never be
195
207
  # attributed to an earlier git subcommand.
@@ -553,9 +565,28 @@ if [ -f "$rules_file" ]; then
553
565
  case "$rule" in
554
566
  '' | '#'*) continue ;;
555
567
  esac
556
- if printf '%s' "$command_for_guards" | grep -Eiq -- "$rule"; then
557
- block "matched a project custom safety rule (${rules_file##*/}): $rule"
558
- fi
568
+ # Normalized text, for the same reason every built-in guard uses it: a
569
+ # project rule must not be evadable by breaking the command across lines.
570
+ #
571
+ # `|| rule_status=$?` rather than a bare pipeline: this script runs under
572
+ # `set -e`, and a no-match grep exits 1, which would end the hook right
573
+ # here — before the remaining rules ran, and with an exit status that is
574
+ # not a refusal. The `||` puts the pipeline in a condition context, where
575
+ # a non-zero status is expected rather than fatal.
576
+ rule_status=0
577
+ printf '%s' "$normalized_command_str" | grep -Eiq -- "$rule" || rule_status=$?
578
+ case "$rule_status" in
579
+ 0) block "matched a project custom safety rule (${rules_file##*/}): $rule" ;;
580
+ 1) ;; # no match
581
+ # grep exits 2 on a malformed ERE. Treated as no-match before, so a typo
582
+ # in a project's rules file silently disabled that rule — a guard the
583
+ # project believed it had. Say so instead; still non-fatal, because one
584
+ # bad line must not take the other rules down with it.
585
+ *)
586
+ printf 'parity-safety-net: invalid regex in %s, rule NOT enforced: %s\n' \
587
+ "$rules_file" "$rule" >&2
588
+ ;;
589
+ esac
559
590
  done <"$rules_file"
560
591
  fi
561
592
 
@@ -6,7 +6,14 @@ set -euo pipefail
6
6
 
7
7
  if NPM_ROOT="$(npm root 2>/dev/null)" && [ -n "$NPM_ROOT" ]; then
8
8
  LOCAL_LISA_SCRIPT="$NPM_ROOT/@codyswann/lisa/plugins/lisa/scripts/remote-agent-aws-setup.sh"
9
- [ -x "$LOCAL_LISA_SCRIPT" ] && exec "$LOCAL_LISA_SCRIPT" "$@"
9
+ # Spelled as a full `if` rather than `[ -x ] && exec …`. That form is the
10
+ # last command in this block, so when the file is absent its non-zero status
11
+ # is the block's status, and `set -e` exits (1) right here — before the
12
+ # diagnostic below can print. The operator saw a silent failure instead of
13
+ # being told to install the package.
14
+ if [ -x "$LOCAL_LISA_SCRIPT" ]; then
15
+ exec "$LOCAL_LISA_SCRIPT" "$@"
16
+ fi
10
17
  fi
11
18
 
12
19
  echo "remote-agent-aws-setup: install @codyswann/lisa before running this setup script" >&2
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/cli/apply.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,qBAAqB,CAAC;AAmH1E;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CAoEf"}
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/cli/apply.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AA+J7B;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CAqEf"}
package/dist/cli/apply.js CHANGED
@@ -7,7 +7,7 @@ import { detectLegacyHarnessMigration, projectConfigExists, readProjectConfig, r
7
7
  import { ConsoleLogger } from "../logging/index.js";
8
8
  import { toAbsolutePath } from "../utils/path-utils.js";
9
9
  import { nudgeCrossPollinate } from "./cross-pollinate-nudge.js";
10
- import { createDependencies } from "./shared-options.js";
10
+ import { createDependencies, parseRefreshTemplates, } from "./shared-options.js";
11
11
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
12
  /**
13
13
  * Get Lisa directory (where configs are stored)
@@ -30,6 +30,11 @@ function printUsageAndExit() {
30
30
  console.log(" -y, --yes Non-interactive mode (auto-accept defaults, overwrite on conflict)");
31
31
  console.log(" -v, --validate Validate project compatibility without applying changes");
32
32
  console.log(" --skip-git-check Skip dirty git working directory check (for postinstall use)");
33
+ console.log(" --refresh-templates [paths]");
34
+ console.log(" Let a non-interactive apply replace managed files it would");
35
+ console.log(" otherwise report as out of date. Optionally scope to a");
36
+ console.log(" comma-separated path list, e.g.");
37
+ console.log(" --refresh-templates=scripts/lisa-hooks. Backs up first.");
33
38
  console.log(" --no-update-check Skip the npm latest-version check");
34
39
  console.log(` --harness <h> Target harness for emitted artifacts: ${ACCEPTED_HARNESS_INPUTS.join(" | ")} (persisted in .lisa.config.json)`);
35
40
  console.log(" -h, --help Show this help message");
@@ -79,6 +84,30 @@ async function migrateLegacyHarnessIfNeeded(destDir, logger) {
79
84
  await writeProjectConfig(destDir, { harness: migration.to });
80
85
  logger.info(`Migrated legacy harness "${migration.from}" to "${migration.to}" in .lisa.config.json`);
81
86
  }
87
+ /**
88
+ * Assemble the apply config.
89
+ *
90
+ * Split out so the optional `refreshTemplates` key can be omitted entirely
91
+ * rather than set to undefined — `exactOptionalPropertyTypes` distinguishes
92
+ * the two — without that conditional counting against `runApply`.
93
+ * @param parts - Resolved settings for this invocation
94
+ * @param parts.destDir - Project directory being applied to
95
+ * @param parts.dryRun - Whether to report without writing
96
+ * @param parts.yesMode - Whether prompts auto-accept
97
+ * @param parts.validateOnly - Whether to validate instead of apply
98
+ * @param parts.skipGitCheck - Whether the dirty-tree prompt is skipped
99
+ * @param parts.refreshTemplates - Opted-in managed files, if any
100
+ * @param parts.harness - Target harness for emitted artifacts
101
+ * @returns The config to hand to Lisa
102
+ */
103
+ function buildApplyConfig(parts) {
104
+ const { refreshTemplates, ...rest } = parts;
105
+ return {
106
+ lisaDir: getLisaDir(),
107
+ ...rest,
108
+ ...(refreshTemplates === undefined ? {} : { refreshTemplates }),
109
+ };
110
+ }
82
111
  /**
83
112
  * Apply Lisa to the given destination with the given options.
84
113
  *
@@ -105,15 +134,16 @@ export async function runApply(destination, options) {
105
134
  const projectConfig = await readProjectConfig(destDir);
106
135
  const configFileExists = await projectConfigExists(destDir);
107
136
  const harness = resolveHarness(options.harness, projectConfig);
108
- const config = {
109
- lisaDir: getLisaDir(),
137
+ const refreshTemplates = parseRefreshTemplates(options.refreshTemplates);
138
+ const config = buildApplyConfig({
110
139
  destDir,
111
140
  dryRun,
112
141
  yesMode,
113
142
  validateOnly,
114
143
  skipGitCheck: options.skipGitCheck ?? false,
144
+ refreshTemplates,
115
145
  harness,
116
- };
146
+ });
117
147
  const deps = createDependencies(dryRun, yesMode, logger);
118
148
  const lisa = new Lisa(config, deps);
119
149
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/cli/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAmB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE1E,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAkB/D;;;GAGG;AACH,SAAS,UAAU;IACjB,sCAAsC;IACtC,OAAO,I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AO,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACjC,MAAM,mBAAmB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type Command } from "commander";
2
- import type { Harness } from "../core/config.js";
2
+ import type { Harness, RefreshTemplates } from "../core/config.js";
3
3
  import type { LisaDependencies } from "../core/lisa.js";
4
4
  import type { ConsoleLogger } from "../logging/index.js";
5
5
  /**
@@ -11,8 +11,16 @@ export interface CLIOptions {
11
11
  yes?: boolean;
12
12
  validate?: boolean;
13
13
  skipGitCheck?: boolean;
14
+ /** Bare `--refresh-templates` yields true; with a value, the raw path list. */
15
+ refreshTemplates?: boolean | string;
14
16
  harness?: Harness;
15
17
  }
18
+ /**
19
+ * Resolve `--refresh-templates` into the selection the strategies consume.
20
+ * @param value - Raw commander value: absent, true, or a comma-separated list
21
+ * @returns The selection, or undefined when the flag was not passed
22
+ */
23
+ export declare function parseRefreshTemplates(value: boolean | string | undefined): RefreshTemplates | undefined;
16
24
  /**
17
25
  * Validate the --harness CLI argument. Commander invokes this with the raw
18
26
  * user-supplied string and expects either the parsed value or a thrown
@@ -1 +1 @@
1
- {"version":3,"file":"shared-options.d.ts","sourceRoot":"","sources":["../../src/cli/shared-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAwB,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,KAAK,EAAE,gBAAgB,E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wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAClC,gBAAgB,GAAG,SAAS,CAW9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAStD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CA0B1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,aAAa,GACpB,gBAAgB,CAYlB"}
@@ -7,6 +7,25 @@ import { normalizeHarness } from "../core/project-config.js";
7
7
  import { StrategyRegistry } from "../strategies/index.js";
8
8
  import { BackupService, DryRunBackupService } from "../transaction/index.js";
9
9
  import { createPrompter } from "./prompts.js";
10
+ /**
11
+ * Resolve `--refresh-templates` into the selection the strategies consume.
12
+ * @param value - Raw commander value: absent, true, or a comma-separated list
13
+ * @returns The selection, or undefined when the flag was not passed
14
+ */
15
+ export function parseRefreshTemplates(value) {
16
+ if (value === undefined || value === false)
17
+ return undefined;
18
+ if (value === true)
19
+ return { mode: "all" };
20
+ const paths = value
21
+ .split(",")
22
+ .map(entry => entry.trim())
23
+ .filter(entry => entry.length > 0);
24
+ // `--refresh-templates=` with nothing after it reads as "refresh nothing",
25
+ // which is a footgun either way. Treat it as the bare flag rather than
26
+ // silently matching no path.
27
+ return paths.length > 0 ? { mode: "paths", paths } : { mode: "all" };
28
+ }
10
29
  /**
11
30
  * Validate the --harness CLI argument. Commander invokes this with the raw
12
31
  * user-supplied string and expects either the parsed value or a thrown
@@ -34,6 +53,9 @@ export function addSharedOptions(command) {
34
53
  .option("-y, --yes", "Non-interactive mode (auto-accept defaults, overwrite on conflict)")
35
54
  .option("-v, --validate", "Validate project compatibility without applying changes")
36
55
  .option("--skip-git-check", "Skip dirty git working directory check (for postinstall use)")
56
+ .option("--refresh-templates [paths]", "Let a non-interactive apply replace managed files it would otherwise report as out of date. " +
57
+ "Optionally scope to a comma-separated list of repo-relative paths " +
58
+ "(e.g. --refresh-templates=scripts/lisa-hooks). Backs up before replacing.")
37
59
  .option("--harness <harness>", `Target harness for emitted artifacts: ${ACCEPTED_HARNESS_INPUTS.join(" | ")} (default: claude, or value from .lisa.config.json)`, parseHarnessArg);
38
60
  }
39
61
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shared-options.js","sourceRoot":"","sources":["../../src/cli/shared-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAc9C;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpD,MAAM,IAAI,oBAAoB,CAC5B,YAAY,OAAO,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CACpD,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,g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EAAE,gDAAgD,CAAC;SACzE,MAAM,CACL,WAAW,EACX,oEAAoE,CACrE;SACA,MAAM,CACL,gBAAgB,EAChB,yDAAyD,CAC1D;SACA,MAAM,CACL,kBAAkB,EAClB,8DAA8D,CAC/D;SACA,MAAM,CACL,6BAA6B,EAC7B,8FAA8F;QAC5F,oEAAoE;QACpE,2EAA2E,CAC9E;SACA,MAAM,CACL,qBAAqB,EACrB,yCAAyC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,qDAAqD,EACjI,eAAe,CAChB,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,OAAgB,EAChB,MAAqB;IAErB,OAAO;QACL,MAAM;QACN,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC;QACjC,aAAa,EAAE,MAAM;YACnB,CAAC,CAAC,IAAI,mBAAmB,EAAE;YAC3B,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC;QAC7B,gBAAgB,EAAE,IAAI,gBAAgB,EAAE;QACxC,gBAAgB,EAAE,IAAI,gBAAgB,EAAE;QACxC,UAAU,EAAE,IAAI,UAAU,EAAE;QAC5B,iBAAiB,EAAE,IAAI,iBAAiB,EAAE;KAC3C,CAAC;AACJ,CAAC"}
@@ -99,9 +99,45 @@ export interface LisaConfig {
99
99
  readonly validateOnly: boolean;
100
100
  /** If true, skip the dirty git working directory check (for postinstall use) */
101
101
  readonly skipGitCheck: boolean;
102
+ /**
103
+ * Opt-in permission for a non-interactive apply to replace managed files it
104
+ * would otherwise only report as `stale`.
105
+ *
106
+ * Undefined — the default — keeps the conservative behaviour: a
107
+ * non-interactive apply never replaces a file the project may have
108
+ * customised. Set only when the operator has decided to take upstream's
109
+ * version, which is the supported way to deliver a changed enforcement guard
110
+ * without hand-deleting it first.
111
+ */
112
+ readonly refreshTemplates?: RefreshTemplates;
102
113
  /** Target harness(es) for emitted artifacts (e.g. claude | codex | fleet) */
103
114
  readonly harness: Harness;
104
115
  }
116
+ /**
117
+ * Which managed files a non-interactive apply may refresh.
118
+ *
119
+ * Scoping exists because the blunt form is genuinely dangerous: the managed set
120
+ * includes files projects legitimately customise (`tsconfig.json`, `knip.json`,
121
+ * `eslint.config.ts`). Refreshing only `scripts/lisa-hooks` to take a security
122
+ * fix should not cost a project its build config.
123
+ */
124
+ export type RefreshTemplates =
125
+ /** Every stale managed file. */
126
+ {
127
+ readonly mode: "all";
128
+ }
129
+ /** Only files at, or beneath, these repo-relative paths. */
130
+ | {
131
+ readonly mode: "paths";
132
+ readonly paths: readonly string[];
133
+ };
134
+ /**
135
+ * Whether a non-interactive apply may replace this managed file.
136
+ * @param relativePath - Repo-relative path of the managed file
137
+ * @param refresh - The resolved --refresh-templates selection, if any
138
+ * @returns True when the operator opted this path in
139
+ */
140
+ export declare function mayRefreshTemplate(relativePath: string, refresh: RefreshTemplates | undefined): boolean;
105
141
  /**
106
142
  * Operation mode for Lisa execution
107
143
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,OAAO,GACP,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,KAAK,GACL,eAAe,GACf,QAAQ,GACR,aAAa,GACb,OAAO,CAAC;AAEZ;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,CAU/B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAS3C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAOzC,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,O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AM,EACX,QAAQ,GACR,SAAS;IACX;;;;;;;;OAQG;OACD,OAAO,GACP,aAAa,GACb,UAAU,GACV,QAAQ,GACR,SAAS,CAAC;IACd,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,iBAAiB,CAazD"}
@@ -98,6 +98,38 @@ export function harnessIncludesAgent(harness, agent) {
98
98
  * host projects predate Codex support and have always emitted .claude/ artifacts)
99
99
  */
100
100
  export const DEFAULT_HARNESS = "claude";
101
+ /**
102
+ * Whether a non-interactive apply may replace this managed file.
103
+ * @param relativePath - Repo-relative path of the managed file
104
+ * @param refresh - The resolved --refresh-templates selection, if any
105
+ * @returns True when the operator opted this path in
106
+ */
107
+ export function mayRefreshTemplate(relativePath, refresh) {
108
+ if (refresh === undefined)
109
+ return false;
110
+ if (refresh.mode === "all")
111
+ return true;
112
+ // Normalise so `scripts/lisa-hooks`, `scripts/lisa-hooks/`, and an exact file
113
+ // path all behave the way the flag reads.
114
+ const target = relativePath.replaceAll("\\", "/");
115
+ return refresh.paths.some(raw => {
116
+ const scope = stripTrailingSlashes(raw.replaceAll("\\", "/"));
117
+ return scope === target || target.startsWith(`${scope}/`);
118
+ });
119
+ }
120
+ /**
121
+ * Drop trailing slashes so `scripts/lisa-hooks/` and `scripts/lisa-hooks` are
122
+ * one scope.
123
+ *
124
+ * Written as a loop rather than a `/\/+$/` replace: that pattern is
125
+ * super-linear on a pathological input, and a scope string comes straight from
126
+ * the command line.
127
+ * @param value - Normalised, forward-slashed path
128
+ * @returns The path without any trailing slashes
129
+ */
130
+ function stripTrailingSlashes(value) {
131
+ return value.endsWith("/") ? stripTrailingSlashes(value.slice(0, -1)) : value;
132
+ }
101
133
  /**
102
134
  * Create initial operation counters with all values at zero
103
135
  * @returns Operation counters initialized to zero
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAE/B;IACF,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,YAAY;IACjB,eAAe,EAAE,YAAY;IAC7B,MAAM,EAAE,YAAY;IACpB,aAAa,EAAE,YAAY;IAC3B,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;CACR,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,OAAO;CACC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA4B;IACtD,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,OAAO;IACP,cAAc;IACd,cAAc;CACN,CAAC;AAyBX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,KAAK;IACL,SAAS;IACT,UAAU;IACV,OAAO;CACC,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsC;IAChE,GAAG,EAAE,OAAO;CACb,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,GAAG,cAAc;IACjB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;CAChC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsC;IACvE,IAAI,EAAE,OAAO;CACd,CAAC;AASF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAgB,EAChB,KAAgB;IAEhB,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,OAAO,KAAK,KAAK,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAY,QAAQ,CAAC;AAiGjD;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,CAAC;QACR,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,iBAAiB,EAAE,CAAC;QACpB,iBAAiB,EAAE,CAAC;KACrB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAwBA;;GAEG;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appings":"AACA,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwqEpE,CAAC;AAEL,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAkvNjE,CAAC;AAEL,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAk6I/D,CAAC"}
1
+ {"version":3,"file":"upstream-evidence-manifest.d.ts","sourceRoot":"","sources":["../../src/core/upstream-evidence-manifest.ts"],"names":[],"mappings":"AACA,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwqEpE,CAAC;AAEL,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAqvNjE,CAAC;AAEL,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAk6I/D,CAAC"}
@@ -4,16 +4,16 @@ export const UPSTREAM_EVIDENCE_MANIFEST = Object.freeze({
4
4
  "all/copy-contents/.gitattributes": "9d3831007e681186a3673e1037ef3fc82980cab2fc04e27c0868e562912c9e9f",
5
5
  "all/copy-contents/gitignore": "2dbf7fd2f2020fc7824c432342002d9ca3ebb57b2872e761b14e942b23479a11",
6
6
  "all/copy-overwrite/scripts/lisa-enforcement-fallback.sh": "1bec5f3c284b3febdc471487ee6a23ffb72bd4e7b293f9e26b0188f32318c722",
7
- "all/copy-overwrite/scripts/lisa-floor-collisions.mjs": "a612f172282d13ba9318fe5e03689d7c6ff42a0122d0c9d5d39051e1967b93dc",
7
+ "all/copy-overwrite/scripts/lisa-floor-collisions.mjs": "3c7a0234b4f5609fce49e44711d2ec86af8cf7fb82b0831e4450e3347ecefe45",
8
8
  "all/copy-overwrite/scripts/lisa-hooks/block-instruction-file-edits.sh": "850cfc23852eb752114ae1e938a1c7bcf34bc50c85d3aaca0c02311cc8c0ef70",
9
9
  "all/copy-overwrite/scripts/lisa-hooks/block-no-verify.sh": "33e2bd341eb992036059b0c4606db35a218adcfeca7e44d174fedf8ebdff29d2",
10
10
  "all/copy-overwrite/scripts/lisa-hooks/block-shell-json-parsing.sh": "1934a15e154fda3c2a40979a5cd6225661b14fe7bc77328a69ce499bea85dba7",
11
- "all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh": "062c69eea85157f1e941ec3626d8912aa9f182af6ccdbe19687588a6074db5ce",
11
+ "all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh": "d9ea58150aa27e7f0aa9a4ef155ed446d30bdfc932d01c64e2b8ca211aa0de7b",
12
12
  "all/copy-overwrite/scripts/lisa-hooks/sonar-secrets.sh": "bf4132e49ba18e2f7e941520c299c15aeeacfd220e489f3d2eb8397f2048157b",
13
13
  "all/copy-overwrite/scripts/lisa-work-item.mjs": "2d9ca0841db9e75ddfd95e3a4d485fd01aa639a512ef648996f565b7991d8e2b",
14
14
  "all/create-only/.claude/rules/PROJECT_RULES.md": "6e1c7923ad2a15356babc60c97e7f97be728d790af285b6a7cd7d1b4d39cd97f",
15
15
  "all/create-only/.lisaignore": "3c9827e7e98daa46510b5357cd6dd9406da1821e64cc46d2eea9f311cd6d06b9",
16
- "all/create-only/scripts/remote-agent-aws-setup.sh": "7677908a345891810d2104ba8b2fd1a8318bb29c408fb5ce0110d57beef9b556",
16
+ "all/create-only/scripts/remote-agent-aws-setup.sh": "12d2204d34195ad4f81082e90a25dbbf7d2493debcc50c1cd37b32dc4648fc17",
17
17
  "all/create-only/specs/.keep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
18
18
  "all/deletions.json": "31af98085a56dd96d34d4b3cb42956e068fb492df7b1dd781987408c1b4b2ea3",
19
19
  "all/github-rulesets/base.json": "58b9606f185cdca8b17218829aac333b7d8c08f0f2b4f86d7e360f7be1de4787",
@@ -310,13 +310,13 @@ export const UPSTREAM_EVIDENCE_MANIFEST = Object.freeze({
310
310
  "plugins/src/base/hooks/install-pkgs.sh": "e9a13faba849a277410dde911ab102ee6f88ef915b33571bb1d4eef904172db5",
311
311
  "plugins/src/base/hooks/parity-safety-net-heredoc.py": "f21b1232ac82bd0e42d2ba43c68f4cc4546334fc885ba31747881f427097ef78",
312
312
  "plugins/src/base/hooks/parity-safety-net.agy.sh": "ce9bd2b4566ad9147e4ace56434cffbbe87edb4ccbb57549ab3fd9f4c671ced4",
313
- "plugins/src/base/hooks/parity-safety-net.sh": "062c69eea85157f1e941ec3626d8912aa9f182af6ccdbe19687588a6074db5ce",
313
+ "plugins/src/base/hooks/parity-safety-net.sh": "d9ea58150aa27e7f0aa9a4ef155ed446d30bdfc932d01c64e2b8ca211aa0de7b",
314
314
  "plugins/src/base/hooks/setup-jira-cli.sh": "a675f6b17ce7f0d6b9fb7daeba6d2bc59bcb48ef79b034076ea73b2b1e72ee09",
315
315
  "plugins/src/base/hooks/shell-write-nudge.sh": "69839af423f8792b1e52c71097316c3264425553031627c0a2f9409a9d5becd0",
316
316
  "plugins/src/base/hooks/sonar-secrets.sh": "bf4132e49ba18e2f7e941520c299c15aeeacfd220e489f3d2eb8397f2048157b",
317
317
  "plugins/src/base/hooks/threshold-ratchet-compare.mjs": "4535a145c5c5cbee13bdf970bc91d390a264043604e607288cdd6bf28de56192",
318
318
  "plugins/src/base/hooks/threshold-ratchet-families.mjs": "db14245ed89b483912af287bdee917a7a921dc21bb29b49be37fc799c05c413f",
319
- "plugins/src/base/hooks/threshold-ratchet.mjs": "04f660131bf50864239eb09cbf4d9555e53921254f6ab45ff2b85c173e160901",
319
+ "plugins/src/base/hooks/threshold-ratchet.mjs": "49dee610439f4f21aecb0420a0cc72f5d3595a36f2489970053096190b9909c4",
320
320
  "plugins/src/base/hooks/threshold-ratchet.sh": "b86f4d0b554e44fd119ad8a8920cd0ba6c9dbe779f7ee219d381cf0629453990",
321
321
  "plugins/src/base/hooks/ticket-sync-reminder.sh": "212f80bcdfd9e3ec2254987c5a7186d1d2d38065b330ddcdc631f76df7c4a6c0",
322
322
  "plugins/src/base/hooks/track-plan-sessions.sh": "8bc47dcad3aed628df0c9efbe7b6f3df87635b94b0c54c71e0bd52eceace563a",
@@ -947,7 +947,7 @@ export const UPSTREAM_EVIDENCE_MANIFEST = Object.freeze({
947
947
  "rails/copy-overwrite/ast-grep/utils/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
948
948
  "rails/copy-overwrite/config/initializers/version.rb": "fa664a84f407877b5ddbd3709a2352b30e4dc6fbce538a8503bad6c52448dc86",
949
949
  "rails/copy-overwrite/lefthook.yml": "28bb382b9171a04fb92ebafc1f1522b8639f5edc4fcffcc6940e7fba3460fb4e",
950
- "rails/copy-overwrite/scripts/check-threshold-ratchet.mjs": "04f660131bf50864239eb09cbf4d9555e53921254f6ab45ff2b85c173e160901",
950
+ "rails/copy-overwrite/scripts/check-threshold-ratchet.mjs": "49dee610439f4f21aecb0420a0cc72f5d3595a36f2489970053096190b9909c4",
951
951
  "rails/copy-overwrite/scripts/lisa-clean-git-env.sh": "e7121a0ee9e1bf7c01cd2ab55f563dd6d9ab75990739bb6ddf571a513efa10e9",
952
952
  "rails/copy-overwrite/scripts/threshold-ratchet-compare.mjs": "4535a145c5c5cbee13bdf970bc91d390a264043604e607288cdd6bf28de56192",
953
953
  "rails/copy-overwrite/scripts/threshold-ratchet-families.mjs": "db14245ed89b483912af287bdee917a7a921dc21bb29b49be37fc799c05c413f",
@@ -1070,7 +1070,7 @@ export const UPSTREAM_EVIDENCE_MANIFEST = Object.freeze({
1070
1070
  "typescript/copy-overwrite/eslint.ignore.config.json": "04dcd754829cf93bf0ba0d76e4031d28cb7149afa658575d02bb13bf73f7880e",
1071
1071
  "typescript/copy-overwrite/eslint.slow.config.ts": "f66d04381940936544931d7f20ffd4e43c38b8a907d56ffa101e2236371d8c94",
1072
1072
  "typescript/copy-overwrite/knip.json": "6eb93d705a2d645332fbae1dd42cf2d48f85978ebc265451a53790912f277d12",
1073
- "typescript/copy-overwrite/scripts/check-threshold-ratchet.mjs": "04f660131bf50864239eb09cbf4d9555e53921254f6ab45ff2b85c173e160901",
1073
+ "typescript/copy-overwrite/scripts/check-threshold-ratchet.mjs": "49dee610439f4f21aecb0420a0cc72f5d3595a36f2489970053096190b9909c4",
1074
1074
  "typescript/copy-overwrite/scripts/check-verification-coverage.mjs": "3c1d27d0668fc66a18cb014f2b607878f0a88c178a773fbe964b8e46b19e86d6",
1075
1075
  "typescript/copy-overwrite/scripts/lisa-mutation.mjs": "7d8d24dea151ef2178807046e97aea7ebfadd9c88eb50347feb7bb4bb190227d",
1076
1076
  "typescript/copy-overwrite/scripts/threshold-ratchet-compare.mjs": "4535a145c5c5cbee13bdf970bc91d390a264043604e607288cdd6bf28de56192",
@@ -7183,6 +7183,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
7183
7183
  "tests/unit/cli/kane-index.test.ts": true,
7184
7184
  "tests/unit/cli/learnings-overflow-cmd.test.ts": true,
7185
7185
  "tests/unit/cli/merge-learnings-cmd.test.ts": true,
7186
+ "tests/unit/cli/parse-refresh-templates.test.ts": true,
7186
7187
  "tests/unit/cli/prompts.test.ts": true,
7187
7188
  "tests/unit/cli/setup-project.test.ts": true,
7188
7189
  "tests/unit/cli/setup-wiki.test.ts": true,
@@ -7351,6 +7352,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
7351
7352
  "tests/unit/hooks/parity-safety-net-heredoc-continuation.test.ts": true,
7352
7353
  "tests/unit/hooks/parity-safety-net-heredoc-literal.test.ts": true,
7353
7354
  "tests/unit/hooks/parity-safety-net-heredoc.test.ts": true,
7355
+ "tests/unit/hooks/parity-safety-net-line-continuation.test.ts": true,
7354
7356
  "tests/unit/hooks/parity-safety-net.test.ts": true,
7355
7357
  "tests/unit/hooks/post-checkout.test.ts": true,
7356
7358
  "tests/unit/hooks/pre-push-git-environment.test.ts": true,
@@ -7516,6 +7518,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
7516
7518
  "tests/unit/strategies/convergent-review-contract.test.ts": true,
7517
7519
  "tests/unit/strategies/copy-contents-gitignore.test.ts": true,
7518
7520
  "tests/unit/strategies/copy-contents.test.ts": true,
7521
+ "tests/unit/strategies/copy-overwrite-refresh-templates.test.ts": true,
7519
7522
  "tests/unit/strategies/copy-overwrite.test.ts": true,
7520
7523
  "tests/unit/strategies/create-only.test.ts": true,
7521
7524
  "tests/unit/strategies/debrief-destination-hints.test.ts": true,