@codyswann/lisa 4.101.3 → 4.101.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/all/copy-overwrite/scripts/lib/usage-ledger-integrity.mjs +18 -1
  2. package/all/copy-overwrite/scripts/lib/usage-ledger.d.mts +1 -0
  3. package/all/copy-overwrite/scripts/lib/usage-ledger.mjs +2 -2
  4. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +2 -2
  5. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  6. package/dist/core/lisa-owned-hash-ledger.js +8 -0
  7. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  8. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  9. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  10. package/dist/core/upstream-evidence-manifest.js +17 -8
  11. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  12. package/dist/opencode/hooks-installer.d.ts.map +1 -1
  13. package/dist/opencode/hooks-installer.js +8 -0
  14. package/dist/opencode/hooks-installer.js.map +1 -1
  15. package/dist/opencode/plugin-catalog.d.ts.map +1 -1
  16. package/dist/opencode/plugin-catalog.js +5 -0
  17. package/dist/opencode/plugin-catalog.js.map +1 -1
  18. package/dist/opencode/plugin-templates/block-host-name-leak.mjs +511 -0
  19. package/dist/opencode/plugin-templates/block-host-name-leak.sh +69 -0
  20. package/dist/opencode/plugin-templates/host-name-command-context.mjs +455 -0
  21. package/dist/opencode/plugin-templates/lisa-block-host-name-leak.ts +62 -0
  22. package/dist/utils/usage-accounting.d.ts.map +1 -1
  23. package/dist/utils/usage-accounting.js +12 -2
  24. package/dist/utils/usage-accounting.js.map +1 -1
  25. package/package.json +4 -4
  26. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa/hooks/block-host-name-leak.mjs +11 -5
  29. package/plugins/lisa/hooks/host-name-command-context.mjs +45 -2
  30. package/plugins/lisa-agy/hooks/block-host-name-leak.mjs +11 -5
  31. package/plugins/lisa-agy/hooks/host-name-command-context.mjs +45 -2
  32. package/plugins/lisa-agy/plugin.json +1 -1
  33. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  34. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  35. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  36. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  38. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  40. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-copilot/hooks/block-host-name-leak.mjs +11 -5
  42. package/plugins/lisa-copilot/hooks/host-name-command-context.mjs +45 -2
  43. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-cursor/hooks/block-host-name-leak.mjs +11 -5
  45. package/plugins/lisa-cursor/hooks/host-name-command-context.mjs +45 -2
  46. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  48. package/plugins/lisa-devin/hooks/block-host-name-leak.mjs +11 -5
  49. package/plugins/lisa-devin/hooks/host-name-command-context.mjs +45 -2
  50. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  52. package/plugins/lisa-expo-agy/plugin.json +1 -1
  53. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  57. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  59. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  64. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  66. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  67. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  71. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  73. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  74. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  78. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  80. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  81. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  85. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-rails-agy/plugin.json +1 -1
  88. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  89. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  92. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  94. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  95. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  99. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  100. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  101. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  102. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  105. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  106. package/plugins/src/base/hooks/block-host-name-leak.mjs +11 -5
  107. package/plugins/src/base/hooks/host-name-command-context.mjs +45 -2
  108. package/scripts/copy-opencode-plugin-templates.mjs +3 -0
  109. package/scripts/lib/host-name-launcher-cases.mjs +280 -0
  110. package/scripts/verify-host-name-target-scope.mjs +9 -0
package/package.json CHANGED
@@ -196,7 +196,7 @@
196
196
  "qs": "^6.16.0"
197
197
  },
198
198
  "name": "@codyswann/lisa",
199
- "version": "4.101.3",
199
+ "version": "4.101.5",
200
200
  "description": "Governance-as-code for AI coding agents: turns a repository into agent-operated software factories with guardrails, guidance and automated enforcement for Claude Code, Codex, Cursor, OpenCode, Antigravity, Copilot and Devin",
201
201
  "main": "dist/index.js",
202
202
  "exports": {
@@ -359,7 +359,7 @@
359
359
  "test": "tests"
360
360
  },
361
361
  "types": "./dist/index.d.ts",
