@arshdelight/practi 0.18.0 → 0.19.0

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 (71) hide show
  1. package/README.md +76 -136
  2. package/dist/client.js +6 -6
  3. package/dist/client.js.map +1 -1
  4. package/dist/cmd/blob.js +21 -24
  5. package/dist/cmd/blob.js.map +1 -1
  6. package/dist/cmd/branch.js +5 -7
  7. package/dist/cmd/branch.js.map +1 -1
  8. package/dist/cmd/clone.js +29 -23
  9. package/dist/cmd/clone.js.map +1 -1
  10. package/dist/cmd/commit.js +97 -0
  11. package/dist/cmd/commit.js.map +1 -0
  12. package/dist/cmd/config.js +1 -17
  13. package/dist/cmd/config.js.map +1 -1
  14. package/dist/cmd/edit.js +18 -4
  15. package/dist/cmd/edit.js.map +1 -1
  16. package/dist/cmd/embed.js +30 -25
  17. package/dist/cmd/embed.js.map +1 -1
  18. package/dist/cmd/export.js +43 -0
  19. package/dist/cmd/export.js.map +1 -0
  20. package/dist/cmd/fix.js +9 -153
  21. package/dist/cmd/fix.js.map +1 -1
  22. package/dist/cmd/gc.js +6 -5
  23. package/dist/cmd/gc.js.map +1 -1
  24. package/dist/cmd/history.js +73 -70
  25. package/dist/cmd/history.js.map +1 -1
  26. package/dist/cmd/init.js +10 -5
  27. package/dist/cmd/init.js.map +1 -1
  28. package/dist/cmd/lint.js +23 -20
  29. package/dist/cmd/lint.js.map +1 -1
  30. package/dist/cmd/log.js +2 -4
  31. package/dist/cmd/log.js.map +1 -1
  32. package/dist/cmd/merge.js +13 -10
  33. package/dist/cmd/merge.js.map +1 -1
  34. package/dist/cmd/new.js +56 -54
  35. package/dist/cmd/new.js.map +1 -1
  36. package/dist/cmd/note.js +27 -42
  37. package/dist/cmd/note.js.map +1 -1
  38. package/dist/cmd/pull.js +17 -13
  39. package/dist/cmd/pull.js.map +1 -1
  40. package/dist/cmd/push.js +27 -12
  41. package/dist/cmd/push.js.map +1 -1
  42. package/dist/cmd/search.js +30 -44
  43. package/dist/cmd/search.js.map +1 -1
  44. package/dist/cmd/show.js +5 -4
  45. package/dist/cmd/show.js.map +1 -1
  46. package/dist/cmd/similar.js +7 -20
  47. package/dist/cmd/similar.js.map +1 -1
  48. package/dist/cmd/skill.js +16 -16
  49. package/dist/cmd/skill.js.map +1 -1
  50. package/dist/cmd/switch.js +11 -6
  51. package/dist/cmd/switch.js.map +1 -1
  52. package/dist/index.js +243 -447
  53. package/dist/index.js.map +1 -1
  54. package/dist/practice.js +120 -97
  55. package/dist/practice.js.map +1 -1
  56. package/dist/quality.js +2 -2
  57. package/dist/quality.js.map +1 -1
  58. package/dist/state.js +13 -73
  59. package/dist/state.js.map +1 -1
  60. package/dist/sync.js +6 -48
  61. package/dist/sync.js.map +1 -1
  62. package/dist/web.js +156 -492
  63. package/dist/web.js.map +1 -1
  64. package/dist/workspace.js +10 -52
  65. package/dist/workspace.js.map +1 -1
  66. package/package.json +1 -1
  67. package/skills/use-practi/SKILL.md +121 -125
  68. package/web-default/chain.html +39 -0
  69. package/web-default/chain.js +54 -0
  70. package/web-default/app.js +0 -132
  71. package/web-default/index.html +0 -28
package/dist/web.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,C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,CAAC;IAC7C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
package/dist/workspace.js CHANGED
@@ -1,58 +1,12 @@
1
- import fs from 'node:fs';
2
1
  import path from 'node:path';
