@codyswann/lisa 4.107.3 → 4.107.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 (91) hide show
  1. package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +84 -0
  2. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  3. package/dist/core/lisa-owned-hash-ledger.js +4 -0
  4. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  5. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  6. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  7. package/dist/core/upstream-evidence-manifest.js +11 -7
  8. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  9. package/dist/opencode/plugin-templates/block-managed-file-edits.sh +84 -0
  10. package/npm-package/create-only/.github/workflows/publish-to-npm.yml +2 -2
  11. package/package.json +4 -4
  12. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  13. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  14. package/plugins/lisa/hooks/block-managed-file-edits.sh +84 -0
  15. package/plugins/lisa-agy/hooks/block-managed-file-edits.sh +84 -0
  16. package/plugins/lisa-agy/plugin.json +1 -1
  17. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  19. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  20. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  21. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  24. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +84 -0
  26. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +84 -0
  28. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  30. package/plugins/lisa-devin/hooks/block-managed-file-edits.sh +84 -0
  31. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa-expo-agy/plugin.json +1 -1
  34. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  38. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  40. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  41. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  45. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  47. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  48. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  52. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  54. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  55. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  59. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  61. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  62. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  66. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-rails-agy/plugin.json +1 -1
  69. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  73. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  76. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  82. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  83. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  87. package/plugins/src/base/hooks/block-managed-file-edits.sh +84 -0
  88. package/scripts/lib/packaged-apply-driver.mjs +2 -0
  89. package/scripts/update-node-version.ts +16 -2
  90. package/scripts/verify-packaged-apply.mjs +21 -1
  91. package/typescript/copy-overwrite/.github/GITHUB_ACTIONS.md +2 -2
@@ -280,6 +280,86 @@ relative_path() {
280
280
  printf '%s' "${rel#./}"
281
281
  }
282
282
 
283
+ # The host's dependency and devDependency names, one per line, read at most
284
+ # once per classification. `managed_source` runs inside `$(...)`, so the cache
285
+ # lives only as long as that subshell — one classification, not one hook run.
286
+ # Unreadable or malformed `package.json` yields nothing, which makes every
287
+ # dependency-keyed stack below read as absent — an allow, the safe direction.
288
+ #
289
+ # Loaded into a global rather than echoed, so callers match with a here-string
290
+ # and no pipeline: under `pipefail` a `grep -q` that stops reading early can
291
+ # fail the writer with SIGPIPE and turn a match into a miss.
292
+ host_dependency_names=""
293
+ host_dependency_names_pending=1
294
+ load_host_dependency_names() {
295
+ [ "$host_dependency_names_pending" -eq 1 ] || return 0
296
+ host_dependency_names="$(jq -r \
297
+ '[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
298
+ "$project_root/package.json" 2>/dev/null || true)"
299
+ host_dependency_names_pending=0
300
+ }
301
+
302
+ # Exact dependency name, or with `prefix` as the second argument, any name
303
+ # starting with it (the NestJS detector's `@nestjs` test).
304
+ host_has_dependency() {
305
+ load_host_dependency_names
306
+ local name
307
+ while IFS= read -r name; do
308
+ case "$name" in
309
+ "$1") return 0 ;;
310
+ "$1"*) [ "${2:-}" = prefix ] && return 0 ;;
311
+ esac
312
+ done <<<"$host_dependency_names"
313
+ return 1
314
+ }
315
+
316
+ # Whether the host is the given stack, so that stack's templates reach it.
317
+ #
318
+ # THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
319
+ # `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
320
+ # rails — the host owns it after the first apply — but copy-overwrite in
321
+ # harper-fabric and phaser. Probing every stack's tree without asking which
322
+ # stacks this host is made a NestJS host's own ci.yml read as managed via the
323
+ # harper-fabric copy, and a project-owned one-line Node bump needed a human to
324
+ # run the override (CodySwannGT/lisa#4511).
325
+ #
326
+ # `lisa apply` copies a stack's templates only into a host that stack's
327
+ # detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
328
+ # `all`, `typescript`, and any stack without an arm here keep the pre-existing
329
+ # answer — always managed — so this narrows only where a detector proves the
330
+ # stack absent. Where a shell mirror cannot be exact it errs toward allowing,
331
+ # the same direction `.lisaignore` handling above takes.
332
+ stack_reaches_host() {
333
+ local stack="$1"
334
+ case "$stack" in
335
+ harper-fabric)
336
+ local config="$project_root/harper-app/config.yaml"
337
+ [ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
338
+ return 1
339
+ {
340
+ grep -qF 'graphqlSchema:' "$config" &&
341
+ grep -qF 'jsResource:' "$config" &&
342
+ grep -qF 'static:' "$config"
343
+ } || host_has_dependency harperdb
344
+ ;;
345
+ phaser) host_has_dependency phaser ;;
346
+ nestjs)
347
+ [ -e "$project_root/nest-cli.json" ] ||
348
+ host_has_dependency @nestjs prefix
349
+ ;;
350
+ expo)
351
+ [ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
352
+ host_has_dependency expo
353
+ ;;
354
+ cdk) [ -e "$project_root/cdk.json" ] ;;
355
+ rails)
356
+ [ -e "$project_root/bin/rails" ] ||
357
+ [ -e "$project_root/config/application.rb" ]
358
+ ;;
359
+ *) return 0 ;;
360
+ esac
361
+ }
362
+
283
363
  # Whether a host-relative path is shipped as a copy-overwrite template.
