@codyswann/lisa 4.60.7 → 4.60.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/all/copy-overwrite/scripts/check-orphaned-branches.mjs +31 -18
  2. package/all/copy-overwrite/scripts/lisa-gates.mjs +17 -5
  3. package/all/copy-overwrite/scripts/lisa-hooks/block-instruction-file-edits.sh +26 -35
  4. package/all/copy-overwrite/scripts/lisa-reconcile-policy.mjs +31 -8
  5. package/all/copy-overwrite/scripts/lisa-run-gates.mjs +8 -1
  6. package/all/create-only/.agents/rules/README.md +13 -6
  7. package/dist/core/host-rules-pointer.js +2 -2
  8. package/dist/core/host-rules-pointer.js.map +1 -1
  9. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  10. package/dist/core/lisa-owned-hash-ledger.js +10 -0
  11. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  12. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  13. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  14. package/dist/core/upstream-evidence-manifest.js +11 -9
  15. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  16. package/dist/opencode/plugin-templates/lisa-block-instruction-file-edits.ts +25 -22
  17. package/package.json +4 -4
  18. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  19. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  20. package/plugins/lisa/hooks/block-instruction-file-edits.sh +26 -35
  21. package/plugins/lisa/rules/reference/config-resolution.md +1 -1
  22. package/plugins/lisa/rules/reference/project-learnings.md +28 -3
  23. package/plugins/lisa-agy/hooks/block-instruction-file-edits.sh +26 -35
  24. package/plugins/lisa-agy/plugin.json +1 -1
  25. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  27. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  28. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-copilot/hooks/block-instruction-file-edits.sh +26 -35
  32. package/plugins/lisa-copilot/rules/reference/config-resolution.md +1 -1
  33. package/plugins/lisa-copilot/rules/reference/project-learnings.md +28 -3
  34. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-cursor/hooks/block-instruction-file-edits.sh +26 -35
  36. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +1 -1
  37. package/plugins/lisa-cursor/rules/project-learnings-reference.mdc +28 -3
  38. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  40. package/plugins/lisa-expo-agy/plugin.json +1 -1
  41. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  45. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  46. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  50. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  51. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  55. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  56. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  60. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  61. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  65. package/plugins/lisa-rails-agy/plugin.json +1 -1
  66. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  71. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  76. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/src/base/hooks/block-instruction-file-edits.sh +26 -35
  79. package/plugins/src/base/rules/reference/config-resolution.md +1 -1
  80. package/plugins/src/base/rules/reference/project-learnings.md +28 -3
@@ -7,9 +7,9 @@
7
7
  * session for the project. Agents appending their own findings is how they grow
8
8
  * into hundreds of lines of stale, ticket-specific trivia.
9
9
  *
10
- * Port of Lisa's canonical hook `block-instruction-file-edits.sh`. OpenCode
11
- * exposes only `edit` / `write` filesystem tools (no `apply_patch`), so the file
12
- * path comes straight from `output.args.filePath`. Throwing in
10
+ * Adapter for Lisa's hook `block-instruction-file-edits.sh`. This adapter
11
+ * handles `edit` / `write`; shell screening belongs to the shell dispatcher
12
+ * where installed. The file path comes from `output.args.filePath`. Throwing in
13
13
  * `tool.execute.before` cancels the tool call and surfaces the message to the
14
14
  * agent.
15
15
  *
