@hasna/instructions 0.4.8 → 0.4.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.
package/README.md CHANGED
@@ -192,6 +192,41 @@ manifests for drift, refuses unmanaged file conflicts unless `--force` is
192
192
  passed, removes stale managed mirrors only when safe, and writes local snapshots
193
193
  before mutating managed files.
194
194
 
195
+ ### Session renderer ownership
196
+
197
+ Anything the session renderer writes is off limits to `instructions apply` and
198
+ `instructions sync --to-disk`; those rows are reported as `[owned]` and skipped
199
+ instead of overwriting rendered output. Ownership is decided from the renderer's
200
+ own definitions rather than a hand-maintained path list:
201
+
202
+ - **Managed directories** — every `managedDir` in `SESSION_TOOL_ADAPTERS`, matched
203
+ on whole path segments under any target home (`~/.claude/.hasna/instructions/…`,
204
+ `~/.hasna/accounts/profiles/claude/account003/.hasna/instructions/…`, …), plus
205
+ the renderer's `.hasna/session-render-manifest.json` and
206
+ `.hasna/session-render-snapshots/`.
207
+ - **Manifest claims** — any file listed in an ancestor target home's
208
+ `.hasna/session-render-manifest.json`. This covers provider-native output such
209
+ as `CLAUDE.md`, `AGENTS.md`, and `opencode.json` exactly where the renderer
210
+ actually rendered.
211
+
212
+ `~/.cursor/rules` is deliberately *not* statically reserved: the config fan-out
213
+ writes `cursor-mdc` transform outputs there too, so files in that directory are
214
+ owned only when a manifest claims them.
215
+
216
+ Renumbering a source (inserting a new lower-order source shifts `01-` → `02-`
217
+ and so on) orphans older `target_path` values that still point inside a managed
218
+ directory. The guard is what neutralises those orphans, so stale rows are inert
219
+ rather than destructive.
220
+
221
+ Applying a config into renderer-owned space requires the explicit opt-in flag:
222
+
223
+ ```bash
224
+ instructions apply <id> --allow-renderer-owned
225
+ ```
226
+
227
+ It is separate from `--force` on purpose — "overwrite even if unchanged" must
228
+ never silently become "overwrite renderer-owned instruction files".
229
+
195
230
  ### Managed project context
196
231
 
197
232
  `instructions project-context plan|apply` is the sole writer for the strict