284
364
  #
285
365
  # A few stat calls rather than an enumeration: the same relative path is probed
@@ -299,6 +379,10 @@ managed_source() {
299
379
  for stack in "$package_root"/*/copy-overwrite; do
300
380
  [ -d "$stack" ] || continue
301
381
  if [ -e "$stack/$rel" ]; then
382
+ # Another stack's copy-overwrite twin is not this host's file. Keep
383
+ # looking: a stack this host IS may still manage the same path.
384
+ local stack_name="${stack%/copy-overwrite}"
385
+ stack_reaches_host "${stack_name##*/}" || continue
302
386
  printf '%s' "${stack#"$package_root"/}/$rel"
303
387
  return 0
304
388
  fi
@@ -12,7 +12,7 @@
12
12
  # with:
13
13
  # tag: ${{ needs.release.outputs.tag }}
14
14
  # version: ${{ needs.release.outputs.version }}
15
- # node_version: '22.x'
15
+ # node_version: '24.21.0'
16
16
  # package_manager: 'bun'
17
17
 
18
18
  name: Publish to npm
@@ -31,7 +31,7 @@ on:
31
31
  node_version:
32
32
  description: 'Node.js version to use'
33
33
  required: false
34
- default: '20.x'
34
+ default: '24.21.0'
35
35
  type: string
36
36
  package_manager:
37
37
  description: 'Package manager to use (npm, yarn, or bun)'
package/package.json CHANGED
@@ -188,7 +188,7 @@
188
188
  "qs": "^6.16.0"
189
189
  },
190
190
  "name": "@codyswann/lisa",
191
- "version": "4.107.3",
191
+ "version": "4.107.5",
192
192
  "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",
193
193
  "main": "dist/index.js",
194
194
  "exports": {
@@ -351,7 +351,7 @@
351
351
  "test": "tests"
352
352
  },
353
353
  "types": "./dist/index.d.ts",
354
- "lisaReleaseCommit": "df3ab3a184e3c57ac9dd4347d27bbbc917767853",
355
- "gitHead": "df3ab3a184e3c57ac9dd4347d27bbbc917767853",
356
- "lisaReleaseTag": "v4.107.3"
354
+ "lisaReleaseCommit": "d14bf8be069e2b6216c49ad1b28df38c9ed18ea4",
355
+ "gitHead": "d14bf8be069e2b6216c49ad1b28df38c9ed18ea4",
356
+ "lisaReleaseTag": "v4.107.5"
357
357
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.5",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -280,6 +280,86 @@ relative_path() {
280
280
  printf '%s' "${rel#./}"
281
281
  }
282
282
 
