@codyswann/lisa 4.103.11 → 4.103.12

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 (82) hide show
  1. package/dist/codex/scripts/block-suppress-directives.sh +120 -26
  2. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  3. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  4. package/dist/core/upstream-evidence-manifest.js +4 -1
  5. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  6. package/dist/opencode/plugin-templates/lisa-block-suppress-directives.ts +72 -22
  7. package/package.json +4 -4
  8. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  9. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  10. package/plugins/lisa-agy/plugin.json +1 -1
  11. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  12. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  13. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  14. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  15. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  17. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  18. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  22. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  24. package/plugins/lisa-expo-agy/plugin.json +1 -1
  25. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  29. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  31. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  32. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  33. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  36. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  39. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  43. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  45. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  46. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  50. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  53. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  57. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-rails-agy/plugin.json +1 -1
  60. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  64. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  66. package/plugins/lisa-typescript/hooks/block-suppress-directives.sh +104 -14
  67. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  68. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-typescript-copilot/hooks/block-suppress-directives.sh +104 -14
  70. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-typescript-cursor/hooks/block-suppress-directives.sh +104 -14
  72. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  74. package/plugins/lisa-typescript-devin/hooks/block-suppress-directives.sh +104 -14
  75. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  77. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  78. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  82. package/plugins/src/typescript/hooks/block-suppress-directives.sh +104 -14
@@ -9,9 +9,17 @@
9
9
  # Codex blocks the tool call when the script exits 2 with a deny message on
10
10
  # stderr. apply_patch carries the whole diff as a STRING under
11
11
  # tool_input.command (verified against codex-cli 0.125.0), so we walk the patch
12
- # and inspect added (`+`) lines under JS/TS file headers. Edit/Write inspect the
13
- # new text directly. Only comment-syntax matches count, so prose/strings that
14
- # merely mention these tokens are not flagged.
12
+ # per JS/TS file header.
13
+ #
14
+ # Refuses directive GROWTH, not presence: a directive in the after text that the
15
+ # before text lacks (new, another copy, or reworded) refuses. Write judges the
16
+ # whole file (disk vs content). Edit/MultiEdit judge each replaced fragment on
17
+ # its own (old_string vs new_string), and apply_patch each file (`-` vs `+`
18
+ # lines). So a widening done purely by deleting text from an existing directive,
19
+ # or a directive assembled across separate edits, is NOT detected — a
20
+ # pre-existing limit, shared with the presence check this replaced.
21
+ # Only comment-syntax matches count, so prose/strings that merely mention these
22
+ # tokens are not flagged.
15
23
  #
16
24
  # WHAT A REFUSAL HOOK OWES THAT AN ON-EDIT HOOK DOES NOT. The PostToolUse
17
25
  # scripts on this surface may bail out when they cannot run: the write has
@@ -117,49 +125,135 @@ LISA_GATE_PATHS
117
125
  exit "$LISA_GATE_STATUS"
118
126
  fi
119
127
 
128
+ # The directives in $1, one per line and sorted, so the lists are multisets
129
+ # `comm` can subtract. Each runs from its comment opener to the end of its line
130
+ # (so indentation is never part of one); trailing whitespace and a CR are not.
131
+ directives_in() {
132
+ printf '%s\n' "$1" | grep -Eo "${DIRECTIVE_RE}.*" |
133
+ sed 's/[[:space:]]*$//' | LC_ALL=C sort
134
+ }
135
+
136
+ # True when $2 (after) carries a directive $1 (before) does not. `comm -13`
137
+ # pairs repeated lines one-for-one, so a further copy of an existing directive
138
+ # is left over, and counts.
139
+ grows() {
140
+ [ -n "$(LC_ALL=C comm -13 <(directives_in "$1") <(directives_in "$2"))" ]
141
+ }
142
+
120
143
  TOOL_NAME="$(printf '%s' "$JSON_INPUT" | jq -r '.tool_name // .tool // empty')"
121
144
 
