@codyswann/lisa 4.103.8 → 4.103.10
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/nightly-e2e-guard-behavior-certificate.js.map +1 -1
- 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 +21 -5
- 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 -2
- 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-heredoc.py +0 -1004
- 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
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/** Genuine Bun isolated dependency update with an old executable host fallback. */
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import {
|
|
4
|
-
cpSync,
|
|
5
|
-
existsSync,
|
|
6
|
-
mkdirSync,
|
|
7
|
-
readFileSync,
|
|
8
|
-
realpathSync,
|
|
9
|
-
writeFileSync,
|
|
10
|
-
} from "node:fs";
|
|
11
|
-
import { homedir } from "node:os";
|
|
12
|
-
import path from "node:path";
|
|
13
|
-
import { ok, repositoryProbe, sha } from "./probes.mjs";
|
|
14
|
-
|
|
15
|
-
assert.equal(process.platform, "linux");
|
|
16
|
-
assert.ok(existsSync("/.dockerenv"));
|
|
17
|
-
assert.equal(homedir(), "/root");
|
|
18
|
-
const [parentRoot, preview] = process.argv.slice(2);
|
|
19
|
-
const root = "/isolated-linker-project";
|
|
20
|
-
const pkg = path.join(root, "node_modules/@codyswann/lisa");
|
|
21
|
-
const hooks = path.join(root, "scripts/lisa-hooks");
|
|
22
|
-
const target = path.join(hooks, "parity-safety-net.sh");
|
|
23
|
-
const settings = path.join(root, ".claude/settings.json");
|
|
24
|
-
const receipt = path.join(root, ".lisa/apply-receipt.json");
|
|
25
|
-
const config = path.join(root, "bunfig.toml");
|
|
26
|
-
const proof = { root, commands: [], started_at: new Date().toISOString() };
|
|
27
|
-
mkdirSync(root);
|
|
28
|
-
writeFileSync(
|
|
29
|
-
path.join(root, "package.json"),
|
|
30
|
-
'{"name":"isolated-retirement-proof","private":true,"trustedDependencies":["@codyswann/lisa","@ast-grep/cli","@sentry/cli","esbuild"]}\n'
|
|
31
|
-
);
|
|
32
|
-
writeFileSync(config, '[install]\nlinker = "isolated"\n');
|
|
33
|
-
ok(proof, "bun", ["add", "/baseline.tgz"]);
|
|
34
|
-
proof.baseline_package_realpath = realpathSync(pkg);
|
|
35
|
-
assert.ok(proof.baseline_package_realpath.includes("/node_modules/.bun/"));
|
|
36
|
-
|
|
37
|
-
// Seed supported old state from genuine released handlers and the actual
|
|
38
|
-
// baseline-emitted configuration/receipt preserved by the parent journey.
|
|
39
|
-
mkdirSync(path.dirname(hooks), { recursive: true });
|
|
40
|
-
cpSync(path.join(pkg, "all/copy-overwrite/scripts/lisa-hooks"), hooks, {
|
|
41
|
-
recursive: true,
|
|
42
|
-
});
|
|
43
|
-
for (const name of [
|
|
44
|
-
"lisa-enforcement-fallback.sh",
|
|
45
|
-
"lisa-enforcement-freshness.mjs",
|
|
46
|
-
])
|
|
47
|
-
cpSync(
|
|
48
|
-
path.join(pkg, "all/copy-overwrite/scripts", name),
|
|
49
|
-
path.join(root, "scripts", name)
|
|
50
|
-
);
|
|
51
|
-
mkdirSync(path.dirname(settings), { recursive: true });
|
|
52
|
-
mkdirSync(path.dirname(receipt), { recursive: true });
|
|
53
|
-
cpSync(path.join(parentRoot, ".claude/settings.json"), settings);
|
|
54
|
-
cpSync(path.join(parentRoot, ".lisa/apply-receipt.json"), receipt);
|
|
55
|
-
const preserved = [
|
|
56
|
-
config,
|
|
57
|
-
settings,
|
|
58
|
-
receipt,
|
|
59
|
-
path.join(hooks, "block-no-verify.sh"),
|
|
60
|
-
];
|
|
61
|
-
const snapshot = () => preserved.map(file => sha(readFileSync(file)));
|
|
62
|
-
const before = snapshot();
|
|
63
|
-
proof.target_before_sha256 = sha(readFileSync(target));
|
|
64
|
-
proof.before = repositoryProbe(proof, "claude", settings, false);
|
|
65
|
-
proof.update = ok(proof, "bun", ["add", "/candidate.tgz"]);
|
|
66
|
-
proof.candidate_package_realpath = realpathSync(pkg);
|
|
67
|
-
assert.ok(proof.candidate_package_realpath.includes("/node_modules/.bun/"));
|
|
68
|
-
proof.candidate_bytes = [];
|
|
69
|
-
for (const name of [
|
|
70
|
-
"scripts/retire-native-safety-net.mjs",
|
|
71
|
-
"plugins/lisa/hooks/parity-safety-net.sh",
|
|
72
|
-
"dist/core/native-safety-net-retirement.js",
|
|
73
|
-
]) {
|
|
74
|
-
const installed = sha(readFileSync(path.join(pkg, name)));
|
|
75
|
-
const archived = sha(readFileSync(path.join(preview, name)));
|
|
76
|
-
assert.equal(installed, archived, name);
|
|
77
|
-
proof.candidate_bytes.push({ file: name, installed, archived });
|
|
78
|
-
}
|
|
79
|
-
proof.target_after_sha256 = sha(readFileSync(target));
|
|
80
|
-
assert.equal(
|
|
81
|
-
proof.target_after_sha256,
|
|
82
|
-
sha(
|
|
83
|
-
readFileSync(
|
|
84
|
-
path.join(
|
|
85
|
-
preview,
|
|
86
|
-
"all/copy-overwrite/scripts/lisa-hooks",
|
|
87
|
-
path.basename(target)
|
|
88
|
-
)
|
|
89
|
-
)
|
|
90
|
-
)
|
|
91
|
-
);
|
|
92
|
-
proof.after = repositoryProbe(proof, "claude", settings, true);
|
|
93
|
-
assert.deepEqual(snapshot(), before);
|
|
94
|
-
proof.preservation = { files: preserved, before, after: snapshot() };
|
|
95
|
-
proof.completed_at = new Date().toISOString();
|
|
96
|
-
proof.outcome = "PASS: isolated Bun update retires the real host target";
|
|
97
|
-
writeFileSync(
|
|
98
|
-
"/evidence/isolated-linker-proof.json",
|
|
99
|
-
`${JSON.stringify(proof, null, 2)}\n`
|
|
100
|
-
);
|
|
101
|
-
console.log(JSON.stringify(proof));
|
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
/** Genuine released-package → normal candidate update inside a mount-free VM. */
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import {
|
|
4
|
-
cpSync,
|
|
5
|
-
existsSync,
|
|
6
|
-
mkdirSync,
|
|
7
|
-
readFileSync,
|
|
8
|
-
readdirSync,
|
|
9
|
-
writeFileSync,
|
|
10
|
-
} from "node:fs";
|
|
11
|
-
import { homedir } from "node:os";
|
|
12
|
-
import path from "node:path";
|
|
13
|
-
import {
|
|
14
|
-
load,
|
|
15
|
-
ok,
|
|
16
|
-
run,
|
|
17
|
-
openCodeProbe,
|
|
18
|
-
pluginProbe,
|
|
19
|
-
repositoryProbe,
|
|
20
|
-
sha,
|
|
21
|
-
} from "./probes.mjs";
|
|
22
|
-
|
|
23
|
-
assert.equal(process.platform, "linux");
|
|
24
|
-
assert.ok(existsSync("/.dockerenv"));
|
|
25
|
-
assert.equal(homedir(), "/root");
|
|
26
|
-
const root = "/retirement-project";
|
|
27
|
-
const PACKAGE_FILE = "package.json";
|
|
28
|
-
const RECEIPT_FILE = ".lisa/apply-receipt.json";
|
|
29
|
-
const RETIREMENT_ENTRY = "scripts/retire-native-safety-net.mjs";
|
|
30
|
-
const HOST_HOOKS = "scripts/lisa-hooks";
|
|
31
|
-
mkdirSync(root);
|
|
32
|
-
mkdirSync("/evidence", { mode: 0o700 });
|
|
33
|
-
const proof = {
|
|
34
|
-
schema: 1,
|
|
35
|
-
root,
|
|
36
|
-
started_at: new Date().toISOString(),
|
|
37
|
-
boundary:
|
|
38
|
-
"actual emitted registrations and executable handlers; copied installed-handler fixtures are not vendor installations or native sessions",
|
|
39
|
-
commands: [],
|
|
40
|
-
phases: [],
|
|
41
|
-
};
|
|
42
|
-
const pkg = path.join(root, "node_modules/@codyswann/lisa");
|
|
43
|
-
const ports = [
|
|
44
|
-
[
|
|
45
|
-
"claude",
|
|
46
|
-
"lisa",
|
|
47
|
-
".claude-plugin/plugin.json",
|
|
48
|
-
"/root/.claude/plugins/cache/lisa/lisa/4.90.0",
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
"codex",
|
|
52
|
-
"lisa",
|
|
53
|
-
".codex-plugin/hooks.json",
|
|
54
|
-
"/root/.codex/plugins/cache/lisa/lisa/4.90.0",
|
|
55
|
-
],
|
|
56
|
-
[
|
|
57
|
-
"cursor",
|
|
58
|
-
"lisa-cursor",
|
|
59
|
-
"hooks/hooks.json",
|
|
60
|
-
"/root/.cursor/plugins/cache/local/lisa/4.90.0",
|
|
61
|
-
],
|
|
62
|
-
[
|
|
63
|
-
"copilot",
|
|
64
|
-
"lisa-copilot",
|
|
65
|
-
".claude-plugin/plugin.json",
|
|
66
|
-
"/root/.copilot/installed-plugins/lisa/lisa",
|
|
67
|
-
],
|
|
68
|
-
["devin", "lisa-devin", "hooks.json", "/root/.config/devin/plugins/lisa"],
|
|
69
|
-
["agy", "lisa-agy", "hooks.json", "/root/.gemini/config/plugins/lisa"],
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
/** Capture literal file bytes without injecting runtime or credential state. */
|
|
73
|
-
function snapshot(files) {
|
|
74
|
-
return Object.fromEntries(files.map(file => [file, sha(readFileSync(file))]));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** Every concrete owned handler copy under a chosen fixture directory. */
|
|
78
|
-
function handlerFiles(dir) {
|
|
79
|
-
return readdirSync(dir, { recursive: true, withFileTypes: true })
|
|
80
|
-
.filter(
|
|
81
|
-
entry =>
|
|
82
|
-
entry.isFile() &&
|
|
83
|
-
[
|
|
84
|
-
"parity-safety-net.sh",
|
|
85
|
-
"parity-safety-net.agy.sh",
|
|
86
|
-
"lisa-parity-safety-net.ts",
|
|
87
|
-
].includes(entry.name)
|
|
88
|
-
)
|
|
89
|
-
.map(entry => path.join(entry.parentPath, entry.name));
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Observe package, independent copies and old repository registrations. */
|
|
93
|
-
function probe(phase, retired) {
|
|
94
|
-
const channels = [];
|
|
95
|
-
for (const [agent, port, manifest, installed] of ports) {
|
|
96
|
-
// Agy's emitted command resolves its fixed user plugin path. It is
|
|
97
|
-
// instantiated from delivered bytes, with no vendor registry fabricated.
|
|
98
|
-
if (agent !== "agy")
|
|
99
|
-
channels.push(
|
|
100
|
-
pluginProbe(
|
|
101
|
-
proof,
|
|
102
|
-
agent,
|
|
103
|
-
path.join(pkg, "plugins", port, manifest),
|
|
104
|
-
path.join(pkg, "plugins", port),
|
|
105
|
-
retired,
|
|
106
|
-
"actual packaged registration"
|
|
107
|
-
)
|
|
108
|
-
);
|
|
109
|
-
channels.push(
|
|
110
|
-
pluginProbe(
|
|
111
|
-
proof,
|
|
112
|
-
agent,
|
|
113
|
-
path.join(installed, manifest),
|
|
114
|
-
installed,
|
|
115
|
-
retired,
|
|
116
|
-
"independent copied-handler fixture; not vendor installation"
|
|
117
|
-
)
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
channels.push(openCodeProbe(proof, retired));
|
|
121
|
-
const repositories = [
|
|
122
|
-
["claude", ".claude/settings.json"],
|
|
123
|
-
["codex", ".codex/hooks.json"],
|
|
124
|
-
["devin", ".devin/hooks.v1.json"],
|
|
125
|
-
].map(([agent, file]) =>
|
|
126
|
-
repositoryProbe(proof, agent, path.join(root, file), retired)
|
|
127
|
-
);
|
|
128
|
-
const result = { phase, retired, channels, repositories };
|
|
129
|
-
proof.phases.push(result);
|
|
130
|
-
console.log(
|
|
131
|
-
JSON.stringify({
|
|
132
|
-
phase,
|
|
133
|
-
target: retired ? "allowed" : "refused (retirement assertion RED)",
|
|
134
|
-
unrelated: "refused",
|
|
135
|
-
channels: channels.length,
|
|
136
|
-
repositories: repositories.length,
|
|
137
|
-
})
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** Explicit real full apply, separately observed from the install lifecycle. */
|
|
142
|
-
function apply() {
|
|
143
|
-
// The update leg above/below is measured before this separate full-apply
|
|
144
|
-
// leg. Commit fixture changes normally so the clean-tree check stays on.
|
|
145
|
-
if (ok(proof, "git", ["status", "--porcelain"]).stdout.trim()) {
|
|
146
|
-
ok(proof, "git", ["add", "--all"]);
|
|
147
|
-
ok(proof, "git", ["commit", "-m", "Record isolated upgrade fixture"]);
|
|
148
|
-
}
|
|
149
|
-
return run(
|
|
150
|
-
proof,
|
|
151
|
-
process.execPath,
|
|
152
|
-
[
|
|
153
|
-
path.join(pkg, "dist/index.js"),
|
|
154
|
-
"apply",
|
|
155
|
-
root,
|
|
156
|
-
"--yes",
|
|
157
|
-
"--full-apply",
|
|
158
|
-
"--no-update-check",
|
|
159
|
-
"--harness",
|
|
160
|
-
"fleet",
|
|
161
|
-
],
|
|
162
|
-
{ env: { ...process.env, LISA_BOOTSTRAP: "1" } }
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
try {
|
|
167
|
-
assert.match(ok(proof, "node", ["--version"]).stdout, /^v24\.21\.0\s*$/);
|
|
168
|
-
assert.match(ok(proof, "bun", ["--version"]).stdout, /^1\.4\.4\s*$/);
|
|
169
|
-
writeFileSync(
|
|
170
|
-
path.join(root, PACKAGE_FILE),
|
|
171
|
-
`${JSON.stringify({ name: "retirement-proof", private: true, version: "1.0.0", type: "module", trustedDependencies: ["@codyswann/lisa", "@ast-grep/cli", "@sentry/cli", "esbuild"] }, null, 2)}\n`
|
|
172
|
-
);
|
|
173
|
-
writeFileSync(path.join(root, ".gitignore"), "node_modules/\n");
|
|
174
|
-
ok(proof, "bun", ["add", "/baseline.tgz"]);
|
|
175
|
-
assert.equal(load(path.join(pkg, PACKAGE_FILE)).version, "4.90.0");
|
|
176
|
-
assert.equal(
|
|
177
|
-
existsSync(path.join(root, "scripts/lisa-hooks/parity-safety-net.sh")),
|
|
178
|
-
false
|
|
179
|
-
);
|
|
180
|
-
assert.equal(existsSync(path.join(root, RECEIPT_FILE)), false);
|
|
181
|
-
for (const args of [
|
|
182
|
-
["init", "--initial-branch=main"],
|
|
183
|
-
["config", "user.name", "Lisa verification"],
|
|
184
|
-
["config", "user.email", "verification@example.invalid"],
|
|
185
|
-
["add", "--all"],
|
|
186
|
-
["commit", "-m", "Initialize isolated baseline"],
|
|
187
|
-
])
|
|
188
|
-
ok(proof, "git", args);
|
|
189
|
-
apply();
|
|
190
|
-
assert.equal(load(path.join(root, RECEIPT_FILE)).apply_mode, "full");
|
|
191
|
-
for (const [, port, , installed] of ports) {
|
|
192
|
-
mkdirSync(path.dirname(installed), { recursive: true });
|
|
193
|
-
cpSync(path.join(pkg, "plugins", port), installed, { recursive: true });
|
|
194
|
-
}
|
|
195
|
-
probe("released-baseline", false);
|
|
196
|
-
|
|
197
|
-
const reduced = "/reduced-core-project";
|
|
198
|
-
mkdirSync(reduced);
|
|
199
|
-
cpSync(path.join(root, HOST_HOOKS), path.join(reduced, HOST_HOOKS), {
|
|
200
|
-
recursive: true,
|
|
201
|
-
});
|
|
202
|
-
cpSync(
|
|
203
|
-
path.join(pkg, "plugins/lisa-agy/hooks/parity-safety-net.agy.sh"),
|
|
204
|
-
path.join(reduced, "scripts/lisa-hooks/parity-safety-net.agy.sh")
|
|
205
|
-
);
|
|
206
|
-
writeFileSync(
|
|
207
|
-
path.join(reduced, PACKAGE_FILE),
|
|
208
|
-
'{"name":"reduced-proof","private":true,"version":"1.0.0"}\n'
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
const settingsFile = path.join(root, ".claude/settings.json");
|
|
212
|
-
const settings = load(settingsFile);
|
|
213
|
-
settings.operatorSentinel = { preserve: true };
|
|
214
|
-
settings.hooks.PreToolUse.push({
|
|
215
|
-
matcher: "Bash",
|
|
216
|
-
operatorField: "keep",
|
|
217
|
-
hooks: [
|
|
218
|
-
{
|
|
219
|
-
type: "command",
|
|
220
|
-
command: "printf operator-sentinel",
|
|
221
|
-
operatorField: "keep",
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
});
|
|
225
|
-
writeFileSync(settingsFile, `${JSON.stringify(settings, null, 2)}\n`);
|
|
226
|
-
const failure = path.join(root, "node_modules/.lisa/apply-failed.json");
|
|
227
|
-
mkdirSync(path.dirname(failure), { recursive: true });
|
|
228
|
-
writeFileSync(failure, '{"previousFailure":"preserve"}\n');
|
|
229
|
-
const custom = path.join(
|
|
230
|
-
root,
|
|
231
|
-
"plugins/operator-copy/hooks/parity-safety-net.sh"
|
|
232
|
-
);
|
|
233
|
-
mkdirSync(path.dirname(custom), { recursive: true });
|
|
234
|
-
writeFileSync(
|
|
235
|
-
custom,
|
|
236
|
-
`${readFileSync(path.join(pkg, "plugins/lisa/hooks/parity-safety-net.sh"), "utf8")}\n# operator customization\n`
|
|
237
|
-
);
|
|
238
|
-
const preservedFiles = [
|
|
239
|
-
settingsFile,
|
|
240
|
-
failure,
|
|
241
|
-
path.join(root, RECEIPT_FILE),
|
|
242
|
-
custom,
|
|
243
|
-
...ports.map(([, , , installed]) =>
|
|
244
|
-
path.join(
|
|
245
|
-
installed,
|
|
246
|
-
"hooks",
|
|
247
|
-
installed.includes(".gemini/")
|
|
248
|
-
? "block-no-verify.agy.sh"
|
|
249
|
-
: "block-no-verify.sh"
|
|
250
|
-
)
|
|
251
|
-
),
|
|
252
|
-
path.join(root, "scripts/lisa-hooks/block-no-verify.sh"),
|
|
253
|
-
];
|
|
254
|
-
const before = snapshot(preservedFiles);
|
|
255
|
-
const oldHandlers = [
|
|
256
|
-
...handlerFiles(path.join(root, HOST_HOOKS)),
|
|
257
|
-
...handlerFiles(path.join(root, ".opencode/plugin")),
|
|
258
|
-
...ports.flatMap(([, , , installed]) => handlerFiles(installed)),
|
|
259
|
-
];
|
|
260
|
-
const oldBytes = snapshot(oldHandlers);
|
|
261
|
-
|
|
262
|
-
// Preview the genuine candidate archive at a dependency-shaped fixture path.
|
|
263
|
-
// This is not an update or a substitute for the lifecycle measured below.
|
|
264
|
-
const preview = "/preview/node_modules/@codyswann/lisa";
|
|
265
|
-
mkdirSync(preview, { recursive: true });
|
|
266
|
-
ok(proof, "tar", [
|
|
267
|
-
"-xzf",
|
|
268
|
-
"/candidate.tgz",
|
|
269
|
-
"--strip-components=1",
|
|
270
|
-
"-C",
|
|
271
|
-
preview,
|
|
272
|
-
]);
|
|
273
|
-
const dry = ok(proof, process.execPath, [
|
|
274
|
-
path.join(preview, RETIREMENT_ENTRY),
|
|
275
|
-
root,
|
|
276
|
-
"--dry-run",
|
|
277
|
-
"--json",
|
|
278
|
-
]);
|
|
279
|
-
assert.ok(JSON.parse(dry.stdout).some(row => row.status === "would-retire"));
|
|
280
|
-
assert.deepEqual(snapshot(oldHandlers), oldBytes);
|
|
281
|
-
assert.deepEqual(snapshot(preservedFiles), before);
|
|
282
|
-
|
|
283
|
-
proof.update = ok(proof, "bun", ["add", "/candidate.tgz"]);
|
|
284
|
-
proof.candidate_package = load(path.join(pkg, PACKAGE_FILE));
|
|
285
|
-
const expected = load(path.join(preview, PACKAGE_FILE));
|
|
286
|
-
assert.equal(proof.candidate_package.version, expected.version);
|
|
287
|
-
// A local candidate can have the same version as the baseline: prove bytes,
|
|
288
|
-
// so reusing an old package-manager cache can never masquerade as retirement.
|
|
289
|
-
for (const file of [
|
|
290
|
-
"scripts/retire-native-safety-net.mjs",
|
|
291
|
-
"plugins/lisa/hooks/parity-safety-net.sh",
|
|
292
|
-
"dist/core/native-safety-net-retirement.js",
|
|
293
|
-
])
|
|
294
|
-
assert.equal(
|
|
295
|
-
sha(readFileSync(path.join(pkg, file))),
|
|
296
|
-
sha(readFileSync(path.join(preview, file))),
|
|
297
|
-
file
|
|
298
|
-
);
|
|
299
|
-
assert.deepEqual(snapshot(preservedFiles), before);
|
|
300
|
-
assert.notDeepEqual(snapshot(oldHandlers), oldBytes);
|
|
301
|
-
probe("normal-package-update-without-apply", true);
|
|
302
|
-
const retiredBytes = snapshot(oldHandlers);
|
|
303
|
-
ok(proof, process.execPath, [path.join(pkg, RETIREMENT_ENTRY), root]);
|
|
304
|
-
assert.deepEqual(snapshot(oldHandlers), retiredBytes);
|
|
305
|
-
assert.deepEqual(snapshot(preservedFiles), before);
|
|
306
|
-
proof.preservation = {
|
|
307
|
-
before,
|
|
308
|
-
after_update: snapshot(preservedFiles),
|
|
309
|
-
old_handlers_before: oldBytes,
|
|
310
|
-
retired_handlers: retiredBytes,
|
|
311
|
-
dry_run_unchanged: true,
|
|
312
|
-
reconciliation_idempotent: true,
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
proof.isolated_linker_update = ok(proof, process.execPath, [
|
|
316
|
-
"/proof/isolated-linker.mjs",
|
|
317
|
-
root,
|
|
318
|
-
preview,
|
|
319
|
-
]);
|
|
320
|
-
|
|
321
|
-
proof.reduced_core_apply = ok(proof, process.execPath, [
|
|
322
|
-
"/proof/reduced-core.mjs",
|
|
323
|
-
pkg,
|
|
324
|
-
reduced,
|
|
325
|
-
]);
|
|
326
|
-
|
|
327
|
-
// Legacy direct CLI postinstall must still stand down after target cleanup.
|
|
328
|
-
ok(proof, process.execPath, [
|
|
329
|
-
path.join(pkg, "dist/index.js"),
|
|
330
|
-
"apply",
|
|
331
|
-
root,
|
|
332
|
-
"--postinstall-safe",
|
|
333
|
-
"--yes",
|
|
334
|
-
"--no-update-check",
|
|
335
|
-
]);
|
|
336
|
-
assert.deepEqual(snapshot(preservedFiles), before);
|
|
337
|
-
if (proof.candidate_package.lisaReleaseCommit) {
|
|
338
|
-
assert.equal(apply().status, 0);
|
|
339
|
-
probe("explicit-full-apply", true);
|
|
340
|
-
const afterApply = snapshot([settingsFile, ...oldHandlers]);
|
|
341
|
-
assert.equal(apply().status, 0);
|
|
342
|
-
assert.deepEqual(snapshot([settingsFile, ...oldHandlers]), afterApply);
|
|
343
|
-
proof.published_full_apply = {
|
|
344
|
-
status: "established",
|
|
345
|
-
repeat_unchanged: true,
|
|
346
|
-
};
|
|
347
|
-
} else {
|
|
348
|
-
// Local packs have no release identity. Keep that existing refusal intact;
|
|
349
|
-
// the published archive must repeat this journey before tracker closure.
|
|
350
|
-
const rejected = apply();
|
|
351
|
-
assert.equal(rejected.status, 1);
|
|
352
|
-
assert.match(rejected.stdout + rejected.stderr, /no release-commit stamp/);
|
|
353
|
-
proof.published_full_apply = {
|
|
354
|
-
status: "not-established",
|
|
355
|
-
reason:
|
|
356
|
-
"Local candidate is unstamped; repeat against the exact published archive",
|
|
357
|
-
release_pin_refusal_preserved: true,
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
assert.equal(load(settingsFile).operatorSentinel.preserve, true);
|
|
361
|
-
assert.equal(
|
|
362
|
-
load(settingsFile).enabledPlugins["safety-net@cc-marketplace"],
|
|
363
|
-
false
|
|
364
|
-
);
|
|
365
|
-
proof.outcome =
|
|
366
|
-
"PASS: genuine baseline RED; normal update retires seven handler surfaces and old copies; unrelated refusals and operator/evidence preservation; dry-run and repeat reconciliation unchanged; published full-apply status recorded separately";
|
|
367
|
-
proof.completed_at = new Date().toISOString();
|
|
368
|
-
writeFileSync(
|
|
369
|
-
"/evidence/retirement-proof.json",
|
|
370
|
-
`${JSON.stringify(proof, null, 2)}\n`
|
|
371
|
-
);
|
|
372
|
-
console.log(proof.outcome);
|
|
373
|
-
} catch (error) {
|
|
374
|
-
proof.failure = { message: error.message, stack: error.stack };
|
|
375
|
-
writeFileSync(
|
|
376
|
-
"/evidence/retirement-proof.json",
|
|
377
|
-
`${JSON.stringify(proof, null, 2)}\n`
|
|
378
|
-
);
|
|
379
|
-
console.error(error.stack);
|
|
380
|
-
process.exitCode = 1;
|
|
381
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
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
|
-
}
|