283
+ # The host's dependency and devDependency names, one per line, read at most
284
+ # once per classification. `managed_source` runs inside `$(...)`, so the cache
285
+ # lives only as long as that subshell — one classification, not one hook run.
286
+ # Unreadable or malformed `package.json` yields nothing, which makes every
287
+ # dependency-keyed stack below read as absent — an allow, the safe direction.
288
+ #
289
+ # Loaded into a global rather than echoed, so callers match with a here-string
290
+ # and no pipeline: under `pipefail` a `grep -q` that stops reading early can
291
+ # fail the writer with SIGPIPE and turn a match into a miss.
292
+ host_dependency_names=""
293
+ host_dependency_names_pending=1
294
+ load_host_dependency_names() {
295
+ [ "$host_dependency_names_pending" -eq 1 ] || return 0
296
+ host_dependency_names="$(jq -r \
297
+ '[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
298
+ "$project_root/package.json" 2>/dev/null || true)"
299
+ host_dependency_names_pending=0
300
+ }
301
+
302
+ # Exact dependency name, or with `prefix` as the second argument, any name
303
+ # starting with it (the NestJS detector's `@nestjs` test).
304
+ host_has_dependency() {
305
+ load_host_dependency_names
306
+ local name
307
+ while IFS= read -r name; do
308
+ case "$name" in
309
+ "$1") return 0 ;;
310
+ "$1"*) [ "${2:-}" = prefix ] && return 0 ;;
311
+ esac
312
+ done <<<"$host_dependency_names"
313
+ return 1
314
+ }
315
+
316
+ # Whether the host is the given stack, so that stack's templates reach it.
317
+ #
318
+ # THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
319
+ # `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
320
+ # rails — the host owns it after the first apply — but copy-overwrite in
321
+ # harper-fabric and phaser. Probing every stack's tree without asking which
322
+ # stacks this host is made a NestJS host's own ci.yml read as managed via the
323
+ # harper-fabric copy, and a project-owned one-line Node bump needed a human to
324
+ # run the override (CodySwannGT/lisa#4511).
325
+ #
326
+ # `lisa apply` copies a stack's templates only into a host that stack's
327
+ # detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
328
+ # `all`, `typescript`, and any stack without an arm here keep the pre-existing
329
+ # answer — always managed — so this narrows only where a detector proves the
330
+ # stack absent. Where a shell mirror cannot be exact it errs toward allowing,
331
+ # the same direction `.lisaignore` handling above takes.
332
+ stack_reaches_host() {
333
+ local stack="$1"
334
+ case "$stack" in
335
+ harper-fabric)
336
+ local config="$project_root/harper-app/config.yaml"
337
+ [ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
338
+ return 1
339
+ {
340
+ grep -qF 'graphqlSchema:' "$config" &&
341
+ grep -qF 'jsResource:' "$config" &&
342
+ grep -qF 'static:' "$config"
343
+ } || host_has_dependency harperdb
344
+ ;;
345
+ phaser) host_has_dependency phaser ;;
346
+ nestjs)
347
+ [ -e "$project_root/nest-cli.json" ] ||
348
+ host_has_dependency @nestjs prefix
349
+ ;;
350
+ expo)
351
+ [ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
352
+ host_has_dependency expo
353
+ ;;
354
+ cdk) [ -e "$project_root/cdk.json" ] ;;
355
+ rails)
356
+ [ -e "$project_root/bin/rails" ] ||
357
+ [ -e "$project_root/config/application.rb" ]
358
+ ;;
359
+ *) return 0 ;;
360
+ esac
361
+ }
362
+
283
363
  # Whether a host-relative path is shipped as a copy-overwrite template.
284
364
  #
285
365
  # A few stat calls rather than an enumeration: the same relative path is probed
@@ -299,6 +379,10 @@ managed_source() {
299
379
  for stack in "$package_root"/*/copy-overwrite; do
300
380
  [ -d "$stack" ] || continue
301
381
  if [ -e "$stack/$rel" ]; then
382
+ # Another stack's copy-overwrite twin is not this host's file. Keep
383
+ # looking: a stack this host IS may still manage the same path.
384
+ local stack_name="${stack%/copy-overwrite}"
385
+ stack_reaches_host "${stack_name##*/}" || continue
302
386
  printf '%s' "${stack#"$package_root"/}/$rel"
303
387
  return 0
304
388
  fi
@@ -280,6 +280,86 @@ relative_path() {
280
280
  printf '%s' "${rel#./}"
281
281
  }
282
282
 
