ctxr-cli 0.8.0 → 0.10.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 (250) hide show
  1. package/README.md +313 -22
  2. package/dist/adapters/types.d.ts +0 -5
  3. package/dist/adapters/types.d.ts.map +1 -1
  4. package/dist/commands/adapters-generate.d.ts.map +1 -1
  5. package/dist/commands/adapters-generate.js +2 -3
  6. package/dist/commands/adapters-generate.js.map +1 -1
  7. package/dist/commands/context-gather.d.ts +22 -0
  8. package/dist/commands/context-gather.d.ts.map +1 -0
  9. package/dist/commands/context-gather.js +36 -0
  10. package/dist/commands/context-gather.js.map +1 -0
  11. package/dist/commands/graph-query.d.ts.map +1 -1
  12. package/dist/commands/graph-query.js +6 -8
  13. package/dist/commands/graph-query.js.map +1 -1
  14. package/dist/commands/ingest.d.ts +22 -9
  15. package/dist/commands/ingest.d.ts.map +1 -1
  16. package/dist/commands/ingest.js +86 -24
  17. package/dist/commands/ingest.js.map +1 -1
  18. package/dist/commands/init.d.ts.map +1 -1
  19. package/dist/commands/init.js +22 -5
  20. package/dist/commands/init.js.map +1 -1
  21. package/dist/commands/publish-check.d.ts.map +1 -1
  22. package/dist/commands/publish-check.js +8 -0
  23. package/dist/commands/publish-check.js.map +1 -1
  24. package/dist/commands/publish-new.d.ts.map +1 -1
  25. package/dist/commands/publish-new.js +15 -0
  26. package/dist/commands/publish-new.js.map +1 -1
  27. package/dist/commands/serve.d.ts.map +1 -1
  28. package/dist/commands/serve.js +33 -11
  29. package/dist/commands/serve.js.map +1 -1
  30. package/dist/commands/session-start.d.ts.map +1 -1
  31. package/dist/commands/session-start.js +9 -1
  32. package/dist/commands/session-start.js.map +1 -1
  33. package/dist/commands/source-check.d.ts.map +1 -1
  34. package/dist/commands/source-check.js +52 -9
  35. package/dist/commands/source-check.js.map +1 -1
  36. package/dist/commands/source-stamp.d.ts +6 -5
  37. package/dist/commands/source-stamp.d.ts.map +1 -1
  38. package/dist/commands/source-stamp.js +8 -7
  39. package/dist/commands/source-stamp.js.map +1 -1
  40. package/dist/commands/update.d.ts.map +1 -1
  41. package/dist/commands/update.js +7 -1
  42. package/dist/commands/update.js.map +1 -1
  43. package/dist/commands/verify.d.ts +11 -2
  44. package/dist/commands/verify.d.ts.map +1 -1
  45. package/dist/commands/verify.js +86 -5
  46. package/dist/commands/verify.js.map +1 -1
  47. package/dist/commands/version.d.ts +31 -0
  48. package/dist/commands/version.d.ts.map +1 -0
  49. package/dist/commands/version.js +87 -0
  50. package/dist/commands/version.js.map +1 -0
  51. package/dist/config/defaults.d.ts +113 -4
  52. package/dist/config/defaults.d.ts.map +1 -1
  53. package/dist/config/defaults.js +83 -4
  54. package/dist/config/defaults.js.map +1 -1
  55. package/dist/config/load.d.ts +2 -2
  56. package/dist/config/load.d.ts.map +1 -1
  57. package/dist/config/load.js +13 -3
  58. package/dist/config/load.js.map +1 -1
  59. package/dist/config/render.d.ts +5 -0
  60. package/dist/config/render.d.ts.map +1 -1
  61. package/dist/config/render.js +62 -3
  62. package/dist/config/render.js.map +1 -1
  63. package/dist/config/schema.d.ts +47 -76
  64. package/dist/config/schema.d.ts.map +1 -1
  65. package/dist/config/schema.js +171 -134
  66. package/dist/config/schema.js.map +1 -1
  67. package/dist/core/agents-doc.d.ts.map +1 -1
  68. package/dist/core/agents-doc.js +4 -1
  69. package/dist/core/agents-doc.js.map +1 -1
  70. package/dist/core/browse/nav.d.ts.map +1 -1
  71. package/dist/core/browse/nav.js +4 -1
  72. package/dist/core/browse/nav.js.map +1 -1
  73. package/dist/core/browse/preferences.d.ts +26 -0
  74. package/dist/core/browse/preferences.d.ts.map +1 -0
  75. package/dist/core/browse/preferences.js +74 -0
  76. package/dist/core/browse/preferences.js.map +1 -0
  77. package/dist/core/browse/routes.d.ts +10 -8
  78. package/dist/core/browse/routes.d.ts.map +1 -1
  79. package/dist/core/browse/routes.js +113 -24
  80. package/dist/core/browse/routes.js.map +1 -1
  81. package/dist/core/browse/templates.d.ts +14 -4
  82. package/dist/core/browse/templates.d.ts.map +1 -1
  83. package/dist/core/browse/templates.js +22 -4
  84. package/dist/core/browse/templates.js.map +1 -1
  85. package/dist/core/checks/harness-portability-checks.d.ts +22 -1
  86. package/dist/core/checks/harness-portability-checks.d.ts.map +1 -1
  87. package/dist/core/checks/harness-portability-checks.js +48 -4
  88. package/dist/core/checks/harness-portability-checks.js.map +1 -1
  89. package/dist/core/checks/integrity-checks.d.ts +0 -2
  90. package/dist/core/checks/integrity-checks.d.ts.map +1 -1
  91. package/dist/core/checks/integrity-checks.js +2 -27
  92. package/dist/core/checks/integrity-checks.js.map +1 -1
  93. package/dist/core/checks/manifest.d.ts.map +1 -1
  94. package/dist/core/checks/manifest.js +2 -0
  95. package/dist/core/checks/manifest.js.map +1 -1
  96. package/dist/core/checks/organize-checks.d.ts +11 -1
  97. package/dist/core/checks/organize-checks.d.ts.map +1 -1
  98. package/dist/core/checks/organize-checks.js +42 -12
  99. package/dist/core/checks/organize-checks.js.map +1 -1
  100. package/dist/core/checks/retrieval-checks.d.ts +9 -0
  101. package/dist/core/checks/retrieval-checks.d.ts.map +1 -0
  102. package/dist/core/checks/retrieval-checks.js +30 -0
  103. package/dist/core/checks/retrieval-checks.js.map +1 -0
  104. package/dist/core/command.d.ts +6 -0
  105. package/dist/core/command.d.ts.map +1 -1
  106. package/dist/core/content/canonicalize.d.ts +10 -0
  107. package/dist/core/content/canonicalize.d.ts.map +1 -1
  108. package/dist/core/content/canonicalize.js +12 -0
  109. package/dist/core/content/canonicalize.js.map +1 -1
  110. package/dist/core/env.d.ts +5 -0
  111. package/dist/core/env.d.ts.map +1 -1
  112. package/dist/core/env.js +3 -0
  113. package/dist/core/env.js.map +1 -1
  114. package/dist/core/environment/probe.d.ts +12 -0
  115. package/dist/core/environment/probe.d.ts.map +1 -0
  116. package/dist/core/environment/probe.js +36 -0
  117. package/dist/core/environment/probe.js.map +1 -0
  118. package/dist/core/errors.d.ts +32 -0
  119. package/dist/core/errors.d.ts.map +1 -1
  120. package/dist/core/errors.js +81 -3
  121. package/dist/core/errors.js.map +1 -1
  122. package/dist/core/fs/prefix.d.ts +13 -0
  123. package/dist/core/fs/prefix.d.ts.map +1 -0
  124. package/dist/core/fs/prefix.js +22 -0
  125. package/dist/core/fs/prefix.js.map +1 -0
  126. package/dist/core/git/worktree.d.ts +22 -0
  127. package/dist/core/git/worktree.d.ts.map +1 -1
  128. package/dist/core/git/worktree.js +34 -0
  129. package/dist/core/git/worktree.js.map +1 -1
  130. package/dist/core/graph/persist.d.ts +13 -0
  131. package/dist/core/graph/persist.d.ts.map +1 -1
  132. package/dist/core/graph/persist.js +24 -0
  133. package/dist/core/graph/persist.js.map +1 -1
  134. package/dist/core/harness/isolated-run.d.ts +52 -0
  135. package/dist/core/harness/isolated-run.d.ts.map +1 -0
  136. package/dist/core/harness/isolated-run.js +100 -0
  137. package/dist/core/harness/isolated-run.js.map +1 -0
  138. package/dist/core/hooks.d.ts +3 -12
  139. package/dist/core/hooks.d.ts.map +1 -1
  140. package/dist/core/hooks.js +24 -20
  141. package/dist/core/hooks.js.map +1 -1
  142. package/dist/core/ingest/capture-hash.d.ts +16 -0
  143. package/dist/core/ingest/capture-hash.d.ts.map +1 -0
  144. package/dist/core/ingest/capture-hash.js +34 -0
  145. package/dist/core/ingest/capture-hash.js.map +1 -0
  146. package/dist/core/ingest/identity.d.ts +7 -1
  147. package/dist/core/ingest/identity.d.ts.map +1 -1
  148. package/dist/core/ingest/identity.js +16 -1
  149. package/dist/core/ingest/identity.js.map +1 -1
  150. package/dist/core/ingest/model.d.ts +17 -2
  151. package/dist/core/ingest/model.d.ts.map +1 -1
  152. package/dist/core/ingest/model.js +5 -0
  153. package/dist/core/ingest/model.js.map +1 -1
  154. package/dist/core/install-kind.d.ts +25 -0
  155. package/dist/core/install-kind.d.ts.map +1 -0
  156. package/dist/core/install-kind.js +56 -0
  157. package/dist/core/install-kind.js.map +1 -0
  158. package/dist/core/notes/list.d.ts +20 -0
  159. package/dist/core/notes/list.d.ts.map +1 -1
  160. package/dist/core/notes/list.js +27 -6
  161. package/dist/core/notes/list.js.map +1 -1
  162. package/dist/core/publish/script-check.d.ts +5 -2
  163. package/dist/core/publish/script-check.d.ts.map +1 -1
  164. package/dist/core/publish/script-check.js +5 -2
  165. package/dist/core/publish/script-check.js.map +1 -1
  166. package/dist/core/records.d.ts +7 -0
  167. package/dist/core/records.d.ts.map +1 -1
  168. package/dist/core/records.js +12 -2
  169. package/dist/core/records.js.map +1 -1
  170. package/dist/core/registry.d.ts +40 -0
  171. package/dist/core/registry.d.ts.map +1 -0
  172. package/dist/core/registry.js +55 -0
  173. package/dist/core/registry.js.map +1 -0
  174. package/dist/core/retrieval/pass.d.ts +66 -0
  175. package/dist/core/retrieval/pass.d.ts.map +1 -0
  176. package/dist/core/retrieval/pass.js +171 -0
  177. package/dist/core/retrieval/pass.js.map +1 -0
  178. package/dist/core/root.d.ts +11 -5
  179. package/dist/core/root.d.ts.map +1 -1
  180. package/dist/core/root.js +20 -8
  181. package/dist/core/root.js.map +1 -1
  182. package/dist/core/skills.d.ts.map +1 -1
  183. package/dist/core/skills.js +7 -0
  184. package/dist/core/skills.js.map +1 -1
  185. package/dist/core/version-check.d.ts +63 -0
  186. package/dist/core/version-check.d.ts.map +1 -0
  187. package/dist/core/version-check.js +181 -0
  188. package/dist/core/version-check.js.map +1 -0
  189. package/dist/core/write-lifecycle/path-gate.d.ts +2 -2
  190. package/dist/core/write-lifecycle/path-gate.d.ts.map +1 -1
  191. package/dist/core/write-lifecycle/path-gate.js +9 -10
  192. package/dist/core/write-lifecycle/path-gate.js.map +1 -1
  193. package/dist/run.d.ts +1 -6
  194. package/dist/run.d.ts.map +1 -1
  195. package/dist/run.js +76 -19
  196. package/dist/run.js.map +1 -1
  197. package/dist/version.d.ts +8 -1
  198. package/dist/version.d.ts.map +1 -1
  199. package/dist/version.js +8 -1
  200. package/dist/version.js.map +1 -1
  201. package/package.json +12 -4
  202. package/templates/agents/canonical.md +1 -1
  203. package/templates/agents/capture-and-ingest.md +27 -8
  204. package/templates/agents/retrieval-leg-routing.md +34 -8
  205. package/templates/hooks/_resolve-ctxr.sh +37 -0
  206. package/templates/hooks/claude-code-write-gate.sh +34 -6
  207. package/templates/hooks/pre-commit.sh +15 -8
  208. package/templates/serve/shell.html +16 -2
  209. package/templates/serve/style.css +145 -3
  210. package/templates/skills/ctxr-connection-finding.md +7 -5
  211. package/templates/skills/ctxr-ingest-orchestration.md +15 -9
  212. package/templates/skills/ctxr-publish.md +7 -8
  213. package/templates/skills/ctxr-session-lifecycle.md +20 -0
  214. package/templates/skills/ctxr-upgrade.md +44 -0
  215. package/dist/commands/migrate.d.ts +0 -30
  216. package/dist/commands/migrate.d.ts.map +0 -1
  217. package/dist/commands/migrate.js +0 -56
  218. package/dist/commands/migrate.js.map +0 -1
  219. package/dist/core/migrations/add-explanation-craft-skill.d.ts +0 -26
  220. package/dist/core/migrations/add-explanation-craft-skill.d.ts.map +0 -1
  221. package/dist/core/migrations/add-explanation-craft-skill.js +0 -94
  222. package/dist/core/migrations/add-explanation-craft-skill.js.map +0 -1
  223. package/dist/core/migrations/archive-destination-from-taxonomy.d.ts +0 -35
  224. package/dist/core/migrations/archive-destination-from-taxonomy.d.ts.map +0 -1
  225. package/dist/core/migrations/archive-destination-from-taxonomy.js +0 -109
  226. package/dist/core/migrations/archive-destination-from-taxonomy.js.map +0 -1
  227. package/dist/core/migrations/drop-access-axes.d.ts +0 -24
  228. package/dist/core/migrations/drop-access-axes.d.ts.map +0 -1
  229. package/dist/core/migrations/drop-access-axes.js +0 -54
  230. package/dist/core/migrations/drop-access-axes.js.map +0 -1
  231. package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts +0 -19
  232. package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts.map +0 -1
  233. package/dist/core/migrations/drop-forge-and-workspaces-external.js +0 -49
  234. package/dist/core/migrations/drop-forge-and-workspaces-external.js.map +0 -1
  235. package/dist/core/migrations/registry.d.ts +0 -16
  236. package/dist/core/migrations/registry.d.ts.map +0 -1
  237. package/dist/core/migrations/registry.js +0 -30
  238. package/dist/core/migrations/registry.js.map +0 -1
  239. package/dist/core/migrations/rename-conventions-path.d.ts +0 -26
  240. package/dist/core/migrations/rename-conventions-path.d.ts.map +0 -1
  241. package/dist/core/migrations/rename-conventions-path.js +0 -86
  242. package/dist/core/migrations/rename-conventions-path.js.map +0 -1
  243. package/dist/core/migrations/rename-procedures-path.d.ts +0 -17
  244. package/dist/core/migrations/rename-procedures-path.d.ts.map +0 -1
  245. package/dist/core/migrations/rename-procedures-path.js +0 -45
  246. package/dist/core/migrations/rename-procedures-path.js.map +0 -1
  247. package/dist/core/migrations/types.d.ts +0 -27
  248. package/dist/core/migrations/types.d.ts.map +0 -1
  249. package/dist/core/migrations/types.js +0 -2
  250. package/dist/core/migrations/types.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Contexture (`ctxr`)