145
+ # apply_patch: growth per file. Before = that file's `-` lines, after = its `+`
146
+ # lines (context lines are unchanged either way). An Add File has no `-` lines,
147
+ # so every directive in it is new; a Delete File removes and adds nothing.
148
+ judge_patch_file() {
149
+ [ -n "$current_file" ] && is_js_ts "$current_file" || return 0
150
+ if grows "$removed" "$added"; then deny "$current_file"; fi
151
+ }
152
+
122
153
  if [ "$TOOL_NAME" = "apply_patch" ]; then
123
154
  PATCH_TEXT="$(printf '%s' "$JSON_INPUT" | jq -r '.tool_input.command // empty')"
124
155
  [ -n "$PATCH_TEXT" ] || exit 0
125
- current_file=""
156
+ current_file="" removed="" added=""
126
157
  while IFS= read -r line; do
127
158
  case "$line" in
128
- "*** Add File: "* | "*** Update File: "*)
129
- current_file="${line#*File: }"
130
- ;;
131
- "*** Delete File: "* | "*** Begin Patch"* | "*** End Patch"*)
132
- current_file=""
133
- ;;
134
- "+"*)
135
- [ -n "$current_file" ] || continue
136
- is_js_ts "$current_file" || continue
137
- # Strip the single leading '+' that marks an added line.
138
- added="${line#+}"
139
- if printf '%s' "$added" | grep -Eq "$DIRECTIVE_RE"; then
140
- deny "$current_file"
141
- fi
159
+ "*** Add File: "* | "*** Update File: "* | "*** Delete File: "* | \
160
+ "*** Begin Patch"* | "*** End Patch"*)
161
+ judge_patch_file
162
+ removed="" added="" current_file=""
163
+ case "$line" in
164
+ "*** Add File: "* | "*** Update File: "*) current_file="${line#*File: }" ;;
165
+ esac
142
166
  ;;
167
+ "+"*) added="${added}${line#+}"$'\n' ;;
168
+ "-"*) removed="${removed}${line#-}"$'\n' ;;
143
169
  esac
144
170
  done <<EOF
145
171
  $PATCH_TEXT
146
172
  EOF
173
+ judge_patch_file
147
174
  exit 0
148
175
  fi
149
176
 
150
- # Edit / Write
177
+ # ---------------------------------------------------------------------------
178
+ # Edit / Write / MultiEdit: refuse directive GROWTH, never mere presence
179
+ # (CodySwannGT/lisa#4492). Same semantics as the Claude TypeScript-stack hook:
180
+ # Write -> before = the file on disk (nothing when it does not exist),
181
+ # after = tool_input.content
182
+ # Edit -> before = tool_input.old_string, after = tool_input.new_string
183
+ # MultiEdit -> each edits[] pair judged the same way, on its own
184
+ # Each directive is taken from its comment opener to the end of its line, so a
185
+ # directive that is added, copied again, or reworded (a `-next-line` disable
186
+ # turned file-wide, a longer rule list) is new text, and is growth.
187
+ # ---------------------------------------------------------------------------
151
188
  FILE_PATH="$(printf '%s' "$JSON_INPUT" | jq -r '.tool_input.file_path // empty')"
152
189
  [ -n "$FILE_PATH" ] || exit 0
153
190
  is_js_ts "$FILE_PATH" || exit 0
154
191
 