283
+ # The host's dependency and devDependency names, one per line, read at most
284
+ # once per classification. `managed_source` runs inside `$(...)`, so the cache
285
+ # lives only as long as that subshell — one classification, not one hook run.
286
+ # Unreadable or malformed `package.json` yields nothing, which makes every
287
+ # dependency-keyed stack below read as absent — an allow, the safe direction.
288
+ #
289
+ # Loaded into a global rather than echoed, so callers match with a here-string
290
+ # and no pipeline: under `pipefail` a `grep -q` that stops reading early can
291
+ # fail the writer with SIGPIPE and turn a match into a miss.
292
+ host_dependency_names=""
293
+ host_dependency_names_pending=1
294
+ load_host_dependency_names() {
295
+ [ "$host_dependency_names_pending" -eq 1 ] || return 0
296
+ host_dependency_names="$(jq -r \
297
+ '[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
298
+ "$project_root/package.json" 2>/dev/null || true)"
299
+ host_dependency_names_pending=0
300
+ }
301
+
302
+ # Exact dependency name, or with `prefix` as the second argument, any name
303
+ # starting with it (the NestJS detector's `@nestjs` test).
304
+ host_has_dependency() {
305
+ load_host_dependency_names
306
+ local name
307
+ while IFS= read -r name; do
308
+ case "$name" in
309
+ "$1") return 0 ;;
310
+ "$1"*) [ "${2:-}" = prefix ] && return 0 ;;
311
+ esac
312
+ done <<<"$host_dependency_names"
313
+ return 1
314
+ }
315
+
316
+ # Whether the host is the given stack, so that stack's templates reach it.
317
+ #
318
+ # THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
319
+ # `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
320
+ # rails — the host owns it after the first apply — but copy-overwrite in
321
+ # harper-fabric and phaser. Probing every stack's tree without asking which
322
+ # stacks this host is made a NestJS host's own ci.yml read as managed via the
323
+ # harper-fabric copy, and a project-owned one-line Node bump needed a human to
324
+ # run the override (CodySwannGT/lisa#4511).
325
+ #
326
+ # `lisa apply` copies a stack's templates only into a host that stack's
327
+ # detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
328
+ # `all`, `typescript`, and any stack without an arm here keep the pre-existing
329
+ # answer — always managed — so this narrows only where a detector proves the
330
+ # stack absent. Where a shell mirror cannot be exact it errs toward allowing,
331
+ # the same direction `.lisaignore` handling above takes.
332
+ stack_reaches_host() {
333
+ local stack="$1"
334
+ case "$stack" in
335
+ harper-fabric)
336
+ local config="$project_root/harper-app/config.yaml"
337
+ [ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
338
+ return 1
339
+ {
340
+ grep -qF 'graphqlSchema:' "$config" &&
341
+ grep -qF 'jsResource:' "$config" &&
342
+ grep -qF 'static:' "$config"
343
+ } || host_has_dependency harperdb
344
+ ;;
345
+ phaser) host_has_dependency phaser ;;
346
+ nestjs)
347
+ [ -e "$project_root/nest-cli.json" ] ||
348
+ host_has_dependency @nestjs prefix
349
+ ;;
350
+ expo)
351
+ [ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
352
+ host_has_dependency expo
353
+ ;;
354
+ cdk) [ -e "$project_root/cdk.json" ] ;;
355
+ rails)
356
+ [ -e "$project_root/bin/rails" ] ||
357
+ [ -e "$project_root/config/application.rb" ]
358
+ ;;
359
+ *) return 0 ;;
360
+ esac
361
+ }
362
+
283
363
  # Whether a host-relative path is shipped as a copy-overwrite template.
284
364
  #
285
365
  # A few stat calls rather than an enumeration: the same relative path is probed
@@ -299,6 +379,10 @@ managed_source() {
299
379
  for stack in "$package_root"/*/copy-overwrite; do
300
380
  [ -d "$stack" ] || continue
301
381
  if [ -e "$stack/$rel" ]; then
382
+ # Another stack's copy-overwrite twin is not this host's file. Keep
383
+ # looking: a stack this host IS may still manage the same path.
384
+ local stack_name="${stack%/copy-overwrite}"
385
+ stack_reaches_host "${stack_name##*/}" || continue
302
386
  printf '%s' "${stack#"$package_root"/}/$rel"
303
387
  return 0
304
388
  fi
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -280,6 +280,86 @@ relative_path() {
280
280
  printf '%s' "${rel#./}"
281
281
  }
282
282
 