@@ -35,10 +35,11 @@ const LisaBlockInstructionFileEdits = async () => {
35
35
  const filePath = String(output.args?.filePath ?? "");
36
36
  if (!filePath) return;
37
37
  if (/(^|\/)(node_modules|dist)\//.test(filePath)) return;
38
- // The operator's explicit override, named in the refusal below.
38
+ // Existing operator-configured override; not proof of conversation approval.
39
39
  if (process.env["LISA_ALLOW_INSTRUCTION_FILE_WRITE"]) return;
40
- // Lisa's own marker-bounded regions replace in place and cannot grow the
41
- // file, so they are never the unbounded append this guard exists to stop.
40
+ // Existing parity gap: this adapter accepts a content marker; the shell
41
+ // guard requires bounded old/new replacement pairs. Do not describe this
42
+ // weaker exemption as authorization or proof that an edit cannot grow.
42
43
  if (String(output.args?.content ?? "").includes("<!-- LISA_")) return;
43
44
  const base = (filePath.split("/").pop() ?? "").toLowerCase();
44
45
  if (!INSTRUCTION_FILES.has(base)) return;
@@ -46,25 +47,27 @@ const LisaBlockInstructionFileEdits = async () => {
46
47
  [
47
48
  `block-instruction-file-edits: refusing to write ${filePath}.`,
48
49
  "",
49
- "WHY: this is a session-instruction file, not a place to record what",
50
- "you just learned. Every line in it loads into the context of every",
51
- "agent, in every future session, in this project, forever. It is",
52
- "human-curated on purpose.",
50
+ "WHY: this session-instruction file is loaded into future agent sessions.",
51
+ "Appending incidental findings makes every later session carry those notes.",
52
+ "This adapter cannot read or authenticate conversation approval.",
53
53
  "",
54
- "WHERE IT GOES INSTEAD — take the first one that fits:",
54
+ "If an operator already requested a standing-rule edit, that authorization",
55
+ "is enough for the requested change. Use the relevant topic file in",
56
+ ".agents/rules/ when no other destination was specified. All six agents",
57
+ "read it through the existing AGENTS.md pointer. Edit it directly; do not",
58
+ "require learning capture, another ticket, or repeated approval.",
55
59
  "",
56
- "1. Every agent needs it every session, only in this project? That is a",
57
- " project rule — capture it with /lisa:persist-learning so it lands in",
58
- " the learnings ledger. The gardener (/lisa:learnings:audit) proposes",
59
- " promotion into the host-rules directory .agents/rules/ as a human-gated ticket.",
60
- "2. It changes how an existing skill behaves? Edit that skill's SKILL.md.",
61
- "3. It is true beyond this project? Propose it upstream via",
62
- " /lisa:cross-pollinate, or open an issue on CodySwannGT/lisa.",
63
- "4. Otherwise it is background, not a standing instruction — write it",
64
- " into the project documentation (wiki/ or docs/).",
60
+ "If the operator explicitly named this guarded file, preserve that target",
61
+ "and use the runtime's authorized edit path, or report this restriction.",
62
+ "Do not silently move the edit, switch tools to evade this refusal, or",
63
+ "set an override yourself. The existing operator-configured",
64
+ "LISA_ALLOW_INSTRUCTION_FILE_WRITE=1 escape hatch is not proof of consent.",
65
65
  "",
66
- "If a human explicitly asked for this edit, re-run with",
67
- "LISA_ALLOW_INSTRUCTION_FILE_WRITE=1 set.",
66
+ "For an agent's own finding, first decide whether it is worth maintaining.",
67
+ "Decline one-off trivia and unnecessary rules. Durable project knowledge",
68
+ "can use /lisa:persist-learning; procedures belong with their SKILL.md;",
69
+ "background belongs in existing documentation. Use /lisa:cross-pollinate",
70
+ "only for a material, reusable upstream improvement.",
68
71
  ].join("\n")
69
72
  );
70
73
  },
package/package.json CHANGED
@@ -187,7 +187,7 @@
187
187
  "zod-validation-error": "^4.0.0"
188
188
  },
189
189
  "name": "@codyswann/lisa",
190
- "version": "4.60.7",
190
+ "version": "4.60.9",
191
191
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
192
192
  "main": "dist/index.js",
193
193
  "exports": {
@@ -336,7 +336,7 @@
336
336
  "test": "tests"
337
337
  },
338
338
  "types": "./dist/index.d.ts",
339
- "lisaReleaseCommit": "df30c717ece730d5fb6e9c4f3a44b9e43bd6cee0",
340
- "gitHead": "df30c717ece730d5fb6e9c4f3a44b9e43bd6cee0",
341
- "lisaReleaseTag": "v4.60.7"
339
+ "lisaReleaseCommit": "a751e96b63604310f04fb158b76c8ac632d85852",
340
+ "gitHead": "a751e96b63604310f04fb158b76c8ac632d85852",
341
+ "lisaReleaseTag": "v4.60.9"
342
342
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -24,11 +24,9 @@
24
24
  # Reads (`cat AGENTS.md`, `rg pattern AGENTS.md`) never fire.
25
25
  #
26
26
  # Exemptions (allowed):