3
- import { PracticeError, initWorkspace, loadWorkspace } from '@arshdelight/pop-sdk';
4
- import { statePath, legacyStatePath, loadState } from './state.js';
5
- /** A data dir is initialized when it carries both the CLI state (practi.json,
6
- * legacy pop.json counts) and the POP workspace marker */
7
- export function isInitialized(dataDir) {
8
- const hasState = fs.existsSync(statePath(dataDir)) || fs.existsSync(legacyStatePath(dataDir));
9
- return hasState && fs.existsSync(path.join(dataDir, 'practice.yaml'));
10
- }
11
- export function requireDataDir(dataDir) {
12
- if (!isInitialized(dataDir)) {
13
- throw new PracticeError('E_NOT_INITIALIZED', `no practi data directory at ${dataDir}`, {
14
- hint: 'run `practi init <path>` first (or pass --data-dir)',
15
- });
16
- }
17
- }
18
- export function openWorkspace(dataDir) {
19
- requireDataDir(dataDir);
20
- return loadWorkspace(dataDir);
21
- }
22
- /** 节点文件的系统 mtime:这份内容落进本工作区的时刻(new/edit=创建或编辑时刻;
23
- * 导入时刻,非原创时刻)。repair 用它给老数据补认领戳 */
24
- export function nodeFileTime(dataDir, hash) {
25
- try {
26
- return fs.statSync(path.join(dataDir, 'nodes', `${hash.slice('sha256:'.length)}.md`)).mtime.toISOString();
27
- }
28
- catch {
29
- return null;
30
- }
31
- }
32
- /** Create the data dir (idempotent): workspace + CLI state. Adopts an existing workspace if present.
33
- * 既有 practi.json 一律保留(remote set 可先于 init 执行、legacy pop.json 迁移)——init 只补
34
- * workspace,不动账本;账本缺失时经 loadState 读旧写新落盘(S2-2:覆写会抹掉 remote/instance)。 */
35
- export function initDataDir(dataDir) {
36
- fs.mkdirSync(dataDir, { recursive: true });
37
- if (isInitialized(dataDir))
38
- return 'exists';
39
- try {
40
- initWorkspace(dataDir);
41
- }
42
- catch (e) {
43
- // practice.yaml already exists (workspace created by another tool); we still adopt it
44
- if (!(e instanceof PracticeError && e.code === 'E_EXISTS'))
45
- throw e;
46
- }
47
- if (!fs.existsSync(statePath(dataDir))) {
48
- fs.writeFileSync(statePath(dataDir), JSON.stringify(loadState(dataDir), null, 2) + '\n', 'utf8');
49
- }
50
- return 'created';
51
- }
2
+ /**
3
+ * 实例池工具:文件夹模型下节点池在 <实例>/.practi/(practice.yaml+nodes/+blobs/),
4
+ * 打开一律走 practice.ts 的 openPool(repo)——本文件只留子树文件集这一个通用件。
5
+ */
52
6
  /**
53
7
  * 本次操作子树的节点文件集(nodes/<hex>.md,与 sdk validateWorkspace 的 issue.file 同形态)。
54
- * new/edit 的注册门禁只统计本次子树的校验问题——workspace 里其它文档的历史问题
55
- * (如 v1.1.0 前写的外链 media 引用、缺字节旧附件)不连坐本次创建/编辑的注册。
8
+ * commit/new 的门禁只统计本次子树的校验问题——池里其它文档的历史问题
9
+ * (如 v1.1.0 前写的外链 media 引用、缺字节旧附件)不连坐本次提交。
56
10
  */