362
- "lisaReleaseCommit": "57d0d8663f9de455e6738f46efb32cf65b13b8d5",
363
- "gitHead": "57d0d8663f9de455e6738f46efb32cf65b13b8d5",
364
- "lisaReleaseTag": "v4.101.3"
362
+ "lisaReleaseCommit": "c8b9c2c341f94b26513f1e0609a95da50e19187b",
363
+ "gitHead": "c8b9c2c341f94b26513f1e0609a95da50e19187b",
364
+ "lisaReleaseTag": "v4.101.5"
365
365
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -47,11 +47,13 @@
47
47
  * `dist/` ships to npm, so **this** repository may not name its hosts. A host
48
48
  * naming itself carries none of that.
49
49
  *
50
- * So the parity obligation is satisfied across every agent surface OF THIS
51
- * REPOSITORY — Claude, Codex, Cursor, Antigravity, Copilot all register it —
52
- * and stops at the boundary where the rule itself stops applying. Anyone
53
- * tempted to add it to `plugins/materialized-artifacts.json` should have a
54
- * reason why a host project should be refused its own name.
50
+ * Claude, Codex, Cursor, Antigravity, Copilot and Devin register the canonical
51
+ * plugin guard. OpenCode installs a native tool.execute.before adapter beside
52
+ * the same wrapper/classifier/helper; its package staging adds only the normal
53
+ * ownership banner. It preserves exit0 warnings and exit2 refusals. All seven
54
+ * surfaces therefore share target-scoped policy, rather than refusing a host
55
+ * project's own name. The generic dispatcher copy-overwrite roster remains
56
+ * separate; this guard is not added to that roster.
55
57
  *
