@hraness/wordcell 0.20.0-bootstrap.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.
Files changed (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +749 -0
  3. package/dist/agent-context.js +35 -0
  4. package/dist/agent-guide-audit.js +18 -0
  5. package/dist/attachments.js +19 -0
  6. package/dist/authoring.js +33 -0
  7. package/dist/benchmark.js +19 -0
  8. package/dist/capture.js +49 -0
  9. package/dist/cli.js +57 -0
  10. package/dist/clip/acquire.js +57 -0
  11. package/dist/clip/args.js +21 -0
  12. package/dist/clip/bounded-byte-buffer.js +9 -0
  13. package/dist/clip/browser-profiles.js +17 -0
  14. package/dist/clip/bundle-reader.js +11 -0
  15. package/dist/clip/cli.js +27 -0
  16. package/dist/clip/cookies.js +21 -0
  17. package/dist/clip/defuddle-worker.js +84 -0
  18. package/dist/clip/doctor.js +32 -0
  19. package/dist/clip/jobs.js +784 -0
  20. package/dist/clip/network-proxy.js +9 -0
  21. package/dist/clip/network.js +28 -0
  22. package/dist/clip/persist.js +30 -0
  23. package/dist/clip/refresh.js +11 -0
  24. package/dist/clip/terminal.js +11 -0
  25. package/dist/evaluation-builder.js +12238 -0
  26. package/dist/evaluation-kb.js +26 -0
  27. package/dist/evaluation.js +35 -0
  28. package/dist/git.js +39 -0
  29. package/dist/graph.js +41 -0
  30. package/dist/index-054mb7d3.js +1974 -0
  31. package/dist/index-06c9ctr6.js +738 -0
  32. package/dist/index-180zbkkt.js +2480 -0
  33. package/dist/index-1gwbassd.js +743 -0
  34. package/dist/index-1xxnjn0d.js +171 -0
  35. package/dist/index-23z4zxgg.js +119 -0
  36. package/dist/index-2gv8y733.js +432 -0
  37. package/dist/index-3ehtt59c.js +199 -0
  38. package/dist/index-3rm7cz6h.js +373 -0
  39. package/dist/index-48pz4jpc.js +392 -0
  40. package/dist/index-4j3tt0c3.js +234 -0
  41. package/dist/index-5n05se68.js +307 -0
  42. package/dist/index-5vwpzb5a.js +764 -0
  43. package/dist/index-6jcz0m1c.js +712 -0
  44. package/dist/index-6sw24nvv.js +1189 -0
  45. package/dist/index-8a08v6x8.js +56 -0
  46. package/dist/index-adx6khj5.js +488 -0
  47. package/dist/index-b88v3vtm.js +805 -0
  48. package/dist/index-bcknqxrq.js +1943 -0
  49. package/dist/index-bs0yf4pp.js +711 -0
  50. package/dist/index-by0pbant.js +827 -0
  51. package/dist/index-d13v9ckt.js +150 -0
  52. package/dist/index-dfag79p7.js +370 -0
  53. package/dist/index-e4fagfjz.js +44 -0
  54. package/dist/index-e5fbsywq.js +658 -0
  55. package/dist/index-ekpwvbra.js +1070 -0
  56. package/dist/index-f984hw45.js +927 -0
  57. package/dist/index-gh719d91.js +63 -0
  58. package/dist/index-h170byqw.js +371 -0
  59. package/dist/index-hgve9rh2.js +2046 -0
  60. package/dist/index-hya40gb2.js +474 -0
  61. package/dist/index-j4zgmzjr.js +152 -0
  62. package/dist/index-m7et4rz4.js +966 -0
  63. package/dist/index-mxxxytys.js +1254 -0
  64. package/dist/index-n05s3wsb.js +2728 -0
  65. package/dist/index-nd6nynv2.js +1162 -0
  66. package/dist/index-npg9z1a4.js +431 -0
  67. package/dist/index-pj501bh1.js +140 -0
  68. package/dist/index-rdd5f7jj.js +70 -0
  69. package/dist/index-sy0zety7.js +3630 -0
  70. package/dist/index-tkpxp48t.js +1166 -0
  71. package/dist/index-w2zc0vwa.js +571 -0
  72. package/dist/index-why54q5p.js +462 -0
  73. package/dist/index-x3fthpsc.js +585 -0
  74. package/dist/index-x6m57nfc.js +1041 -0
  75. package/dist/index.js +784 -0
  76. package/dist/kb-alias.js +55 -0
  77. package/dist/navigation.js +13 -0
  78. package/dist/pdf.js +85 -0
  79. package/dist/percolate.js +44 -0
  80. package/dist/portfolio.js +77 -0
  81. package/dist/query.js +29 -0
  82. package/dist/repository-memory.js +60 -0
  83. package/dist/sdk.js +36 -0
  84. package/dist/search-rules.js +34 -0
  85. package/dist/search.js +22 -0
  86. package/dist/semantic.js +39 -0
  87. package/dist/source-inbox.js +17 -0
  88. package/dist/untrusted-content.js +32 -0
  89. package/dist/url-intelligence.js +74 -0
  90. package/dist/workflow.js +23 -0
  91. package/dist/workflows/decision-context.js +20 -0
  92. package/dist/workflows/explain-change.js +8 -0
  93. package/dist/workflows/index.js +28 -0
  94. package/dist/workflows/plan-radar.js +10 -0
  95. package/package.json +421 -0
  96. package/skills/wordcell/AGENTS.md +22 -0
  97. package/skills/wordcell/SKILL.md +91 -0
  98. package/skills/wordcell/agents/openai.yaml +4 -0
  99. package/skills/wordcell/references/companion-skills.md +96 -0
  100. package/skills/wordcell/references/customize.md +123 -0
  101. package/skills/wordcell/references/pdf-review.md +51 -0
  102. package/skills/wordcell/references/percolate.md +176 -0
  103. package/skills/wordcell/references/plan-structure.md +105 -0
  104. package/skills/wordcell/references/plan.md +115 -0
  105. package/skills/wordcell/references/query.md +252 -0
  106. package/skills/wordcell/references/refresh.md +133 -0
  107. package/skills/wordcell/references/save-pdf.md +125 -0
  108. package/skills/wordcell/references/save-url.md +178 -0
  109. package/skills/wordcell/references/url-authentication.md +75 -0
  110. package/skills/wordcell/references/url-platforms.md +25 -0
  111. package/skills/wordcell/templates/companion-skill.template.md +57 -0
  112. package/src/agent-context.ts +1241 -0
  113. package/src/agent-guide-audit.ts +750 -0
  114. package/src/attachments.ts +723 -0
  115. package/src/authoring-model.ts +798 -0
  116. package/src/authoring-platform.ts +549 -0
  117. package/src/authoring-program.ts +278 -0
  118. package/src/authoring-runtime.ts +54 -0
  119. package/src/authoring.ts +75 -0
  120. package/src/benchmark.ts +362 -0
  121. package/src/capture.ts +68 -0
  122. package/src/cli-program.ts +3662 -0
  123. package/src/cli.ts +6 -0
  124. package/src/clip/acquire.ts +1273 -0
  125. package/src/clip/archive-today.ts +402 -0
  126. package/src/clip/args.ts +423 -0
  127. package/src/clip/assets.ts +262 -0
  128. package/src/clip/bounded-byte-buffer.ts +75 -0
  129. package/src/clip/browser-profiles.ts +372 -0
  130. package/src/clip/bundle-reader.ts +608 -0
  131. package/src/clip/capture.ts +1054 -0
  132. package/src/clip/cli.ts +181 -0
  133. package/src/clip/cookies.ts +512 -0
  134. package/src/clip/doctor.ts +1110 -0
  135. package/src/clip/extract.ts +868 -0
  136. package/src/clip/jobs.ts +959 -0
  137. package/src/clip/lib.ts +861 -0
  138. package/src/clip/media.ts +1474 -0
  139. package/src/clip/metadata-search-tool/Cargo.lock +2498 -0
  140. package/src/clip/metadata-search-tool/Cargo.toml +18 -0
  141. package/src/clip/metadata-search-tool/runner.ts +685 -0
  142. package/src/clip/metadata-search-tool/src/main.rs +389 -0
  143. package/src/clip/metadata-search.ts +687 -0
  144. package/src/clip/network-proxy.ts +627 -0
  145. package/src/clip/network.ts +950 -0
  146. package/src/clip/package-root.ts +54 -0
  147. package/src/clip/persist.ts +1472 -0
  148. package/src/clip/platforms.ts +1824 -0
  149. package/src/clip/refresh.ts +197 -0
  150. package/src/clip/structured.ts +432 -0
  151. package/src/clip/terminal.ts +197 -0
  152. package/src/clip/url-intelligence.ts +581 -0
  153. package/src/clip/url-metadata-backfill.ts +616 -0
  154. package/src/clip/url-metadata-cli.ts +251 -0
  155. package/src/clip/url-metadata.ts +1397 -0
  156. package/src/evaluation-analysis-v2.ts +1440 -0
  157. package/src/evaluation-builder.ts +2539 -0
  158. package/src/evaluation-corpus-authoring.ts +2052 -0
  159. package/src/evaluation-evidence.ts +1147 -0
  160. package/src/evaluation-execution-v2.ts +426 -0
  161. package/src/evaluation-implementation.ts +131 -0
  162. package/src/evaluation-kb-closure.ts +1430 -0
  163. package/src/evaluation-kb-runner-v2.ts +735 -0
  164. package/src/evaluation-kb-v2.ts +2567 -0
  165. package/src/evaluation-kb.ts +1018 -0
  166. package/src/evaluation-measurement-v2.ts +1462 -0
  167. package/src/evaluation-packing-v2.ts +452 -0
  168. package/src/evaluation-redaction.ts +28 -0
  169. package/src/evaluation-v2.ts +3857 -0
  170. package/src/evaluation.ts +1220 -0
  171. package/src/git.ts +1276 -0
  172. package/src/graph.ts +1494 -0
  173. package/src/index.ts +21 -0
  174. package/src/init.ts +123 -0
  175. package/src/kb-alias.ts +14 -0
  176. package/src/navigation.ts +277 -0
  177. package/src/note-lock.ts +529 -0
  178. package/src/oh-adoption.ts +444 -0
  179. package/src/pdf/args.ts +202 -0
  180. package/src/pdf/capture.ts +298 -0
  181. package/src/pdf/cli.ts +159 -0
  182. package/src/pdf/extract.ts +303 -0
  183. package/src/pdf/layout.ts +618 -0
  184. package/src/pdf/markdown.ts +154 -0
  185. package/src/pdf/model.ts +234 -0
  186. package/src/pdf/ocr.ts +190 -0
  187. package/src/pdf/persist.ts +314 -0
  188. package/src/pdf/source.ts +135 -0
  189. package/src/pdf/tools.ts +146 -0
  190. package/src/pdf.ts +92 -0
  191. package/src/percolate.ts +1948 -0
  192. package/src/portfolio-audit.ts +574 -0
  193. package/src/portfolio-identity.ts +162 -0
  194. package/src/portfolio-registry.ts +473 -0
  195. package/src/portfolio.ts +765 -0
  196. package/src/query.ts +646 -0
  197. package/src/repository-memory.ts +1150 -0
  198. package/src/sdk.ts +1452 -0
  199. package/src/search-rules.ts +712 -0
  200. package/src/search.ts +710 -0
  201. package/src/semantic-runtime.ts +1139 -0
  202. package/src/semantic.ts +2480 -0
  203. package/src/source-inbox.ts +232 -0
  204. package/src/untrusted-content.ts +401 -0
  205. package/src/url-intelligence.ts +104 -0
  206. package/src/vault.ts +636 -0
  207. package/src/workflow-model.ts +444 -0
  208. package/src/workflow-platform.ts +74 -0
  209. package/src/workflow-program.ts +183 -0
  210. package/src/workflow-runtime.ts +51 -0
  211. package/src/workflow.ts +23 -0
  212. package/src/workflows/decision-context.ts +81 -0
  213. package/src/workflows/explain-change.ts +73 -0
  214. package/src/workflows/index.ts +3 -0
  215. package/src/workflows/plan-radar.ts +101 -0
@@ -0,0 +1,96 @@
1
+ # Companion skill contracts
2
+
3
+ A companion skill handles one recurring Wordcell ritual that benefits from a
4
+ discriminating trigger and an explicit operating contract. It composes with
5
+ the public `wordcell` skill. It does not register code at runtime, execute vault
6
+ metadata, or gain authority by being installed.
7
+
8
+ ## Identity and routing
9
+
10
+ Give the skill a lowercase action-oriented name and a description that states
11
+ the concrete request that should select it. Keep generic querying, capture,
12
+ planning, percolation, refresh, and validation in the main `wordcell` skill. Propose
13
+ at most three companions, and prefer zero when the standard router is enough.
14
+
15
+ ## Inputs and preconditions
16
+
17
+ List the exact inputs that must be supplied or resolved before work starts.
18
+ Distinguish an existing vault from a proposed location. State required local
19
+ commands, repository state, source availability, and authorization without
20
+ installing or probing them as a side effect of skill discovery.
21
+
22
+ ## Surfaces and authority
23
+
24
+ List each filesystem, repository, application, account, network, and
25
+ integration surface the workflow may read or write. Skill discovery,
26
+ installation, or an existing signed-in session grants no authority. The user's
27
+ scope, the applicable repository instructions, host permissions, and the
28
+ selected tool's own approval boundary remain controlling.
29
+
30
+ Do not infer that an account operation is read-only from its HTTP method. Do
31
+ not place secrets, cookies, tokens, session data, or ambient personal context
32
+ in durable output.
33
+
34
+ The shipped customization executor proves filesystem scaffolding only. It
35
+ does not execute an application, account, network, or integration write. A
36
+ companion skill that later needs such an action must treat it as a separate
37
+ runtime request with its own exact proposal, approval, capable tool, and
38
+ inspectable result.
39
+
40
+ ## Approval boundary
41
+
42
+ Separate read-only inspection from mutation. Present exact targets and writes
43
+ before approval unless the user's request already authorizes them. A denial,
44
+ no response, changed proposal, path expansion, added account, or new external
45
+ surface requires stopping or renewed approval.
46
+
47
+ ## Execution semantics
48
+
49
+ Define deterministic behavior for the first run and an exact repeat. Require
50
+ path confinement, reject symbolic-link targets, and preserve divergent
51
+ existing content. Name each effect explicitly instead of granting a broad
52
+ filesystem or application capability.
53
+
54
+ ## Durable outputs and provenance
55
+
56
+ Name the files or records that persist, their authority, and the provenance
57
+ they retain. Markdown and Git remain authoritative Wordcell state. Generated
58
+ catalogs, indexes, embeddings, and graph reports stay rebuildable. Exclude
59
+ credentials, session material, and unrelated account data.
60
+
61
+ ## Verification and Wordcell maintenance
62
+
63
+ Define the narrow checks that establish the intended result. After material Wordcell
64
+ edits, review percolation candidates and run the appropriate catalog-aware
65
+ check. Parallel lanes use `wordcell check --no-catalog`; one integrating agent owns a
66
+ managed catalog refresh.
67
+
68
+ ## Composition boundary
69
+
70
+ Call the installed `wordcell` command or its public package interfaces only when the
71
+ approved workflow needs them. Do not add a plugin registry, hook loader,
72
+ background process, executable vault metadata, or implicit account bridge. A
73
+ companion skill is an instruction boundary, not runtime extensibility.
74
+
75
+ ## Review checklist
76
+
77
+ The repository's fake-capability suite is a tested contract example. It checks
78
+ the expected approval and failure transitions, but it does not prove that every
79
+ agent or host integration complies. Review the executing agent's actual tool
80
+ and permission boundaries as well.
81
+
82
+ - Does the trigger identify one recurring request without attracting generic
83
+ Wordcell work?
84
+ - Are inputs, preconditions, read surfaces, write surfaces, and exact targets
85
+ explicit?
86
+ - Can inspection finish without installing, indexing, caching, or mutating?
87
+ - Does approval cover every effect, with renewed approval for any change?
88
+ - Is an exact repeat a no-op, while divergence, path escape, symlinks, partial
89
+ failure, and unapproved external access stop safely?
90
+ - Do durable outputs preserve useful provenance without secrets or session
91
+ data?
92
+ - Does the skill compose with the public router without copying its general
93
+ instructions?
94
+
95
+ Start from [`companion-skill.template.md`](../templates/companion-skill.template.md)
96
+ only after the proposal's target skill root and name are approved.
@@ -0,0 +1,123 @@
1
+ # Customize a Wordcell setup
2
+
3
+ Design the smallest Wordcell arrangement that answers the user's recurring memory
4
+ questions. Begin with an interview and read-only inspection. Do not install a
5
+ runtime, initialize a vault, build an index, access an account, or write a file
6
+ before the proposal has the user's approval.
7
+
8
+ ## Establish the boundary
9
+
10
+ Identify the repositories, vaults, people, agents, and time horizons in scope.
11
+ Ask what the Wordcell must help a future agent recover, which information must remain
12
+ outside it, and which existing instructions govern the target paths. Treat the
13
+ user's explicit request as authorization for the named work. Do not extend it
14
+ to another path, repository, account, application, or integration.
15
+
16
+ For a new vault, ask for or propose an exact location. Do not require an
17
+ existing `index.md`. For an existing vault, resolve its front door and read the
18
+ applicable `AGENTS.md` files before proposing changes.
19
+
20
+ ## Inspect without mutation
21
+
22
+ Inspect only the surfaces needed to understand the current setup. Typical
23
+ evidence includes directory structure, existing Markdown conventions, scoped
24
+ agent guides, active plans, source records, repository paths, and available
25
+ local commands. Keep filesystem, application, account, network, and
26
+ integration access within the user's stated scope and the host's actual
27
+ permissions.
28
+
29
+ Do not run `wordcell doctor`, `wordcell init`, `wordcell index`, QMD, hybrid or semantic search,
30
+ an installer, or a command that may create a cache during this phase. Do not
31
+ create a hidden profile such as `.context/me.md` or infer personal context from
32
+ an ambient account.
33
+
34
+ ## Interview in small batches
35
+
36
+ Ask only questions whose answers change the proposed structure. Prefer a small
37
+ batch about one decision at a time:
38
+
39
+ - Which recurring questions should the Wordcell answer?
40
+ - Which sources, maintained explanations, plans, and repository rules already
41
+ exist?
42
+ - Which writes should happen automatically, require review, or never happen?
43
+ - Which recurring action is common enough to justify a companion skill?
44
+
45
+ Summarize each resolved decision before moving to the next uncertain one. A
46
+ short interview may conclude that the standard profile or no change is best.
47
+
48
+ ## Propose the smallest useful change
49
+
50
+ Describe the exact files and surfaces before editing. Use this table:
51
+
52
+ | Surface | Exact target | Read | Write | Purpose | Approval |
53
+ | --- | --- | --- | --- | --- | --- |
54
+ | Vault | `<path>` | `<bounded inputs>` | `<files or none>` | `<memory question>` | `<approved or pending>` |
55
+
56
+ Propose zero to three companion skills. Each proposed skill must own a distinct
57
+ recurring request that the main `wordcell` router cannot express clearly enough. Do
58
+ not add a skill only to restate repository policy or wrap one command.
59
+
60
+ State the verification, idempotence, retry, and failure behavior for every
61
+ write. Keep Markdown and Git authoritative. Treat indexes, embeddings,
62
+ catalogs, graph reports, and caches as replaceable views.
63
+
64
+ ## Obtain approval
65
+
66
+ Present the proposal and wait when its writes are not already authorized by
67
+ the user's explicit request. Approval applies to the exact targets and
68
+ operations shown. A changed path, expanded repository, additional skill,
69
+ account surface, network action, or broader write requires renewed approval.
70
+
71
+ Silence, a denial, or an ambiguous response is not approval. Inspection does
72
+ not grant write authority. Discovery of a command, application, account, or
73
+ integration does not authorize its use.
74
+
75
+ ## Scaffold within the approved boundary
76
+
77
+ Create only approved paths. For a companion skill, read [Companion skill
78
+ contracts](companion-skills.md) and copy
79
+ [`companion-skill.template.md`](../templates/companion-skill.template.md) to
80
+ `<explicit-skill-root>/<name>/SKILL.md`. Never edit the template inside an
81
+ installed package or `node_modules`.
82
+
83
+ If approved execution needs the Wordcell CLI, prepare the runtime now using the main
84
+ skill's pinned installation instructions. Installation does not authorize
85
+ `wordcell init`, indexing, semantic search, or vault writes. Run only the approved
86
+ commands and exact allowlisted writes.
87
+
88
+ The scaffold executor writes filesystem targets only. It never performs an
89
+ application, account, network, or integration write. A companion skill may
90
+ describe one of those later actions, but its execution is a separate runtime
91
+ request with its own exact proposal, approval, tool boundary, and result.
92
+
93
+ On a repeated request, compare the desired bytes with the approved targets.
94
+ Treat an exact match as a no-op. Stop on divergent existing content, a symlink,
95
+ a path that escapes the approved root, an unapproved external surface, or a
96
+ partial write. Report the retained state instead of overwriting, silently
97
+ retrying, or widening the boundary.
98
+
99
+ ## Start with real material
100
+
101
+ Use a small amount of material that exercises the agreed structure: one saved
102
+ source, one maintained explanation, one plan, or one repository-context
103
+ mapping. Do not manufacture empty directories, placeholder notes, a complete
104
+ ontology, or speculative metadata merely to make the vault look populated.
105
+
106
+ ## Verify and hand off
107
+
108
+ Verify every approved file and record the exact paths changed. Run the
109
+ narrowest applicable Wordcell checks only when they were approved and the runtime is
110
+ available. State what remains unconfigured, which views are rebuildable, and
111
+ which action would require separate authority.
112
+
113
+ Keep durable output free of credentials, session material, account exports,
114
+ and hidden ambient context. Record source provenance and the boundary of any
115
+ incomplete acquisition.
116
+
117
+ ## Evolve an existing setup
118
+
119
+ Re-run the boundary, inspection, interview, proposal, and approval steps when
120
+ the vault's recurring questions change. Prefer a focused convention or skill
121
+ revision to a migration. Preserve authored Markdown and Git history, and do not
122
+ mass-rewrite metadata to fit a new taxonomy unless a measured retrieval or
123
+ maintenance problem justifies that work.
@@ -0,0 +1,51 @@
1
+ # Review PDF image-derived text
2
+
3
+ Read this guide when a PDF contains screenshots, scans, or mixed text and
4
+ visual media.
5
+
6
+ ## Keep the source inspectable
7
+
8
+ - Retain every extracted image in `assets/`.
9
+ - Embed primarily visual images.
10
+ - Keep a source-image link beside OCR-derived or manually corrected text.
11
+ - Preserve page number, image index, bounding box, extraction method, and
12
+ confidence in `capture.json`.
13
+ - Never replace a mixed image with text alone. Screenshots can contain a
14
+ message, chart, photograph, code sample, or UI state at the same time.
15
+ - The renderer embeds the source image and adds its metadata and “Text visible
16
+ in…” heading. Annotation `markdown` should contain only the transcription.
17
+
18
+ ## Structure conversations
19
+
20
+ When the surface is recognizable, use available metadata rather than flattening
21
+ the screenshot into one paragraph:
22
+
23
+ ```markdown
24
+ > bg @ Oct 15, 2024 at 4:26 PM
25
+ > Substrate did look very well designed and ambitious from the outside...
26
+ ```
27
+
28
+ Use the platform's visible display name. Include channel, thread, or reply
29
+ context only when the screenshot shows it. Split a multi-message screenshot
30
+ into distinct message blocks, including each visible message author and
31
+ timestamp in that message's Markdown header. Annotation metadata describes
32
+ shared or whole-image context: use its scalar `author` or `timestamp` only when
33
+ one value accurately characterizes the image, and use `participants` for
34
+ multiple visible authors. The generated image embed is the shared source-image
35
+ reference.
36
+
37
+ Do not invent missing authors, dates, channels, or thread relationships. Mark
38
+ uncertain OCR as `[unclear]`; do not silently turn a plausible guess into source
39
+ text.
40
+
41
+ ## Distinguish image roles
42
+
43
+ - `text`: a scan or crop is adequately represented by its prose, code, table,
44
+ or labels, although the source asset is still retained.
45
+ - `visual`: the image remains meaningful without recognized text.
46
+ - `mixed`: both recognized text and non-text visual or spatial context matter.
47
+ Use this for most message and application screenshots because avatars,
48
+ grouping, thread layout, reactions, and UI state can remain evidentiary.
49
+
50
+ When classification is uncertain, choose `mixed`, keep the image visible, and
51
+ preserve the OCR warning.
@@ -0,0 +1,176 @@
1
+ # Percolate concepts and relationships
2
+
3
+ Keep the graph authored, local, and reviewable. `wordcell percolate` proposes
4
+ candidates from deterministic evidence; it never changes a note. Backlinks,
5
+ graph reports, and QMD results are derived views, while Markdown remains the
6
+ authority.
7
+
8
+ ## Locate the vault
9
+
10
+ - Resolve `<vault>` to the directory containing its authored or managed
11
+ `index.md` front door.
12
+ - Read the applicable repository and vault instructions before editing.
13
+ - Pass the resolved path to every `--root`.
14
+ - Identify the note or small neighborhood changed by the current task. Prefer a
15
+ bounded review to a vault-wide cleanup during parallel work.
16
+
17
+ ## Inspect candidates
18
+
19
+ Run percolation on the changed note when possible:
20
+
21
+ ```sh
22
+ wordcell percolate notes/example --root "$KB_ROOT" --limit 25 --json
23
+ ```
24
+
25
+ Run it without a note only when reviewing the whole vault:
26
+
27
+ ```sh
28
+ wordcell percolate --root "$KB_ROOT" --min-support 2 --limit 50 --json
29
+ ```
30
+
31
+ Treat each result as a prompt to open the cited notes and read the relevant
32
+ prose. Candidate kinds may include:
33
+
34
+ - a recurring tag with no maintained `type: concept` note;
35
+ - notes that share a concept or tag but have no explicit relationship;
36
+ - an exact title or alias mentioned without a contextual link;
37
+ - a self, reciprocal, malformed, broken, or ambiguous authored relationship.
38
+
39
+ For missing relationships, `support` counts independent shared tags or concept
40
+ neighbors; the evidence array shows the participating notes. The default
41
+ minimum of two therefore requires two shared signals, not merely both endpoints
42
+ of one tag match. Other candidate kinds count their natural unit: supporting
43
+ notes, mention occurrences, or authored hygiene evidence.
44
+
45
+ Percolation Result V2 reports a missing relationship as an unordered pair of
46
+ endpoints with `predicate: { "kind": "required" }`. The output does not choose
47
+ which note owns the assertion, its direction, or its predicate. In particular,
48
+ it never inserts `related-to` as a fallback. Read both notes and their evidence,
49
+ then choose a source, target, and predicate only when the prose establishes that
50
+ claim. Historical unversioned V1 results may contain a suggested predicate;
51
+ parse them through the explicit V1 compatibility surface and do not treat that
52
+ suggestion as an authored fact or silently upgrade it to V2. V1 remains
53
+ available through the 0.19 release line and is not removed before 0.20.0.
54
+
55
+ For a missing concept, use `suggestedId`. When `collidesWith` is non-null, the
56
+ natural ID is already an ordinary note, so Wordcell chooses an unoccupied
57
+ `*-concept` ID. Read the occupied note before deciding whether to create the
58
+ suggested concept or promote and improve the existing note instead.
59
+
60
+ Semantic search may help discover evidence, but similarity is never enough to
61
+ author an edge.
62
+
63
+ ## Promote durable concepts
64
+
65
+ Create a concept only when the idea is likely to be reused and its definition
66
+ can be stated from the source material:
67
+
68
+ ```sh
69
+ wordcell note create notes/local-first \
70
+ --root "$KB_ROOT" \
71
+ --title "Local-first" \
72
+ --type concept \
73
+ --tag architecture \
74
+ --body '# Local-first
75
+
76
+ A concise reviewed definition grounded in the cited notes.'
77
+ ```
78
+
79
+ Write a concise definition and cite or link the notes that establish it.
80
+ Concepts are ordinary Markdown notes, so they can carry aliases, evidence,
81
+ context, and their own outbound relationships. Do not create a concept merely
82
+ to mirror every tag.
83
+
84
+ After promotion, rerun percolation on the cited non-concept notes. The new
85
+ concept may support relationships among its neighbors even when a run scoped to
86
+ the concept itself has no candidate:
87
+
88
+ ```sh
89
+ wordcell percolate notes/write-path --root "$KB_ROOT" --limit 25 --json
90
+ ```
91
+
92
+ ## Author typed relationships
93
+
94
+ Add a relationship from the note that owns the assertion:
95
+
96
+ ```sh
97
+ wordcell relation add notes/write-path supports notes/durable-agent-memory \
98
+ --root "$KB_ROOT"
99
+ ```
100
+
101
+ Use a specific lower-kebab-case predicate. Recommended predicates for common
102
+ Wordcell evidence and maintenance claims are:
103
+
104
+ - `synthesizes` when the source combines and maintains conclusions from the
105
+ target material;
106
+ - `evidenced-by` when the target directly supports a claim in the source;
107
+ - `informed-by` when the target influenced the source without serving as its
108
+ direct evidence;
109
+ - `supersedes` when the source deliberately replaces the target as the current
110
+ account;
111
+ - `contradicts` when the source records a supported incompatible claim.
112
+
113
+ This vocabulary is advisory. A vault may use any canonical custom predicate
114
+ whose meaning its prose establishes. Do not assign a recommended predicate by
115
+ directory, note type, shared tags, chronology, or similarity alone. A local
116
+ target is an exact vault-root note ID without `.md`. A reviewed cross-vault
117
+ target is its stable qualified identity, such as
118
+ `kb://hraness/kb/document-id`; never use a checkout path as cross-vault
119
+ identity. Ground the assertion in nearby prose or evidence; the frontmatter is
120
+ an indexable statement, not a substitute for explanation.
121
+
122
+ List or remove relationships without editing reciprocal notes:
123
+
124
+ ```sh
125
+ wordcell relation list notes/write-path --root "$KB_ROOT" --json
126
+ wordcell relation remove notes/write-path supports notes/durable-agent-memory \
127
+ --root "$KB_ROOT"
128
+ ```
129
+
130
+ Never write inverse edges, generated backlinks, inferred transitive
131
+ relationships, reciprocal edges, similarity-derived relationships, or
132
+ semantic-search scores into Markdown. External or unclassified material is
133
+ outside this vocabulary evaluation and remains unresolved. Those are derived
134
+ views or review work.
135
+
136
+ The interview-first setup and relationship-review pattern builds on Frank
137
+ Chen's public notes about [designing a personal knowledge base with an
138
+ agent](https://gist.github.com/fxchen/773397095d7a6bffda621e4237da0da9)
139
+ and [extending it with skills](https://gist.github.com/fxchen/09cb410b22c9c5256d80243ee925b57e).
140
+
141
+ ## Query before concluding
142
+
143
+ Use exact structure to verify that the promoted graph says what the prose says:
144
+
145
+ ```sh
146
+ wordcell links notes/write-path --root "$KB_ROOT" --direction both --depth 2 --json
147
+ wordcell relation list notes/write-path --root "$KB_ROOT" --json
148
+ wordcell graph --root "$KB_ROOT" --json
149
+ ```
150
+
151
+ Prefer the note-scoped commands first. Use the whole-vault graph only when the
152
+ question spans several neighborhoods, and confirm returned IDs against their
153
+ Markdown notes before reporting a conclusion.
154
+
155
+ ## Finish under the vault's catalog mode
156
+
157
+ When working alone or integrating several lanes:
158
+
159
+ ```sh
160
+ wordcell refresh --root "$KB_ROOT"
161
+ wordcell check --root "$KB_ROOT"
162
+ ```
163
+
164
+ When several agents are editing different notes in a managed-catalog vault,
165
+ each lane should validate authored structure and local attachments without
166
+ rewriting the shared catalog:
167
+
168
+ ```sh
169
+ wordcell check --root "$KB_ROOT" --no-catalog
170
+ ```
171
+
172
+ The integrating agent runs one final managed refresh and normal check. In an
173
+ authored-catalog vault, refresh and check leave the front door untouched, while
174
+ `wordcell catalog --root "$KB_ROOT"` renders an exhaustive disposable inventory.
175
+ Resolve same-note Git conflicts from the prose and evidence; do not accept one
176
+ side's frontmatter mechanically.
@@ -0,0 +1,105 @@
1
+ # Durable Wordcell plan structure
2
+
3
+ Use the smallest version that still makes execution and verification
4
+ unambiguous. Omit empty optional sections; do not pad a small change into a
5
+ program document.
6
+
7
+ ## Frontmatter
8
+
9
+ ```yaml
10
+ ---
11
+ title: Descriptive outcome
12
+ description: One sentence naming the change and dominant result.
13
+ type: plan
14
+ area: product-or-system
15
+ status: proposed
16
+ repository_scopes:
17
+ - packages/example
18
+ aliases:
19
+ - Short plan name
20
+ tags:
21
+ - migration
22
+ ---
23
+ ```
24
+
25
+ `type`, `area`, `status`, and a non-empty description are the stable plan query
26
+ surface. Use a kebab-case `area`. Add `repository_scopes` when the plan owns
27
+ repository work; each entry is one exact canonical repository-relative file or
28
+ directory path, without globs. Omit the field for plans with no code-path
29
+ ownership. Tags are optional facets, not a replacement for prose or links.
30
+
31
+ ## Core sections
32
+
33
+ ```md
34
+ # Descriptive outcome
35
+
36
+ ## Outcome
37
+
38
+ What will be true when this plan succeeds. Prefer observable behavior over a
39
+ list of files to edit.
40
+
41
+ ## Context
42
+
43
+ The present state, evidence, and reason the change is needed. Link the notes,
44
+ captures, code, or prior plans that carry necessary context.
45
+
46
+ ## Scope
47
+
48
+ ### In scope
49
+
50
+ - Work required for the outcome.
51
+
52
+ ### Non-goals
53
+
54
+ - Adjacent work deliberately excluded.
55
+
56
+ ## Constraints and decisions
57
+
58
+ - Constraints that shape the implementation.
59
+ - Decisions already made and why.
60
+ - Open questions whose answers can change the plan.
61
+
62
+ ## Plan
63
+
64
+ 1. A dependency-ordered phase with its concrete output.
65
+ 2. The next phase and its gate from the prior phase.
66
+
67
+ ## Verification
68
+
69
+ - Behavior or invariant → exact check, test, observation, or evidence.
70
+
71
+ ## Risks and recovery
72
+
73
+ - Failure mode → prevention, detection, and rollback or recovery.
74
+ ```
75
+
76
+ ## Sections that grow with the work
77
+
78
+ Add these when execution starts:
79
+
80
+ ```md
81
+ ## Execution evidence
82
+
83
+ - YYYY-MM-DD — Result, command or artifact, and what it proved.
84
+
85
+ ## Review findings
86
+
87
+ - Finding, disposition, and resulting plan or implementation change.
88
+
89
+ ## Result
90
+
91
+ What shipped or why work stopped, what was verified, and what intentionally
92
+ remains.
93
+
94
+ ## Durable memory
95
+
96
+ Link each reusable conclusion to the maintained note, guide, documentation, or
97
+ checked code contract that now owns it. If no conclusion warrants promotion,
98
+ state that no durable promotion was needed and explain why.
99
+ ```
100
+
101
+ Keep evidence compact but reproducible. A test name, checked invariant, or link
102
+ to an artifact is stronger than “validation passed.” Preserve superseded
103
+ decisions when they explain the final shape; mark their disposition instead of
104
+ silently deleting them. Require both Result and Durable memory when the status
105
+ becomes `completed`, `superseded`, or `cancelled`.
@@ -0,0 +1,115 @@
1
+ # Write a durable plan
2
+
3
+ Keep the plan useful before, during, and after execution. It is the coordination
4
+ record, not a disposable answer or a duplicate task tracker.
5
+
6
+ ## Find the plan's owner
7
+
8
+ 1. Resolve `<vault>` to the directory containing its authored or managed
9
+ `index.md` front door, then
10
+ set the shell-local `KB_ROOT` to that path (`KB_ROOT=kb` from a typical
11
+ repository root, or `KB_ROOT=.` from inside the vault). Read the vault's
12
+ `AGENTS.md` and the nearest guide under `<vault>/plans/`. Pass that resolved
13
+ root to every command; do not assume the starting directory is the vault.
14
+ 2. When the plan owns a repository path, resolve the repository root as
15
+ `KB_REPO` and load that path's current memory before a whole-vault search:
16
+
17
+ ```sh
18
+ wordcell context "<repository-path>" --root "$KB_ROOT" --repo "$KB_REPO"
19
+ ```
20
+
21
+ Use `--kind file` or `--kind directory` when an absent future path cannot be
22
+ classified from the filesystem. Read the inherited guides first, then the
23
+ applicable maintained knowledge, active plans, dated research, reports, and
24
+ separate historical-plan group.
25
+
26
+ 3. Search existing plans before creating one:
27
+
28
+ ```sh
29
+ wordcell list --root "$KB_ROOT" --where type=plan --sort area --json
30
+ wordcell search "the intended outcome" --root "$KB_ROOT" --json
31
+ ```
32
+
33
+ If `wordcell` is not installed, do not let retrieval tooling block the plan: use
34
+ `rg` or the available file search over `<vault>/plans/`, titles, aliases, and relevant
35
+ terms. If the directory is not an initialized hraness/wordcell vault, follow the
36
+ repository's existing planning convention instead of initializing one without
37
+ being asked. Semantic search writes only a derived local cache; when that cache
38
+ location is not writable, use exact search or point `XDG_CACHE_HOME` at a
39
+ writable cache directory.
40
+
41
+ 4. Update an existing plan when it already owns the outcome. Create a new file
42
+ only for independently executable work.
43
+ 5. Use `<vault>/plans/<descriptive-kebab-name>.md` unless the local guide already groups
44
+ plans by area. Do not reorganize older plans merely to impose a new tree.
45
+
46
+ ## Write from evidence
47
+
48
+ Read [the plan structure reference](plan-structure.md), then tailor it to
49
+ the work. Preserve these invariants:
50
+
51
+ - State one concrete outcome and the current status.
52
+ - Record what is known, what is assumed, and what remains to discover.
53
+ - Separate in-scope work from non-goals.
54
+ - Put constraints and decisions before the steps they shape.
55
+ - Make dependencies and ordering visible.
56
+ - Give each acceptance claim a verification method.
57
+ - Include rollback or recovery when a change can leave durable state behind.
58
+
59
+ Turn a missing implementation detail into an ordered discovery gate when the
60
+ outcome and authorization are already clear and the decision can be made from
61
+ in-scope evidence. Stop and request direction when the unknown would change the
62
+ intended outcome, expand authority or external coordination, or choose between
63
+ materially different products.
64
+
65
+ Use small frontmatter. Start with `type: plan`, a descriptive title and
66
+ one-sentence description, a kebab-case `area`, and one of `proposed`,
67
+ `accepted`, `in-progress`, `blocked`, `completed`, `superseded`, or `cancelled`.
68
+ When the plan owns work in a code repository, add `repository_scopes` with the
69
+ few exact canonical repository-relative files or directories it explains. Use
70
+ no globs. A future path is valid; update an active plan deliberately when code
71
+ moves instead of relying on inferred Git renames. Add aliases or tags only when
72
+ they help humans or structured queries.
73
+
74
+ ## Grow the same file during execution
75
+
76
+ - Change status when reality changes, not in anticipation.
77
+ - Check off completed work without deleting the original intent.
78
+ - Incorporate decisions, review findings, deviations, and command or test
79
+ evidence where a future reader can understand their consequence.
80
+ - When blocked, name the exact missing condition and the safe work already
81
+ completed.
82
+ - When a plan becomes `completed`, `superseded`, or `cancelled`, write a
83
+ non-empty `## Result` and `## Durable memory`. State what shipped or why work
84
+ stopped in Result. In Durable memory, link each reusable conclusion to the
85
+ maintained note, guide, documentation, or checked code contract that now owns
86
+ it. When nothing warrants promotion, say so explicitly and give the reason.
87
+ Retain the terminal plan as history.
88
+ - Do not create separate progress, review, or completion files for the same
89
+ plan.
90
+
91
+ ## Connect and verify
92
+
93
+ Add wikilinks or typed relationships only where the prose and evidence explain
94
+ a useful connection. Review the changed plan for reusable concepts before
95
+ refreshing:
96
+
97
+ ```sh
98
+ wordcell percolate "<plan-note-id>" --root "$KB_ROOT" --limit 25 --json
99
+ wordcell refresh --root "$KB_ROOT"
100
+ wordcell check --root "$KB_ROOT"
101
+ ```
102
+
103
+ Run those commands when the plan lives in an initialized hraness/wordcell vault. In a
104
+ repository-native planning directory, use that repository's own validation
105
+ instead. Review broken links first, then inspect orphan and mention advisories
106
+ in context. Promote only concepts likely to be reused, and ground every typed
107
+ relationship in the plan's prose. An independently useful plan may legitimately
108
+ remain an orphan in a new or sparse vault. Record that disposition mentally or
109
+ in the task handoff; do not manufacture links or relations merely to improve
110
+ graph counts.
111
+
112
+ In an authored-catalog vault, refresh leaves the front door unchanged and `kb
113
+ catalog --root "$KB_ROOT"` renders an exhaustive disposable inventory. In a
114
+ managed vault, independent edit lanes use `wordcell check --root "$KB_ROOT"
115
+ --no-catalog`; the integrating lane performs the single catalog refresh.