57
11
  export function subtreeFiles(ws, root) {
58
12
  const out = new Set();
@@ -71,4 +25,8 @@ export function subtreeFiles(ws, root) {
71
25
  walk(root);
72
26
  return out;
73
27
  }
28
+ export const PRACTI_DIRNAME = '.practi';
29
+ export function poolPathFor(dir) {
30
+ return path.join(dir, '.practi');
31
+ }
74
32
  //# sourceMappingURL=workspace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnE;2DAC2D;AAC3D,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,QAAQ,GAAG,EAAE,CAAC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"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EAAa,EAAE,IAAY;IACtD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,MAAM,IAAI,GAAG,CAAC,CAAS,EAAQ,EAAE;QAC/B,6EAA6E;QAC7E,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChE,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO;QACvB,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACX,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ;gBAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AACxC,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arshdelight/practi",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
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": {
@@ -1,18 +1,20 @@
1
1
  ---
2
2
  name: use-practi
3
- description: Record, search, read, and manage practice documents with the
4
- practi CLI — a local, content-addressed registry of POP (Protocol of
5
- Practice) documents. Use whenever the user wants to save what was just done
6
- as a reusable practice ("record this practice", "save this session", "turn
7
- this into steps"), search or read practices ("search my practices", "find a
8
- how-to I saved", "what else is about this"), annotate your own learning ("take
9
- a note on this step", "note what I learned while reproducing") or fold a note
10
- back into the practice it came from, or manage them ("delete my
11
- practice", "clean orphan blobs") — even when practi is not mentioned by name.
12
- Also for any explicit practi CLI usage (practi new, practi show, practi ls,
13
- practi search, practi similar, practi note, practi blob add, practi skill
14
- import, practi skill export, …), and for converting between formats ("turn
15
- this skill into a POP", "export this practice as a skill").
3
+ description: Record, version, search, and manage practices with the practi
4
+ CLI — each practice is a self-contained folder whose pop is a plain JSON
5
+ document you edit with any editor, with full local history beside it (like
6
+ .git) and optional practihub sync. Use whenever the user wants to save what
7
+ was just done as a reusable practice ("record this practice", "save this
8
+ session", "turn this into steps"), version or rewrite one ("commit this",
9
+ "amend", "revert to v1", "squash my history"), search or read practices
10
+ ("search my practices", "find a how-to I saved", "what else is about this"),
11
+ annotate learning ("take a note on this step", "note what I learned while
12
+ reproducing"), or sync with the hub ("publish this practice", "clone my
13
+ practices") — even when practi is not mentioned by name. Also for any
14
+ explicit practi CLI usage (practi new, practi commit, practi log, practi
15
+ show, practi search, practi export, practi note, practi skill export, …),
16
+ and for converting between formats ("turn this skill into a POP", "export
17
+ this practice as a skill").
16
18
  ---
17
19
 
18
20
  One JSON document = one practice tree. Leaves are **actions** — atomic skills; interior nodes are **practices** — compositions. Everything except `name` is optional, and type is inferred: a node with `children` is a practice, one without is an action.
@@ -23,17 +25,27 @@ Three principles hold everywhere:
23
25
  - **A document format, not a workflow engine.** Nothing executes. Judgment — waiting times, acceptance prose, loop predicates — stays in human-readable text.
24
26
  - **Prose before fields.** What needs no machine semantics belongs in `content`; a field exists only when structure earns its place.
25
27
 
26
- The data directory (default `~/.practi`) is the workspace: nodes content-addressed under `nodes/*.md`; `practi.json` records the registered **direct** roots (indirect = every other node the direct POPs reference). Learning notes live beside it in a `notes.json` sidecar (local only).
28
+ **A practice is a self-contained folder** (2026-10-20 model):
29
+
30
+ ```
31
+ green-tea/
32
+ green-tea.json the pop — a plain document, edit it with any editor
33
+ .practi/ the history (like .git): chain.json (commits {seq, root,
34
+ parent, message} + branch pointers), nodes/ (every revision,
35
+ content-addressed), blobs/ (attachment bytes), notes.json
36
+ ```
37
+
38
+ The config home (default `~/.practi`) only holds credentials and the remote — `practi.json` (remote) and `practi.auth.json` (OAuth). Practices themselves are plain folders, wherever you keep your documents; deleting a folder deletes the practice (the hub copy stays).
27
39
 
28
40
  ## Setup
29
41
 
30
42
  ```bash
31
43
  npm install -g @arshdelight/practi
32
- practi init # initialize the workspace
33
- practi config # data dir and registry summary
44
+ practi init # create the config home (credentials + remote)
45
+ practi config # show config home and remote
34
46
  ```
35
47
 
36
- The local workflow is fully offline. Optionally, the workspace can sync with practihub (the reference hub) — see **Hub workflow** below. (Upgrades from the pre-rename `pop` CLI keep working: the old data directory is found automatically.)
48
+ The local workflow is fully offline. Optionally a practice syncs with practihub (the reference hub) — see **Hub workflow** below.
37
49
 
38
50
  ## Writing a document
39
51
 
@@ -49,7 +61,7 @@ The local workflow is fully offline. Optionally, the workspace can sync with pra
49
61
  | `attachments` | action | blob pointers (below) |
50
62
  | `license` / `metadata` | both | reuse terms / vendor bag (`x-<vendor>-<name>` keys) |
51
63
 
52
- Documents carry **no history fields**: a document is a pure content snapshot. Revisions live in the repository layer (a hub instance's commit chain), and "this practice improves that one" is instance metadata (`refines`, §9.1) — never document fields. Documents carrying the POP 1.x `revisions`/`refines` fields are rejected (`E_SCHEMA`); migrate them with `practi fix <file>|<hash>|--all` (`--dry-run` previews, the new hash is reported per document).
64
+ Documents carry **no history fields**: a document is a pure content snapshot. Revisions live in the repository layer (`.practi/chain.json` locally, the hub instance's commit chain remotely), and "this practice improves that one" is instance metadata (`refines`, §9.1) — never document fields. Documents carrying the POP 1.x `revisions`/`refines` fields are rejected (`E_SCHEMA`); migrate them with `practi fix <file.json>` (`--dry-run` previews, the new hash is reported).
53
65
 
54
66
  ```json
55
67
  {
@@ -69,40 +81,40 @@ Rules that bite:
69
81
  - **Unknown fields are rejected** (`E_SCHEMA`), never dropped — silently dropping a field forks hashes. **Empty ≡ absent**: an optional field set to `""` or `[]` hashes exactly as if omitted.
70
82
  - `attachments` / `inputs` / `outputs` are **action-only**; on a practice they are a schema error (they are derived aggregate views).
71
83
  - `inputs.from` accepts authoring sugar `"@<name>"`, resolved against this document's inline nodes; the stored form always carries hashes.
72
- - Export (`show --doc`, `skill export`) rewrites an in-subtree from pin as its `@name` label when the name is unambiguous — editing the referenced child then re-resolves by name on import instead of dangling on the old hash. Out-of-subtree or same-name-ambiguous pins export verbatim.
84
+ - Export (`export`, `show --doc`, `skill export`) rewrites an in-subtree from pin as its `@name` label when the name is unambiguous — editing the referenced child then re-resolves by name on import instead of dangling on the old hash. Out-of-subtree or same-name-ambiguous pins export verbatim.
73
85
  - Children may inline recursively or reference stored content as `{ "hash": "sha256:…" }` — both forms produce the same root hash.
74
86
 
75
87
  ## Recording quality
76
88
 
77
- Check every document against these before `practi new`:
89
+ Check every document against these before committing it:
78
90
 
79
91
  - **Detailed** — someone who wasn't here can reproduce it: exact commands, file changes, config values, concrete specs. Record what was actually done — dead ends included — not the idealized version.
80
92
  - **Sanitized** — remove values specific to the author that a reproducer won't reuse: own repos, accounts, usernames, addresses, phones, credentials, personal hostnames/IPs — even embedded in commands, and even inside attachment bytes (screenshots, logs). Replace with descriptive placeholders (`<your-github-username>/repo`). Keep third-party package names, public endpoints, standard tools, and command structure.
81
93
  - **Curated** — a child step is something a reproducer physically does. Research and deciding are not steps; their conclusions go in `content`. Test: *would a reproducer physically do this, or only need its conclusion?*
82
- - **Bounded** — one document is one thing a reproducer pulls up and follows end-to-end for a single trigger. Sessions are time units; practices are structural ones — "record a session" means extracting the *practices* the session produced (zero, one, or several documents). Split when the parts would be invoked by different triggers (a client asking for analytics ≠ you deciding access policy) or share few or no steps; if what remains after a split has 1–2 steps and no judgment content, it was an action — don't manufacture a document around it.
94
+ - **Bounded** — one document is one thing a reproducer pulls up and follows end-to-end for a single trigger. Sessions are time units; practices are structural ones — "record a session" means extracting the *practices* the session produced (zero, one, or several documents). Split when the parts would be invoked by different triggers or share few or no steps; if what remains has 1–2 steps and no judgment content, it was an action — don't manufacture a document around it.
83
95
 
84
96
  ### E_ blocks, W_ only prompts
85
97
 
86
- `practi new` reports two different kinds of message. They are not the same thing, and confusing them loses work in both directions:
98
+ `practi new --base` / `practi commit` report two different kinds of message. They are not the same thing, and confusing them loses work in both directions:
87
99
 
88
100
  | | `E_*` | `W_*` |
89
101
  |---|---|---|
90
102
  | Meaning | a validation invariant is violated | the writing looks thin, but is *legal* |
91
- | Effect | the tree is **stored but NOT registered** — the pop does not exist in the directory, and the command exits 1 | the pop **is registered as direct** and the command exits 0 |
103
+ | Effect | the revision is **refused** — `new --base` rejects without leaving a half-born folder, `commit` rolls the chain back; exit 1 | the revision **is committed** and the command exits 0 |
92
104
  | What to do | fix the JSON and re-run — this is a hard stop | keep the recording, then go back and fill in content when you can |
93
105
 
94
- So: **`W_*` are prompts, not errors — seeing one means "go back and add the missing content", never "this failed"**. Do not retry a `practi new` that only printed `W_*`: it already succeeded. The codes are `W_THIN_CONTENT` (near-empty action with no attachments), `W_NO_VERIFY` (an action with no `outputs`), `W_CONTENT_LONG` (a node carrying so much prose — fenced code blocks excluded — that it is probably several steps sharing one node: **split it into child steps, do not trim it**), `W_FLAT_TREE` (many steps, none grouped), `W_DEEP_TREE`, `W_DUP_NAME`, `W_VAGUE_NAME`, `W_DESC_MISSING` (a practice root with no `description` — the field search leans on most). The thresholds are the CLI's own calibration, not protocol (pop-spec §6); treat them as a nudge, not a rule.
106
+ So: **`W_*` are prompts, not errors — seeing one means "go back and add the missing content", never "this failed"**. Do not retry a commit that only printed `W_*`: it already succeeded. The codes are `W_THIN_CONTENT` (near-empty action with no attachments), `W_NO_VERIFY` (an action with no `outputs`), `W_CONTENT_LONG` (a node carrying so much prose — fenced code blocks excluded — that it is probably several steps sharing one node: **split it into child steps, do not trim it**), `W_FLAT_TREE` (many steps, none grouped), `W_DEEP_TREE`, `W_DUP_NAME`, `W_VAGUE_NAME`, `W_DESC_MISSING` (a practice root with no `description` — the field search leans on most). The thresholds are the CLI's own calibration, not protocol (pop-spec §6); treat them as a nudge, not a rule.
95
107
 
96
108
  ## Attachments
97
109
 
98
110
  Stage the bytes first, then paste the emitted entry into the document:
99
111
 
100
112
  ```bash
101
- practi blob add <file-or-url> [--name <name>]
113
+ practi blob add <file-or-url> [--name <name>] # inside the practice folder; bytes → .practi/blobs/
102
114
  ```
103
115
 
104
- - **Local file** — hashed and stored into the workspace blob channel (`blobs/<2 hex>/<64 hex>`); emits the entry without `url`. Needs an initialized workspace (`practi init`), or validation later reports `E_BLOB_MISSING`.
105
- - **http(s) URL** — fetched once (25 MB limit); the bytes are ALSO stored into the workspace blob channel and the entry is emitted **without** `url` (practi pointers are pure hash — the url is just the import channel; spec §5 still allows the field).
116
+ - **Local file** — hashed and stored into the practice's blob channel; emits the entry without `url`. Validation later reports `E_BLOB_MISSING` if the bytes are absent.
117
+ - **http(s) URL** — fetched once (25 MB limit); the bytes are ALSO stored and the entry is emitted **without** `url` (practi pointers are pure hash — the url is just the import channel; spec §5 still allows the field).
106
118
 
107
119
  The command prints a ready-to-paste object. Put it on the **action's** `attachments`, then reference it from `content`:
108
120
 
@@ -118,118 +130,104 @@ The command prints a ready-to-paste object. Put it on the **action's** `attachme
118
130
  ```
119
131
 
120
132
  - `![caption](attachment-name)` resolves node-locally against this node's own list; attachment names must be unique within a node; any target that is not exactly an entry of that list — http(s) URLs included — is `E_MEDIA_REF` (external media references are not valid grammar; use an attachment or a plain markdown link).
121
- - Pointers hash, bytes don't: changed bytes → changed blob hash → changed pointer → a new node identity. Attachments are immutable content — the entry goes into the document **before** `practi new`, never mutated onto an existing node.
133
+ - Pointers hash, bytes don't: changed bytes → changed blob hash → changed pointer → a new node identity. Attachments are immutable content — the entry goes into the document **before** committing, never mutated onto an existing node.
122
134
 
123
- ## Local workflow
135
+ ## The practice workflow (git-style)
124
136
 
125
137
  ```bash
126
- practi new doc.json # or: practi new --json '<text>' / practi new < doc.json (stdin)
127
- practi edit <hash> doc.json # replace a direct POP (new hash; the swap lands in the local commit
128
- # log commits.json — --message sets the commit note pushed later;
129
- # GC of unreachable nodes)
130
- practi remove <hash> # take a direct pop out of the local directory (registry op; GCs
131
- # unreachable nodes — shared indirect nodes survive)
132
- practi claim <hash> # register an existing stored node as a direct pop (indirect → direct)
133
- practi unclaim <hash> # take a referenced direct pop back to indirect; fails when
134
- # unreferenced (that would orphan it — delete with remove instead)
135
- practi show <hash> # aggregate view; --json machine view (steps carry content —
136
- # the one-read reproduction view); --doc full document form
137
- practi similar <hash> # content neighbours: "what else is about this?" — literal
138
- # (character-bigram) similarity, not semantics
139
- practi ls [-a] [--json] # direct roots; -a adds indirect nodes; --json machine view
140
- practi search <q> [--notes] [--semantic]
141
- # offline search over EVERY stored node — name / description /
142
- # content / declared inputs+outputs / loop prose (+ notes)
143
- practi embed status|pull|build|prune # optional vector model behind search --semantic
144
- practi lint [--json] # audit W_* recording-quality hints across the whole workspace
145
- practi web # browse direct POPs in a local web UI
146
- practi gc [--apply] # free orphan blobs — bytes no stored node references
147
- # (dry-run by default; --apply removes)
148
- practi migrate [path] [--keep] # cut: move the workspace (old dir removed after per-file
149
- # verification; --keep retains a .bak; a path becomes the
150
- # default via ~/.practi-home)
138
+ practi new <name> [--base <file.json>] [-m <msg>] # birth a practice folder in cwd; --base
139
+ # seeds v1 from a pop document (write the
140
+ # JSON with any editor first)
141
+ cd <name>
142
+ $EDITOR <name>.json # ...edit the pop with any editor...
143
+ practi commit [-m <msg>] # snapshot the working file as a new revision (local; nothing
144
+ # to commit when it matches the head; --amend replaces the
145
+ # head instead — message-only amend rewords)
146
+ practi export <hash> [-o f] # write any revision back out (the current one IS the working
147
+ # file; export serves old revisions — compare/rollback)
148
+ practi log [--branch <b>] [--json] # commit history, tip first; (local, unpushed) marked
149
+ practi lint # quality hints on the current branch head
150
+ practi show <hash> [--json] [--doc] # inspect one revision node (hash prefix OK)
151
+ practi search <q> [--notes] [--semantic] # search this practice's revisions
152
+ practi similar <hash> # content neighbours within this practice (literal bigram
153
+ # similarity, not semantics)
154
+ practi note add|list|edit|delete # learning notes pinned to node hashes (.practi/notes.json)
155
+ practi gc [--apply] # free orphan blobs (dry-run by default)
156
+ practi web # browse this practice locally: chain, branches, per-revision
157
+ # reader (wizard / standard view / document tree)
158
+ practi embed status|pull|build|prune # optional vector model (.practi/models/), scoped to
159
+ # this practice; without it search is lexical-only
151
160
  ```
152
161
 
153
- - `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.
154
- - `practi show` accepts a unique hash prefix (≥4 hex digits); `--doc` emits the expanded document — the starting point for forking or refining.
155
- - **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.
156
- - **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`).
162
+ - The **working file is the write door**, `export` is the read-back door. `commit` when the file equals the head says `nothing to commit`.
163
+ - `practi show` accepts a unique hash prefix (≥4 hex digits); `--doc` emits the expanded document.
164
+ - **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, read `--doc` — the aggregate flattens those by design.
165
+ - **History rewriting is local and free** (`practi history`, below). It never touches the working file (git reset semantics): after a rewrite the file may hold pre-rewrite content — commit it to keep, or `export <head> -o <name>.json` to discard. The printed note says which.
157
166
 
158
167
  ## Hub workflow (optional, practihub)
159
168
 
160
- The workspace can back onto a practice **instance** on practihub — a single-owner, GitHub-like home for one POP's revision chain, with branches. The binding lives in `practi.json` (`remote` + `instance: {owner, name, branch}`), like git's origin + HEAD.
169
+ A practice folder maps one-to-one onto a hub **instance** — a single-owner, GitHub-like home for one POP's revision chain, with branches. Everything hub-side needs:
161
170
 
162
171
  ```bash
163
- practi remote set https://practihub.com # point at the hub (default; remove falls back to it)
172
+ practi remote set https://practihub.com # point at the hub (remove falls back to it)
164
173
  practi login # OAuth sign-in (browser consent); --no-open prints the URL
165
- practi me # show the signed-in account
166
- practi clone <owner>/<name>[@branch] # fetch a practice instance, bind the workspace to it and
167
- # check out its head (git clone: the instance IS the repository)
168
- practi instance create <name> [--public] [--desc <text>] # create + bind (branch main)
169
- practi instance bind <owner>/<name> # bind an existing instance (pointer only — clone also fetches)
170
- practi instance show # binding summary: branch, visibility, branches
171
-
172
- practi push [hash] [--branch <b>] # one call stores the doc AND binds it as the branch
173
- # head; the commit is appended with parent = current
174
- # head (--message / the local commit log supplies the note)
175
- practi log [--branch <b>] [--json] # commit history of the current branch (tip first;
176
- # unpushed local entries listed on top)
177
- practi branch [name] [--from <hash>] # list branches (* = default) / create one / -d <name> deletes
178
- practi switch <branch> # switch the bound branch (local pointer; `practi pull` brings content)
179
- practi merge <branch> # merge into the current branch: fast-forward when the tip's
180
- # parent chain reaches the head, otherwise a squash merge
181
- # commit is appended — always succeeds
182
- practi pull # sync the bound instance's remote revisions into the workspace
183
- # (git pull inside the repository: fetch missing chain revisions,
184
- # fast-forward the head when your local direct is an ancestor)
185
- practi fetch <owner>/<name> <hash> # pull one revision of that instance into your local registry (direct;
186
- # full sha256 hash — content access is repo-scoped: public instances
187
- # fetchable by anyone, private ones only by their owners)
174
+ practi me # show the signed-in account and scopes
188
175
  practi logout # revoke + drop stored credentials
189
176
  ```
190
177
 
191
- - **The commit is repository state, the document is a snapshot.** The instance keeps a commit chain (`seq`, `root_hash`, `parent_hash?`, `message?`, `created_at`) — history lives there, never in the document. Pushing appends one commit (parent = current head) and moves the branch pointer. A fast-forward means the merged tip's parent chain reaches the current head (a pointer move); a diverged `merge` appends a squash commit whose tree is the branch tip's, with parent = current head — the merge always completes.
178
+ ```bash
179
+ practi new <name> --base <file.json> -m "first" # birth locally; the hub copy is born by
180
+ # the first push
181
+ practi push [--force] # sync to the hub: first push creates the instance
182
+ # there; FF pushes append commits; divergence
183
+ # errors — --force overwrites and the hub drops
184
+ # unreachable revisions
185
+ practi pull # fetch missing revisions, fast-forward the branch,
186
+ # update the working file (refuses when dirty)
187
+ practi clone <owner>/<name>[@branch] [--dir <path>] # a hub practice → a local folder
188
+ # (full chain + working file; git clone)
189
+ practi branch [name] [--from <hash>] | -d <name> # list (* = current) / create / delete
190
+ practi switch <branch> # switch branches; the working file follows the
191
+ # head (refuses when dirty — commit first)
192
+ practi merge <branch> # fast-forward (pointer move), else a pointer move
193
+ # too — same-tree commits are identical (§9.1:
194
+ # one row per root); the merge always completes
195
+ practi history reword <seq> -m <msg> | squash <seq> | drop <seq> | reset <seq>
196
+ # rewrite the local chain; push reconciles —
197
+ # divergence needs --force
198
+ ```
199
+
200
+ - **The commit is repository state, the document is a snapshot.** History lives in `chain.json` (local) and the hub instance's commit chain (remote) — never in the document.
192
201
  - **The hub never changes the content.** Pushes are re-hashed server-side with the same SDK; visibility follows the instance (a PUBLIC instance's chain is readable by anyone, PRIVATE only by its owner). Making an instance public is a hub-web workflow, not a CLI one.
193
- - POP lives on the hub only as practice instances (the document store is object storage addressed by hash, not an inbox): without a bound instance `push` and `pull` refuse — start with `clone` or `instance bind`/`create`. There is no claim table: what you pulled from an instance is its chain, and a lone hash travels via `fetch`.
202
+ - Deleting a practice folder removes the local copy only — the hub instance stays (delete it on the hub web).
194
203
 
195
204
  ## Finding things again
196
205
 
197
- `practi search` matches **every stored node** — direct roots, indirect steps, nodes wired only through an `inputs.from`, and orphans — across `name`, `description`, `content`, declared `inputs`/`outputs` (so "which step produces boiling water" works), and loop prose. What to know before concluding "I never recorded that":
206
+ `practi search` matches **every revision node in this practice** across `name`, `description`, `content`, declared `inputs`/`outputs` (so "which step produces boiling water" works), and loop prose. What to know before concluding "I never recorded that":
198
207
 
199
208
  - **Multiple words are ANDed, and may match in different fields.** `practi search listary 编码` needs both words somewhere in the same node — not adjacent in the text. Quote a phrase to require it whole.
200
209
  - **`field:value` scopes one word** — `name:`, `desc:`, `content:`, `flow:` (declared inputs/outputs), `loop:`, `op:`, `hash:`. `practi search name:yt-dlp` hits only nodes whose *name* says it.
201
210
  - **Chinese is matched by character bigram, not by word** — no dictionary needed. A query word matches only when *all* of its bigrams are present, so word order matters; when strict matching finds nothing the command retries with a strict-majority-of-terms rule and labels every row `partial match`. **A partial-match row is a hint, not an answer** — never present one as the found practice without reading it.
202
- - **A literal search is not a semantic one, and that is deliberate.** Measured on this corpus: queries that share no wording with the record (「科学上网」 for a 翻墙/节点 practice) return *nothing*, and every attempt to fake semantics locally returned confident nonsense instead. So when `practi search` reports no matches, it prints the next move — retry with `--notes`, try `--semantic` if the vector model is installed, start from a node you already have with `practi similar`, or browse with `practi ls`. Take that step instead of rephrasing the same query repeatedly.
211
+ - **A literal search is not a semantic one, and that is deliberate.** Queries that share no wording with the record return *nothing*. So when `practi search` reports no matches, it prints the next move — retry with `--notes`, try `--semantic` if the vector model is installed, or start from a node you already have with `practi similar`. Take that step instead of rephrasing the same query repeatedly.
203
212
  - **`--notes` also searches your local notes** (off by default, so the plain result set stays stable). Notes are where the most conversational keywords end up — when a search comes up empty, retry it with `--notes` before giving up.
204
- - **Results are ranked title-first and each says why it matched** (`← name, description`). Trust the explanation over the number.
205
- - **`practi similar <hash>` answers the other question** — not "where did I write X" but "what else is about X". It compares the node's whole subtree (a practice root is often one line; the steps hold the substance) and lists the shared terms that carried each hit. It is literal: a paraphrase sharing no wording will not surface. Use it to find sibling practices and near-duplicate recordings.
213
+ - **Results are ranked title-first and each says why it matched.** Trust the explanation over the number.
214
+ - **`practi similar <hash>` answers the other question** — not "where did I write X" but "what else is about X". Literal: a paraphrase sharing no wording will not surface.
215
+ - Across practices, browse folders in your file manager — a practice folder *is* its own listing.
206
216
 
207
217
  ## Semantic recall (optional, off by default)
208
218
 
209
- Literal search cannot find a paraphrase (measured: queries sharing no wording with the record return nothing — see the bullet above). When that matters, practi can add a real vector layer. It is **optional and never automatic**:
219
+ Literal search cannot find a paraphrase. When that matters, practi can add a real vector layer, scoped to the practice. It is **optional and never automatic**:
210
220
 
211
221
  ```bash
212
- practi embed pull # download the model once (~24MB int8 ONNX) into <data-dir>/models/
222
+ practi embed pull # download the model once (~24MB int8 ONNX) into .practi/models/
213
223
  practi embed build # embed every stored node (incremental: only new hashes are embedded)
214
224
  practi embed status # is the model present? how many nodes are covered?
215
225
  practi search <q> --semantic # fuse vector recall with the lexical ranking (RRF)
216
226
  ```
217
227
 
218
- - **Nothing here is required.** Without a model `practi search` is lexical-only; `--semantic` then prints `--semantic ignored: …` on stderr and answers from the lexical index anyway. Missing capability is always announced, never a silent drop in recall.
219
- - **Known-good expectation, not a promise.** Measured on a 772-node corpus, `--semantic` recovered **4 of 9** paraphrase queries that lexical search got 0 of 9 — real but partial. It never *hurts* exact-term queries (RRF only adds), and it does not make bad queries good.
220
- - **It costs one build.** ~20s for 772 nodes; after that only new nodes are embedded, so day-to-day use is incremental.
221
- - **Swapping the model recomputes everything by itself**: vectors are cached per model fingerprint (`vectors/<fingerprint>.pvec`), so a different model is a different bucket — no migration, and stale vectors can never be mistaken for current ones. `practi embed prune` drops the old buckets.
222
- - Model bytes and vectors live in the data dir as sidecars; they are **derived**, never written into a node and never part of a hash. The protocol reserves semantic ranking for the hub (pop-spec §9.1), so this local layer is deliberately non-normative.
223
- - **The vector layer can never break a command.** `practi search` without `--semantic` does not touch it at all; `--semantic` degrades to lexical with the reason on stderr if the model, the index, or the optional `onnxruntime-node` runtime is missing or broken; `practi new`/`edit` keep an *already enabled* index fresh and stay silent otherwise. Only `practi embed pull|build` — explicit requests — fail loudly.
224
- - **You rarely need `embed build` by hand**: once the model is pulled and an index exists, `practi new`/`edit` top it up with just the new nodes (~25ms each) and say nothing on success. Run `build` when the workspace says it is too far behind; `embed prune` drops buckets left by an older model.
225
-
226
- ## Recording quality audit
227
-
228
- ```bash
229
- practi lint [--json] [--limit N]
230
- ```
231
-
232
- `practi new` prints its `W_*` hints once, at creation. `practi lint` runs the same checks (same code, no second standard) across **every** direct pop, aggregates them by code, and ranks the worst nodes first — so the debt skipped at creation time stays visible instead of quietly accumulating. Read-only, and always exits 0: a to-do list, not a gate.
228
+ - **Nothing here is required.** Without a model `practi search` is lexical-only; `--semantic` then says what is missing on stderr and answers from the lexical index anyway.
229
+ - **It costs one build.** After that only new nodes are embedded, so day-to-day use is incremental. Model bytes and vectors live under `.practi/` as **derived** sidecars — never written into a node, never part of a hash.
230
+ - **The vector layer can never break a command.** `--semantic` degrades to lexical with the reason on stderr if anything is missing; only `practi embed pull|build` — explicit requests — fail loudly.
233
231
 
234
232
  ## Local notes
235
233
 
@@ -238,44 +236,42 @@ practi note add <hash> -m "<text>" # pin a learning note to any node (hash
238
236
  practi note list [hash] # all notes grouped by document; with a hash: that subtree only
239
237
  practi note edit <note-id> -m "<text>" # 8-hex id, unique prefix works
240
238
  practi note delete <note-id>
241
- practi note promote <note-id> [--out f] # a note → a draft document of its owning direct root
242
239
  ```
243
240
 
244
- - Notes are **local** — a `notes.json` sidecar. A note is your learning/reproduction experience: what actually worked, where you deviated, dead ends.
245
- - A note pins to **any** node hash, not just document roots — annotate the exact step that taught you something. Content addressing makes the pin exact: a note always refers to precisely this version of the content, and edits that replace a node leave the old note in place (kept, listed last as dangling).
246
- - `--json` prints a flat machine list (no grouping); human output groups by owning document, newest document first. `practi web` renders and edits the viewed document's notes in a right-hand panel — same file, same data as the CLI.
247
- - **A note is not a dead end.** `practi note promote <note-id>` drafts the owning direct root's document with the note's text spliced in at the node it was pinned to, so `practi edit <root> draft.json` folds the lesson back into the practice it came from. It writes a draft and stops — **it never edits for you** (under content addressing an edit is a new hash, and that is the user's call). When the pinned version is gone it fails with `E_NOTE_DANGLING` rather than guessing a successor.
241
+ - Notes are **local** — `.practi/notes.json` inside the practice. A note is your learning/reproduction experience: what actually worked, where you deviated, dead ends.
242
+ - A note pins to **any** node hash, not just roots — annotate the exact step that taught you something. Content addressing makes the pin exact: a note always refers to precisely this version of the content.
243
+ - `--json` prints a flat machine list; human output groups by document. `practi web` renders and edits the viewed document's notes — same file, same data as the CLI.
244
+ - **A note is not a dead end**: to fold a lesson back in, `export` the revision (or edit the working file), splice the note's content into the step, and `commit` — an edit is a new hash, and that is the user's call.
248
245
 
249
246
  ## Skill ⇄ POP conversion
250
247
 
251
248
  ```bash
252
- practi skill export <ref> [--dir <out>] # a POP → an installable skill directory (default: ./<name>)
253
- practi skill import <dir> # replay a `practi skill export` directory back into a POP
249
+ practi skill export <ref> [--dir <out>] # a revision → an installable skill directory (default: ./<name>)
250
+ practi skill import <dir> # replay a `practi skill export` directory back into the practice
254
251
  ```
255
252
 
256
- - An exported directory carries `SKILL.md` (a readable projection), attachment files, and `pop.doc.json` — the sidecar holding the canonical document. Import replays the sidecar byte-identically (same hash, any machine), re-staging attachment files into the local blob store.
257
- - Import refuses directories without a sidecar (`E_NO_SIDECAR`): it is the inverse of export, not a skill importer. To bring a foreign skill into POP, read it and **author** a structured tree of practices and actions (the recording-quality rules apply) — flattening its text into one node would discard exactly the structure POP exists for.
258
- - Hand-editing `SKILL.md` after export desynchronizes the sidecar: import warns and treats the edited body as truth (a new hash — fork semantics). Edit the POP and re-export instead.
253
+ - An exported directory carries `SKILL.md` (a readable projection), attachment files, and `pop.doc.json` — the sidecar holding the canonical document. Import replays the sidecar byte-identically (same hash, any machine), re-staging attachment files into the practice's blob store; then `practi commit -m "..."` records it as a revision.
254
+ - Import refuses directories without a sidecar (`E_NO_SIDECAR`): it is the inverse of export, not a skill importer. To bring a foreign skill into POP, read it and **author** a structured tree of practices and actions (the recording-quality rules apply).
255
+ - Hand-editing `SKILL.md` after export desynchronizes the sidecar: import warns and treats the edited body as truth (a new hash — fork semantics). Edit the document and re-export instead.
259
256
 
260
257
  ## Error codes
261
258
 
262
- `E_*` refuse a document (stored but **not registered**). `W_*` never do — see "Recording quality" above.
259
+ `E_*` refuse a revision (born-empty folder on `new --base`, chain rollback on `commit`). `W_*` never do — see "Recording quality" above.
263
260
 
264
261
  | Code | Trigger |
265
262
  |---|---|
266
263
  | `E_SCHEMA` | shape violation: unknown field anywhere, derived fields on a practice, op/children/loop on an action, duplicate attachment names, unresolvable `@label` |
267
- | `E_DANGLING` | a `{hash}` child not stored locally |
264
+ | `E_DANGLING` | a `{hash}` child not stored in this practice |
268
265
  | `E_FLOW_FROM` | `from` names no node in scope |
269
266
  | `E_HASH_FORMAT` | not `sha256:` + 64 lowercase hex |
270
267
  | `E_MEDIA_REF` | inline media reference with no matching attachment |
271
268
  | `E_BLOB_MISSING` / `E_BLOB_CORRUPT` | blob absent / bytes disagree with the pointer |
272
- | `E_NOTE_DANGLING` | `note promote` on a note whose pinned version left the workspace |
273
- | `W_*` | advisory quality hints (`W_THIN_CONTENT`, `W_NO_VERIFY`, `W_CONTENT_LONG`, `W_FLAT_TREE`, `W_DEEP_TREE`, `W_DUP_NAME`, `W_VAGUE_NAME`, `W_DESC_MISSING`) — **the document is valid and registered** |
269
+ | `W_*` | advisory quality hints (`W_THIN_CONTENT`, `W_NO_VERIFY`, `W_CONTENT_LONG`, `W_FLAT_TREE`, `W_DEEP_TREE`, `W_DUP_NAME`, `W_VAGUE_NAME`, `W_DESC_MISSING`) — **the revision is committed** |
274
270
 
275
271
  ## Workflow quick reference
276
272
 
277
- - **Record a session** — extract the *practices* the conversation produced → shape one JSON tree per practice (quality rules above; see **Bounded** for document boundaries) → `practi new doc.json` → confirm `status: valid, registered as direct` → replace any `W_*` prompts you can → `practi show <hash>` to review.
278
- - **Find prior art** — `practi search <query>` (add `--notes`; use `field:` when you know which field it was in) → `practi show <hash>`. When you cannot recall any wording, start from a node you *do* have and run `practi similar <hash>`.
279
- - **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). Later, `practi note promote <note-id>` turns that note back into a draft of the practice it belongs to, so the lesson does not rot in the sidecar.
280
- - **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.
281
- - **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, records the swap in the local commit log (`commits.json`: `from` = old root, the message rides along and is pushed as the commit note), and garbage-collects nodes no longer reachable from any direct POP (reachability follows children pins and `inputs.from` references alike; `--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 someone else's practice is a new instance on the hub declaring `refines` → the original's root hash (§9.1); declaring the edge is a hub-side action for now — the CLI carries no flag for it.
273
+ - **Record a session** — extract the *practices* the conversation produced → shape one JSON tree per practice (quality rules above) → `practi new <name> --base doc.json -m "first"` → replace any `W_*` prompts you can (edit the working file, `commit` again) → `practi push` when it should live on the hub.
274
+ - **Find prior art** — `cd` into the practice → `practi search <query>` (add `--notes`; `field:` when you know the field) → `practi show <hash>`. No wording recall? `practi similar <hash>` from a node you do have.
275
+ - **Learn from a practice** — reproduce it, then pin what you learned: `practi note add <node-hash> -m "…"`. Fold it back by editing the working file and committing.
276
+ - **Improve a practice** — edit `<name>.json` → `practi commit -m "what changed"` → `practi push`. Oops: `commit --amend`, `history reset <seq>` (working file kept — keep or discard), or `export <head>` and re-edit. Improving someone else's practice is a new instance on the hub declaring `refines` → the original's root hash (§9.1) — a hub-web action.
277
+ - **Reproduce someone's practice** — `practi clone <owner>/<name>` → follow the working file (or `practi web`) → pin notes as you learn.