27
- # - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set — the operator's explicit override,
28
- # named in the refusal so a human who really wants the edit can take it;
29
- # - payloads carrying a `<!-- LISA_` marker: Lisa's own marker-bounded regions
30
- # (the agy project-learnings bridge, cross-pollinate's rule section) replace
31
- # in place on re-run and cannot grow the file;
27
+ # - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set in the operator's runtime config.
28
+ # This cooperative override does not authenticate conversation approval;
29
+ # - Edit/MultiEdit replacing only bounded `<!-- LISA_` regions on both sides;
32
30
  # - paths under `node_modules/` or `dist/` — vendored copies, not the host's.
33
31
  set -euo pipefail
34
32
 
@@ -58,8 +56,8 @@ fi
58
56
 
59
57
  command -v jq >/dev/null 2>&1 || exit 0
60
58
 
61
- # The operator's override. Checked before anything else so it is always the
62
- # cheapest way out of a refusal a human deliberately wants to overrule.
59
+ # Existing operator-configured override. This hook sees tool payloads, not the
60
+ # conversation; the environment variable is not proof of who approved an edit.
63
61
  if [ -n "${LISA_ALLOW_INSTRUCTION_FILE_WRITE:-}" ]; then
64
62
  exit 0
65
63
  fi
@@ -129,34 +127,27 @@ refuse() {
129
127
  cat >&2 <<EOF
130
128
  BLOCKED: refusing to write \`$target\`.
131
129
 
132
- WHY: this is a session-instruction file, not a place to record what you just
133
- learned. Every line in it is loaded into the context of every agent, in every
134
- future session, in this project, forever. It is human-curated on purpose. An
135
- agent appending its own findings is how these files grow into hundreds of lines
136
- of stale, ticket-specific trivia that every later session pays for and half of
137
- which was only ever true once.
138
-
139
- WHERE IT GOES INSTEAD — take the first one that fits:
140
-
141
- 1. Every agent genuinely needs this in every session, and only in this project.
142
- That is a project rule — but do not write it yourself. Capture it with
143
- \`/lisa:persist-learning\` so it lands in the learnings ledger with provenance
144
- and a confidence score. The gardener (\`/lisa:learnings:audit\`) then proposes
145
- promotion into the host-rules directory \`.agents/rules/\` as a human-gated ticket.
146
-
147
- 2. It changes how an existing skill should behave. Edit that skill's SKILL.md.
148
- Knowledge belongs next to the procedure it modifies, not in a global preamble.
149
-
150
- 3. It is true beyond this project. Propose it upstream to Lisa via
151
- \`/lisa:cross-pollinate\`, or open an issue on CodySwannGT/lisa. A local copy of
152
- a general rule silently drifts the moment upstream changes.
153
-
154
- 4. None of the above — it is background someone may want to look up, not a
155
- standing instruction. Write it into the project documentation (\`wiki/\` or
156
- \`docs/\`).
157
-
158
- If a human explicitly asked for this edit, they can re-run with
159
- \`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` set, which bypasses this guard.
130
+ WHY: this session-instruction file is loaded into future agent sessions.
131
+ Appending incidental findings makes every later session carry those notes.
132
+ This hook checks write patterns; it cannot read or authenticate conversation approval.
133
+
134
+ If an operator already requested a standing-rule edit, that authorization is
135
+ enough for the requested change. Use the relevant topic file in \`.agents/rules/\`
136
+ when no other destination was specified. All six supported agents read that
137
+ directory through the existing \`AGENTS.md\` pointer. Edit it directly; do not
138
+ require learning capture, another ticket, or repeated approval for the same ruling.
139
+
140
+ If the operator explicitly named this guarded file, preserve that target and
141
+ use the runtime's authorized edit path, or report this remaining restriction.
142
+ Do not silently move the edit, switch tools to evade this refusal, or set an
143
+ override yourself. The existing operator-configured
144
+ \`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` escape hatch is not proof of consent.
145
+
146
+ For an agent's own finding, first decide whether it is worth maintaining.
147
+ Decline one-off trivia and unnecessary rules. Durable project knowledge can
148
+ use \`/lisa:persist-learning\`; procedural knowledge belongs with its SKILL.md;
149
+ background belongs in existing project documentation. Use
150
+ \`/lisa:cross-pollinate\` only for a material, reusable upstream improvement.
160
151
  EOF
161
152
  exit 2
162
153
  }
@@ -286,7 +286,7 @@ fi
286
286
  Host-authored operating rules live in `.agents/rules/` — **fixed, not configurable**. One directory, every agent.
287
287
 
288
288
  - **Not a native auto-load tree.** `.claude/rules`, `.cursor/rules`, and `.github/instructions` are; `.agents/rules` deliberately is not. Every agent reaches it through the single Lisa-managed pointer block in `AGENTS.md` (Claude via the `@AGENTS.md` import in `CLAUDE.md`), so no agent loads host rules twice.
289
- - **Host-owned.** Lisa never writes rule bodies into `.agents/rules/`, and never edits or deletes a file there. Lisa's own rules originate in its plugins and arrive by their own route.
289
+ - **Host-owned.** Lisa's installer never overwrites host rule bodies. Agents may make specific operator-requested edits directly, without recapturing the approved decision as a learning or promotion ticket; see **Operator-directed standing rules** in `project-learnings.md`. Lisa's own rules arrive through its plugins.
290
290
  - **Not the learnings ledger.** `.agents/rules` is reserved in the auto-loaded-tree blocklist, so a `learnings.file` override can never resolve inside it.
291
291
  - **Transition.** A project that still has the retired `.claude/rules/PROJECT_RULES.md` keeps it, untouched and authoritative. The pointer block names it so agents whose runtime does not auto-load `.claude/rules/` still find it. Moving that content is a human-gated decision, never an automated rewrite.
292
292
 
@@ -81,10 +81,35 @@ collide.
81
81
  - The **build-intake flows** advance `last_confirmed` at claim time
82
82
  (`confirmLearningEntry`, below).
83
83
 
84
- Promotion to a higher rung (skill, eager rule, executable control, upstream
85
- ticket) is never a writer here — it is the gardener's job, gated by a human
84
+ Automated promotion of a captured learning to a higher rung (skill, eager rule,
85
+ executable control, upstream ticket) is the gardener's job, gated by a human
86
86
  flipping a tracker ticket to `status:ready`.
87
87
 
88
+ ## Operator-directed standing rules
89
+
90
+ An operator's instruction to add, revise, or remove a standing rule is already
91
+ authorization for that specific edit. It is not a new machine-captured learning.
92
+ Make the requested change directly, preserving unrelated content; do not require
93
+ learning capture, a promotion ticket, or repeated approval for the same decision.
94
+ "Human-authored" describes who controls the rule, not who types the approved edit.
95
+
96
+ Use the existing topic file under `.agents/rules/`, or create a short one there,
97
+ when the operator has not specified another destination. The `AGENTS.md` host-rules
98
+ pointer reaches Claude Code, Codex, Cursor, OpenCode, Antigravity, and Copilot.
99
+ These shared rules are not a Claude-only surface, and they do not need to be
100
+ copied into every agent's startup file.
101
+
102
+ If the operator explicitly named a guarded startup file, do not substitute a
103
+ different destination or switch tools to evade a refusal. Use the runtime's
104
+ authorized edit path, or report the specific remaining runtime restriction.
105
+ The existing instruction-file override is an operator-configured escape hatch,
106
+ not proof of human approval; agents must not set it to work around a refusal.
107
+ No new approval token is needed for ordinary authorized edits to shared host rules.
108
+
109
+ This does not authorize agents to promote their own incidental findings. Decline
110
+ one-off notes and unnecessary rules; use the existing learning flow only for
111
+ durable knowledge worth maintaining.
112
+
88
113
  ## Claim-time confirmation (`last_confirmed`)
89
114
 
90
115
  `last_confirmed` is advanced at claim time by the build-intake flows (step
@@ -111,7 +136,7 @@ warning, apply no entry, and do not block unrelated work.
111
136
  Precedence:
112
137
 
113
138
  1. System, developer, user, and repo instructions still outrank learnings.
114
- 2. Committed host rules (`.agents/rules/`) remain durable human-authored
139
+ 2. Committed host rules (`.agents/rules/`) remain durable, operator-controlled
115
140
  guidance.
116
141
  3. Project learnings add recent operational knowledge, but never rewrite or
117
142
  append to host rules.
@@ -24,11 +24,9 @@
24
24
  # Reads (`cat AGENTS.md`, `rg pattern AGENTS.md`) never fire.
25
25
  #
26
26
  # Exemptions (allowed):
27
- # - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set — the operator's explicit override,
28
- # named in the refusal so a human who really wants the edit can take it;
29
- # - payloads carrying a `<!-- LISA_` marker: Lisa's own marker-bounded regions
30
- # (the agy project-learnings bridge, cross-pollinate's rule section) replace
31
- # in place on re-run and cannot grow the file;
27
+ # - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set in the operator's runtime config.
28
+ # This cooperative override does not authenticate conversation approval;
29
+ # - Edit/MultiEdit replacing only bounded `<!-- LISA_` regions on both sides;
32
30
  # - paths under `node_modules/` or `dist/` — vendored copies, not the host's.
33
31
  set -euo pipefail
34
32
 
@@ -58,8 +56,8 @@ fi
58
56
 
59
57
  command -v jq >/dev/null 2>&1 || exit 0
60
58
 
61
- # The operator's override. Checked before anything else so it is always the
62
- # cheapest way out of a refusal a human deliberately wants to overrule.
59
+ # Existing operator-configured override. This hook sees tool payloads, not the
60
+ # conversation; the environment variable is not proof of who approved an edit.
63
61
  if [ -n "${LISA_ALLOW_INSTRUCTION_FILE_WRITE:-}" ]; then
64
62
  exit 0
65
63
  fi
@@ -129,34 +127,27 @@ refuse() {
129
127
  cat >&2 <<EOF
130
128
  BLOCKED: refusing to write \`$target\`.
131
129
 
132
- WHY: this is a session-instruction file, not a place to record what you just
133
- learned. Every line in it is loaded into the context of every agent, in every
134
- future session, in this project, forever. It is human-curated on purpose. An
135
- agent appending its own findings is how these files grow into hundreds of lines
136
- of stale, ticket-specific trivia that every later session pays for and half of
137
- which was only ever true once.
138
-
139
- WHERE IT GOES INSTEAD — take the first one that fits:
140
-
141
- 1. Every agent genuinely needs this in every session, and only in this project.
142
- That is a project rule — but do not write it yourself. Capture it with
143
- \`/lisa:persist-learning\` so it lands in the learnings ledger with provenance
144
- and a confidence score. The gardener (\`/lisa:learnings:audit\`) then proposes
145
- promotion into the host-rules directory \`.agents/rules/\` as a human-gated ticket.
146
-
147
- 2. It changes how an existing skill should behave. Edit that skill's SKILL.md.
148
- Knowledge belongs next to the procedure it modifies, not in a global preamble.
149
-
150
- 3. It is true beyond this project. Propose it upstream to Lisa via
151
- \`/lisa:cross-pollinate\`, or open an issue on CodySwannGT/lisa. A local copy of
152
- a general rule silently drifts the moment upstream changes.
153
-
154
- 4. None of the above — it is background someone may want to look up, not a
155
- standing instruction. Write it into the project documentation (\`wiki/\` or
156
- \`docs/\`).
157
-
158
- If a human explicitly asked for this edit, they can re-run with
159
- \`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` set, which bypasses this guard.
130
+ WHY: this session-instruction file is loaded into future agent sessions.
131
+ Appending incidental findings makes every later session carry those notes.
132
+ This hook checks write patterns; it cannot read or authenticate conversation approval.
133
+
134
+ If an operator already requested a standing-rule edit, that authorization is
135
+ enough for the requested change. Use the relevant topic file in \`.agents/rules/\`
136
+ when no other destination was specified. All six supported agents read that
137
+ directory through the existing \`AGENTS.md\` pointer. Edit it directly; do not
138
+ require learning capture, another ticket, or repeated approval for the same ruling.
139
+
140
+ If the operator explicitly named this guarded file, preserve that target and
141
+ use the runtime's authorized edit path, or report this remaining restriction.
142
+ Do not silently move the edit, switch tools to evade this refusal, or set an
143
+ override yourself. The existing operator-configured
144
+ \`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` escape hatch is not proof of consent.
145
+
146
+ For an agent's own finding, first decide whether it is worth maintaining.
147
+ Decline one-off trivia and unnecessary rules. Durable project knowledge can
148
+ use \`/lisa:persist-learning\`; procedural knowledge belongs with its SKILL.md;
149
+ background belongs in existing project documentation. Use
150
+ \`/lisa:cross-pollinate\` only for a material, reusable upstream improvement.
160
151
  EOF
161
152
  exit 2
162
153
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
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.60.7",
3
+ "version": "4.60.9",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -24,11 +24,9 @@
24
24
  # Reads (`cat AGENTS.md`, `rg pattern AGENTS.md`) never fire.
25
25
  #
26
26
  # Exemptions (allowed):
27
- # - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set — the operator's explicit override,
28
- # named in the refusal so a human who really wants the edit can take it;
29
- # - payloads carrying a `<!-- LISA_` marker: Lisa's own marker-bounded regions
30
- # (the agy project-learnings bridge, cross-pollinate's rule section) replace
31
- # in place on re-run and cannot grow the file;
27
+ # - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set in the operator's runtime config.
28
+ # This cooperative override does not authenticate conversation approval;
29
+ # - Edit/MultiEdit replacing only bounded `<!-- LISA_` regions on both sides;
32
30
  # - paths under `node_modules/` or `dist/` — vendored copies, not the host's.
33
31
  set -euo pipefail
34
32
 
@@ -58,8 +56,8 @@ fi
58
56
 
59
57
  command -v jq >/dev/null 2>&1 || exit 0
60
58
 
61
- # The operator's override. Checked before anything else so it is always the
62
- # cheapest way out of a refusal a human deliberately wants to overrule.
59
+ # Existing operator-configured override. This hook sees tool payloads, not the
60
+ # conversation; the environment variable is not proof of who approved an edit.
63
61
  if [ -n "${LISA_ALLOW_INSTRUCTION_FILE_WRITE:-}" ]; then
64
62
  exit 0
65
63
  fi
@@ -129,34 +127,27 @@ refuse() {
129
127
  cat >&2 <<EOF
130
128
  BLOCKED: refusing to write \`$target\`.
131
129
 
132
- WHY: this is a session-instruction file, not a place to record what you just
133
- learned. Every line in it is loaded into the context of every agent, in every
134
- future session, in this project, forever. It is human-curated on purpose. An
135
- agent appending its own findings is how these files grow into hundreds of lines
136
- of stale, ticket-specific trivia that every later session pays for and half of
137
- which was only ever true once.
138
-
139
- WHERE IT GOES INSTEAD — take the first one that fits:
140
-
141
- 1. Every agent genuinely needs this in every session, and only in this project.
142
- That is a project rule — but do not write it yourself. Capture it with
143
- \`/lisa:persist-learning\` so it lands in the learnings ledger with provenance
144
- and a confidence score. The gardener (\`/lisa:learnings:audit\`) then proposes
145
- promotion into the host-rules directory \`.agents/rules/\` as a human-gated ticket.
146
-
147
- 2. It changes how an existing skill should behave. Edit that skill's SKILL.md.
148
- Knowledge belongs next to the procedure it modifies, not in a global preamble.
149
-
150
- 3. It is true beyond this project. Propose it upstream to Lisa via
151
- \`/lisa:cross-pollinate\`, or open an issue on CodySwannGT/lisa. A local copy of
152
- a general rule silently drifts the moment upstream changes.
153
-
154
- 4. None of the above — it is background someone may want to look up, not a
155
- standing instruction. Write it into the project documentation (\`wiki/\` or
156
- \`docs/\`).
157
-
158
- If a human explicitly asked for this edit, they can re-run with
159
- \`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` set, which bypasses this guard.
130
+ WHY: this session-instruction file is loaded into future agent sessions.
131
+ Appending incidental findings makes every later session carry those notes.
132
+ This hook checks write patterns; it cannot read or authenticate conversation approval.
133
+
134
+ If an operator already requested a standing-rule edit, that authorization is
135
+ enough for the requested change. Use the relevant topic file in \`.agents/rules/\`
136
+ when no other destination was specified. All six supported agents read that
137
+ directory through the existing \`AGENTS.md\` pointer. Edit it directly; do not
138
+ require learning capture, another ticket, or repeated approval for the same ruling.
139
+
140
+ If the operator explicitly named this guarded file, preserve that target and
141
+ use the runtime's authorized edit path, or report this remaining restriction.
142
+ Do not silently move the edit, switch tools to evade this refusal, or set an
143
+ override yourself. The existing operator-configured
144
+ \`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` escape hatch is not proof of consent.
145
+
146
+ For an agent's own finding, first decide whether it is worth maintaining.
147
+ Decline one-off trivia and unnecessary rules. Durable project knowledge can
148
+ use \`/lisa:persist-learning\`; procedural knowledge belongs with its SKILL.md;
149
+ background belongs in existing project documentation. Use
150
+ \`/lisa:cross-pollinate\` only for a material, reusable upstream improvement.
160
151
  EOF
161
152
  exit 2
162
153
  }
@@ -286,7 +286,7 @@ fi
286
286
  Host-authored operating rules live in `.agents/rules/` — **fixed, not configurable**. One directory, every agent.
287
287
 
288
288
  - **Not a native auto-load tree.** `.claude/rules`, `.cursor/rules`, and `.github/instructions` are; `.agents/rules` deliberately is not. Every agent reaches it through the single Lisa-managed pointer block in `AGENTS.md` (Claude via the `@AGENTS.md` import in `CLAUDE.md`), so no agent loads host rules twice.
289
- - **Host-owned.** Lisa never writes rule bodies into `.agents/rules/`, and never edits or deletes a file there. Lisa's own rules originate in its plugins and arrive by their own route.
289
+ - **Host-owned.** Lisa's installer never overwrites host rule bodies. Agents may make specific operator-requested edits directly, without recapturing the approved decision as a learning or promotion ticket; see **Operator-directed standing rules** in `project-learnings.md`. Lisa's own rules arrive through its plugins.
290
290
  - **Not the learnings ledger.** `.agents/rules` is reserved in the auto-loaded-tree blocklist, so a `learnings.file` override can never resolve inside it.
291
291
  - **Transition.** A project that still has the retired `.claude/rules/PROJECT_RULES.md` keeps it, untouched and authoritative. The pointer block names it so agents whose runtime does not auto-load `.claude/rules/` still find it. Moving that content is a human-gated decision, never an automated rewrite.
292
292
 
@@ -81,10 +81,35 @@ collide.
81
81
  - The **build-intake flows** advance `last_confirmed` at claim time
82
82
  (`confirmLearningEntry`, below).
83
83
 
84
- Promotion to a higher rung (skill, eager rule, executable control, upstream
85
- ticket) is never a writer here — it is the gardener's job, gated by a human
84
+ Automated promotion of a captured learning to a higher rung (skill, eager rule,
85
+ executable control, upstream ticket) is the gardener's job, gated by a human
86
86
  flipping a tracker ticket to `status:ready`.
87
87
 
88
+ ## Operator-directed standing rules
89
+
90
+ An operator's instruction to add, revise, or remove a standing rule is already
91
+ authorization for that specific edit. It is not a new machine-captured learning.
92
+ Make the requested change directly, preserving unrelated content; do not require
93
+ learning capture, a promotion ticket, or repeated approval for the same decision.
94
+ "Human-authored" describes who controls the rule, not who types the approved edit.
95
+
96
+ Use the existing topic file under `.agents/rules/`, or create a short one there,
97
+ when the operator has not specified another destination. The `AGENTS.md` host-rules
98
+ pointer reaches Claude Code, Codex, Cursor, OpenCode, Antigravity, and Copilot.
99
+ These shared rules are not a Claude-only surface, and they do not need to be
100
+ copied into every agent's startup file.
101
+
102
+ If the operator explicitly named a guarded startup file, do not substitute a
103
+ different destination or switch tools to evade a refusal. Use the runtime's
104
+ authorized edit path, or report the specific remaining runtime restriction.
105
+ The existing instruction-file override is an operator-configured escape hatch,
106
+ not proof of human approval; agents must not set it to work around a refusal.
107
+ No new approval token is needed for ordinary authorized edits to shared host rules.
108
+
109
+ This does not authorize agents to promote their own incidental findings. Decline
110
+ one-off notes and unnecessary rules; use the existing learning flow only for
111
+ durable knowledge worth maintaining.
112
+
88
113
  ## Claim-time confirmation (`last_confirmed`)
89
114
 
90
115
  `last_confirmed` is advanced at claim time by the build-intake flows (step
@@ -111,7 +136,7 @@ warning, apply no entry, and do not block unrelated work.
111
136
  Precedence:
112
137
 
113
138
  1. System, developer, user, and repo instructions still outrank learnings.
114
- 2. Committed host rules (`.agents/rules/`) remain durable human-authored
139
+ 2. Committed host rules (`.agents/rules/`) remain durable, operator-controlled
115
140
  guidance.
116
141
  3. Project learnings add recent operational knowledge, but never rewrite or
117
142
  append to host rules.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "4.60.7",
3
+ "version": "4.60.9",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"