@codyswann/lisa 4.103.8 → 4.103.9
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 +12 -13
- package/all/copy-overwrite/scripts/lisa-hooks/block-no-verify.sh +4 -5
- package/all/copy-overwrite/scripts/lisa-hooks/worktree-binding-guard.mjs +16 -30
- package/all/copy-overwrite/scripts/lisa-postinstall.mjs +4 -15
- package/all/deletions.json +92 -2
- package/dist/cli/apply.d.ts.map +1 -1
- package/dist/cli/apply.js +1 -22
- package/dist/cli/apply.js.map +1 -1
- package/dist/cli/refresh-hooks-cmd.d.ts.map +1 -1
- package/dist/cli/refresh-hooks-cmd.js +3 -8
- package/dist/cli/refresh-hooks-cmd.js.map +1 -1
- package/dist/cli/worktree-prune.d.ts.map +1 -1
- package/dist/cli/worktree-prune.js +2 -4
- package/dist/cli/worktree-prune.js.map +1 -1
- package/dist/codex/scripts/block-no-verify.sh +4 -5
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +8 -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 +24 -71
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/migrations/index.d.ts +0 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +0 -3
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/prune-retired-third-party-plugins.d.ts +2 -2
- package/dist/migrations/prune-retired-third-party-plugins.js +2 -2
- package/dist/opencode/hooks-installer.d.ts.map +1 -1
- package/dist/opencode/hooks-installer.js +17 -4
- package/dist/opencode/hooks-installer.js.map +1 -1
- package/dist/opencode/plugin-catalog.d.ts.map +1 -1
- package/dist/opencode/plugin-catalog.js +0 -6
- package/dist/opencode/plugin-catalog.js.map +1 -1
- package/dist/opencode/plugin-templates/block-no-verify.sh +4 -5
- package/dist/opencode/plugin-templates/lisa-block-no-verify.ts +1 -1
- package/package.json +6 -8
- package/plugins/lisa/.claude-plugin/plugin.json +1 -5
- package/plugins/lisa/.codex-plugin/hooks.json +0 -4
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/hooks/block-direct-issue-create.sh +12 -13
- package/plugins/lisa/hooks/block-no-verify.agy.sh +4 -5
- package/plugins/lisa/hooks/block-no-verify.sh +4 -5
- package/plugins/lisa/hooks/block-shell-json-parsing.agy.sh +3 -3
- package/plugins/lisa/hooks/failure-signature-index.mjs +2 -2
- package/plugins/lisa/hooks/worktree-binding-guard.mjs +16 -30
- package/plugins/lisa-agy/hooks/block-direct-issue-create.sh +12 -13
- package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +4 -5
- package/plugins/lisa-agy/hooks/block-shell-json-parsing.agy.sh +3 -3
- package/plugins/lisa-agy/hooks.json +0 -13
- 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-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 -5
- package/plugins/lisa-copilot/hooks/block-direct-issue-create.sh +12 -13
- package/plugins/lisa-copilot/hooks/block-no-verify.sh +4 -5
- package/plugins/lisa-copilot/hooks/failure-signature-index.mjs +2 -2
- package/plugins/lisa-copilot/hooks/worktree-binding-guard.mjs +16 -30
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-direct-issue-create.sh +12 -13
- package/plugins/lisa-cursor/hooks/block-no-verify.sh +4 -5
- package/plugins/lisa-cursor/hooks/failure-signature-index.mjs +2 -2
- package/plugins/lisa-cursor/hooks/hooks.json +0 -4
- package/plugins/lisa-cursor/hooks/worktree-binding-guard.mjs +16 -30
- 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-direct-issue-create.sh +12 -13
- package/plugins/lisa-devin/hooks/block-no-verify.sh +4 -5
- package/plugins/lisa-devin/hooks/failure-signature-index.mjs +2 -2
- package/plugins/lisa-devin/hooks/worktree-binding-guard.mjs +16 -30
- package/plugins/lisa-devin/hooks.json +0 -4
- 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-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-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-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-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-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-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-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-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-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-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-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-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-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-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/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/materialized-artifacts.json +0 -2
- package/plugins/src/base/.claude-plugin/plugin.json +0 -4
- package/plugins/src/base/hooks/block-direct-issue-create.sh +12 -13
- package/plugins/src/base/hooks/block-no-verify.agy.sh +4 -5
- package/plugins/src/base/hooks/block-no-verify.sh +4 -5
- package/plugins/src/base/hooks/block-shell-json-parsing.agy.sh +3 -3
- package/plugins/src/base/hooks/failure-signature-index.mjs +2 -2
- package/plugins/src/base/hooks/worktree-binding-guard.mjs +16 -30
- package/scripts/build-plugins.sh +10 -15
- package/scripts/check-cwd-resolution-corpus.mjs +4 -5
- package/scripts/check-generated-artifact-merge-coverage.mjs +0 -7
- package/scripts/copy-opencode-plugin-templates.mjs +0 -1
- package/scripts/generate-agy-plugin-artifacts.mjs +8 -13
- package/scripts/install-claude-plugins.sh +7 -11
- package/scripts/lib/packaged-apply-driver.mjs +4 -22
- package/scripts/lib/shell-guard-refusal-coverage.mjs +3 -3
- package/scripts/materialize-copy-overwrite.mjs +2 -2
- package/scripts/merge-generated-artifact.mjs +3 -3
- package/scripts/remedy-conformance.mjs +12 -13
- package/scripts/two-channel-couplings.json +1 -1
- package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +0 -16
- package/dist/core/native-safety-net-retirement.d.ts +0 -13
- package/dist/core/native-safety-net-retirement.d.ts.map +0 -1
- package/dist/core/native-safety-net-retirement.js +0 -23
- package/dist/core/native-safety-net-retirement.js.map +0 -1
- package/dist/migrations/retire-native-safety-net.d.ts +0 -18
- package/dist/migrations/retire-native-safety-net.d.ts.map +0 -1
- package/dist/migrations/retire-native-safety-net.js +0 -36
- package/dist/migrations/retire-native-safety-net.js.map +0 -1
- package/dist/opencode/plugin-templates/lisa-parity-safety-net.ts +0 -4
- package/dist/opencode/plugin-templates/parity-safety-net.sh +0 -16
- package/plugins/lisa/hooks/parity-safety-net.agy.sh +0 -6
- package/plugins/lisa/hooks/parity-safety-net.sh +0 -16
- package/plugins/lisa-agy/hooks/parity-safety-net.agy.sh +0 -6
- package/plugins/lisa-agy/hooks/parity-safety-net.sh +0 -16
- package/plugins/lisa-copilot/hooks/parity-safety-net.sh +0 -16
- package/plugins/lisa-cursor/hooks/parity-safety-net.sh +0 -16
- package/plugins/lisa-devin/hooks/parity-safety-net.sh +0 -16
- package/plugins/src/base/hooks/parity-safety-net.agy.sh +0 -6
- package/plugins/src/base/hooks/parity-safety-net.sh +0 -13
- package/scripts/deployed-guard-advice.mjs +0 -637
- package/scripts/fixtures/native-safety-net-retirement/Dockerfile +0 -5
- package/scripts/fixtures/native-safety-net-retirement/invoke-opencode.mjs +0 -13
- package/scripts/fixtures/native-safety-net-retirement/isolated-linker.mjs +0 -101
- package/scripts/fixtures/native-safety-net-retirement/journey.mjs +0 -381
- package/scripts/fixtures/native-safety-net-retirement/probes.mjs +0 -208
- package/scripts/fixtures/native-safety-net-retirement/reduced-core.mjs +0 -93
- package/scripts/generate-retired-safety-net-manifest.mjs +0 -56
- package/scripts/generate-scratch-supervisor-profile.mjs +0 -75
- package/scripts/lib/retired-safety-net-manifest.json +0 -150
- package/scripts/retire-native-safety-net.mjs +0 -237
- package/scripts/verify-native-safety-net-retirement.mjs +0 -287
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
# expects an allow/deny JSON object on stdout. The canonical hook consumes the
|
|
6
6
|
# Claude Bash-hook envelope and communicates denial with exit status 2. This
|
|
7
7
|
# adapter only translates protocols; all classification stays in the canonical
|
|
8
|
-
# block-shell-json-parsing.sh beside it (same delegation pattern as
|
|
9
|
-
#
|
|
10
|
-
#
|
|
8
|
+
# block-shell-json-parsing.sh beside it (same delegation pattern as the other
|
|
9
|
+
# *.agy.sh adapters). Fail-open on missing runtimes: a missed nudge here risks
|
|
10
|
+
# a fragile script, not data loss.
|
|
11
11
|
set -uo pipefail
|
|
12
12
|
|
|
13
13
|
allow() {
|
|
@@ -12,19 +12,6 @@
|
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
|
-
"lisa-parity-safety-net": {
|
|
16
|
-
"PreToolUse": [
|
|
17
|
-
{
|
|
18
|
-
"matcher": "run_command",
|
|
19
|
-
"hooks": [
|
|
20
|
-
{
|
|
21
|
-
"type": "command",
|
|
22
|
-
"command": "bash \"$HOME/.gemini/config/plugins/lisa/hooks/parity-safety-net.agy.sh\""
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
15
|
"lisa-block-shell-json-parsing": {
|
|
29
16
|
"PreToolUse": [
|
|
30
17
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa",
|
|
3
|
-
"version": "4.103.
|
|
3
|
+
"version": "4.103.9",
|
|
4
4
|
"description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -90,10 +90,6 @@
|
|
|
90
90
|
"type": "command",
|
|
91
91
|
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/block-no-verify.sh"
|
|
92
92
|
},
|
|
93
|
-
{
|
|
94
|
-
"type": "command",
|
|
95
|
-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/parity-safety-net.sh"
|
|
96
|
-
},
|
|
97
93
|
{
|
|
98
94
|
"type": "command",
|
|
99
95
|
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/block-shell-json-parsing.sh"
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
# over stdin from the same pipeline), and the contents of any file the command
|
|
45
45
|
# names. The last of those is what CodySwannGT/lisa#3484 was: the guard
|
|
46
46
|
# inspected argv and nothing else, so `bash /path/create.sh` showed it two
|
|
47
|
-
# tokens and the creation was one file away. Lisa's own
|
|
48
|
-
#
|
|
49
|
-
#
|
|
47
|
+
# tokens and the creation was one file away. Lisa's own guidance told agents to
|
|
48
|
+
# write payloads to a file and execute the file, so complying with Lisa's
|
|
49
|
+
# guidance produced the bypass.
|
|
50
50
|
#
|
|
51
51
|
# That is exactly the machine-checkable content of `ready-role-filing`, and it
|
|
52
52
|
# lets `lisa-github-write-issue` / `lisa-jira-write-ticket` /
|
|
@@ -854,10 +854,10 @@ GRAPHQL_CREATE = re.compile(r"createIssue|issueCreate")
|
|
|
854
854
|
# classifier two tokens, neither of which is a tracker CLI.
|
|
855
855
|
#
|
|
856
856
|
# It is not an oversight that an operator had to be clever to find. Lisa's OWN
|
|
857
|
-
# guards instruct agents into this shape:
|
|
858
|
-
#
|
|
859
|
-
#
|
|
860
|
-
#
|
|
857
|
+
# guards instruct agents into this shape: a guard that refuses heredocs says
|
|
858
|
+
# "write the payload to a file with the Write tool, then execute that file
|
|
859
|
+
# directly", and `block-shell-json-parsing.sh` pushes JSON construction into
|
|
860
|
+
# `jq` scripts. An agent complying perfectly with Lisa's
|
|
861
861
|
# guidance lands in the uninspected path BY DEFAULT. The guards were
|
|
862
862
|
# individually reasonable and jointly self-defeating.
|
|
863
863
|
#
|
|
@@ -2138,12 +2138,11 @@ def executed_operand(argv):
|
|
|
2138
2138
|
`wc -l`, a `git grep` PATHSPEC and a test run — every one of them read-only,
|
|
2139
2139
|
and one of them blocked running the tests that would have proved a fix.
|
|
2140
2140
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
state. Both live in this directory; this guard was the one that declined.
|
|
2141
|
+
The rule this restores: "Only a COMMAND POSITION can execute something. A
|
|
2142
|
+
path anywhere else is an argument, and an argument is data." Following
|
|
2143
|
+
data is the known-wrong fix. `block-no-verify.sh` (`strip_command_prefix`)
|
|
2144
|
+
implements the same split with a fail-closed third state, in this same
|
|
2145
|
+
directory; this guard was the one that declined.
|
|
2147
2146
|
|
|
2148
2147
|
NOT narrowed to shells, and NOT narrowed to an enumerated interpreter list.
|
|
2149
2148
|
`file_creation` recognises a creation in any language, so `node wrapper.mjs`
|
|
@@ -804,11 +804,10 @@ def nested_shell_payload(tokens, index):
|
|
|
804
804
|
# file away ALLOW — on bash, sh, zsh, `source`, `.`, an absolute interpreter
|
|
805
805
|
# path, and behind every wrapper.
|
|
806
806
|
#
|
|
807
|
-
# THE RULE
|
|
808
|
-
#
|
|
809
|
-
# `
|
|
810
|
-
#
|
|
811
|
-
# it refuses ordinary reads and attributes a file's capability to a command that
|
|
807
|
+
# THE RULE: a path is followed ONLY when the command EXECUTES it.
|
|
808
|
+
# `grep -n x nv.sh`, `git commit -F msg.txt` and `gh pr create --body-file
|
|
809
|
+
# body.md` name a file as DATA, and following those is a known-wrong fix — it
|
|
810
|
+
# refuses ordinary reads and attributes a file's capability to a command that
|
|
812
811
|
# merely mentions it. So COMMAND POSITION decides, never the presence of a path.
|
|
813
812
|
#
|
|
814
813
|
# Non-shell interpreters (`python3 x.py`, `node x.mjs`) are deliberately NOT
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
* rotted, which is exactly what happened to the reference that named
|
|
79
79
|
* `src/cli/doctor-learnings-merge-driver.ts` before it was renamed;
|
|
80
80
|
* - an entry whose `signature` does not match its own recorded `sample` — a
|
|
81
|
-
* regex typo silently disables an entry, the same way a malformed ERE
|
|
82
|
-
* silently
|
|
81
|
+
* regex typo silently disables an entry, the same way a malformed ERE can
|
|
82
|
+
* silently disable a shell guard's project rule;
|
|
83
83
|
* - an index that resolves ZERO entries — an empty routing table is a broken
|
|
84
84
|
* one, never a clean one;
|
|
85
85
|
* - an entry whose `excludes` has no `counterSample` proving it excludes
|
|
@@ -379,8 +379,8 @@ function foreignTreeIn(text, bound, cwd) {
|
|
|
379
379
|
/**
|
|
380
380
|
* A `cd` target this guard cannot turn into a literal directory.
|
|
381
381
|
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
382
|
+
* Contract point 3 of `tests/unit/hooks/support/cwd-resolution-corpus.json`
|
|
383
|
+
* spells out the same rule; keep the two in step.
|
|
384
384
|
*/
|
|
385
385
|
const UNLITERAL_CD_TARGET = /[$`*?[{]/u;
|
|
386
386
|
|
|
@@ -471,33 +471,21 @@ function applyCd(current, target) {
|
|
|
471
471
|
* copy of every script at the same relative path, and they differ by whatever
|
|
472
472
|
* each lane is doing.
|
|
473
473
|
*
|
|
474
|
-
* ##
|
|
474
|
+
* ## A written contract, driven by a corpus
|
|
475
475
|
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
476
|
+
* The resolution rule is a written contract with a corpus of adversarial rows
|
|
477
|
+
* this guard is driven over in CI, so a change to the resolver fails a test on
|
|
478
|
+
* the commit that causes it rather than surfacing later as a wrong verdict.
|
|
479
|
+
* Contract and corpus live in `tests/unit/hooks/support/cwd-resolution-corpus.json`
|
|
480
|
+
* (CodySwannGT/lisa#3952). **A behaviour with no row in the corpus is
|
|
481
|
+
* unpinned — add a row when you add a branch.**
|
|
482
482
|
*
|
|
483
|
-
*
|
|
484
|
-
* guards are driven over in CI, so a divergence fails a test on the commit that
|
|
485
|
-
* causes it rather than surfacing later as a wrong verdict. Contract and corpus
|
|
486
|
-
* live in `tests/unit/hooks/support/cwd-resolution-corpus.json`.
|
|
483
|
+
* ## The corpus pins the RESOLUTION, not the verdict
|
|
487
484
|
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* ## The two guards agree on the RESOLUTION, not on the verdict
|
|
493
|
-
*
|
|
494
|
-
* When the effective directory cannot be known, both guards decline to resolve
|
|
495
|
-
* the token. What they then do differs, and that difference is deliberate:
|
|
496
|
-
* `parity-safety-net.sh` refuses, because a destructive command it cannot see
|
|
497
|
-
* is the thing it exists to stop. This guard fails open, which is the doctrine
|
|
498
|
-
* every other undecidable case in this file follows. The corpus asserts the
|
|
499
|
-
* resolved path, not the exit code, precisely so that one contract can bind two
|
|
500
|
-
* guards whose fail directions are correctly different.
|
|
485
|
+
* When the effective directory cannot be known, this guard declines to resolve
|
|
486
|
+
* the token and fails open, which is the doctrine every other undecidable case
|
|
487
|
+
* in this file follows. The corpus asserts the resolved path rather than the
|
|
488
|
+
* exit code, so the contract stays about resolution.
|
|
501
489
|
*
|
|
502
490
|
* Fails OPEN and says so, like every other undecidable case in this file.
|
|
503
491
|
*/
|
|
@@ -516,10 +504,8 @@ function scriptReachingForeignTree(payload, bound) {
|
|
|
516
504
|
if (!isAbsolute(named) && cwd === null) {
|
|
517
505
|
// Contract point 3: the effective directory is unknown, so WHICH copy of
|
|
518
506
|
// a same-named script would run is unknown too. Declining to resolve is
|
|
519
|
-
// the
|
|
520
|
-
//
|
|
521
|
-
// guards on the resolution precisely so it does not have to bind them
|
|
522
|
-
// on a verdict one of them would be wrong to reach.
|
|
507
|
+
// the contract; failing open rather than refusing is this guard's own
|
|
508
|
+
// doctrine, and the corpus pins the resolution rather than the verdict.
|
|
523
509
|
say(
|
|
524
510
|
`cannot tell which directory ${named} would run from; NOT enforcing on it`
|
|
525
511
|
);
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
# over stdin from the same pipeline), and the contents of any file the command
|
|
45
45
|
# names. The last of those is what CodySwannGT/lisa#3484 was: the guard
|
|
46
46
|
# inspected argv and nothing else, so `bash /path/create.sh` showed it two
|
|
47
|
-
# tokens and the creation was one file away. Lisa's own
|
|
48
|
-
#
|
|
49
|
-
#
|
|
47
|
+
# tokens and the creation was one file away. Lisa's own guidance told agents to
|
|
48
|
+
# write payloads to a file and execute the file, so complying with Lisa's
|
|
49
|
+
# guidance produced the bypass.
|
|
50
50
|
#
|
|
51
51
|
# That is exactly the machine-checkable content of `ready-role-filing`, and it
|
|
52
52
|
# lets `lisa-github-write-issue` / `lisa-jira-write-ticket` /
|
|
@@ -854,10 +854,10 @@ GRAPHQL_CREATE = re.compile(r"createIssue|issueCreate")
|
|
|
854
854
|
# classifier two tokens, neither of which is a tracker CLI.
|
|
855
855
|
#
|
|
856
856
|
# It is not an oversight that an operator had to be clever to find. Lisa's OWN
|
|
857
|
-
# guards instruct agents into this shape:
|
|
858
|
-
#
|
|
859
|
-
#
|
|
860
|
-
#
|
|
857
|
+
# guards instruct agents into this shape: a guard that refuses heredocs says
|
|
858
|
+
# "write the payload to a file with the Write tool, then execute that file
|
|
859
|
+
# directly", and `block-shell-json-parsing.sh` pushes JSON construction into
|
|
860
|
+
# `jq` scripts. An agent complying perfectly with Lisa's
|
|
861
861
|
# guidance lands in the uninspected path BY DEFAULT. The guards were
|
|
862
862
|
# individually reasonable and jointly self-defeating.
|
|
863
863
|
#
|
|
@@ -2138,12 +2138,11 @@ def executed_operand(argv):
|
|
|
2138
2138
|
`wc -l`, a `git grep` PATHSPEC and a test run — every one of them read-only,
|
|
2139
2139
|
and one of them blocked running the tests that would have proved a fix.
|
|
2140
2140
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
state. Both live in this directory; this guard was the one that declined.
|
|
2141
|
+
The rule this restores: "Only a COMMAND POSITION can execute something. A
|
|
2142
|
+
path anywhere else is an argument, and an argument is data." Following
|
|
2143
|
+
data is the known-wrong fix. `block-no-verify.sh` (`strip_command_prefix`)
|
|
2144
|
+
implements the same split with a fail-closed third state, in this same
|
|
2145
|
+
directory; this guard was the one that declined.
|
|
2147
2146
|
|
|
2148
2147
|
NOT narrowed to shells, and NOT narrowed to an enumerated interpreter list.
|
|
2149
2148
|
`file_creation` recognises a creation in any language, so `node wrapper.mjs`
|
|
@@ -804,11 +804,10 @@ def nested_shell_payload(tokens, index):
|
|
|
804
804
|
# file away ALLOW — on bash, sh, zsh, `source`, `.`, an absolute interpreter
|
|
805
805
|
# path, and behind every wrapper.
|
|
806
806
|
#
|
|
807
|
-
# THE RULE
|
|
808
|
-
#
|
|
809
|
-
# `
|
|
810
|
-
#
|
|
811
|
-
# it refuses ordinary reads and attributes a file's capability to a command that
|
|
807
|
+
# THE RULE: a path is followed ONLY when the command EXECUTES it.
|
|
808
|
+
# `grep -n x nv.sh`, `git commit -F msg.txt` and `gh pr create --body-file
|
|
809
|
+
# body.md` name a file as DATA, and following those is a known-wrong fix — it
|
|
810
|
+
# refuses ordinary reads and attributes a file's capability to a command that
|
|
812
811
|
# merely mentions it. So COMMAND POSITION decides, never the presence of a path.
|
|
813
812
|
#
|
|
814
813
|
# Non-shell interpreters (`python3 x.py`, `node x.mjs`) are deliberately NOT
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
* rotted, which is exactly what happened to the reference that named
|
|
79
79
|
* `src/cli/doctor-learnings-merge-driver.ts` before it was renamed;
|
|
80
80
|
* - an entry whose `signature` does not match its own recorded `sample` — a
|
|
81
|
-
* regex typo silently disables an entry, the same way a malformed ERE
|
|
82
|
-
* silently
|
|
81
|
+
* regex typo silently disables an entry, the same way a malformed ERE can
|
|
82
|
+
* silently disable a shell guard's project rule;
|
|
83
83
|
* - an index that resolves ZERO entries — an empty routing table is a broken
|
|
84
84
|
* one, never a clean one;
|
|
85
85
|
* - an entry whose `excludes` has no `counterSample` proving it excludes
|
|
@@ -41,10 +41,6 @@
|
|
|
41
41
|
"command": "${CURSOR_PLUGIN_ROOT}/hooks/block-no-verify.sh",
|
|
42
42
|
"matcher": "Bash"
|
|
43
43
|
},
|
|
44
|
-
{
|
|
45
|
-
"command": "${CURSOR_PLUGIN_ROOT}/hooks/parity-safety-net.sh",
|
|
46
|
-
"matcher": "Bash"
|
|
47
|
-
},
|
|
48
44
|
{
|
|
49
45
|
"command": "${CURSOR_PLUGIN_ROOT}/hooks/block-shell-json-parsing.sh",
|
|
50
46
|
"matcher": "Bash"
|
|
@@ -379,8 +379,8 @@ function foreignTreeIn(text, bound, cwd) {
|
|
|
379
379
|
/**
|
|
380
380
|
* A `cd` target this guard cannot turn into a literal directory.
|
|
381
381
|
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
382
|
+
* Contract point 3 of `tests/unit/hooks/support/cwd-resolution-corpus.json`
|
|
383
|
+
* spells out the same rule; keep the two in step.
|
|
384
384
|
*/
|
|
385
385
|
const UNLITERAL_CD_TARGET = /[$`*?[{]/u;
|
|
386
386
|
|
|
@@ -471,33 +471,21 @@ function applyCd(current, target) {
|
|
|
471
471
|
* copy of every script at the same relative path, and they differ by whatever
|
|
472
472
|
* each lane is doing.
|
|
473
473
|
*
|
|
474
|
-
* ##
|
|
474
|
+
* ## A written contract, driven by a corpus
|
|
475
475
|
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
476
|
+
* The resolution rule is a written contract with a corpus of adversarial rows
|
|
477
|
+
* this guard is driven over in CI, so a change to the resolver fails a test on
|
|
478
|
+
* the commit that causes it rather than surfacing later as a wrong verdict.
|
|
479
|
+
* Contract and corpus live in `tests/unit/hooks/support/cwd-resolution-corpus.json`
|
|
480
|
+
* (CodySwannGT/lisa#3952). **A behaviour with no row in the corpus is
|
|
481
|
+
* unpinned — add a row when you add a branch.**
|
|
482
482
|
*
|
|
483
|
-
*
|
|
484
|
-
* guards are driven over in CI, so a divergence fails a test on the commit that
|
|
485
|
-
* causes it rather than surfacing later as a wrong verdict. Contract and corpus
|
|
486
|
-
* live in `tests/unit/hooks/support/cwd-resolution-corpus.json`.
|
|
483
|
+
* ## The corpus pins the RESOLUTION, not the verdict
|
|
487
484
|
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* ## The two guards agree on the RESOLUTION, not on the verdict
|
|
493
|
-
*
|
|
494
|
-
* When the effective directory cannot be known, both guards decline to resolve
|
|
495
|
-
* the token. What they then do differs, and that difference is deliberate:
|
|
496
|
-
* `parity-safety-net.sh` refuses, because a destructive command it cannot see
|
|
497
|
-
* is the thing it exists to stop. This guard fails open, which is the doctrine
|
|
498
|
-
* every other undecidable case in this file follows. The corpus asserts the
|
|
499
|
-
* resolved path, not the exit code, precisely so that one contract can bind two
|
|
500
|
-
* guards whose fail directions are correctly different.
|
|
485
|
+
* When the effective directory cannot be known, this guard declines to resolve
|
|
486
|
+
* the token and fails open, which is the doctrine every other undecidable case
|
|
487
|
+
* in this file follows. The corpus asserts the resolved path rather than the
|
|
488
|
+
* exit code, so the contract stays about resolution.
|
|
501
489
|
*
|
|
502
490
|
* Fails OPEN and says so, like every other undecidable case in this file.
|
|
503
491
|
*/
|
|
@@ -516,10 +504,8 @@ function scriptReachingForeignTree(payload, bound) {
|
|
|
516
504
|
if (!isAbsolute(named) && cwd === null) {
|
|
517
505
|
// Contract point 3: the effective directory is unknown, so WHICH copy of
|
|
518
506
|
// a same-named script would run is unknown too. Declining to resolve is
|
|
519
|
-
// the
|
|
520
|
-
//
|
|
521
|
-
// guards on the resolution precisely so it does not have to bind them
|
|
522
|
-
// on a verdict one of them would be wrong to reach.
|
|
507
|
+
// the contract; failing open rather than refusing is this guard's own
|
|
508
|
+
// doctrine, and the corpus pins the resolution rather than the verdict.
|
|
523
509
|
say(
|
|
524
510
|
`cannot tell which directory ${named} would run from; NOT enforcing on it`
|
|
525
511
|
);
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
# over stdin from the same pipeline), and the contents of any file the command
|
|
45
45
|
# names. The last of those is what CodySwannGT/lisa#3484 was: the guard
|
|
46
46
|
# inspected argv and nothing else, so `bash /path/create.sh` showed it two
|
|
47
|
-
# tokens and the creation was one file away. Lisa's own
|
|
48
|
-
#
|
|
49
|
-
#
|
|
47
|
+
# tokens and the creation was one file away. Lisa's own guidance told agents to
|
|
48
|
+
# write payloads to a file and execute the file, so complying with Lisa's
|
|
49
|
+
# guidance produced the bypass.
|
|
50
50
|
#
|
|
51
51
|
# That is exactly the machine-checkable content of `ready-role-filing`, and it
|
|
52
52
|
# lets `lisa-github-write-issue` / `lisa-jira-write-ticket` /
|
|
@@ -854,10 +854,10 @@ GRAPHQL_CREATE = re.compile(r"createIssue|issueCreate")
|
|
|
854
854
|
# classifier two tokens, neither of which is a tracker CLI.
|
|
855
855
|
#
|
|
856
856
|
# It is not an oversight that an operator had to be clever to find. Lisa's OWN
|
|
857
|
-
# guards instruct agents into this shape:
|
|
858
|
-
#
|
|
859
|
-
#
|
|
860
|
-
#
|
|
857
|
+
# guards instruct agents into this shape: a guard that refuses heredocs says
|
|
858
|
+
# "write the payload to a file with the Write tool, then execute that file
|
|
859
|
+
# directly", and `block-shell-json-parsing.sh` pushes JSON construction into
|
|
860
|
+
# `jq` scripts. An agent complying perfectly with Lisa's
|
|
861
861
|
# guidance lands in the uninspected path BY DEFAULT. The guards were
|
|
862
862
|
# individually reasonable and jointly self-defeating.
|
|
863
863
|
#
|
|
@@ -2138,12 +2138,11 @@ def executed_operand(argv):
|
|
|
2138
2138
|
`wc -l`, a `git grep` PATHSPEC and a test run — every one of them read-only,
|
|
2139
2139
|
and one of them blocked running the tests that would have proved a fix.
|
|
2140
2140
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
state. Both live in this directory; this guard was the one that declined.
|
|
2141
|
+
The rule this restores: "Only a COMMAND POSITION can execute something. A
|
|
2142
|
+
path anywhere else is an argument, and an argument is data." Following
|
|
2143
|
+
data is the known-wrong fix. `block-no-verify.sh` (`strip_command_prefix`)
|
|
2144
|
+
implements the same split with a fail-closed third state, in this same
|
|
2145
|
+
directory; this guard was the one that declined.
|
|
2147
2146
|
|
|
2148
2147
|
NOT narrowed to shells, and NOT narrowed to an enumerated interpreter list.
|
|
2149
2148
|
`file_creation` recognises a creation in any language, so `node wrapper.mjs`
|
|
@@ -804,11 +804,10 @@ def nested_shell_payload(tokens, index):
|
|
|
804
804
|
# file away ALLOW — on bash, sh, zsh, `source`, `.`, an absolute interpreter
|
|
805
805
|
# path, and behind every wrapper.
|
|
806
806
|
#
|
|
807
|
-
# THE RULE
|
|
808
|
-
#
|
|
809
|
-
# `
|
|
810
|
-
#
|
|
811
|
-
# it refuses ordinary reads and attributes a file's capability to a command that
|
|
807
|
+
# THE RULE: a path is followed ONLY when the command EXECUTES it.
|
|
808
|
+
# `grep -n x nv.sh`, `git commit -F msg.txt` and `gh pr create --body-file
|
|
809
|
+
# body.md` name a file as DATA, and following those is a known-wrong fix — it
|
|
810
|
+
# refuses ordinary reads and attributes a file's capability to a command that
|
|
812
811
|
# merely mentions it. So COMMAND POSITION decides, never the presence of a path.
|
|
813
812
|
#
|
|
814
813
|
# Non-shell interpreters (`python3 x.py`, `node x.mjs`) are deliberately NOT
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
* rotted, which is exactly what happened to the reference that named
|
|
79
79
|
* `src/cli/doctor-learnings-merge-driver.ts` before it was renamed;
|
|
80
80
|
* - an entry whose `signature` does not match its own recorded `sample` — a
|
|
81
|
-
* regex typo silently disables an entry, the same way a malformed ERE
|
|
82
|
-
* silently
|
|
81
|
+
* regex typo silently disables an entry, the same way a malformed ERE can
|
|
82
|
+
* silently disable a shell guard's project rule;
|
|
83
83
|
* - an index that resolves ZERO entries — an empty routing table is a broken
|
|
84
84
|
* one, never a clean one;
|
|
85
85
|
* - an entry whose `excludes` has no `counterSample` proving it excludes
|