56
58
  * WHERE IT APPLIES: THE TARGET, NOT THE CHECKOUT (#4462)
57
59
  *
@@ -70,6 +72,10 @@
70
72
  * routing. Unsupported shell syntax, unresolved expansions and ambiguous
71
73
  * repositories earn no host exemption. This is bounded command inspection,
72
74
  * not shell execution or a claim to close every shell/identity leak class.
75
+ * Literal one-level sh -c and bash -c executable-script operands reuse that
76
+ * inspection with the inherited directory/environment. No other quoted argv
77
+ * is interpreted as code. Dynamic scripts, deeper nesting, other interpreters
78
+ * and other launcher options remain outside this recognition contract.
73
79
  *
74
80
  * FAILING OPEN, LOUDLY
75
81
  *
@@ -1,4 +1,9 @@
1
- /** Bounded literal command/target resolution for the host-name guard; never a shell. */
1
+ /**
2
+ * Bounded command/target resolution; submitted scripts are never executed.
3
+ * One literal sh/bash -c script operand is parsed once. Dynamic scripts,
4
+ * deeper launchers, other interpreters and other launcher options are outside
5
+ * this recognition contract, not proof that an unrecognized command is safe.
6
+ */
2
7
  import { execFileSync } from "node:child_process";
3
8
  import { statSync } from "node:fs";
4
9
  import path from "node:path";
@@ -204,11 +209,30 @@ export function repositoryFromSpec(spec) {
204
209
  * @returns {object[]} Active gh calls with their bounded command contexts.
205
210
  */
206
211
  export function ghCommands(command, initialCwd, env = process.env) {
212
+ return commandContexts(command, initialCwd, env, true, false);
213
+ }
214
+
215
+ /**
216
+ * Parse a command list, permitting at most one literal executable script slot.
217
+ * @param {string} command Command text, never evaluated.
218
+ * @param {string|undefined} initialCwd Inherited literal directory, if known.
219
+ * @param {object} env Inherited environment.
220
+ * @param {boolean} launcherAllowed Whether one launcher remains in scope.
221
+ * @param {boolean} initialUncertain Whether the parent context is unresolved.
222
+ * @returns {object[]} Active gh calls and their isolated command contexts.
223
+ */
224
+ function commandContexts(
225
+ command,
226
+ initialCwd,
227
+ env,
228
+ launcherAllowed,
229
+ initialUncertain
230
+ ) {
207
231
  const calls = [];
208
232
  const inherited = { ...env };
209
233
  let cwd = initialCwd,
210
234
  segment = [],
211
- uncertain = false;
235
+ uncertain = initialUncertain;
212
236
  const consume = () => {
213
237
  if (segment.length === 0) return;
214
238
  const local = { ...inherited };
@@ -263,6 +287,25 @@ export function ghCommands(command, initialCwd, env = process.env) {
263
287
  env: local,
264
288
  certainContext: !uncertain,
265
289
  });
290
+ } else if (
291
+ launcherAllowed &&
292
+ segment[index]?.literal &&
293
+ ["sh", "bash"].includes(path.basename(executable ?? "")) &&
294
+ segment[index + 1]?.literal &&
295
+ segment[index + 1].value === "-c" &&
296
+ segment[index + 2]?.literal
297
+ ) {
298
+ // Only this operand is executable text. Later argv words are $0/$1/etc,
299
+ // not scripts. Child cd/export changes cannot mutate the outer shell.
300
+ calls.push(
301
+ ...commandContexts(
302
+ segment[index + 2].value,
303
+ cwd,
304
+ local,
305
+ false,
306
+ uncertain
307
+ )
308
+ );
266
309
  } else {
267
310
  // A function/source/pushd or unsupported launcher may change the shell
268
311
  // context. Do not grant later writes an exemption based on the old cwd.
@@ -47,11 +47,13 @@
47
47
  * `dist/` ships to npm, so **this** repository may not name its hosts. A host
48
48
  * naming itself carries none of that.
49
49
  *
50
- * So the parity obligation is satisfied across every agent surface OF THIS
51
- * REPOSITORY — Claude, Codex, Cursor, Antigravity, Copilot all register it —
52
- * and stops at the boundary where the rule itself stops applying. Anyone
53
- * tempted to add it to `plugins/materialized-artifacts.json` should have a
54
- * reason why a host project should be refused its own name.
50
+ * Claude, Codex, Cursor, Antigravity, Copilot and Devin register the canonical
51
+ * plugin guard. OpenCode installs a native tool.execute.before adapter beside
52
+ * the same wrapper/classifier/helper; its package staging adds only the normal
53
+ * ownership banner. It preserves exit0 warnings and exit2 refusals. All seven
54
+ * surfaces therefore share target-scoped policy, rather than refusing a host
55
+ * project's own name. The generic dispatcher copy-overwrite roster remains
56
+ * separate; this guard is not added to that roster.
55
57
  *
56
58
  * WHERE IT APPLIES: THE TARGET, NOT THE CHECKOUT (#4462)
57
59
  *
@@ -70,6 +72,10 @@
70
72
  * routing. Unsupported shell syntax, unresolved expansions and ambiguous
71
73
  * repositories earn no host exemption. This is bounded command inspection,
72
74
  * not shell execution or a claim to close every shell/identity leak class.
75
+ * Literal one-level sh -c and bash -c executable-script operands reuse that
76
+ * inspection with the inherited directory/environment. No other quoted argv
77
+ * is interpreted as code. Dynamic scripts, deeper nesting, other interpreters
78
+ * and other launcher options remain outside this recognition contract.
73
79
  *
74
80
  * FAILING OPEN, LOUDLY
75
81
  *
@@ -1,4 +1,9 @@
1
- /** Bounded literal command/target resolution for the host-name guard; never a shell. */
1
+ /**
2
+ * Bounded command/target resolution; submitted scripts are never executed.
3
+ * One literal sh/bash -c script operand is parsed once. Dynamic scripts,
4
+ * deeper launchers, other interpreters and other launcher options are outside
5
+ * this recognition contract, not proof that an unrecognized command is safe.
6
+ */
2
7
  import { execFileSync } from "node:child_process";
3
8
  import { statSync } from "node:fs";
4
9
  import path from "node:path";
@@ -204,11 +209,30 @@ export function repositoryFromSpec(spec) {
204
209
  * @returns {object[]} Active gh calls with their bounded command contexts.
205
210
  */
206
211
  export function ghCommands(command, initialCwd, env = process.env) {
212
+ return commandContexts(command, initialCwd, env, true, false);
213
+ }
214
+
215
+ /**
216
+ * Parse a command list, permitting at most one literal executable script slot.
217
+ * @param {string} command Command text, never evaluated.
218
+ * @param {string|undefined} initialCwd Inherited literal directory, if known.
219
+ * @param {object} env Inherited environment.
220
+ * @param {boolean} launcherAllowed Whether one launcher remains in scope.
221
+ * @param {boolean} initialUncertain Whether the parent context is unresolved.
222
+ * @returns {object[]} Active gh calls and their isolated command contexts.
223
+ */
224
+ function commandContexts(
225
+ command,
226
+ initialCwd,
227
+ env,
228
+ launcherAllowed,
229
+ initialUncertain
230
+ ) {
207
231
  const calls = [];
208
232
  const inherited = { ...env };
209
233
  let cwd = initialCwd,
210
234
  segment = [],
211
- uncertain = false;
235
+ uncertain = initialUncertain;
212
236
  const consume = () => {
213
237
  if (segment.length === 0) return;
214
238
  const local = { ...inherited };
@@ -263,6 +287,25 @@ export function ghCommands(command, initialCwd, env = process.env) {
263
287
  env: local,
264
288
  certainContext: !uncertain,
265
289
  });
290
+ } else if (
291
+ launcherAllowed &&
292
+ segment[index]?.literal &&
293
+ ["sh", "bash"].includes(path.basename(executable ?? "")) &&
294
+ segment[index + 1]?.literal &&
295
+ segment[index + 1].value === "-c" &&
296
+ segment[index + 2]?.literal
297
+ ) {
298
+ // Only this operand is executable text. Later argv words are $0/$1/etc,
299
+ // not scripts. Child cd/export changes cannot mutate the outer shell.
300
+ calls.push(
301
+ ...commandContexts(
302
+ segment[index + 2].value,
303
+ cwd,
304
+ local,
305
+ false,
306
+ uncertain
307
+ )
308
+ );
266
309
  } else {
267
310
  // A function/source/pushd or unsupported launcher may change the shell
268
311
  // context. Do not grant later writes an exemption based on the old cwd.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -47,11 +47,13 @@
47
47
  * `dist/` ships to npm, so **this** repository may not name its hosts. A host
48
48
  * naming itself carries none of that.
49
49
  *
50
- * So the parity obligation is satisfied across every agent surface OF THIS
51
- * REPOSITORY — Claude, Codex, Cursor, Antigravity, Copilot all register it —
52
- * and stops at the boundary where the rule itself stops applying. Anyone
53
- * tempted to add it to `plugins/materialized-artifacts.json` should have a
54
- * reason why a host project should be refused its own name.
50
+ * Claude, Codex, Cursor, Antigravity, Copilot and Devin register the canonical
51
+ * plugin guard. OpenCode installs a native tool.execute.before adapter beside
52
+ * the same wrapper/classifier/helper; its package staging adds only the normal
53
+ * ownership banner. It preserves exit0 warnings and exit2 refusals. All seven
54
+ * surfaces therefore share target-scoped policy, rather than refusing a host
55
+ * project's own name. The generic dispatcher copy-overwrite roster remains
56
+ * separate; this guard is not added to that roster.
55
57
  *
56
58
  * WHERE IT APPLIES: THE TARGET, NOT THE CHECKOUT (#4462)
57
59
  *
@@ -70,6 +72,10 @@
70
72
  * routing. Unsupported shell syntax, unresolved expansions and ambiguous
71
73
  * repositories earn no host exemption. This is bounded command inspection,
72
74
  * not shell execution or a claim to close every shell/identity leak class.
75
+ * Literal one-level sh -c and bash -c executable-script operands reuse that
76
+ * inspection with the inherited directory/environment. No other quoted argv
77
+ * is interpreted as code. Dynamic scripts, deeper nesting, other interpreters
78
+ * and other launcher options remain outside this recognition contract.
73
79
  *
74
80
  * FAILING OPEN, LOUDLY
75
81
  *
@@ -1,4 +1,9 @@
1
- /** Bounded literal command/target resolution for the host-name guard; never a shell. */
1
+ /**
2
+ * Bounded command/target resolution; submitted scripts are never executed.
3
+ * One literal sh/bash -c script operand is parsed once. Dynamic scripts,
4
+ * deeper launchers, other interpreters and other launcher options are outside
5
+ * this recognition contract, not proof that an unrecognized command is safe.
6
+ */
2
7
  import { execFileSync } from "node:child_process";
3
8
  import { statSync } from "node:fs";
4
9
  import path from "node:path";
@@ -204,11 +209,30 @@ export function repositoryFromSpec(spec) {
204
209
  * @returns {object[]} Active gh calls with their bounded command contexts.
205
210
  */
206
211
  export function ghCommands(command, initialCwd, env = process.env) {
212
+ return commandContexts(command, initialCwd, env, true, false);
213
+ }
214
+
215
+ /**
216
+ * Parse a command list, permitting at most one literal executable script slot.
217
+ * @param {string} command Command text, never evaluated.
218
+ * @param {string|undefined} initialCwd Inherited literal directory, if known.
219
+ * @param {object} env Inherited environment.
220
+ * @param {boolean} launcherAllowed Whether one launcher remains in scope.
221
+ * @param {boolean} initialUncertain Whether the parent context is unresolved.
222
+ * @returns {object[]} Active gh calls and their isolated command contexts.
223
+ */
224
+ function commandContexts(
225
+ command,
226
+ initialCwd,
227
+ env,
228
+ launcherAllowed,
229
+ initialUncertain
230
+ ) {
207
231
  const calls = [];
208
232
  const inherited = { ...env };
209
233
  let cwd = initialCwd,
210
234
  segment = [],
211
- uncertain = false;
235
+ uncertain = initialUncertain;
212
236
  const consume = () => {
213
237
  if (segment.length === 0) return;
214
238
  const local = { ...inherited };
@@ -263,6 +287,25 @@ export function ghCommands(command, initialCwd, env = process.env) {
263
287
  env: local,
264
288
  certainContext: !uncertain,
265
289
  });
290
+ } else if (
291
+ launcherAllowed &&
292
+ segment[index]?.literal &&
293
+ ["sh", "bash"].includes(path.basename(executable ?? "")) &&
294
+ segment[index + 1]?.literal &&
295
+ segment[index + 1].value === "-c" &&
296
+ segment[index + 2]?.literal
297
+ ) {
298
+ // Only this operand is executable text. Later argv words are $0/$1/etc,
299
+ // not scripts. Child cd/export changes cannot mutate the outer shell.
300
+ calls.push(
301
+ ...commandContexts(
302
+ segment[index + 2].value,
303
+ cwd,
304
+ local,
305
+ false,
306
+ uncertain
307
+ )
308
+ );
266
309
  } else {
267
310
  // A function/source/pushd or unsupported launcher may change the shell
268
311
  // context. Do not grant later writes an exemption based on the old cwd.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -47,11 +47,13 @@
47
47
  * `dist/` ships to npm, so **this** repository may not name its hosts. A host
48
48
  * naming itself carries none of that.
49
49
  *
50
- * So the parity obligation is satisfied across every agent surface OF THIS
51
- * REPOSITORY — Claude, Codex, Cursor, Antigravity, Copilot all register it —
52
- * and stops at the boundary where the rule itself stops applying. Anyone
53
- * tempted to add it to `plugins/materialized-artifacts.json` should have a
54
- * reason why a host project should be refused its own name.
50
+ * Claude, Codex, Cursor, Antigravity, Copilot and Devin register the canonical
51
+ * plugin guard. OpenCode installs a native tool.execute.before adapter beside
52
+ * the same wrapper/classifier/helper; its package staging adds only the normal
53
+ * ownership banner. It preserves exit0 warnings and exit2 refusals. All seven
54
+ * surfaces therefore share target-scoped policy, rather than refusing a host
55
+ * project's own name. The generic dispatcher copy-overwrite roster remains
56
+ * separate; this guard is not added to that roster.
55
57
  *
56
58
  * WHERE IT APPLIES: THE TARGET, NOT THE CHECKOUT (#4462)
57
59
  *
@@ -70,6 +72,10 @@
70
72
  * routing. Unsupported shell syntax, unresolved expansions and ambiguous
71
73
  * repositories earn no host exemption. This is bounded command inspection,
72
74
  * not shell execution or a claim to close every shell/identity leak class.
75
+ * Literal one-level sh -c and bash -c executable-script operands reuse that
76
+ * inspection with the inherited directory/environment. No other quoted argv
77
+ * is interpreted as code. Dynamic scripts, deeper nesting, other interpreters
78
+ * and other launcher options remain outside this recognition contract.
73
79
  *
74
80
  * FAILING OPEN, LOUDLY
75
81
  *
@@ -1,4 +1,9 @@
1
- /** Bounded literal command/target resolution for the host-name guard; never a shell. */
1
+ /**
2
+ * Bounded command/target resolution; submitted scripts are never executed.
3
+ * One literal sh/bash -c script operand is parsed once. Dynamic scripts,
4
+ * deeper launchers, other interpreters and other launcher options are outside
5
+ * this recognition contract, not proof that an unrecognized command is safe.
6
+ */
2
7
  import { execFileSync } from "node:child_process";
3
8
  import { statSync } from "node:fs";
4
9
  import path from "node:path";
@@ -204,11 +209,30 @@ export function repositoryFromSpec(spec) {
204
209
  * @returns {object[]} Active gh calls with their bounded command contexts.
205
210
  */
206
211
  export function ghCommands(command, initialCwd, env = process.env) {
212
+ return commandContexts(command, initialCwd, env, true, false);
213
+ }
214
+
215
+ /**
216
+ * Parse a command list, permitting at most one literal executable script slot.
217
+ * @param {string} command Command text, never evaluated.
218
+ * @param {string|undefined} initialCwd Inherited literal directory, if known.
219
+ * @param {object} env Inherited environment.
220
+ * @param {boolean} launcherAllowed Whether one launcher remains in scope.
221
+ * @param {boolean} initialUncertain Whether the parent context is unresolved.
222
+ * @returns {object[]} Active gh calls and their isolated command contexts.
223
+ */
224
+ function commandContexts(
225
+ command,
226
+ initialCwd,
227
+ env,
228
+ launcherAllowed,
229
+ initialUncertain
230
+ ) {
207
231
  const calls = [];
208
232
  const inherited = { ...env };
209
233
  let cwd = initialCwd,
210
234
  segment = [],
211
- uncertain = false;
235
+ uncertain = initialUncertain;
212
236
  const consume = () => {
213
237
  if (segment.length === 0) return;
214
238
  const local = { ...inherited };
@@ -263,6 +287,25 @@ export function ghCommands(command, initialCwd, env = process.env) {
263
287
  env: local,
264
288
  certainContext: !uncertain,
265
289
  });
290
+ } else if (
291
+ launcherAllowed &&
292
+ segment[index]?.literal &&
293
+ ["sh", "bash"].includes(path.basename(executable ?? "")) &&
294
+ segment[index + 1]?.literal &&
295
+ segment[index + 1].value === "-c" &&
296
+ segment[index + 2]?.literal
297
+ ) {
298
+ // Only this operand is executable text. Later argv words are $0/$1/etc,
299
+ // not scripts. Child cd/export changes cannot mutate the outer shell.
300
+ calls.push(
301
+ ...commandContexts(
302
+ segment[index + 2].value,
303
+ cwd,
304
+ local,
305
+ false,
306
+ uncertain
307
+ )
308
+ );
266
309
  } else {
267
310
  // A function/source/pushd or unsupported launcher may change the shell
268
311
  // context. Do not grant later writes an exemption based on the old cwd.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.101.3",
3
+ "version": "4.101.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -47,11 +47,13 @@
47
47
  * `dist/` ships to npm, so **this** repository may not name its hosts. A host
48
48
  * naming itself carries none of that.
49
49
  *
50
- * So the parity obligation is satisfied across every agent surface OF THIS
51
- * REPOSITORY — Claude, Codex, Cursor, Antigravity, Copilot all register it —
52
- * and stops at the boundary where the rule itself stops applying. Anyone
53
- * tempted to add it to `plugins/materialized-artifacts.json` should have a
54
- * reason why a host project should be refused its own name.
50
+ * Claude, Codex, Cursor, Antigravity, Copilot and Devin register the canonical
51
+ * plugin guard. OpenCode installs a native tool.execute.before adapter beside
52
+ * the same wrapper/classifier/helper; its package staging adds only the normal
53
+ * ownership banner. It preserves exit0 warnings and exit2 refusals. All seven
54
+ * surfaces therefore share target-scoped policy, rather than refusing a host
55
+ * project's own name. The generic dispatcher copy-overwrite roster remains
56
+ * separate; this guard is not added to that roster.
55
57
  *
56
58
  * WHERE IT APPLIES: THE TARGET, NOT THE CHECKOUT (#4462)
57
59
  *
@@ -70,6 +72,10 @@
70
72
  * routing. Unsupported shell syntax, unresolved expansions and ambiguous
71
73
  * repositories earn no host exemption. This is bounded command inspection,
72
74
  * not shell execution or a claim to close every shell/identity leak class.
75
+ * Literal one-level sh -c and bash -c executable-script operands reuse that
76
+ * inspection with the inherited directory/environment. No other quoted argv
77
+ * is interpreted as code. Dynamic scripts, deeper nesting, other interpreters
78
+ * and other launcher options remain outside this recognition contract.
73
79
  *
74
80
  * FAILING OPEN, LOUDLY
75
81
  *
@@ -1,4 +1,9 @@
1
- /** Bounded literal command/target resolution for the host-name guard; never a shell. */
1
+ /**
2
+ * Bounded command/target resolution; submitted scripts are never executed.
3
+ * One literal sh/bash -c script operand is parsed once. Dynamic scripts,
4
+ * deeper launchers, other interpreters and other launcher options are outside
5
+ * this recognition contract, not proof that an unrecognized command is safe.
6
+ */
2
7
  import { execFileSync } from "node:child_process";
3
8
  import { statSync } from "node:fs";
4
9
  import path from "node:path";
@@ -204,11 +209,30 @@ export function repositoryFromSpec(spec) {
204
209
  * @returns {object[]} Active gh calls with their bounded command contexts.
205
210
  */
206
211
  export function ghCommands(command, initialCwd, env = process.env) {
212
+ return commandContexts(command, initialCwd, env, true, false);
213
+ }
214
+
215
+ /**
216
+ * Parse a command list, permitting at most one literal executable script slot.
217
+ * @param {string} command Command text, never evaluated.
218
+ * @param {string|undefined} initialCwd Inherited literal directory, if known.
219
+ * @param {object} env Inherited environment.
220
+ * @param {boolean} launcherAllowed Whether one launcher remains in scope.
221
+ * @param {boolean} initialUncertain Whether the parent context is unresolved.
222
+ * @returns {object[]} Active gh calls and their isolated command contexts.
223
+ */
224
+ function commandContexts(
225
+ command,
226
+ initialCwd,
227
+ env,
228
+ launcherAllowed,
229
+ initialUncertain
230
+ ) {
207
231
  const calls = [];
208
232
  const inherited = { ...env };
209
233
  let cwd = initialCwd,
210
234
  segment = [],
211
- uncertain = false;
235
+ uncertain = initialUncertain;
212
236
  const consume = () => {
213
237
  if (segment.length === 0) return;
214
238
  const local = { ...inherited };
@@ -263,6 +287,25 @@ export function ghCommands(command, initialCwd, env = process.env) {
263
287
  env: local,
264
288
  certainContext: !uncertain,
265
289
  });
290
+ } else if (
291
+ launcherAllowed &&
292
+ segment[index]?.literal &&
293
+ ["sh", "bash"].includes(path.basename(executable ?? "")) &&
294
+ segment[index + 1]?.literal &&
295
+ segment[index + 1].value === "-c" &&
296
+ segment[index + 2]?.literal
297
+ ) {
298
+ // Only this operand is executable text. Later argv words are $0/$1/etc,
299
+ // not scripts. Child cd/export changes cannot mutate the outer shell.
300
+ calls.push(
301
+ ...commandContexts(
302
+ segment[index + 2].value,
303
+ cwd,
304
+ local,
305
+ false,
306
+ uncertain
307
+ )
308
+ );
266
309
  } else {
267
310
  // A function/source/pushd or unsupported launcher may change the shell
268
311
  // context. Do not grant later writes an exemption based on the old cwd.