@codyswann/lisa 4.90.0 → 4.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/copy-overwrite/scripts/lisa-enforcement-fallback.sh +2 -2
- package/all/copy-overwrite/scripts/lisa-enforcement-freshness.mjs +1 -2
- package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +9 -3634
- package/all/copy-overwrite/scripts/lisa-postinstall.mjs +16 -5
- package/dist/cli/apply.d.ts.map +1 -1
- package/dist/cli/apply.js +25 -4
- package/dist/cli/apply.js.map +1 -1
- package/dist/cli/lisa-test-run-process-group.d.ts.map +1 -1
- package/dist/cli/lisa-test-run-process-group.js +19 -2
- package/dist/cli/lisa-test-run-process-group.js.map +1 -1
- package/dist/core/bootstrap-environment.d.ts +10 -1
- package/dist/core/bootstrap-environment.d.ts.map +1 -1
- package/dist/core/bootstrap-environment.js +14 -5
- package/dist/core/bootstrap-environment.js.map +1 -1
- package/dist/core/enforcement-coverage.d.ts +2 -2
- package/dist/core/enforcement-coverage.d.ts.map +1 -1
- package/dist/core/enforcement-coverage.js +2 -3
- package/dist/core/enforcement-coverage.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +10 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/native-safety-net-retirement.d.ts +13 -0
- package/dist/core/native-safety-net-retirement.d.ts.map +1 -0
- package/dist/core/native-safety-net-retirement.js +23 -0
- package/dist/core/native-safety-net-retirement.js.map +1 -0
- 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 +39 -53
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +3 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/retire-native-safety-net.d.ts +18 -0
- package/dist/migrations/retire-native-safety-net.d.ts.map +1 -0
- package/dist/migrations/retire-native-safety-net.js +36 -0
- package/dist/migrations/retire-native-safety-net.js.map +1 -0
- package/dist/opencode/plugin-catalog.d.ts.map +1 -1
- package/dist/opencode/plugin-catalog.js +1 -0
- package/dist/opencode/plugin-catalog.js.map +1 -1
- package/dist/opencode/plugin-templates/lisa-parity-safety-net.ts +2 -48
- package/dist/opencode/plugin-templates/parity-safety-net.sh +9 -3634
- package/package.json +8 -6
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/hooks/parity-safety-net.agy.sh +5 -49
- package/plugins/lisa/hooks/parity-safety-net.sh +9 -3634
- package/plugins/lisa-agy/hooks/parity-safety-net.agy.sh +5 -49
- package/plugins/lisa-agy/hooks/parity-safety-net.sh +9 -3634
- 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 -1
- package/plugins/lisa-copilot/hooks/parity-safety-net.sh +9 -3634
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/parity-safety-net.sh +9 -3634
- 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/parity-safety-net.sh +9 -3634
- 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/src/base/hooks/parity-safety-net.agy.sh +5 -49
- package/plugins/src/base/hooks/parity-safety-net.sh +9 -3634
- package/scripts/build-plugins.sh +3 -0
- package/scripts/check-generated-artifact-merge-coverage.mjs +7 -0
- package/scripts/fixtures/native-safety-net-retirement/Dockerfile +5 -0
- package/scripts/fixtures/native-safety-net-retirement/invoke-opencode.mjs +13 -0
- package/scripts/fixtures/native-safety-net-retirement/isolated-linker.mjs +101 -0
- package/scripts/fixtures/native-safety-net-retirement/journey.mjs +381 -0
- package/scripts/fixtures/native-safety-net-retirement/probes.mjs +208 -0
- package/scripts/fixtures/native-safety-net-retirement/reduced-core.mjs +93 -0
- package/scripts/generate-lisa-owned-hash-ledger.mjs +1 -1
- package/scripts/generate-retired-safety-net-manifest.mjs +56 -0
- package/scripts/install-claude-plugins.sh +9 -5
- package/scripts/lib/retired-safety-net-manifest.json +150 -0
- package/scripts/lisa-enforcement-fallback.sh +2 -2
- package/scripts/lisa-enforcement-freshness.mjs +1 -2
- package/scripts/remedy-conformance.mjs +5 -1
- package/scripts/retire-native-safety-net.mjs +237 -0
- package/scripts/verify-native-safety-net-retirement.mjs +287 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/** Actual delivered registration/handler probes. Proposed commands are data. */
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
8
|
+
|
|
9
|
+
export const TARGET = "rm -rf /";
|
|
10
|
+
export const CONTROL = "git commit --no-verify -m x";
|
|
11
|
+
export const ORDINARY = "git status --short";
|
|
12
|
+
export const sha = bytes => createHash("sha256").update(bytes).digest("hex");
|
|
13
|
+
export const load = file => JSON.parse(readFileSync(file, "utf8"));
|
|
14
|
+
|
|
15
|
+
/** Run a bounded actual process and retain its full result. */
|
|
16
|
+
export function run(proof, command, args, options = {}) {
|
|
17
|
+
const result = spawnSync(command, args, {
|
|
18
|
+
cwd: proof.root,
|
|
19
|
+
encoding: "utf8",
|
|
20
|
+
timeout: 15 * 60_000,
|
|
21
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
22
|
+
...options,
|
|
23
|
+
});
|
|
24
|
+
const row = {
|
|
25
|
+
command,
|
|
26
|
+
args,
|
|
27
|
+
status: result.status,
|
|
28
|
+
signal: result.signal,
|
|
29
|
+
error: result.error?.message ?? null,
|
|
30
|
+
stdout: result.stdout ?? "",
|
|
31
|
+
stderr: result.stderr ?? "",
|
|
32
|
+
};
|
|
33
|
+
proof.commands.push(row);
|
|
34
|
+
assert.equal(result.error, undefined, JSON.stringify(row));
|
|
35
|
+
assert.equal(result.signal, null, JSON.stringify(row));
|
|
36
|
+
return row;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Require process success, without interpreting it as a native session. */
|
|
40
|
+
export function ok(proof, command, args, options = {}) {
|
|
41
|
+
const result = run(proof, command, args, options);
|
|
42
|
+
assert.equal(result.status, 0, JSON.stringify(result));
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Enumerate real command registrations rather than reconstructing commands. */
|
|
47
|
+
export function commands(value, needle, trail = []) {
|
|
48
|
+
if (Array.isArray(value))
|
|
49
|
+
return value.flatMap((entry, index) =>
|
|
50
|
+
commands(entry, needle, [...trail, index])
|
|
51
|
+
);
|
|
52
|
+
if (value && typeof value === "object") {
|
|
53
|
+
const own =
|
|
54
|
+
typeof value.command === "string" && value.command.includes(needle)
|
|
55
|
+
? [{ path: trail, registration: value, command: value.command }]
|
|
56
|
+
: [];
|
|
57
|
+
return [
|
|
58
|
+
...own,
|
|
59
|
+
...Object.entries(value)
|
|
60
|
+
.filter(([key]) => key !== "command")
|
|
61
|
+
.flatMap(([key, entry]) => commands(entry, needle, [...trail, key])),
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Each runtime receives its actual native tool-input envelope. */
|
|
68
|
+
function envelope(agent, command) {
|
|
69
|
+
return JSON.stringify(
|
|
70
|
+
agent === "agy"
|
|
71
|
+
? { toolCall: { name: "run_command", args: { CommandLine: command } } }
|
|
72
|
+
: {
|
|
73
|
+
tool_name: agent === "devin" ? "exec" : "Bash",
|
|
74
|
+
tool_input: { command },
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Execute the trusted registered hook command, never the proposed tool text. */
|
|
80
|
+
function invoke(proof, agent, registration, pluginRoot, proposal) {
|
|
81
|
+
return run(proof, "/bin/bash", ["-c", registration.command], {
|
|
82
|
+
input: envelope(agent, proposal),
|
|
83
|
+
env: {
|
|
84
|
+
...process.env,
|
|
85
|
+
CLAUDE_PROJECT_DIR: proof.root,
|
|
86
|
+
CLAUDE_PLUGIN_ROOT: pluginRoot,
|
|
87
|
+
PLUGIN_ROOT: pluginRoot,
|
|
88
|
+
CURSOR_PLUGIN_ROOT: pluginRoot,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Assert target transition and an unrelated real refusal on one plugin port. */
|
|
94
|
+
export function pluginProbe(
|
|
95
|
+
proof,
|
|
96
|
+
agent,
|
|
97
|
+
manifest,
|
|
98
|
+
pluginRoot,
|
|
99
|
+
retired,
|
|
100
|
+
scope
|
|
101
|
+
) {
|
|
102
|
+
const data = load(manifest);
|
|
103
|
+
const target = commands(
|
|
104
|
+
data,
|
|
105
|
+
agent === "agy" ? "parity-safety-net.agy.sh" : "parity-safety-net.sh"
|
|
106
|
+
);
|
|
107
|
+
const control = commands(
|
|
108
|
+
data,
|
|
109
|
+
agent === "agy" ? "block-no-verify.agy.sh" : "block-no-verify.sh"
|
|
110
|
+
);
|
|
111
|
+
assert.equal(target.length, 1, `${agent} target registration`);
|
|
112
|
+
assert.equal(control.length, 1, `${agent} control registration`);
|
|
113
|
+
const result = invoke(proof, agent, target[0], pluginRoot, TARGET);
|
|
114
|
+
const unrelated = invoke(proof, agent, control[0], pluginRoot, CONTROL);
|
|
115
|
+
const ordinary = invoke(proof, agent, target[0], pluginRoot, ORDINARY);
|
|
116
|
+
if (agent === "agy") {
|
|
117
|
+
assert.equal(result.status, 0);
|
|
118
|
+
assert.equal(
|
|
119
|
+
JSON.parse(result.stdout).decision,
|
|
120
|
+
retired ? "allow" : "deny"
|
|
121
|
+
);
|
|
122
|
+
assert.equal(unrelated.status, 0);
|
|
123
|
+
assert.equal(JSON.parse(unrelated.stdout).decision, "deny");
|
|
124
|
+
assert.match(JSON.parse(unrelated.stdout).reason, /no.verify/i);
|
|
125
|
+
assert.equal(JSON.parse(ordinary.stdout).decision, "allow");
|
|
126
|
+
} else {
|
|
127
|
+
assert.equal(result.status, retired ? 0 : 2, JSON.stringify(result));
|
|
128
|
+
if (!retired)
|
|
129
|
+
assert.match(result.stderr, /safety.net|recursive forced delete/i);
|
|
130
|
+
assert.equal(unrelated.status, 2);
|
|
131
|
+
assert.match(unrelated.stderr, /no.verify/i);
|
|
132
|
+
assert.equal(ordinary.status, 0);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
agent,
|
|
136
|
+
scope,
|
|
137
|
+
manifest,
|
|
138
|
+
target: target[0],
|
|
139
|
+
control: control[0],
|
|
140
|
+
result,
|
|
141
|
+
unrelated,
|
|
142
|
+
ordinary,
|
|
143
|
+
retirement_assertion_passes: retired,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Invoke real full-apply OpenCode modules under their Bun runtime. */
|
|
148
|
+
export function openCodeProbe(proof, retired) {
|
|
149
|
+
const dir = path.join(proof.root, ".opencode/plugin");
|
|
150
|
+
const invokeModule = (name, factory, proposal) =>
|
|
151
|
+
ok(proof, "bun", [
|
|
152
|
+
"/proof/invoke-opencode.mjs",
|
|
153
|
+
pathToFileURL(path.join(dir, name)).href,
|
|
154
|
+
factory,
|
|
155
|
+
proposal,
|
|
156
|
+
]);
|
|
157
|
+
const result = invokeModule(
|
|
158
|
+
"lisa-parity-safety-net.ts",
|
|
159
|
+
"LisaParitySafetyNet",
|
|
160
|
+
TARGET
|
|
161
|
+
);
|
|
162
|
+
const unrelated = invokeModule(
|
|
163
|
+
"lisa-block-no-verify.ts",
|
|
164
|
+
"LisaBlockNoVerify",
|
|
165
|
+
CONTROL
|
|
166
|
+
);
|
|
167
|
+
const ordinary = invokeModule(
|
|
168
|
+
"lisa-parity-safety-net.ts",
|
|
169
|
+
"LisaParitySafetyNet",
|
|
170
|
+
ORDINARY
|
|
171
|
+
);
|
|
172
|
+
assert.equal(JSON.parse(result.stdout).decision, retired ? "allow" : "deny");
|
|
173
|
+
assert.equal(JSON.parse(unrelated.stdout).decision, "deny");
|
|
174
|
+
assert.match(JSON.parse(unrelated.stdout).reason, /no.verify/i);
|
|
175
|
+
assert.equal(JSON.parse(ordinary.stdout).decision, "allow");
|
|
176
|
+
return {
|
|
177
|
+
agent: "opencode",
|
|
178
|
+
scope: "actual emitted modules",
|
|
179
|
+
result,
|
|
180
|
+
unrelated,
|
|
181
|
+
ordinary,
|
|
182
|
+
retirement_assertion_passes: retired,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Select each actual repository group matching its native shell tool. */
|
|
187
|
+
export function repositoryProbe(proof, agent, file, retired) {
|
|
188
|
+
const data = load(file);
|
|
189
|
+
const matches = commands(data, "lisa-enforcement-fallback.sh").filter(row => {
|
|
190
|
+
const group = row.path
|
|
191
|
+
.slice(0, -2)
|
|
192
|
+
.reduce((value, key) => value[key], data);
|
|
193
|
+
return (
|
|
194
|
+
typeof group.matcher === "string" &&
|
|
195
|
+
new RegExp(group.matcher).test(agent === "devin" ? "exec" : "Bash")
|
|
196
|
+
);
|
|
197
|
+
});
|
|
198
|
+
assert.equal(matches.length, 1);
|
|
199
|
+
const results = [TARGET, CONTROL, ORDINARY].map(proposal =>
|
|
200
|
+
invoke(proof, agent, matches[0], "", proposal)
|
|
201
|
+
);
|
|
202
|
+
assert.deepEqual(
|
|
203
|
+
results.map(row => row.status),
|
|
204
|
+
[retired ? 0 : 2, 2, 0]
|
|
205
|
+
);
|
|
206
|
+
assert.match(results[1].stderr, /no.verify/i);
|
|
207
|
+
return { agent, file, registration: matches[0], results };
|
|
208
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** Real reduced-core apply, separately from the normal package-update journey. */
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { CONTROL, TARGET, ok, run, sha } from "./probes.mjs";
|
|
7
|
+
|
|
8
|
+
const [pkg, projectDir] = process.argv.slice(2);
|
|
9
|
+
assert.equal(process.platform, "linux");
|
|
10
|
+
assert.ok(existsSync("/.dockerenv"));
|
|
11
|
+
const { Lisa } = await import(
|
|
12
|
+
pathToFileURL(path.join(pkg, "dist/core/lisa.js")).href
|
|
13
|
+
);
|
|
14
|
+
const { createDependencies } = await import(
|
|
15
|
+
pathToFileURL(path.join(pkg, "dist/cli/shared-options.js")).href
|
|
16
|
+
);
|
|
17
|
+
const { ConsoleLogger } = await import(
|
|
18
|
+
pathToFileURL(path.join(pkg, "dist/logging/index.js")).href
|
|
19
|
+
);
|
|
20
|
+
const proof = { root: projectDir, commands: [] };
|
|
21
|
+
const hooks = path.join(projectDir, "scripts/lisa-hooks");
|
|
22
|
+
const CANONICAL = "parity-safety-net.sh";
|
|
23
|
+
const CONTROL_HANDLER = "block-no-verify.sh";
|
|
24
|
+
const invoke = (name, command, agy = false) =>
|
|
25
|
+
run(proof, "/bin/bash", [path.join(hooks, name)], {
|
|
26
|
+
input: JSON.stringify(
|
|
27
|
+
agy
|
|
28
|
+
? { toolCall: { name: "run_command", args: { CommandLine: command } } }
|
|
29
|
+
: { tool_name: "Bash", tool_input: { command } }
|
|
30
|
+
),
|
|
31
|
+
});
|
|
32
|
+
const config = {
|
|
33
|
+
lisaDir: pkg,
|
|
34
|
+
destDir: projectDir,
|
|
35
|
+
dryRun: false,
|
|
36
|
+
yesMode: true,
|
|
37
|
+
validateOnly: false,
|
|
38
|
+
skipGitCheck: false,
|
|
39
|
+
postinstall: true,
|
|
40
|
+
harness: "fleet",
|
|
41
|
+
};
|
|
42
|
+
const packageHash = sha(readFileSync(path.join(projectDir, "package.json")));
|
|
43
|
+
const controlHash = sha(readFileSync(path.join(hooks, CONTROL_HANDLER)));
|
|
44
|
+
assert.equal(invoke(CANONICAL, TARGET).status, 2);
|
|
45
|
+
assert.equal(
|
|
46
|
+
JSON.parse(invoke("parity-safety-net.agy.sh", TARGET, true).stdout).decision,
|
|
47
|
+
"deny"
|
|
48
|
+
);
|
|
49
|
+
assert.equal(invoke(CONTROL_HANDLER, CONTROL).status, 2);
|
|
50
|
+
for (const args of [
|
|
51
|
+
["init", "--initial-branch=main"],
|
|
52
|
+
["config", "user.name", "Lisa verification"],
|
|
53
|
+
["config", "user.email", "verification@example.invalid"],
|
|
54
|
+
["add", "--all"],
|
|
55
|
+
["commit", "-m", "Initialize reduced-core fixture"],
|
|
56
|
+
])
|
|
57
|
+
ok(proof, "git", args);
|
|
58
|
+
const lisa = new Lisa(
|
|
59
|
+
config,
|
|
60
|
+
createDependencies(false, true, new ConsoleLogger())
|
|
61
|
+
);
|
|
62
|
+
const result = await lisa.apply();
|
|
63
|
+
assert.equal(result.success, true, JSON.stringify(result));
|
|
64
|
+
assert.equal(invoke(CANONICAL, TARGET).status, 0);
|
|
65
|
+
assert.equal(
|
|
66
|
+
JSON.parse(invoke("parity-safety-net.agy.sh", TARGET, true).stdout).decision,
|
|
67
|
+
"allow"
|
|
68
|
+
);
|
|
69
|
+
assert.equal(invoke(CONTROL_HANDLER, CONTROL).status, 2);
|
|
70
|
+
assert.equal(sha(readFileSync(path.join(hooks, CONTROL_HANDLER))), controlHash);
|
|
71
|
+
assert.equal(
|
|
72
|
+
sha(readFileSync(path.join(projectDir, "package.json"))),
|
|
73
|
+
packageHash
|
|
74
|
+
);
|
|
75
|
+
for (const entry of [
|
|
76
|
+
".opencode/plugin/lisa-parity-safety-net.ts",
|
|
77
|
+
".codex/hooks.json",
|
|
78
|
+
".devin/hooks.v1.json",
|
|
79
|
+
".lisa/apply-receipt.json",
|
|
80
|
+
])
|
|
81
|
+
assert.equal(existsSync(path.join(projectDir, entry)), false, entry);
|
|
82
|
+
console.log(
|
|
83
|
+
JSON.stringify({
|
|
84
|
+
phase: "real-reduced-core-apply",
|
|
85
|
+
outcome: "PASS",
|
|
86
|
+
apply_mode: "postinstall-safe",
|
|
87
|
+
target: "allowed",
|
|
88
|
+
unrelated: "refused",
|
|
89
|
+
package_preserved: true,
|
|
90
|
+
no_agent_emit_or_counterfeit_receipt: true,
|
|
91
|
+
commands: proof.commands,
|
|
92
|
+
})
|
|
93
|
+
);
|
|
@@ -232,7 +232,7 @@ function digest(bytes) {
|
|
|
232
232
|
* @param {string} source - Repo-relative source path
|
|
233
233
|
* @returns {string[]} Hashes of every historical revision plus the checked-in copy
|
|
234
234
|
*/
|
|
235
|
-
function historicalHashes(root, source) {
|
|
235
|
+
export function historicalHashes(root, source) {
|
|
236
236
|
const hashes = [];
|
|
237
237
|
const current = workingCopy(root, source);
|
|
238
238
|
if (current !== undefined) hashes.push(digest(current));
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** Hash ownership for the three retired native safety-net entry points. */
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import {
|
|
7
|
+
historicalHashes,
|
|
8
|
+
readLedgerSections,
|
|
9
|
+
} from "./generate-lisa-owned-hash-ledger.mjs";
|
|
10
|
+
import { withOwnershipHeader } from "./materialize-copy-overwrite.mjs";
|
|
11
|
+
|
|
12
|
+
const root = path.resolve(import.meta.dirname, "..");
|
|
13
|
+
const output = path.join(root, "scripts/lib/retired-safety-net-manifest.json");
|
|
14
|
+
const sources = {
|
|
15
|
+
"parity-safety-net.sh": "plugins/src/base/hooks/parity-safety-net.sh",
|
|
16
|
+
"parity-safety-net.agy.sh": "plugins/src/base/hooks/parity-safety-net.agy.sh",
|
|
17
|
+
"lisa-parity-safety-net.ts":
|
|
18
|
+
"src/opencode/plugin-templates/lisa-parity-safety-net.ts",
|
|
19
|
+
};
|
|
20
|
+
const previous = (() => {
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(readFileSync(output, "utf8"));
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (error.code === "ENOENT") return {};
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
})();
|
|
28
|
+
const { ledger } = readLedgerSections(root);
|
|
29
|
+
const entries = Object.fromEntries(
|
|
30
|
+
Object.entries(sources).map(([name, source]) => {
|
|
31
|
+
// Keep known hashes under shallow clones, just as the shipping ledger does.
|
|
32
|
+
const hashes = new Set([
|
|
33
|
+
...(previous[name]?.hashes ?? []),
|
|
34
|
+
...(ledger?.get(`scripts/lisa-hooks/${name}`) ?? []),
|
|
35
|
+
...historicalHashes(root, source),
|
|
36
|
+
...historicalHashes(root, `plugins/lisa/hooks/${name}`),
|
|
37
|
+
...historicalHashes(root, `plugins/lisa-agy/hooks/${name}`),
|
|
38
|
+
]);
|
|
39
|
+
const authored = readFileSync(path.join(root, source), "utf8");
|
|
40
|
+
const shim =
|
|
41
|
+
name === "parity-safety-net.sh"
|
|
42
|
+
? withOwnershipHeader(authored, name)
|
|
43
|
+
: authored;
|
|
44
|
+
hashes.add(createHash("sha256").update(shim).digest("hex"));
|
|
45
|
+
return [name, { source, hashes: [...hashes].sort(), shim }];
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
const rendered = `${JSON.stringify(entries, null, 2)}\n`;
|
|
49
|
+
if (process.argv.includes("--check")) {
|
|
50
|
+
if (readFileSync(output, "utf8") !== rendered) {
|
|
51
|
+
console.error(
|
|
52
|
+
"Retired safety-net ownership changed; run node scripts/generate-retired-safety-net-manifest.mjs"
|
|
53
|
+
);
|
|
54
|
+
process.exitCode = 1;
|
|
55
|
+
} else console.log("Retired safety-net ownership is current.");
|
|
56
|
+
} else writeFileSync(output, rendered);
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Explicit setup helper.
|
|
2
|
+
# Explicit setup helper. Installation reconciles only the retired safety net.
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
6
|
+
PACKAGE_ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
7
|
+
|
|
8
|
+
# Target-only retirement also runs for legacy direct setup callers. It never
|
|
9
|
+
# invokes full apply or changes unrelated templates, checks or plugin choices.
|
|
10
|
+
node "$SCRIPT_DIR/retire-native-safety-net.mjs" --install
|
|
11
|
+
|
|
5
12
|
# Inspect the lifecycle before sanitizing the package manager's environment.
|
|
6
13
|
# Older host postinstall commands are also handled by the CLI bootstrap guard.
|
|
7
14
|
if [[ "${npm_lifecycle_event:-}" = "postinstall" ||
|
|
8
15
|
( -z "${npm_lifecycle_event:-}" && "${npm_config_user_agent:-}" = bun/* ) ]]; then
|
|
9
|
-
echo 'lisa: installation leaves project templates unchanged. Run `lisa apply .` to apply updates, or `lisa doctor` to check freshness.'
|
|
16
|
+
echo 'lisa: installation leaves unrelated project templates unchanged. Run `lisa apply .` to apply updates, or `lisa doctor` to check freshness.'
|
|
10
17
|
exit 0
|
|
11
18
|
fi
|
|
12
19
|
|
|
13
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
14
|
-
PACKAGE_ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
15
|
-
|
|
16
20
|
case "$PACKAGE_ROOT" in
|
|
17
21
|
*/node_modules/.pnpm/*/node_modules/@codyswann/lisa)
|
|
18
22
|
PROJECT_ROOT="${PACKAGE_ROOT%%/node_modules/.pnpm/*}"
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parity-safety-net.sh": {
|
|
3
|
+
"source": "plugins/src/base/hooks/parity-safety-net.sh",
|
|
4
|
+
"hashes": [
|
|
5
|
+
"062c69eea85157f1e941ec3626d8912aa9f182af6ccdbe19687588a6074db5ce",
|
|
6
|
+
"07002535de10d89f6d73e8922517550a02a8974549aaf200c9c314e6f4f83c70",
|
|
7
|
+
"0a984421f99371c00391f48ca6da2508f67385812d0b168fceed1fd29edfd936",
|
|
8
|
+
"1026cf31eceae774ceb055f023ea0edd70d8dcca6132161a932289adea04ba7e",
|
|
9
|
+
"10f328abffac44d436c709d328cb4d8b2a0d2fe2bbe61c774c92da07e98651ad",
|
|
10
|
+
"1162ffd16cef3b23282d2f5207abcb88429462a74a9df1035f0df4968f6dd456",
|
|
11
|
+
"12a2baaf08d27f7944f78fa61c0e36b4bd66adda72310381b12a03a5b380c54f",
|
|
12
|
+
"14158ed93668fadc2154074470dcb257bbb28d8e6b62c8d8615b78fa200d72b0",
|
|
13
|
+
"14fc5e292aebf83dd24fec12fb32e2beb509a9324f127a24a64d5c5d4d05c576",
|
|
14
|
+
"1bf3512bb94923a6cb25b1e7a619a3fc8e1336bffa16f499b459aaee3eaed66d",
|
|
15
|
+
"1d0dbbf436f87ad8b2252ca1a559e44f96751b1c3261cc7a7021989998e2231c",
|
|
16
|
+
"1d4fbe135f1bb4e861d286a6512ed201d4522250dfe3f9eba6584bc5ff166a95",
|
|
17
|
+
"1eef68ecb04183ec75f0c049f039e60c6030d1e7ffb4974c59ef47488e4a3931",
|
|
18
|
+
"1f4759053311d99f371b4f16b6a2c7cc8a6b9afc3f717512c9a4dab595616a17",
|
|
19
|
+
"23cfde6251672a87565af7c2a3dad3c02907d9e726a31e86f3124d7e1030273f",
|
|
20
|
+
"26cd8395f18dda3860a73e90c9c68d16caa07de8a8aa26f71dc09f1c3d74bb15",
|
|
21
|
+
"2b1ca7d317dea3af106df1a74b1718e3df9c18e76e9d9d769aa3271b7abf8a3f",
|
|
22
|
+
"2b3d806137b34bfdd21be9e76ca5159f7b11fbd3ca9223d99bef298e42f49c0d",
|
|
23
|
+
"2bdba97c9a1ccc0e70247ee02b5eff02c042aba83b8e7fed3dfbf29a8a83b394",
|
|
24
|
+
"2da3ad6d7680b61e20b48022e57b8960e063266cb26c197c2c8daa89adf4b648",
|
|
25
|
+
"2f20dd5fca989c27165dda50270546297095fb1b6620a98e9b66ac6dd5d82b94",
|
|
26
|
+
"307f934810a36f5889bc443d7ab3f4166eccd74820b44ff2973b6fc58fe0841d",
|
|
27
|
+
"388cf8847581d96a1ff8ea98290a33a5f96d67cdd502ea807a0b8d88efe90e19",
|
|
28
|
+
"38ae9df19e83950549d8832e888b18654e6d4c45ebfed857c423554cd3ead9f7",
|
|
29
|
+
"3b884946639996f862d0ed6b3a6e34c94f5f8f0189822fc7acba9b1ff241a969",
|
|
30
|
+
"3be47054e9a434dd748e63f9cfad67437824c9b9feda292b28b5757fd2d06ad9",
|
|
31
|
+
"3cc1b8a1730f7a35b82293824715538432bb4c410be38d64ee887eb55fea23b4",
|
|
32
|
+
"3dcf3897381b6cd14903681b371ffde94e3839f34a39acb6192d69f20e06345d",
|
|
33
|
+
"40e12bb956baacb23846456d20b840e11c14dae539fc67806476eb674d6c38b1",
|
|
34
|
+
"40e6c3a23809cf322441265600326fa8c45b184fd9193cd3f8ffdeed597b5365",
|
|
35
|
+
"4242b39169bb05aaac4113569125a2c3a351c5dde2d12fd7dacc303dd9a2b5a4",
|
|
36
|
+
"450338257697a75a8fce9f06f3fc00bf3417947e50d601794da41f9c520a7cc3",
|
|
37
|
+
"4693b532d4f406af6d9559382d35cb65a77782a611a0cba2838d182c71690472",
|
|
38
|
+
"4e3be52be5d36c4be961557188b4f46ba1f1a17a09e53c6514b82ff11a8920db",
|
|
39
|
+
"57051a1913665b34acc342002d799c703258650a19c9b9894e1911ddf3bd519f",
|
|
40
|
+
"5d65516d4a1c7cd41c82941596e9f3fe9b96a1030891b40a1a6080171dddede8",
|
|
41
|
+
"5ef7c10bee0110c4af1e429fac01332433102c495ec467966ddd7b1494dc899d",
|
|
42
|
+
"61f639b07344124fa6c1c66b031e7a699cded442d5ac9a44e1027cba686b6fa2",
|
|
43
|
+
"64546813f168fb446f39e34bc674fd3af85b15bd5e7f4f6bf4503463e701a7b9",
|
|
44
|
+
"649968db4d1aa6ee33fb83ea16d7481806b5cbf3a94aceed9a22bb2615ecf71a",
|
|
45
|
+
"649aecd270cb50794f04a02224e53f8ca6c4409ae50aae73017b62803048be57",
|
|
46
|
+
"67a600105e3d96c0bfedcfc576fe667c4698679236a6c8253fcd8ff2eaf9e649",
|
|
47
|
+
"6a77308c1dc48e3bb87e2ee3a9494e9cb00bea127df0d4cfdf02b2afbdc2bbcb",
|
|
48
|
+
"6c4d5267bc8c4a97a9970987f880f9651c1b2fa2aab9948599d9cb1020ca7614",
|
|
49
|
+
"6cefe613e6cf296fc10927ed886981b00e1f627cb98c1ad1de20db5c829ddfd2",
|
|
50
|
+
"6e76a941e1afb0ebb223d527bc70f73eb101650df5b9d61f77ae951dd601e94d",
|
|
51
|
+
"72640d632dbcfa9fc2fc1b7b22a0d232487251c899352168640e3cd91a52c377",
|
|
52
|
+
"743663565a80b56abc63fbe23dd4da557c41c96a6e98bfe7eca46245dc4e7cb9",
|
|
53
|
+
"74b5b90fcf15dbeb14a69677cf74e339154421cd056fdaf603d1167b34a74105",
|
|
54
|
+
"772202ddd42d626625ff719666afbbe83445d8bae1bc7c0fb5ffdcb402be83f8",
|
|
55
|
+
"7b2c5ea41466f0334a6100a411ca6de033964b3b054d32e0e40778a2ad53bb41",
|
|
56
|
+
"7c5907f9c8f230963f49c4022ccf972cda26634d2ab766118477bbd62f2bdd88",
|
|
57
|
+
"7d034892e60ba52dc964c8d46bcd6aa2ad203b451da8043c12eaf4d646e0011d",
|
|
58
|
+
"7f55986eb29f8ace8616595da4bbe60d80a96f9f29b24fb72efd66bb96b22464",
|
|
59
|
+
"80998c022d907cb2442f93f1356caf8f8f7f50e27cfd44e491f95177b98da458",
|
|
60
|
+
"8509567b13d520ca3d455c2f7ebc69a043d4a73deeab8ba402bb2e1b3c68930e",
|
|
61
|
+
"8b17a697b8a5d0ad13fc2c6012a76915183fc74f3fa1b3eb3fbf8658ca587343",
|
|
62
|
+
"8e19d5f1ba7abe3d22fbee47ff8e0fad76b965ccca20b8849e3c43ab07d9a4ef",
|
|
63
|
+
"90115e7e9d61ff6b0ab64d5154783805ac41e968dcaf398c7a807e76c3f07a9e",
|
|
64
|
+
"9404c374cbd90a0860410080f1044d087c51d84bb4c0a37343c2b632c3a9d03b",
|
|
65
|
+
"98c98b87b3a706dc0f6627bf3f74c815ec1e0f6e111da720bcc92831fe78a7c7",
|
|
66
|
+
"9c8762f3d200572adcdc8ed5718bdd6282fe0fad2eea595a05c559b3dc55aa00",
|
|
67
|
+
"9e5b906e069c6d759304e208a9bc6a089c453c21561b120181ec2c62e8325b45",
|
|
68
|
+
"a10252283023f8657677529e515db6d828453ee3a786fda1ba878f6ac7a35d45",
|
|
69
|
+
"a185d2af6016f93ae7ffe4d584dc36e4e45f624ad5c81113114e12785003b373",
|
|
70
|
+
"a211f1a06aecddb841851463da302f694ab0eafff6bab75ee944b0a58aac431d",
|
|
71
|
+
"a22fd1b7c483f1a538202353ee85c82be17a8910e03c0a930635ce8cb3595c64",
|
|
72
|
+
"a28779ba2e6e4e999014d50734ea0b7e36af886bdb08d144bd4274acd642c902",
|
|
73
|
+
"a71032a182f2cebea3c90476de1ab49bf7a99d0ecbb331fe95ebbeada0f5a0ff",
|
|
74
|
+
"a77a6a15a74a98135d73dcf41e26ee3bbc69f1575693c7c40e3d47a946a2eb07",
|
|
75
|
+
"aa887e9b54353d2a6622547bb4abc442fa33848e3269643a7461e0432b40bee1",
|
|
76
|
+
"ad836d6bcf9b5222b313ba1b8b6714448bac0ca8446feaa55430079d0115f2f7",
|
|
77
|
+
"afe82473fe2a08af298997cbce62417fdaefa37f4a963f720ed38b992a65b8d3",
|
|
78
|
+
"affab52ae58f0ec50ea2a80398c4362a77cb51f824fa8a615bd3e3de8c3e36ca",
|
|
79
|
+
"b0a251412034a54d3a254a5af2c2d1bdb4c6e4e1db3b148c819fa587a2bd7620",
|
|
80
|
+
"b4848fc9e7c2f208369eb340d75e59ca0053b9d6a870c3b39bee781fb9b0fd6a",
|
|
81
|
+
"b5505f55a5092f1d451ae5a01ada85a031e5b063d08fc0ce5527d94b67191a60",
|
|
82
|
+
"b6fbbda29d897a7c39cf0524c91d5c66a47054df32e036f15cdabefdc34ac72a",
|
|
83
|
+
"b755796c218d5b397f4b4bc9077e25a7c5d9bf4fa94eee41c6191a65a80cae78",
|
|
84
|
+
"b83c5043a0f29b2d8851258acfe6906aab7922cd80f486e25220e55f26a8c0a5",
|
|
85
|
+
"bacf584ff4783ab3cb94b59b38fc92dcbc1a9bc3e96ee78246109abede88bfcd",
|
|
86
|
+
"baf3c78b7c333735142cc1a7bc19369f953a4699f7be517bb4e3c12167d5c60b",
|
|
87
|
+
"bb400559f30ffaddcd93c8a2fc64e01922041a3cfdb213d85beb7fed68b42a28",
|
|
88
|
+
"bc67b489af67175696a4378d7e04fe3a7ad3e00029aabc6611bdcf740fc35b32",
|
|
89
|
+
"c0aa42f5e0a15a5d1938369129d0b7f726a4db1a80389d427e6f9647d7cf97fa",
|
|
90
|
+
"c0b820f7b9a1992f11e8ac79b717a228bb3abb055dc72a8f2b11a489c7a6b68b",
|
|
91
|
+
"c4a51de3f1512e7e18935612137e4ddaf548db68f878d8239fcc85436b0f27c7",
|
|
92
|
+
"c57b70eed03b74e7c8335c40b0c2b1102e217e507337b71fcf3d2bec5a450bf8",
|
|
93
|
+
"c663d2a06b32fb263e52cdc9b713a8f73d53f8dc9adebccea44f481210b742d6",
|
|
94
|
+
"c78524d4f11d1de4887c6df139c809dac05813ead6f1e0261f39b8c54f37263c",
|
|
95
|
+
"c93b51e96272b8e2df8a1524b47bc6affd0d327b591f6efe55fe1cb3f16dea17",
|
|
96
|
+
"caea02a07027fc1c74d47e08b36299d369c5c9f7c4043da8828fbca3c64eb2aa",
|
|
97
|
+
"cb5275900b141dc8befc124f2c2e818524a2f65ab8db484ba83f1c00b6210b30",
|
|
98
|
+
"cc9b44042d184a65277116009fccc26a678b57dbc51699e5acaae8afdf9735ff",
|
|
99
|
+
"cda051c451145d6ff93a744a290176640cae39309cd346a00e73a924add089d8",
|
|
100
|
+
"cecab19d8997af8a0864cebf25f32d9bb537043894fc06cc2389fe9c159da529",
|
|
101
|
+
"cfa7f56b1db4e1c0cedb8c3af39eb1af25202569ad5299b278db002ae3584913",
|
|
102
|
+
"d12583803e8ff5e4b64e68eafc8d3c377af4c400d8b7ecd1c7fe699d8f92784a",
|
|
103
|
+
"d70546773bef81d3c8accb2e4bcdde33fe233d253052f382adc8b50b9f2ef178",
|
|
104
|
+
"d9ea58150aa27e7f0aa9a4ef155ed446d30bdfc932d01c64e2b8ca211aa0de7b",
|
|
105
|
+
"db56b49f8a069f5a2f7d352b4f880d8637c3b82ae106e9bf148747f0de424dce",
|
|
106
|
+
"dc9fb867693d67015b3cfd59f5f4bc81aba418746c3c22663d421e0c345b9295",
|
|
107
|
+
"df2ff8dc0f4be6077c2824bb0ece2eb5e72b982538b87e3c758128bc824185f1",
|
|
108
|
+
"df4de965f12ac79a5e9d75c795780e5f1db641468dca7a9d373deb36d9765114",
|
|
109
|
+
"e192737a8756b97e406d2b1cbdb099e3b7f190cc6b96c3681284637de95c1646",
|
|
110
|
+
"e328293f30b39345c26472d3f55b5870d6e23b36d351cd81b43f8cd99a6a608d",
|
|
111
|
+
"e6213bdbfb477f1e37f9111c1e46df1365cb85d5190c5a0cc134edbba52e7d9f",
|
|
112
|
+
"e63b511a942eb2735db2d1b26f13b7eabc60f56e2f40d343dbd58cd3ffe765ba",
|
|
113
|
+
"e6a7f34b68e7c0f1c91669aa90dbbc52d475776efd48922b4cfdf6c4736ccec0",
|
|
114
|
+
"e77079eaa42abf6ab05b4b9140c56a9e9ebbbcac2bc4c01c369e5c1bc5104e6f",
|
|
115
|
+
"eac730634b0f36a91d8a1c18dfb52bdcd668d353420faf525c7bdfdeafb6b509",
|
|
116
|
+
"eb1eb871e8f2f2a21d4bf5bd3a0197975269bf80faf12063bc4ca2bc8660bc1b",
|
|
117
|
+
"ec2eca79031802a67b973482c67cc6dc704606dc12cc4ef3c1904f0afde8480b",
|
|
118
|
+
"ed490ea5c1cfde1b224d935a071cd82ce7578c83fe53815aaf91f1fc4e46f216",
|
|
119
|
+
"f0bc51085b954b4fc9dcda8329069e8c23cc2a3a8bc388d69a1bb43e96af4bda",
|
|
120
|
+
"f0bf8390d9d857b7a1da17504dceb9699c1d4399bcf70d543c3a509caf70888c",
|
|
121
|
+
"f58a1b98128d90ab8879dc08177fb53482c15dc6c743efefc63bda4f2a5f9728",
|
|
122
|
+
"f740f600b255742a50f28e5c9d09427c5783c4084e84052dca46bc1f0c94a187",
|
|
123
|
+
"f7ae7f75c84d00d730f525a2f7779afe7fd68e0f81b58f955739718a4890dd35",
|
|
124
|
+
"f9ba6746df5639e0ac307bbfeaf8f98fc15856a4452986ae6a6b3ad884d26f15",
|
|
125
|
+
"f9f2622b2664ced23825a3c35400797ed68e274677aabdfa69e590218109a10e",
|
|
126
|
+
"fa8f4a6517eacd9266feb7afd62398cdf2075d4824cac24b45bb64ad0cd18c86",
|
|
127
|
+
"fb487a2d54b05a8d3268ce46e64b044a68896827941eb9e6e25b975e76762e13",
|
|
128
|
+
"ff15992834e3bb911a560a6f65be76a791a8cd262f36b18972f25a8dc36d7c00"
|
|
129
|
+
],
|
|
130
|
+
"shim": "#!/usr/bin/env bash\n# This file is managed by Lisa and IS replaced on each `lisa` run.\n# Do not edit directly — durable changes belong upstream in Lisa.\n\n# Retired in #4672. Kept callable for persisted and already-loaded hooks.\n# The Lisa plugin and every unrelated guard remain enabled.\n# The shared parser remains for active instruction guards and legacy copies.\n# No input parsing, command execution, dependencies, or policy refusals.\n# Retained source-profile metadata for compatibility with build tooling. The\n# retired hook never uses this profile to classify a command.\nreadonly SCRATCH_SUPERVISOR_SHA256='76ccf8ca6f98b214361f02ebf6ad58041129b76ed29128455e810095db6c292f'\nreadonly SCRATCH_SUPERVISOR_CLEANUP_COUNT='7'\n# Drain hook input with bounded Bash builtins so native writers do not hit a\n# closed pipe. Nothing in the input is interpreted or executed.\nwhile IFS= read -r -n 8192 _lisa_retired_chunk || [ -n \"$_lisa_retired_chunk\" ]; do :; done\nexit 0\n"
|
|
131
|
+
},
|
|
132
|
+
"parity-safety-net.agy.sh": {
|
|
133
|
+
"source": "plugins/src/base/hooks/parity-safety-net.agy.sh",
|
|
134
|
+
"hashes": [
|
|
135
|
+
"11a4046b6c5b084e2ccd23f956a5b243e20eb83779a379c0874fafff2c1e95c8",
|
|
136
|
+
"ce9bd2b4566ad9147e4ace56434cffbbe87edb4ccbb57549ab3fd9f4c671ced4"
|
|
137
|
+
],
|
|
138
|
+
"shim": "#!/usr/bin/env bash\n# Retired native safety-net adapter (#4672). Old agy registrations stay valid.\n# Does not require the formerly delegated parity-safety-net.sh sibling.\nwhile IFS= read -r -n 8192 _lisa_retired_chunk || [ -n \"$_lisa_retired_chunk\" ]; do :; done\nprintf '{\"decision\":\"allow\"}\\n'\nexit 0\n"
|
|
139
|
+
},
|
|
140
|
+
"lisa-parity-safety-net.ts": {
|
|
141
|
+
"source": "src/opencode/plugin-templates/lisa-parity-safety-net.ts",
|
|
142
|
+
"hashes": [
|
|
143
|
+
"7e3b3f6e0e6548984146b2b8ab471266631458309695f5fc794eb0d792342bef",
|
|
144
|
+
"870365ad7876d8f2ba991e8654899fc888e6c37c4977508b8d790869654f647e",
|
|
145
|
+
"a7bf88e6e5aa39b95785ec2522d9ee9b56b69935a17350fd7b5c06aea396fbc7",
|
|
146
|
+
"b8c5cce685557676782daa5c4cc932a3f3deb647ead8b2de3efd5157ab135003"
|
|
147
|
+
],
|
|
148
|
+
"shim": "/** Retired native safety-net compatibility entry (#4672). No sibling required. */\nexport const LisaParitySafetyNet = async () => ({\n \"tool.execute.before\": async () => {},\n});\n"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Run Lisa's Bash enforcement guards when the plugin that normally provides them
|
|
4
4
|
# is not installed.
|
|
5
5
|
#
|
|
6
|
-
#
|
|
6
|
+
# Active PreToolUse guards — block-no-verify,
|
|
7
7
|
# block-shell-json-parsing, block-instruction-file-edits,
|
|
8
8
|
# block-direct-issue-create, block-blind-automerge, worktree-binding-guard —
|
|
9
9
|
# is declared in the Lisa plugin. A cloud session
|
|
@@ -560,7 +560,7 @@ shadowed=""
|
|
|
560
560
|
host_tree_used=0
|
|
561
561
|
plugin_tree_used=0
|
|
562
562
|
|
|
563
|
-
for guard in block-no-verify
|
|
563
|
+
for guard in block-no-verify block-shell-json-parsing \
|
|
564
564
|
block-instruction-file-edits block-direct-issue-create \
|
|
565
565
|
block-managed-file-edits block-blind-automerge worktree-binding-guard; do
|
|
566
566
|
if [ -f "$host_tree/$guard.sh" ]; then
|
|
@@ -19,7 +19,6 @@ const RECORD_LIMIT = 4 * 1024 * 1024;
|
|
|
19
19
|
const GUARD_LIMIT = 1024 * 1024;
|
|
20
20
|
const GUARDS = new Set([
|
|
21
21
|
"block-no-verify",
|
|
22
|
-
"parity-safety-net",
|
|
23
22
|
"block-shell-json-parsing",
|
|
24
23
|
"block-instruction-file-edits",
|
|
25
24
|
"block-direct-issue-create",
|
|
@@ -141,7 +140,7 @@ if (
|
|
|
141
140
|
marketplace?.name === "lisa" ? version(marketplace.version) : ""
|
|
142
141
|
);
|
|
143
142
|
|
|
144
|
-
//
|
|
143
|
+
// Seven pairs / fourteen MiB, plus one overflow-probe byte per file. Only
|
|
145
144
|
// host-selected names are nonempty; plugin-selected guards are not compared.
|
|
146
145
|
for (const [index, name] of names.entries()) {
|
|
147
146
|
let state = "unknown";
|
|
@@ -394,6 +394,10 @@ export function formatRemedyConformanceReport(sweep) {
|
|
|
394
394
|
export function guardChainClassifier(guardPath, cwd) {
|
|
395
395
|
return command =>
|
|
396
396
|
spawnSync("/bin/bash", [guardPath], {
|
|
397
|
+
cwd,
|
|
398
|
+
env: { ...process.env, CLAUDE_PROJECT_DIR: cwd },
|
|
399
|
+
timeout: 30_000,
|
|
400
|
+
maxBuffer: 1024 * 1024,
|
|
397
401
|
input: JSON.stringify({
|
|
398
402
|
tool_name: "Bash",
|
|
399
403
|
tool_input: { command },
|
|
@@ -426,7 +430,7 @@ if (invokedAsScript(import.meta.url)) {
|
|
|
426
430
|
const sweep = sweepRemedyConformance({
|
|
427
431
|
probes: raw.length === 0 ? null : JSON.parse(raw).probes,
|
|
428
432
|
permits: guardChainClassifier(
|
|
429
|
-
process.argv[2] ?? "
|
|
433
|
+
process.argv[2] ?? "scripts/lisa-enforcement-fallback.sh",
|
|
430
434
|
process.cwd()
|
|
431
435
|
),
|
|
432
436
|
});
|