@arshdelight/practi 0.12.0 → 0.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arshdelight/practi",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Local registry CLI for POP (Protocol of Practice): manage a personal, content-addressed collection of practice documents on top of @arshdelight/pop-sdk. Fully offline.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -112,6 +112,9 @@ practi new doc.json # or: practi new --json '<text>' / practi new < d
112
112
  practi edit <hash> doc.json # replace a direct POP (new hash; auto-revision + GC of unreachable nodes)
113
113
  practi remove <hash> # take a direct pop out of the local directory (registry op; GCs
114
114
  # unreachable nodes — shared indirect nodes survive)
115
+ practi claim <hash> # register an existing stored node as a direct pop (indirect → direct)
116
+ practi unclaim <hash> # take a referenced direct pop back to indirect; fails when
117
+ # unreferenced (that would orphan it — delete with remove instead)
115
118
  practi show <hash> # aggregate view; --json machine view (steps carry content —
116
119
  # the one-read reproduction view); --doc full document form
117
120
  practi ls [-a] # direct roots; -a adds indirect nodes
@@ -128,6 +131,7 @@ practi migrate [path] [--keep] # cut: move the workspace (old dir removed after
128
131
  - `practi new` validates through the SDK, persists the content-addressed tree, registers the root as direct, and prints the root hash with `status: valid, registered as direct`. On validation issues the tree is stored but **not** registered — read the printed `E_*` issues, fix the JSON, re-run.
129
132
  - `practi show` accepts a unique hash prefix (≥4 hex digits); `--doc` emits the expanded document — the starting point for forking or refining.
130
133
  - **Reading vs editing**: to follow or reproduce a practice, read the aggregate view (`show`, or `show --json` — steps come with their content, one read is enough); to edit, fork, or reason about the op structure (choice branches, loop bodies, set sections), read `--doc` — the aggregate flattens those by design.
134
+ - **Missing nodes are reported, never hidden**: if a referenced node file is absent from the workspace, `show` still renders the view (placeholders where the missing subtree belongs), `--doc` exports the dangling pin verbatim, and the command exits 1 with an `E_MISSING` block naming each missing hash and its referencing parent. Creation/editing, by contrast, refuses dangling pins outright (`E_DANGLING`).
131
135
 
132
136
  ## Local notes
133
137
 
@@ -169,4 +173,5 @@ practi skill import <dir> # replay a `practi skill export` direct
169
173
  - **Record a session** — extract what was done from the conversation → shape one JSON tree (quality rules above) → `practi new doc.json` → confirm `status: valid` → `practi show <hash>` to review.
170
174
  - **Find prior art** — `practi search <query>` → `practi show <hash>`.
171
175
  - **Learn from a practice** — reproduce it, then pin what you learned to the step that taught it: `practi note add <node-hash> -m "…"` (notes stay local).
176
+ - **Organize under a set** — a `set` op document is a directory: it pins episodes as `{ hash }` children (episodes live once, as indirect nodes). To move standalone POPs under a set, edit the set to reference them, then `practi unclaim` each — unclaim fails with `E_NOT_REFERENCED` if nothing references the node (that would orphan it; `practi remove` is the delete path). `practi claim <hash>` registers any stored node back as direct.
172
177
  - **Edit one of your direct POPs** — `practi show <hash> --doc > doc.json` → edit the JSON → `practi edit <hash> doc.json --message "what changed"`. The edit validates and stores the new tree, swaps the direct root, appends a revision (`from` = old root — a history pointer, may dangle by design), and garbage-collects nodes no longer referenced by any direct POP (`--keep` preserves them; blobs stay put — `practi gc` sweeps orphaned ones on demand). Editing is replacing — new content lives under a new root hash. Improving an indirect practice is a new document with `refines` set, via `practi new`.