155
- NEW_TEXT="$(printf '%s' "$JSON_INPUT" | jq -r '
156
- .tool_input as $i
157
- | if ($i.content // null) != null then $i.content
158
- elif ($i.edits // null) != null then ([$i.edits[].new_string] | join("\n"))
159
- elif ($i.new_string // null) != null then $i.new_string
160
- else "" end')"
192
+ # The file a Write replaces, on stdout. Codex runs hooks in the project, so a
193
+ # relative path resolves against CLAUDE_PROJECT_DIR when set, else the cwd.
194
+ # Nothing there is a new file (empty before). Something there that is not a
195
+ # readable regular file cannot be judged, so this fails and the caller refuses.
196
+ read_before() {
197
+ local target="$FILE_PATH"
198
+ case "$target" in
199
+ /*) ;;
200
+ *) target="${CLAUDE_PROJECT_DIR:-.}/$target" ;;
201
+ esac
202
+ [ -e "$target" ] || [ -L "$target" ] || return 0
203
+ [ -f "$target" ] && [ -r "$target" ] || return 1
204
+ cat -- "$target"
205
+ }
206
+
207
+ # The edit object $1: tool_input itself for Edit, edits[$1] for MultiEdit.
208
+ EDIT_AT='.tool_input | (if (.edits // null) != null then .edits[$i] else . end)'
209
+
210
+ # One string field ($2) of edit $1, empty when absent.
211
+ edit_field() {
212
+ printf '%s' "$JSON_INPUT" |
213
+ jq -r --argjson i "$1" --arg f "$2" "$EDIT_AT | .[\$f] // empty"
214
+ }
215
+
216
+ # True when edit $1 grows the directives. One that brings a directive with no
217
+ # old_string to compare against cannot be judged, and counts as growth.
218
+ edit_grows() {
219
+ local new
220
+ new="$(edit_field "$1" new_string)"
221
+ [ -n "$(directives_in "$new")" ] || return 1
222
+ printf '%s' "$JSON_INPUT" |
223
+ jq -e --argjson i "$1" "$EDIT_AT | (.old_string | type) == \"string\"" \
224
+ >/dev/null || return 0
225
+ grows "$(edit_field "$1" old_string)" "$new"
226
+ }
227
+
228
+ # True when any edit grows. An edit count that is not a number is unjudgeable.
229
+ any_edit_grows() {
230
+ local count i=0
231
+ count="$(printf '%s' "$JSON_INPUT" |
232
+ jq '.tool_input | if (.edits // null) != null then (.edits | length) else 1 end')"
233
+ case "$count" in '' | *[!0-9]*) return 0 ;; esac
234
+ while [ "$i" -lt "$count" ]; do
235
+ edit_grows "$i" && return 0
236
+ i=$((i + 1))
237
+ done
238
+ return 1
239
+ }
240
+
241
+ # True when the write grows the directives; Write when content is present.
242
+ write_grows() {
243
+ local before after
244
+ if printf '%s' "$JSON_INPUT" |
245
+ jq -e '(.tool_input.content // null) != null' >/dev/null; then
246
+ after="$(printf '%s' "$JSON_INPUT" | jq -r '.tool_input.content')"
247
+ # Nothing in the new text means nothing can have grown; no read needed.
248
+ [ -n "$(directives_in "$after")" ] || return 1
249
+ before="$(read_before)" || return 0
250
+ grows "$before" "$after"
251
+ return
252
+ fi
253
+ any_edit_grows
254
+ }
161
255
 
162
- if printf '%s' "$NEW_TEXT" | grep -Eq "$DIRECTIVE_RE"; then
256
+ if write_grows; then
163
257
  deny "$FILE_PATH"
164
258
  fi
165
259
 
@@ -41,9 +41,9 @@ export const NIGHTLY_E2E_GUARD_BEHAVIOR_CERTIFICATES = Object.freeze({
41
41
  }),
42
42
  d1b26caeaf65950e3b60ff41964d234c032c50470072e7643310b1f6722e34e6: Object.freeze({
43
43
  contractVersion: "1.9.0",
44
- packageVersions: Object.freeze(["4.103.11"]),
44
+ packageVersions: Object.freeze(["4.103.12"]),
45
45
  provenances: Object.freeze([
46
- "workspace package @codyswann/lisa@4.103.11 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
46
+ "workspace package @codyswann/lisa@4.103.12 (typescript/copy-overwrite/scripts/check-nightly-e2e-health.mjs)",
47
47
  ]),
48
48
  }),
49
49
  dfd2fef680de5ef03e63075e8a61c62ca4d95cdfdff6201939b79c748d3397f6: Object.freeze({
@@ -1 +1 @@
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,CAwiGpE,CAAC;AAEL,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAiuVjE,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,CAwiGpE,CAAC;AAEL,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAouVjE,CAAC;AAEL,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAk6I/D,CAAC"}
@@ -1187,7 +1187,7 @@ export const UPSTREAM_EVIDENCE_MANIFEST = Object.freeze({
1187
1187
  "plugins/src/rails/skills/ops-run-local/SKILL.md": "f43176a07e6f863c948194511d18d0bc64ec2917042613b147732efaed496b4a",
1188
1188
  "plugins/src/rails/skills/ops-verify-jobs/SKILL.md": "3458ea2ced915f35f6fef32aaa5491c64c9a64e9f6ef68d3f9ef36d38388e1f4",
1189
1189
  "plugins/src/rails/skills/ops-verify-telemetry/SKILL.md": "ef62ffd2115a67b29ccc2356e555a5e590f7045503400eec5c7289c9c76bb7d4",
1190
- "plugins/src/typescript/hooks/block-suppress-directives.sh": "89c8b356b2edd59d48524bcc74a59eba273a7375574cbde23951babcf971566e",
1190
+ "plugins/src/typescript/hooks/block-suppress-directives.sh": "5ea9756f33064747b1fc5375733de76a61f09685836568d7cb12ff7dc5cdff43",
1191
1191
  "plugins/src/typescript/hooks/format-on-edit.sh": "c9b91f4470a9f96c556124b902a6d86c32c1efe643988b6dcb28dc9b2c127d06",
1192
1192
  "plugins/src/typescript/hooks/lint-on-edit.sh": "7f913add754a9accdc99daf9ff50611e65c5cc363dd99dbc0668e9c928f4eeb4",
1193
1193
  "plugins/src/typescript/hooks/lisa-edit-gate.sh": "0a8d9a043f04b15b71bb500ff03cf1e67e4ac292181a5d596ddf078f301e671f",
@@ -10162,6 +10162,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
10162
10162
  "tests/helpers/staged-dependency-scan.ts": true,
10163
10163
  "tests/helpers/stderr-sync.ts": true,
10164
10164
  "tests/helpers/supervised-unix-fixture.ts": true,
10165
+ "tests/helpers/suppress-directive-growth-cases.ts": true,
10165
10166
  "tests/helpers/template-toolchain.ts": true,
10166
10167
  "tests/helpers/test-run-child-process-analysis.ts": true,
10167
10168
  "tests/helpers/test-run-child-process-binding-plan.ts": true,
@@ -11247,6 +11248,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
11247
11248
  "tests/unit/opencode/block-migration-edits-plugin.test.ts": true,
11248
11249
  "tests/unit/opencode/block-no-verify-emit.test.ts": true,
11249
11250
  "tests/unit/opencode/block-no-verify-plugin.test.ts": true,
11251
+ "tests/unit/opencode/block-suppress-directives-plugin.test.ts": true,
11250
11252
  "tests/unit/opencode/command-installer.test.ts": true,
11251
11253
  "tests/unit/opencode/command-transformer.test.ts": true,
11252
11254
  "tests/unit/opencode/discharge-work-item-gates-plugin.test.ts": true,
@@ -11266,6 +11268,7 @@ export const UPSTREAM_SURFACE_MANIFEST = Object.freeze({
11266
11268
  "tests/unit/opencode/skills-installer.test.ts": true,
11267
11269
  "tests/unit/opencode/support-file-parity.test.ts": true,
11268
11270
  "tests/unit/opencode/support/filing-parity.ts": true,
11271
+ "tests/unit/plugins/block-suppress-directives.test.ts": true,
11269
11272
  "tests/unit/plugins/container-view-pattern-parity.test.ts": true,
11270
11273
  "tests/unit/plugins/hook-registration-agreement.test.ts": true,
11271
11274
  "tests/unit/plugins/hook-registration.test.ts": true,