283
+ # The host's dependency and devDependency names, one per line, read at most
284
+ # once per classification. `managed_source` runs inside `$(...)`, so the cache
285
+ # lives only as long as that subshell — one classification, not one hook run.
286
+ # Unreadable or malformed `package.json` yields nothing, which makes every
287
+ # dependency-keyed stack below read as absent — an allow, the safe direction.
288
+ #
289
+ # Loaded into a global rather than echoed, so callers match with a here-string
290
+ # and no pipeline: under `pipefail` a `grep -q` that stops reading early can
291
+ # fail the writer with SIGPIPE and turn a match into a miss.
292
+ host_dependency_names=""
293
+ host_dependency_names_pending=1
294
+ load_host_dependency_names() {
295
+ [ "$host_dependency_names_pending" -eq 1 ] || return 0
296
+ host_dependency_names="$(jq -r \
297
+ '[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
298
+ "$project_root/package.json" 2>/dev/null || true)"
299
+ host_dependency_names_pending=0
300
+ }
301
+
302
+ # Exact dependency name, or with `prefix` as the second argument, any name
303
+ # starting with it (the NestJS detector's `@nestjs` test).
304
+ host_has_dependency() {
305
+ load_host_dependency_names
306
+ local name
307
+ while IFS= read -r name; do
308
+ case "$name" in
309
+ "$1") return 0 ;;
310
+ "$1"*) [ "${2:-}" = prefix ] && return 0 ;;
311
+ esac
312
+ done <<<"$host_dependency_names"
313
+ return 1
314
+ }
315
+
316
+ # Whether the host is the given stack, so that stack's templates reach it.
317
+ #
318
+ # THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
319
+ # `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
320
+ # rails — the host owns it after the first apply — but copy-overwrite in
321
+ # harper-fabric and phaser. Probing every stack's tree without asking which
322
+ # stacks this host is made a NestJS host's own ci.yml read as managed via the
323
+ # harper-fabric copy, and a project-owned one-line Node bump needed a human to
324
+ # run the override (CodySwannGT/lisa#4511).
325
+ #
326
+ # `lisa apply` copies a stack's templates only into a host that stack's
327
+ # detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
328
+ # `all`, `typescript`, and any stack without an arm here keep the pre-existing
329
+ # answer — always managed — so this narrows only where a detector proves the
330
+ # stack absent. Where a shell mirror cannot be exact it errs toward allowing,
331
+ # the same direction `.lisaignore` handling above takes.
332
+ stack_reaches_host() {
333
+ local stack="$1"
334
+ case "$stack" in
335
+ harper-fabric)
336
+ local config="$project_root/harper-app/config.yaml"
337
+ [ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
338
+ return 1
339
+ {
340
+ grep -qF 'graphqlSchema:' "$config" &&
341
+ grep -qF 'jsResource:' "$config" &&
342
+ grep -qF 'static:' "$config"
343
+ } || host_has_dependency harperdb
344
+ ;;
345
+ phaser) host_has_dependency phaser ;;
346
+ nestjs)
347
+ [ -e "$project_root/nest-cli.json" ] ||
348
+ host_has_dependency @nestjs prefix
349
+ ;;
350
+ expo)
351
+ [ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
352
+ host_has_dependency expo
353
+ ;;
354
+ cdk) [ -e "$project_root/cdk.json" ] ;;
355
+ rails)
356
+ [ -e "$project_root/bin/rails" ] ||
357
+ [ -e "$project_root/config/application.rb" ]
358
+ ;;
359
+ *) return 0 ;;
360
+ esac
361
+ }
362
+
283
363
  # Whether a host-relative path is shipped as a copy-overwrite template.
284
364
  #
285
365
  # A few stat calls rather than an enumeration: the same relative path is probed
@@ -299,6 +379,10 @@ managed_source() {
299
379
  for stack in "$package_root"/*/copy-overwrite; do
300
380
  [ -d "$stack" ] || continue
301
381
  if [ -e "$stack/$rel" ]; then
382
+ # Another stack's copy-overwrite twin is not this host's file. Keep
383
+ # looking: a stack this host IS may still manage the same path.
384
+ local stack_name="${stack%/copy-overwrite}"
385
+ stack_reaches_host "${stack_name##*/}" || continue
302
386
  printf '%s' "${stack#"$package_root"/}/$rel"
303
387
  return 0
304
388
  fi
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.107.3",
3
+ "version": "4.107.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -280,6 +280,86 @@ relative_path() {
280
280
  printf '%s' "${rel#./}"
281
281
  }
282
282
 