2
2
 
3
- The structured context platform for the organization — a context store that ingests, organizes, and retrieves context for any AI agent harness (Claude Code, Codex, Cursor, Cline, Gemini CLI, a cron job, a human at a terminal).
3
+ [![npm](https://img.shields.io/npm/v/ctxr-cli)](https://www.npmjs.com/package/ctxr-cli) [![CI](https://github.com/ayxuerui/contexture/actions/workflows/ci.yml/badge.svg)](https://github.com/ayxuerui/contexture/actions/workflows/ci.yml) [![license](https://img.shields.io/npm/l/ctxr-cli)](LICENSE)
4
+
5
+ **Your agents' long-term knowledge — they write it, you review it before it lands.**
6
+
7
+ Contexture turns a git repository into shared, durable knowledge, and ships the operating procedures an AI agent needs to work it: what to do with a new source, where a note belongs, when a synthesis has gone stale, how a change gets reviewed and landed. Every write lands the way code does — in a branch, past a health check, through a pull request you approve.
8
+
9
+ This is one layer of agent memory — the shared one. Your harness keeps what an agent knows about you and itself; contexture keeps what *you* know, reviewed and versioned, outliving any single agent or session. Claude Code, Codex, Cursor, Cline, Gemini CLI, a cron job, or you at a terminal all operate the same store through the same files.
10
+
11
+ A **store** is an ordinary git repository: markdown notes joined by `[[wikilinks]]`, with `contexture.yaml` as the single source of truth for how that particular store is shaped — its taxonomy, its paths, its relation vocabulary. `ctxr` is a mechanism-only CLI over it — it builds indexes, enforces invariants, and performs validated writes, but it makes no editorial decisions. The judgment lives in **skills**: portable markdown decision procedures that `ctxr init` installs into the store, which whatever agent you're talking to reads and follows. That split is the whole design, and it's what makes the same store operable from any harness.
4
12
 
5
13
  ## Install
6
14
 
@@ -8,36 +16,319 @@ The structured context platform for the organization — a context store that in
8
16
  npm install -g ctxr-cli
9
17
  ```
10
18
 
11
- The npm package is `ctxr-cli`, the executable it installs is `ctxr`, and the project is Contexture. Everything a store contains keeps the project name — `contexture.yaml`, the `.contexture/` home directory, `CONTEXTURE_*` environment variables — while `ctxr` is what you type. A `contexture` alias executable is also installed for compatibility; docs and generated files always say `ctxr`.
19
+ Requires Node 22.13 or newer.
20
+
21
+ The package is `ctxr-cli`, the command it installs is `ctxr`, and the project is Contexture — which is why a store’s own files keep the full name (`contexture.yaml`, `.contexture/`, `CONTEXTURE_*`). A `contexture` alias executable is installed too; docs and generated files always say `ctxr`.
22
+
23
+ ## Quickstart
24
+
25
+ ```sh
26
+ mkdir my-store && cd my-store
27
+ ctxr init
28
+ ctxr adapters generate # writes the harness entry file (CLAUDE.md) and its permission config
29
+ ```
30
+
31
+ `ctxr init` asks two questions, then creates the git repository (if there isn't one), scaffolds the store, and commits it:
32
+
33
+ - **Which taxonomy profile?** `para` (Projects / Areas / Resources / Archives — the default), `zettelkasten` (no layers at all; structure emerges from links), or `diataxis` (Tutorials / How-to / Reference / Explanation). Or bring your own layer list with `--taxonomy <file.yaml>`.
34
+ - **Which agent harnesses?** `claude-code` (default — its adapter generates `CLAUDE.md` plus a `.claude/settings.json` wiring up the write-gate hook) and/or `hermes-agent` (reads `AGENTS.md` directly, so it needs no entry file at all). `--harness none` opts out.
35
+
36
+ Harness adapter output is the one part `init` doesn't write itself, which is why `ctxr adapters generate` is a separate line above; `ctxr update` regenerates it from then on.
37
+
38
+ Non-interactively, pass them as flags — nothing ever blocks on a prompt:
39
+
40
+ ```sh
41
+ ctxr init --profile para --harness claude-code
42
+ ```
43
+
44
+ `init` is idempotent. Re-running it against an existing store reconciles it instead (the same code path as `ctxr update`) rather than overwriting anything.
45
+
46
+ ## What a store looks like on disk
47
+
48
+ After `ctxr init --profile para`, plus `ctxr adapters generate`:
49
+
50
+ ```
51
+ contexture.yaml single source of truth — what this store chose; the rest takes shipped defaults
52
+ AGENTS.md generated entry document — six managed sections
53
+ CLAUDE.md harness entry file; a one-line managed import of AGENTS.md
54
+ .claude/
55
+ settings.json PreToolUse hook wiring for the write gate
56
+ hooks/ the write-gate shim
57
+ skills/ -> ../.agents/skills a bridge, so Claude Code auto-discovers the canonical skills
58
+ .agents/skills/ THE canonical skills location, read natively by most harnesses
59
+ ctxr-*/SKILL.md 13 contexture-owned skills (refreshed by `ctxr update`)
60
+ frontend-design/, eli5/ vendored third-party skills, with licenses and provenance
61
+ .contexture/guidance/
62
+ house-conventions.md your store's own rules — inlined into AGENTS.md verbatim
63
+ mission.md the standing "what's active right now" document
64
+ .githooks/
65
+ pre-commit runs `doctor --staged`
66
+ pre-push refuses a push to the default branch
67
+ projects/ areas/ resources/ archives/ the taxonomy's layers
68
+ raw/inbox/ where captured material lands, before ingest
69
+ ```
70
+
71
+ These appear the first time they're needed rather than at init:
72
+
73
+ ```
74
+ raw/<YYYYMM>/ retained captures, one directory per month of ingest
75
+ .contexture/catalog/*.md one section per layer, plus uncategorized — tracked in git
76
+ .contexture/publish/ published pages
77
+ .contexture/cache/ gitignored — graph.json and the human-readable graph.md
78
+ .worktrees/ gitignored — session worktrees
79
+ ```
80
+
81
+ Two distinctions make the rest of this readable:
82
+
83
+ **Derived vs. authored.** Never hand-edit inside a `contexture:<region>` fence — the next build overwrites it. Edits *outside* a fence survive every rebuild, and that's where they belong: the catalog generates each note's entry line but preserves the one-line gloss you write next to it, forever.
84
+
85
+ **`.contexture/` is not content, and neither is `raw/`.** The store's own home directory, the skills directory, and the worktrees path are excluded from every retrieval leg by default (`retrieval.exclude_paths`), so the store's plumbing never shows up as an answer to a question about the store's subject matter. `raw/` — the capture tier — is excluded for a different reason: what arrived is not yet what you know. It is tracked in git all the same, because a retained capture is the provenance behind a note.
86
+
87
+ ## How agents drive it
88
+
89
+ `ctxr init` writes two things an agent reads, both generated from your store's own config — never from a hardcoded layout:
90
+
91
+ **`AGENTS.md`**, with six managed sections: *Store fundamentals* (root resolution, the frontmatter schema, the write path), *Mission*, *Retrieval: which leg to use*, *Capturing and ingesting*, *Placing a new note* (rendered from your actual taxonomy layers), and *Store conventions*.
92
+
93
+ **The skills**, installed as full copies at `.agents/skills/ctxr-<name>/SKILL.md`. That path is the cross-harness canonical location; a harness that reads its own branded directory instead gets that directory bridged to it (`.claude/skills/` is a symlink), so skill auto-discovery works with no wrapper and no second copy. A harness without auto-discovery reaches the same file by path from `AGENTS.md`. They're contexture-owned — refreshed by `ctxr update`, never hand-edited — and they're written against *your* store's configured taxonomy and relation vocabulary, so no shipped profile's layer names leak into them. Your own skills live alongside, untouched by sync.
94
+
95
+ | Skill | What it decides |
96
+ | --- | --- |
97
+ | `ctxr-ingest-orchestration` | What the store should know after a source — not where to file it |
98
+ | `ctxr-placement` | Which layer and location a note belongs in, and why |
99
+ | `ctxr-connection-finding` | Traversing links that already exist |
100
+ | `ctxr-connection-proposal` | Discovering links a note *should* have |
101
+ | `ctxr-rollup` | Synthesizing an entity's current state from every note referencing it |
102
+ | `ctxr-mission` | Keeping the store's priorities / back burner / debt document current |
103
+ | `ctxr-organize-audit` | Placement review, retiring, classifying broken links |
104
+ | `ctxr-derived-artifacts` | Rebuilding catalog, graph, and generated docs without clobbering them |
105
+ | `ctxr-publish` | Whether a subject earns a page, and what may appear on it |
106
+ | `ctxr-session-lifecycle` | Starting a session, re-scanning, conflicts, sequencing several PRs |
107
+ | `ctxr-submit` | Everything up to and including opening the pull request |
108
+ | `ctxr-land` | Merging after review, and reclaiming the worktree |
109
+ | `ctxr-session-capture` | What a finished session produced that is worth keeping |
110
+
111
+ Your house rules go in `.contexture/guidance/house-conventions.md`. It's inlined into `AGENTS.md`'s *Store conventions* section in full, so it loads for every harness at the start of every session — there's no separate file an agent has to remember to open.
112
+
113
+ ## A session, end to end
114
+
115
+ This is the loop you actually live in: start a session, talk to the agent, publish, submit, land.
116
+
117
+ ```mermaid
118
+ flowchart LR
119
+ S["1 · ctxr session start<br/><small>new worktree</small>"]
120
+ C["2 · chat with the agent<br/><small>AGENTS.md + skills</small>"]
121
+ K["3 · capture<br/><small>approve by ID</small>"]
122
+ P["4 · publish<br/><small>optional</small>"]
123
+ U["5 · submit<br/><small>doctor, commit, PR</small>"]
124
+ R(["review"])
125
+ L["6 · land<br/><small>merge, reclaim</small>"]
126
+
127
+ S --> C --> K --> P --> U --> R --> L
128
+
129
+ G1["write-gate hook"]
130
+ G2["pre-commit · pre-push"]
131
+ C -.- G1
132
+ U -.- G2
133
+
134
+ classDef gate fill:#fbfbfb,stroke:#bbb,stroke-dasharray:4 3,color:#666
135
+ class G1,G2 gate
136
+ ```
137
+
138
+
139
+ **1. Start.** `ctxr session start` creates a git worktree on a generated `session/…` branch off a freshly fetched `origin/<default-branch>`, and prints its path:
140
+
141
+ ```
142
+ Session worktree at "/path/to/my-store/.worktrees/session-20260903-060120-5ccbd6"
143
+ on branch "session/20260903-060120-5ccbd6" (from master).
144
+ ```
145
+
146
+ With no remote configured it falls back honestly to the local branch tip rather than failing. `cd` there and open your agent. Never work in the canonical clone — `ctxr session list` shows what's active. (The default branch is whatever `git init` actually created, recorded once at init; nothing hardcodes `main`.)
147
+
148
+ **2. Chat.** Your harness loads `AGENTS.md` — or `CLAUDE.md`, which imports it — at session start, and discovers the skills through the bridged directory. Describe what you want in plain language: *"read this article and file it"*, *"what do we know about Acme"*, *"roll up this entity"*, *"make me a page comparing these three"*. The agent picks the skill. There's nothing to memorize; the [knowledge loop](#the-knowledge-loop) below is what it runs on your behalf, documented for when you want to drive a step yourself.
149
+
150
+ **3. Wrap.** On *your* closing signal — "done", "ship it", a sign-off; never the agent's own summary — `ctxr-session-capture` fires exactly once. It proposes, in a single message with IDs, what the session produced that is durable, split by kind: a **fact** about what happened becomes a store note, a **rule for future work** becomes a house convention. Nothing is written until you approve by ID. Approved notes go through:
151
+
152
+ ```sh
153
+ ctxr session capture --proposal approved.yaml
154
+ ```
155
+
156
+ ```yaml
157
+ notes:
158
+ - id: A1
159
+ path: resources/Acme.md
160
+ mode: create # or: append
161
+ frontmatter:
162
+ title: Acme
163
+ body: |
164
+ # Acme
165
+ ```
166
+
167
+ Each item is validated and applied independently, so one bad path refuses that item alone rather than the whole proposal. Approved *conventions* aren't notes — they're a direct edit to `house-conventions.md` followed by `ctxr update`, staged in the same commit. (A guidance edit without the matching `AGENTS.md` regeneration fails `doctor --staged`, and the pre-commit hook refuses it.)
168
+
169
+ **4. Publish**, if the session earned a page. Run it before submit so the page rides the same pull request. See [Express](#5-express--publish-a-page) below.
170
+
171
+ **5. Submit.** `ctxr-submit`: re-scan git state (never replay a plan from an earlier snapshot), run the capture pass, stage surgically with `git add <paths>` — never `-A`, and derived cache paths never stage — then `ctxr doctor` over the whole store, not `--staged`: a session's job is to leave the *store* healthy, not merely to pass one commit's gate. Then commit, rename the generated branch to something meaningful before it reaches the forge, `git push -u origin <branch>`, and `gh pr create`. If `gh` has no reachable GitHub remote, the push still succeeds on its own and you get manual pull-request instructions instead of a retry loop.
172
+
173
+ **6. Land.** `ctxr-land`, after review: name the pull request explicitly rather than inferring it from whichever checkout you're standing in, read its state and mergeability with `gh pr view`, then wait for an explicit go — plan consent is not fire consent. `gh pr merge --squash`, then re-read state to confirm the forge reports `MERGED`; a transport error can arrive after a merge already succeeded, so the exit code alone is never enough. Finally fast-forward the canonical clone (`git fetch origin && git merge --ff-only`) and reclaim the worktree (`git worktree remove`, `git branch -d`) — nothing sweeps up afterward, so a worktree left here is left indefinitely.
174
+
175
+ `ctxr-session-lifecycle` covers what surrounds both halves: when to re-scan, the conflict playbook, and sequencing several pull requests.
176
+
177
+ ### Why steps 5 and 6 aren't CLI commands
178
+
179
+ They're ordinary `git` and `gh`. The CLI owns only what git cannot do — creating the worktree, applying validated note writes, running the health gates — and the sequencing, the confirmation gates, and the judgment live in the skills, where you can read and change them. That's why `ctxr session` has exactly three subcommands: `start`, `capture`, and `list`.
180
+
181
+ Three mechanical backstops hold the line underneath all of it: the **pre-commit** hook runs `doctor --staged`; the **pre-push** hook refuses a push to the default branch (`CONTEXTURE_ALLOW_DEFAULT_BRANCH_PUSH=1` is the emergency override, for emergencies); and for Claude Code the **write-gate** PreToolUse hook denies any edit under the store root made outside the active session worktree.
182
+
183
+ ## The knowledge loop
184
+
185
+ What the agent is doing inside step 2 — and how to drive any of it by hand.
186
+
187
+ Four of these are the moves knowledge work is made of: **capture** what arrives, **organize** it so it stays navigable, **distill** it into something that answers a question, **express** it for a reader who wasn't there. Retrieval isn't a stage — it's what makes the other four worth doing — but it sits second here because it's the one you reach for constantly.
188
+
189
+ ### 1. Capture — get material in without duplicating it
190
+
191
+ Capture is just writing the material into `raw/inbox/`; no CLI wraps it. It may already carry `source_type` and `source_id` — whatever fetched it usually knows them — but never `source_hash` or `ingested`, which contexture assigns once, at ingest. Then:
192
+
193
+ ```sh
194
+ ctxr source check raw/inbox/note.md --source-id https://example.com/a
195
+ # ...read the cluster, decide, write or extend the note...
196
+ ctxr ingest raw/inbox/note.md --into resources/topic.md --source-type article --source-id https://example.com/a
197
+ ```
198
+
199
+ `source check` returns one of five verdicts: `new`, `already_ingested`, `drift` (same source, its content moved — read what changed before deciding), `alternate_source_match` (this content is already here under a different identity), or `multiple_matches` — which exits non-zero and means *stop and resolve the ambiguity yourself*, never guess which existing record it is. URLs are canonicalized first, with tracking parameters stripped (`ingest.tracking_params`). `ctxr source stamp` backfills a record with no hash on file; `ctxr source add-alt` records material re-published at a new URL, rather than ingesting it twice.
200
+
201
+ `ctxr ingest` stamps the four identity fields **onto the capture**, moves it out of the inbox into `raw/<YYYYMM>/`, records its path in the destination note's `sources` list, and rebuilds the catalog. The note carries no source identity of its own, which is what lets it be rewritten, merged or restructured without invalidating the frozen hash — and what lets one note cite the several captures it was built from. `--into` is required: ingest never creates the note, because deciding what the store should know is the work.
202
+
203
+ Material that isn't markdown can't carry frontmatter, so it travels with a markdown sidecar naming it in `capture_file`; the hash is taken over that file's bytes and the two move together.
204
+
205
+ The commands are the easy part. `ctxr-ingest-orchestration` exists because ingest is **synthesis, not filing** — "create a new note" is one option among several, and the skill's decision table (new note / expand an existing one / merge two / restructure / add a section to a hub) is the actual work. Every row of that table ends in the same `ingest` call, so provenance is recorded whichever one you take. `ctxr-placement` decides where the result lives, and says why.
206
+
207
+ ### 2. Retrieve — three legs, no ranker
208
+
209
+ ```sh
210
+ ctxr catalog show --section projects # curated index, one section per layer
211
+ ctxr graph build # then query it, or read .contexture/cache/graph.md
212
+ ctxr graph query neighbors <path> --depth 2
213
+ ctxr graph query hubs
214
+ ctxr graph query orphans
215
+ ```
216
+
217
+ The **catalog** is coverage-guaranteed: every retrievable note has exactly one section, so nothing is silently unindexed. Section ids are your layer paths plus `uncategorized` (or a single `notes` section under a zero-layer profile). The **graph** enumerates structure and ranks nothing — neighbors, shortest path, hubs, clusters, bridges, orphans; `--type <relation>` follows one configured relation. `graph build` also writes a human-readable `graph.md` summarizing hubs by cluster. The third leg is **your own grep**, for literal strings the first two can't answer, scoped to exclude `.contexture/`.
218
+
219
+ There is no `ctxr search`, and no semantic ranking. That's deliberate, not missing.
220
+
221
+ → `ctxr-connection-finding` (traverse what exists), `ctxr-connection-proposal` (discover what should).
222
+
223
+ ### 3. Organize — keep it navigable as it grows
224
+
225
+ ```sh
226
+ ctxr lint # observations — orphans, broken links, material still in the inbox; always exits 0
227
+ ctxr doctor # invariants — exits non-zero, and gates every commit
228
+ ctxr catalog check --stale
229
+ ctxr archive <path>
230
+ ```
231
+
232
+ The `lint` / `doctor` split is the point: lint reports what's *worth reviewing* and never blocks; doctor reports what's *broken* and does. `ctxr archive` retires a note as a single tracked rename into `organize.archive_destination`, leaving its frontmatter byte-identical and reporting every note that linked to it — move it, don't tag it, or the active layers stop meaning anything. (The note must be committed first; archive won't rename something git isn't tracking.)
12
233
 
13
- ## Usage
234
+ → `ctxr-organize-audit`, `ctxr-derived-artifacts`.
235
+
236
+ ### 4. Distill — rollups and the mission document
14
237
 
15
238
  ```sh
16
- ctxr init # create a store (or reconcile an existing one)
17
- ctxr doctor # check the store's invariants
18
- ctxr catalog show # the curated index of retrievable notes
19
- ctxr graph build # rebuild the wikilink graph
20
- ctxr graph query hubs # ...and query it
21
- ctxr session start # every write lands via a session worktree and a PR
22
- ctxr --help # the full command list
239
+ ctxr rollup stale # entities whose backlinks moved since last synthesis
240
+ ctxr rollup gather <entity> # enumerate the source notes
241
+ ctxr rollup write <entity> --content-file draft.md # idempotent fenced write
23
242
  ```
24
243
 
25
- Every command accepts `--root <path>` (or `CONTEXTURE_ROOT`) and `--json`.
244
+ Gather and write are deterministic; the synthesis in between is the agent's, over *every* source rather than a sample. The write only ever touches the fenced region — hand-written content elsewhere in the note is never disturbed, and re-writing identical content reports `changed: false` and leaves the file byte-identical.
245
+
246
+ The store's own `.contexture/guidance/mission.md` uses the same write path, but is reported stale on elapsed time (`organize.rollup_stale_days`) rather than on backlinks.
247
+
248
+ → `ctxr-rollup`, `ctxr-mission`.
249
+
250
+ ### 5. Express — publish a page
26
251
 
27
- ## Releasing
252
+ ```sh
253
+ ctxr publish gather --under resources/ # or --note <path>, or --entity <name>
254
+ ctxr publish new comparison # scaffolds the page folder and its sibling README
255
+ ctxr publish check .contexture/publish/comparison
256
+ ```
28
257
 
29
- Publishing to npm is automated: merging to `main` publishes whenever `package.json`'s version isn't
30
- already on the registry, via [`.github/workflows/release.yml`](.github/workflows/release.yml).
31
- Ordinary merges are a no-op — only a version bump triggers a publish.
258
+ `gather` resolves a subject to its note set — never a hand-picked list, which is how an unintended note slips onto a page unnoticed. `check` runs the structural gates: no external references, viewport meta, a print rule, provenance, the sibling README, script syntax. What a page may *contain*, given who will read it, is a judgment `ctxr-publish` walks you through and no check can make.
32
259
 
33
- To cut a release:
260
+ → `ctxr-publish`, plus the vendored `frontend-design` and `eli5` skills for the craft contexture supplies none of.
261
+
262
+ ## Reading a store in a browser
34
263
 
35
264
  ```sh
36
- git checkout -b chore/release-X.Y.Z
37
- npm version X.Y.Z --no-git-tag-version # bumps package.json and package-lock.json together
38
- # hand-edit src/version.ts's CLI_VERSION to match X.Y.Z
265
+ ctxr serve
39
266
  ```
40
267
 
41
- Open a PR and merge it. The workflow then builds, tests, publishes to npm (via trusted publishing —
42
- no stored token), tags the commit `vX.Y.Z`, and creates a GitHub Release. `test/unit/version-sync.test.ts`
43
- guards against `CLI_VERSION` drifting from `package.json`'s version on every PR.
268
+ Renders notes, catalog sections, the graph document, and published pages as cross-linked HTML. It binds loopback (`127.0.0.1`) by default. `--host` widens that, but note what it does not change: `serve` applies **no per-requester filtering at any bind address**. Widening it exposes the whole store to whatever can reach that address, so only do it behind a front end you've arranged yourself.
269
+
270
+ A published page's navigation label follows its own declared `<title>`, falling back to its folder name when it declares none. The header's light/dark/system links choose a display theme, and the ☰ control shows and hides the navigation — both persist across pages via cookies, and neither requires client-side script. A published page itself is still served byte-verbatim, so neither the theme nor the navigation reaches into it; `ctxr publish new`'s scaffold instead follows the viewer's own system preference on its own.
271
+
272
+ ## Keeping a store current
273
+
274
+ ```sh
275
+ ctxr version # the installed version, and where it is installed from
276
+ ctxr version --check # compare it against the latest published release
277
+ ctxr update # refresh every contexture-owned file to the installed version
278
+ ctxr verify --portable # prove the store works from a harness with no harness-specific state
279
+ ```
280
+
281
+ `ctxr update` re-renders the `AGENTS.md` sections, skill copies, hooks, and adapter outputs — run it after upgrading the CLI, and after editing your house conventions.
282
+
283
+ ### Upgrading the CLI
284
+
285
+ `ctxr session start` and `ctxr update` check whether a newer release has been published and say so, once per session and once per update. The notice goes to stderr and appears as an `info` finding in `--json` output; it never changes either command's exit code, and a registry that is slow, unreachable, or behind a proxy simply produces no advice rather than a failure. `ctxr doctor` and `ctxr init` never make the request at all — a commit must not depend on the network, and `init` stays offline.
286
+
287
+ The `ctxr-upgrade` skill performs the upgrade: it reads the live answer, refuses to instruct a global install when the executable it finds is a linked working copy, asks before changing anything, and re-renders the store *after* the package upgrade rather than before. By hand, that is `npm install -g ctxr-cli@latest` followed by `ctxr update`, in that order.
288
+
289
+ To turn the check off, set `update_check.enabled` to `false` in `contexture.yaml`, or set `CONTEXTURE_UPDATE_CHECK=0` for a single invocation. `update_check.ttl_hours` sets how long a resolved answer is reused (a day by default); the cache lives in the store's gitignored `.contexture/cache/`.
290
+
291
+ `schema_version` in `contexture.yaml` versions *store state* — the config shape and frontmatter conventions — as a monotonic integer independent of the npm package version. contexture ships no migration mechanism, so the number is a gate: a store whose recorded version is not the one your CLI supports is refused rather than half-read, in **either** direction. Newer, because the CLI cannot know that shape; older, because it no longer reads it. A release that changes the store's shape bumps the version and documents the one-time fixup in its release notes.
292
+
293
+ ### The config records decisions, not values
294
+
295
+ A generated `contexture.yaml` is short, and that's the design: **any key it doesn't declare takes contexture's shipped default.** So everything the file *does* contain is a choice someone made, and a store that simply agrees with a convention follows it as the convention improves — a later release that changes a shipped default reaches every store that never overrode it, with no edit to its config file.
296
+
297
+ Three kinds of key are always written out, because no constant could be right for them:
298
+
299
+ - **Store facts** — `taxonomy`, and `git.default_branch`, which records whatever branch your repository actually uses rather than a guess.
300
+ - **Taxonomy-derived** — `organize.archive_destination`, resolved from the profile at init. Defaulting it to a flat constant would send a PARA store's archived notes to `archive/` while its own taxonomy declares `archives/`.
301
+ - **Opt-ins** — `organize.mission_path`, where *not* declaring the key is what says the store has no mission document.
302
+
303
+ To pin a value against a future default change, declare it. Nothing rewrites what you declared: `ctxr init` against a directory with no configuration is the only thing that ever writes `contexture.yaml`, and reconciling an existing store leaves the file alone.
304
+
305
+ ## Command reference
306
+
307
+ | Command | What it does |
308
+ | --- | --- |
309
+ | `init` | Create a store, or reconcile an existing one |
310
+ | `doctor [--staged]` | Check real invariants; non-zero on any failure |
311
+ | `lint` | Health observations; always exits 0 |
312
+ | `catalog build \| check \| show` | Build, verify coverage, print a section |
313
+ | `graph build` | Rebuild the wikilink graph and its document |
314
+ | `graph query …` | `neighbors`, `path`, `subgraph`, `hubs`, `clusters`, `bridges`, `orphans` |
315
+ | `ingest <path> --into <note>` | Retain a capture with its source identity, and cite it from a note |
316
+ | `source hash \| check \| stamp \| add-alt` | Dedupe and source identity, ahead of ingest |
317
+ | `archive <path>` | Retire a note via one tracked rename |
318
+ | `entry append <path>` | Append a line into a `contexture:<region>` fenced region |
319
+ | `rollup gather \| write \| stale` | Entity synthesis: enumerate, write, find what's out of date |
320
+ | `publish gather \| new \| check` | Resolve a subject, scaffold a page, run the structural gates |
321
+ | `session start \| capture \| list` | Session worktrees, and applying an approved capture proposal |
322
+ | `adapters generate \| write-gate` | Regenerate harness outputs; the write-gate hook target |
323
+ | `serve` | Read the store in a browser |
324
+ | `update` | Bring contexture-owned files up to the installed version |
325
+ | `version [--check]` | Report the installed version; `--check` compares it against the latest published release |
326
+ | `verify [--portable]` | Exercise core store operations end to end |
327
+
328
+ Every command accepts `--root <path>`, `--json`, and `--no-input`. The store root resolves in exactly one order: `--root`, then `CONTEXTURE_STORE_ROOT`, then walking up from the current directory looking for `contexture.yaml`. Nothing else selects it.
329
+
330
+ Exit codes are a fixed taxonomy, so scripts and hooks can rely on them: `0` success, `1` an internal error (a bug), `2` a usage error (bad arguments, no store root, not a git repository), `3` a check that ran correctly and found a real problem. Success never masks a finding — `doctor` and `catalog check` exit `3` on a violation, never `0`.
331
+
332
+ ## Contributing
333
+
334
+ Build, test, the spec-first workflow, and the release process are in [CONTRIBUTING.md](CONTRIBUTING.md). Contexture is MIT licensed — see [LICENSE](LICENSE).
@@ -43,16 +43,11 @@ export declare const SUPPORTED_ADAPTER_INTERFACE_VERSION: Record<AdapterKind, nu
43
43
  * itself is invoked by (a hook command): `root` is deleted the moment the
44
44
  * session worktree that generated it lands, so a path anchored there goes
45
45
  * stale as soon as that happens.
46
- *
47
- * `binPath` is this installation's own resolved CLI entrypoint, for a
48
- * harness whose config needs to shell out back to `ctxr` (a generated hook
49
- * script). See claude-code.ts's permissionConfig for the concrete case.
50
46
  */
51
47
  export interface PermissionConfigInput {
52
48
  root: string;
53
49
  mainRoot: string;
54
50
  worktreesPath: string;
55
- binPath: string;
56
51
  }
57
52
  export interface HarnessGenerationAdapter extends Adapter<'harness-generation'> {
58
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAE/C,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IAC1D,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAI3E,CAAC;AAEF;;;;;;;;;GASG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAyB,SAAQ,OAAO,CAAC,oBAAoB,CAAC;IAC7E;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,0LAA0L;IAC1L,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,kFAAkF;IAClF,gBAAgB,CAAC,EAAE;QACjB,iEAAiE;QAC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O,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAWtG"}
1
+ {"version":3,"file":"adapters-generate.d.ts","sourceRoot":"","sources":["../../src/commands/adapters-generate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,0BAA0B,EAAE,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wDAAwD;AACxD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAgDhH;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAWtG"}
@@ -4,7 +4,7 @@ import { agentsMdPath } from '../core/agents-doc.js';
4
4
  import { ExitCode } from '../core/exit-codes.js';
5
5
  import { upsertFencedRegionInFile } from '../core/fs/fenced-region.js';
6
6
  import { mainWorktreePath } from '../core/git/worktree.js';
7
- import { installTemplatedHookScript, resolveOwnBinPath } from '../core/hooks.js';
7
+ import { installTemplatedHookScript } from '../core/hooks.js';
8
8
  import { mergeJsonArrayLists } from '../core/json-config-merge.js';
9
9
  import { harnessEntryFence } from '../core/markers.js';
10
10
  export const requires = { store: 'required' };
@@ -33,11 +33,10 @@ export async function generateAdapterOutputs(git, store) {
33
33
  root: store.root,
34
34
  mainRoot,
35
35
  worktreesPath: store.config.session.worktrees_path,
36
- binPath: resolveOwnBinPath(),
37
36
  };
38
37
  let permChanged = false;
39
38
  if (adapter.permissionConfig.hookFile) {
40
- const { changed: hookScriptChanged } = await installTemplatedHookScript(store.root, adapter.permissionConfig.hookFile.targetPath, adapter.permissionConfig.hookFile.templateFileName, { __CONTEXTURE_BIN__: input.binPath });
39
+ const { changed: hookScriptChanged } = await installTemplatedHookScript(store.root, adapter.permissionConfig.hookFile.targetPath, adapter.permissionConfig.hookFile.templateFileName);
41
40
  permChanged = permChanged || hookScriptChanged;
42
41
  }
43
42
  const permPath = path.join(store.root, adapter.permissionConfig.path);
@@ -1 +1 @@
1
- {"version":3,"file":"adapters-generate.js","sourceRoot":"","sources":["../../src/commands/adapters-generate.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAqC,MAAM,8BAA8B,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAW/D;;;;;;GAMG;AACH,wDAAwD;AACxD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,GAAc,EAAE,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,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,mBAAmB,CAAC,QAAQ,EAAE,KAAmB,EAAE;gBACzF,MAAM,EAAE,OAAsB;aAC/B,CAAC,CAAC;YACH,WAAW,GAAG,WAAW,IAAI,YAAY,CAAC;YAE1C,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,KAAY;IACrD,MAAM,KAAK,GAAG,MAAM,sBAAsB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAC3D,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,IAAI,EAAE,EAAE,KAAK,EAAE;QACf,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,sBAAsB,YAAY,qBAAqB,KAAK,CAAC,MAAM,GAAG,YAAY,sBAAsB;QACtH,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { CommandOutcome, CommandRequires } from '../core/command.js';
2
+ import { type GatherOutcome } from '../core/retrieval/pass.js';
3
+ import type { Store } from '../core/store.js';
4
+ export declare const requires: CommandRequires;
5
+ export interface ContextGatherFlags {
6
+ seed?: string[];
7
+ section?: string[];
8
+ under?: string[];
9
+ entity?: string[];
10
+ hops?: number;
11
+ direction?: 'in' | 'out' | 'both';
12
+ type?: string;
13
+ maxNotes?: number;
14
+ }
15
+ /**
16
+ * compose-the-retrieval-pass spec: entry selectors in, the graph-expanded
17
+ * neighbourhood out, each note carrying its gloss and the evidence for why it
18
+ * is there. Agent-facing enumeration only — like `rollup gather` and `publish
19
+ * gather`, it finds and orders candidates and never reads or synthesizes them.
20
+ */
21
+ export declare function execute(store: Store, flags?: ContextGatherFlags): Promise<CommandOutcome<GatherOutcome>>;
22
+ //# sourceMappingURL=context-gather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-gather.d.ts","sourceRoot":"","sources":["../../src/commands/context-gather.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1E,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAE,kBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAyBlH"}
@@ -0,0 +1,36 @@
1
+ import { ExitCode } from '../core/exit-codes.js';
2
+ import { readAdmittedGraph } from '../core/graph/persist.js';
3
+ import { listNotes } from '../core/notes/list.js';
4
+ import { gather } from '../core/retrieval/pass.js';
5
+ export const requires = { store: 'required' };
6
+ /**
7
+ * compose-the-retrieval-pass spec: entry selectors in, the graph-expanded
8
+ * neighbourhood out, each note carrying its gloss and the evidence for why it
9
+ * is there. Agent-facing enumeration only — like `rollup gather` and `publish
10
+ * gather`, it finds and orders candidates and never reads or synthesizes them.
11
+ */
12
+ export async function execute(store, flags = {}) {
13
+ const notes = await listNotes(store.root, store.config);
14
+ const graph = await readAdmittedGraph(store);
15
+ const options = {
16
+ seeds: flags.seed,
17
+ sections: flags.section,
18
+ under: flags.under,
19
+ entities: flags.entity,
20
+ hops: flags.hops,
21
+ direction: flags.direction,
22
+ type: flags.type,
23
+ maxNotes: flags.maxNotes,
24
+ };
25
+ const data = await gather(store, notes, graph, options);
26
+ const truncated = data.budget.truncated ? `, ${data.budget.omitted} omitted by the cap of ${data.budget.maxNotes}` : '';
27
+ return {
28
+ exitCode: ExitCode.Ok,
29
+ data,
30
+ findings: [],
31
+ humanSummary: `${data.budget.returned} note(s) within ${data.hops} hop(s)${truncated}.`,
32
+ storeRoot: store.root,
33
+ schemaVersion: store.config.schema_version,
34
+ };
35
+ }
36
+ //# sourceMappingURL=context-gather.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-gather.js","sourceRoot":"","sources":["../../src/commands/context-gather.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAA0C,MAAM,2BAA2B,CAAC;AAG3F,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAa/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAY,EAAE,KAAK,GAAuB,EAAE;IACxE,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,KA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AAE,KAAK,CAAC,CAAC;AAElD,wBAAsB,eAAe,CACnC,KAAK,EAAE,KAAK,EACZ,KAAK,GAAE,aAAkB,GACxB,OAAO,CAAC,cAAc,CAAC;IAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAAC,CAIvD;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,KAAK,EACZ,KAAK,GAAE,YAAiB,GACvB,OAAO,CAAC,cAAc,CAAC;IAAE,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAAC,CAIrD"}
@@ -1,17 +1,15 @@
1
- import { GraphNodeNotFoundError, GraphNotBuiltError } from '../core/errors.js';
1
+ import { GraphNodeNotFoundError } from '../core/errors.js';
2
2
  import { ExitCode } from '../core/exit-codes.js';
3
3
  import { bridges, clusters, hubs, neighbors, orphans, shortestPath, subgraph, } from '../core/graph/query.js';
4
- import { readGraph } from '../core/graph/persist.js';
4
+ import { readAdmittedGraph } from '../core/graph/persist.js';
5
5
  export const requires = { store: 'required' };
6
6
  /**
7
- * Every subcommand below routes through this one loader, so a query can
8
- * never read a graph the store has not built.
7
+ * Every subcommand below routes through this one loader, so a query can never
8
+ * read a graph the store has not built — nor one carrying a note the store no
9
+ * longer admits, which `readAdmittedGraph` refuses on behalf of every caller.
9
10
  */
10
11
  async function loadGraph(store) {
11
- const graph = await readGraph(store);
12
- if (!graph)
13
- throw new GraphNotBuiltError();
14
- return graph;
12
+ return readAdmittedGraph(store);
15
13
  }
16
14
  function assertNode(graph, nodeId) {
17
15
  if (!graph.nodes.some((n) => n.id === nodeId))
@@ -1 +1 @@
1
- {"version":3,"file":"graph-query.js","sourceRoot":"","sources":["../../src/commands/graph-query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,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,CAAC;IAC/B,OAAO,OAAO,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,cAAc,CAAC,CAAC;AAC9E,CAAC;AAMD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAY,EACZ,KAAK,GAAiB,EAAE;IAExB,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACpF,OAAO,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,MAAM,CAAC,MAAM,8CAA8C,CAAC,CAAC;AACjH,CAAC"}
@@ -4,25 +4,38 @@ import type { Store } from '../core/store.js';
4
4
  export declare const requires: CommandRequires;
5
5
  export interface IngestFlags {
6
6
  path: string;
7
+ into: string;
7
8
  sourceType: string;
8
9
  sourceId: string;
9
10
  }
10
11
  export interface IngestData {
11
- path: string;
12
+ /** Where the capture was retained — its path after the move out of the inbox. */
13
+ capture: string;
14
+ /** The note that now cites it. */
15
+ note: string;
12
16
  sourceType: string;
13
17
  sourceId: string;
14
18
  sourceHash: string;
15
19
  ingested: string;
16
20
  }
17
21
  /**
18
- * context-ingest spec: identity fields are assigned once, here, and never
19
- * recomputed from the live body afterward — the hash computed in this
20
- * function IS the frozen source-hash for this note's lifetime. Rebuilding
21
- * the catalog before returning (rather than documenting it as a required
22
- * next step) is this codebase's choice for task 6.6: a successful write
23
- * leaves its own derived-artifact consequence consistent immediately,
24
- * matching every other writer in the system (init's .gitignore/AGENTS.md
25
- * reconciliation, catalog build itself).
22
+ * context-ingest spec: identity is assigned once, here, onto the CAPTURE —
23
+ * the file that arrived — and never recomputed from it afterwards. The
24
+ * destination note is the synthesis, free to be rewritten without touching
25
+ * the hash, and it may already exist: expanding, merging and restructuring
26
+ * record provenance on the same footing as creating, which is the whole point
27
+ * of retaining the capture rather than consuming it.
28
+ *
29
+ * Order matters for resumability. The capture is written to its retained
30
+ * location before the old one is removed, and the note is cited last, so an
31
+ * interruption leaves either an un-ingested capture or a retained one that a
32
+ * re-run can cite — never a note citing a path that does not exist.
33
+ *
34
+ * Rebuilding the catalog before returning (rather than documenting it as a
35
+ * required next step) is this codebase's choice: a successful write leaves
36
+ * its own derived-artifact consequence consistent immediately, matching every
37
+ * other writer in the system. The retained capture takes no catalog entry —
38
+ * the capture root is a retrieval exclusion, so it is not a note.
26
39
  */
27
40
  export declare function execute(env: RunEnv, store: Store, flags: IngestFlags): Promise<CommandOutcome<IngestData>>;
28
41
  //# sourceMappingURL=ingest.d.ts.map