283
+ # The host's dependency and devDependency names, one per line, read at most
284
+ # once per classification. `managed_source` runs inside `$(...)`, so the cache
285
+ # lives only as long as that subshell — one classification, not one hook run.
286
+ # Unreadable or malformed `package.json` yields nothing, which makes every
287
+ # dependency-keyed stack below read as absent — an allow, the safe direction.
288
+ #
289
+ # Loaded into a global rather than echoed, so callers match with a here-string
290
+ # and no pipeline: under `pipefail` a `grep -q` that stops reading early can
291
+ # fail the writer with SIGPIPE and turn a match into a miss.
292
+ host_dependency_names=""
293
+ host_dependency_names_pending=1
294
+ load_host_dependency_names() {
295
+ [ "$host_dependency_names_pending" -eq 1 ] || return 0
296
+ host_dependency_names="$(jq -r \
297
+ '[(.dependencies // {}), (.devDependencies // {})] | add | keys[]' \
298
+ "$project_root/package.json" 2>/dev/null || true)"
299
+ host_dependency_names_pending=0
300
+ }
301
+
302
+ # Exact dependency name, or with `prefix` as the second argument, any name
303
+ # starting with it (the NestJS detector's `@nestjs` test).
304
+ host_has_dependency() {
305
+ load_host_dependency_names
306
+ local name
307
+ while IFS= read -r name; do
308
+ case "$name" in
309
+ "$1") return 0 ;;
310
+ "$1"*) [ "${2:-}" = prefix ] && return 0 ;;
311
+ esac
312
+ done <<<"$host_dependency_names"
313
+ return 1
314
+ }
315
+
316
+ # Whether the host is the given stack, so that stack's templates reach it.
317
+ #
318
+ # THE SAME PATH CAN BELONG TO DIFFERENT OWNERS IN DIFFERENT STACKS.
319
+ # `.github/workflows/ci.yml` is create-only in typescript, nestjs, cdk, expo and
320
+ # rails — the host owns it after the first apply — but copy-overwrite in
321
+ # harper-fabric and phaser. Probing every stack's tree without asking which
322
+ # stacks this host is made a NestJS host's own ci.yml read as managed via the
323
+ # harper-fabric copy, and a project-owned one-line Node bump needed a human to
324
+ # run the override (CodySwannGT/lisa#4511).
325
+ #
326
+ # `lisa apply` copies a stack's templates only into a host that stack's
327
+ # detector recognises, so each arm mirrors `src/detection/detectors/<stack>.ts`.
328
+ # `all`, `typescript`, and any stack without an arm here keep the pre-existing
329
+ # answer — always managed — so this narrows only where a detector proves the
330
+ # stack absent. Where a shell mirror cannot be exact it errs toward allowing,
331
+ # the same direction `.lisaignore` handling above takes.
332
+ stack_reaches_host() {
333
+ local stack="$1"
334
+ case "$stack" in
335
+ harper-fabric)
336
+ local config="$project_root/harper-app/config.yaml"
337
+ [ -f "$config" ] && [ -e "$project_root/harper-app/schema.graphql" ] ||
338
+ return 1
339
+ {
340
+ grep -qF 'graphqlSchema:' "$config" &&
341
+ grep -qF 'jsResource:' "$config" &&
342
+ grep -qF 'static:' "$config"
343
+ } || host_has_dependency harperdb
344
+ ;;
345
+ phaser) host_has_dependency phaser ;;
346
+ nestjs)
347
+ [ -e "$project_root/nest-cli.json" ] ||
348
+ host_has_dependency @nestjs prefix
349
+ ;;
350
+ expo)
351
+ [ -e "$project_root/app.json" ] || [ -e "$project_root/eas.json" ] ||
352
+ host_has_dependency expo
353
+ ;;
354
+ cdk) [ -e "$project_root/cdk.json" ] ;;
355
+ rails)
356
+ [ -e "$project_root/bin/rails" ] ||
357
+ [ -e "$project_root/config/application.rb" ]
358
+ ;;
359
+ *) return 0 ;;
360
+ esac
361
+ }
362
+
283
363
  # Whether a host-relative path is shipped as a copy-overwrite template.
284
364
  #
285
365
  # A few stat calls rather than an enumeration: the same relative path is probed
@@ -299,6 +379,10 @@ managed_source() {
299
379
  for stack in "$package_root"/*/copy-overwrite; do
300
380
  [ -d "$stack" ] || continue
301
381
  if [ -e "$stack/$rel" ]; then
382
+ # Another stack's copy-overwrite twin is not this host's file. Keep
383
+ # looking: a stack this host IS may still manage the same path.
384
+ local stack_name="${stack%/copy-overwrite}"
385
+ stack_reaches_host "${stack_name##*/}" || continue
302
386
  printf '%s' "${stack#"$package_root"/}/$rel"
303
387
  return 0
304
388
  fi
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.107.3",
3
+ "version": "4.107.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.107.3",
3
+ "version": "4.107.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"