@north-light/crouter 0.3.227 → 0.3.228

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 (286) hide show
  1. package/dist/api/client.d.ts +5 -5
  2. package/dist/api/client.js +3 -3
  3. package/dist/api/dto/broker-ops.d.ts +8 -0
  4. package/dist/api/dto/memory.d.ts +8 -7
  5. package/dist/api/dto/memory.js +2 -2
  6. package/dist/builtin-memory/05-kinds/design/00-base.md +3 -4
  7. package/dist/builtin-memory/05-kinds/design/01-orchestrator.md +4 -3
  8. package/dist/builtin-memory/05-kinds/design/design-contract.md +3 -6
  9. package/dist/builtin-memory/05-kinds/plan/00-base.md +3 -4
  10. package/dist/builtin-memory/05-kinds/plan/01-orchestrator.md +4 -5
  11. package/dist/builtin-memory/05-kinds/plan/plan-contract.md +5 -13
  12. package/dist/builtin-memory/design/guide.md +38 -16
  13. package/dist/builtin-memory/design/roadmap.md +4 -4
  14. package/dist/builtin-memory/insights/init.md +5 -5
  15. package/dist/builtin-memory/internal/INDEX.md +1 -1
  16. package/dist/builtin-memory/internal/examples/INDEX.md +1 -1
  17. package/dist/builtin-memory/internal/memory-loading.md +6 -6
  18. package/dist/builtin-memory/internal/plugins.md +1 -1
  19. package/dist/builtin-memory/plan/guide.md +53 -0
  20. package/dist/builtin-memory/plan/roadmap.md +10 -8
  21. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +50 -37
  22. package/dist/clients/attach/__tests__/pane-tag-successor.test.js +56 -0
  23. package/dist/clients/attach/__tests__/profile-files.test.js +21 -0
  24. package/dist/clients/attach/chrome/inbox-strip.js +11 -7
  25. package/dist/clients/attach/session/pane-tag.d.ts +28 -2
  26. package/dist/clients/attach/session/pane-tag.js +48 -22
  27. package/dist/clients/attach/session/profile-files.d.ts +6 -0
  28. package/dist/clients/attach/session/profile-files.js +44 -11
  29. package/dist/clients/attach/slash/dispatch.js +4 -7
  30. package/dist/clients/attach/viewer.js +588 -596
  31. package/dist/commands/__tests__/surface-reload-target.test.js +21 -0
  32. package/dist/commands/api-client.d.ts +3 -7
  33. package/dist/commands/api-client.js +7 -12
  34. package/dist/commands/memory/__tests__/command-selector-and-mutation-guards.test.js +292 -0
  35. package/dist/commands/memory/__tests__/repository-root-lint.test.js +146 -0
  36. package/dist/commands/memory/delete.js +51 -24
  37. package/dist/commands/memory/edit.js +50 -10
  38. package/dist/commands/memory/find.js +105 -56
  39. package/dist/commands/memory/history.js +51 -31
  40. package/dist/commands/memory/lint.d.ts +0 -9
  41. package/dist/commands/memory/lint.js +78 -322
  42. package/dist/commands/memory/list.d.ts +12 -4
  43. package/dist/commands/memory/list.js +64 -25
  44. package/dist/commands/memory/move.js +103 -73
  45. package/dist/commands/memory/origin.js +35 -5
  46. package/dist/commands/memory/read.d.ts +4 -0
  47. package/dist/commands/memory/read.js +132 -80
  48. package/dist/commands/memory/shared.d.ts +115 -25
  49. package/dist/commands/memory/shared.js +331 -74
  50. package/dist/commands/memory/write.js +72 -21
  51. package/dist/commands/memory.js +2 -2
  52. package/dist/commands/node/lifecycle.js +2 -2
  53. package/dist/commands/pkg/market-manage.js +25 -24
  54. package/dist/commands/pkg/plugin-manage.d.ts +22 -6
  55. package/dist/commands/pkg/plugin-manage.js +118 -25
  56. package/dist/commands/pkg/shared.d.ts +8 -0
  57. package/dist/commands/pkg/shared.js +23 -20
  58. package/dist/commands/surface-reload.d.ts +5 -0
  59. package/dist/commands/surface-reload.js +9 -1
  60. package/dist/commands/sys/__tests__/migrate.test.js +1140 -22
  61. package/dist/commands/sys/__tests__/sync-project-guidance.test.js +218 -0
  62. package/dist/commands/sys/migrate.js +126 -140
  63. package/dist/commands/sys/panels/profiles-panel.d.ts +66 -0
  64. package/dist/commands/sys/panels/profiles-panel.js +599 -0
  65. package/dist/commands/sys/settings-shell.d.ts +4 -2
  66. package/dist/commands/sys/settings-shell.js +35 -4
  67. package/dist/commands/sys/settings.js +21 -5
  68. package/dist/commands/sys/sync-deps.d.ts +2 -0
  69. package/dist/commands/sys/sync-deps.js +26 -15
  70. package/dist/commands/sys/sync-project-guidance.js +228 -145
  71. package/dist/commands/sys/sync-skills.js +28 -17
  72. package/dist/commands/sys/update.js +11 -3
  73. package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +15 -2
  74. package/dist/core/__tests__/config-change-delta.test.js +106 -0
  75. package/dist/core/__tests__/context-intro.test.js +13 -9
  76. package/dist/core/__tests__/daemon-boot.test.js +22 -16
  77. package/dist/core/__tests__/fixtures/memory-slash-live-probe.js +5 -1
  78. package/dist/core/__tests__/human-deliver.test.js +19 -0
  79. package/dist/core/__tests__/inline-memory-refs.test.js +50 -46
  80. package/dist/core/__tests__/{serial → integration}/broker-fork-seam.test.js +1 -1
  81. package/dist/core/__tests__/{serial → integration}/broker-sdk-wiring.test.js +1 -1
  82. package/dist/core/__tests__/{serial → integration}/broker-snapshot-history.test.js +1 -1
  83. package/dist/core/__tests__/{serial → integration}/command-plugins.test.js +94 -3
  84. package/dist/core/__tests__/{serial → integration}/deferred-no-wake.test.js +1 -1
  85. package/dist/core/__tests__/{serial → integration}/flagship-lifecycle.test.js +13 -27
  86. package/dist/core/__tests__/{serial → integration}/host-teardown-process-group.test.js +1 -1
  87. package/dist/core/__tests__/{serial → integration}/human-deliver-e2e.test.js +1 -1
  88. package/dist/core/__tests__/{live-mutation-verbs.test.js → integration/live-mutation-verbs.test.js} +22 -33
  89. package/dist/core/__tests__/{serial → integration}/live-mutation.test.js +21 -41
  90. package/dist/core/__tests__/integration/refresh-stall-recycle.test.d.ts +1 -0
  91. package/dist/core/__tests__/{serial → integration}/refresh-stall-recycle.test.js +1 -1
  92. package/dist/core/__tests__/integration/revive.test.d.ts +1 -0
  93. package/dist/core/__tests__/{serial → integration}/revive.test.js +38 -19
  94. package/dist/core/__tests__/integration/spawn-root.test.d.ts +1 -0
  95. package/dist/core/__tests__/{serial → integration}/spawn-root.test.js +104 -1
  96. package/dist/core/__tests__/integration/subscription-delivery.test.d.ts +1 -0
  97. package/dist/core/__tests__/{serial → integration}/subscription-delivery.test.js +1 -1
  98. package/dist/core/__tests__/integration/tmux-surface.test.d.ts +1 -0
  99. package/dist/core/__tests__/{serial → integration}/tmux-surface.test.js +1 -1
  100. package/dist/core/__tests__/integration/worktree-land.test.d.ts +1 -0
  101. package/dist/core/__tests__/integration/worktree-land.test.js +400 -0
  102. package/dist/core/__tests__/integration/worktree-reap.test.d.ts +1 -0
  103. package/dist/core/__tests__/{serial/worktree.test.js → integration/worktree-reap.test.js} +6 -338
  104. package/dist/core/__tests__/kickoff.test.js +16 -5
  105. package/dist/core/__tests__/memory-resolver-precedence.test.js +122 -91
  106. package/dist/core/__tests__/nested-store-discovery.test.js +5 -3
  107. package/dist/core/__tests__/on-read-crouter-home-fence.test.js +2 -1
  108. package/dist/core/__tests__/on-read-dedup-resume.test.js +39 -27
  109. package/dist/core/__tests__/on-read-nested-store.test.js +19 -13
  110. package/dist/core/__tests__/profile-project-memory-delivery.test.js +138 -44
  111. package/dist/core/__tests__/repository-association.test.d.ts +1 -0
  112. package/dist/core/__tests__/repository-association.test.js +153 -0
  113. package/dist/core/__tests__/repository-root-identity.test.d.ts +1 -0
  114. package/dist/core/__tests__/repository-root-identity.test.js +219 -0
  115. package/dist/core/__tests__/seam/memory-slash-node-relative-inventory.test.js +27 -11
  116. package/dist/core/__tests__/warm-claim-preference-snapshot.test.d.ts +1 -0
  117. package/dist/core/__tests__/warm-claim-preference-snapshot.test.js +40 -0
  118. package/dist/core/canvas/canvas.d.ts +3 -0
  119. package/dist/core/canvas/canvas.js +30 -10
  120. package/dist/core/canvas/db.js +28 -1
  121. package/dist/core/canvas/paths.d.ts +4 -6
  122. package/dist/core/canvas/paths.js +8 -6
  123. package/dist/core/canvas/render-source.js +2 -2
  124. package/dist/core/canvas/types.d.ts +9 -13
  125. package/dist/core/exclusive-lock.d.ts +2 -0
  126. package/dist/core/exclusive-lock.js +21 -0
  127. package/dist/core/git.d.ts +0 -1
  128. package/dist/core/git.js +0 -3
  129. package/dist/core/human/__tests__/integration/inbox-core.test.d.ts +1 -0
  130. package/dist/core/human/feedback-companion.js +3 -0
  131. package/dist/core/human/scan.js +8 -1
  132. package/dist/core/keybindings/catalog.d.ts +2 -2
  133. package/dist/core/keybindings/catalog.js +2 -1
  134. package/dist/core/memory/doc-link-grammar.js +2 -2
  135. package/dist/core/memory/history.d.ts +24 -0
  136. package/dist/core/memory/history.js +66 -1
  137. package/dist/core/memory/identity.d.ts +65 -0
  138. package/dist/core/memory/identity.js +185 -0
  139. package/dist/core/memory/inline-ref-guidance.d.ts +1 -1
  140. package/dist/core/memory/inline-ref-guidance.js +1 -1
  141. package/dist/core/memory/inline-ref-inventory.d.ts +3 -10
  142. package/dist/core/memory/inline-ref-inventory.js +30 -62
  143. package/dist/core/memory/lint.d.ts +129 -0
  144. package/dist/core/memory/lint.js +517 -0
  145. package/dist/core/memory/project-namespace.d.ts +31 -0
  146. package/dist/core/memory/project-namespace.js +85 -0
  147. package/dist/core/memory/repository-association.d.ts +31 -0
  148. package/dist/core/memory/repository-association.js +129 -0
  149. package/dist/core/memory/tree.d.ts +39 -0
  150. package/dist/core/memory/tree.js +93 -0
  151. package/dist/core/memory-resolver.d.ts +193 -90
  152. package/dist/core/memory-resolver.js +461 -375
  153. package/dist/core/nested-stores.js +6 -13
  154. package/dist/core/profiles/select.d.ts +4 -1
  155. package/dist/core/profiles/select.js +108 -48
  156. package/dist/core/review/__tests__/capture-origin.test.js +2 -2
  157. package/dist/core/review/__tests__/stage-identity.test.js +2 -2
  158. package/dist/core/review/companion.js +11 -2
  159. package/dist/core/runtime/bearings.d.ts +2 -2
  160. package/dist/core/runtime/bearings.js +3 -3
  161. package/dist/core/runtime/broker/daemon-ops.d.ts +2 -2
  162. package/dist/core/runtime/broker/rebind.js +5 -0
  163. package/dist/core/runtime/broker-extension-render.d.ts +7 -3
  164. package/dist/core/runtime/broker-extension-render.js +10 -5
  165. package/dist/core/runtime/broker-persona-guidance.d.ts +19 -5
  166. package/dist/core/runtime/broker-persona-guidance.js +122 -27
  167. package/dist/core/runtime/deliver-live.d.ts +16 -4
  168. package/dist/core/runtime/deliver-live.js +29 -15
  169. package/dist/core/runtime/kickoff.d.ts +3 -3
  170. package/dist/core/runtime/kickoff.js +8 -16
  171. package/dist/core/runtime/lifecycle.js +2 -3
  172. package/dist/core/runtime/nodes.d.ts +3 -4
  173. package/dist/core/runtime/nodes.js +3 -4
  174. package/dist/core/runtime/persona.d.ts +8 -12
  175. package/dist/core/runtime/persona.js +24 -96
  176. package/dist/core/runtime/promote.d.ts +2 -2
  177. package/dist/core/runtime/promote.js +8 -21
  178. package/dist/core/runtime/revive.js +20 -17
  179. package/dist/core/runtime/spawn.js +18 -7
  180. package/dist/core/runtime/tmux-bindings.js +2 -3
  181. package/dist/core/runtime/warm-pool.js +3 -4
  182. package/dist/core/scope.js +2 -0
  183. package/dist/core/self-update.d.ts +0 -2
  184. package/dist/core/self-update.js +2 -35
  185. package/dist/core/substrate/__tests__/surface-match-memory-read.test.d.ts +1 -0
  186. package/dist/core/substrate/__tests__/surface-match-memory-read.test.js +28 -0
  187. package/dist/core/substrate/index.d.ts +2 -2
  188. package/dist/core/substrate/index.js +1 -1
  189. package/dist/core/substrate/injected-store.d.ts +43 -27
  190. package/dist/core/substrate/injected-store.js +208 -104
  191. package/dist/core/substrate/listings.d.ts +19 -12
  192. package/dist/core/substrate/listings.js +75 -52
  193. package/dist/core/substrate/on-read-node.d.ts +4 -7
  194. package/dist/core/substrate/on-read-node.js +6 -8
  195. package/dist/core/substrate/on-read.d.ts +22 -25
  196. package/dist/core/substrate/on-read.js +103 -147
  197. package/dist/core/substrate/render-node.d.ts +4 -7
  198. package/dist/core/substrate/render-node.js +5 -7
  199. package/dist/core/substrate/render.d.ts +21 -3
  200. package/dist/core/substrate/render.js +291 -223
  201. package/dist/core/substrate/schema.d.ts +1 -13
  202. package/dist/core/substrate/schema.js +5 -40
  203. package/dist/core/substrate/session-cache.d.ts +14 -4
  204. package/dist/core/substrate/session-cache.js +40 -22
  205. package/dist/core/substrate/surface-match.d.ts +9 -7
  206. package/dist/core/substrate/surface-match.js +26 -25
  207. package/dist/daemon/__tests__/helpers/source-daemon.d.ts +30 -0
  208. package/dist/daemon/__tests__/helpers/source-daemon.js +174 -0
  209. package/dist/daemon/__tests__/integration/migration-startup.test.d.ts +1 -0
  210. package/dist/daemon/__tests__/integration/migration-startup.test.js +97 -0
  211. package/dist/daemon/api/__tests__/bridge-heartbeat.test.js +21 -5
  212. package/dist/daemon/api/handlers/broker-ops.js +21 -16
  213. package/dist/daemon/api/handlers/memory.js +2 -0
  214. package/dist/daemon/crtrd.js +2 -0
  215. package/dist/daemon/human/finish.js +8 -1
  216. package/dist/daemon/manage.d.ts +0 -1
  217. package/dist/daemon/manage.js +7 -16
  218. package/dist/daemon/startup-policy.d.ts +1 -0
  219. package/dist/daemon/startup-policy.js +1 -0
  220. package/dist/migrations/001-surfaces-frontmatter.js +21 -109
  221. package/dist/migrations/002-profile-project-memory.js +1 -0
  222. package/dist/migrations/003-repository-root-memory-identity/front-door.d.ts +26 -0
  223. package/dist/migrations/003-repository-root-memory-identity/front-door.js +231 -0
  224. package/dist/migrations/003-repository-root-memory-identity/index.d.ts +2 -0
  225. package/dist/migrations/003-repository-root-memory-identity/index.js +513 -0
  226. package/dist/migrations/003-repository-root-memory-identity/references.d.ts +95 -0
  227. package/dist/migrations/003-repository-root-memory-identity/references.js +469 -0
  228. package/dist/migrations/003-repository-root-memory-identity/repository-facts.d.ts +39 -0
  229. package/dist/migrations/003-repository-root-memory-identity/repository-facts.js +349 -0
  230. package/dist/migrations/__tests__/activation-concurrency.test.d.ts +1 -0
  231. package/dist/migrations/__tests__/activation-concurrency.test.js +145 -0
  232. package/dist/migrations/__tests__/activation.test.d.ts +1 -0
  233. package/dist/migrations/__tests__/activation.test.js +149 -0
  234. package/dist/migrations/__tests__/deletion-and-root-declaration.test.d.ts +1 -0
  235. package/dist/migrations/__tests__/deletion-and-root-declaration.test.js +149 -0
  236. package/dist/migrations/activation.d.ts +16 -0
  237. package/dist/migrations/activation.js +78 -0
  238. package/dist/migrations/convergent.d.ts +14 -3
  239. package/dist/migrations/convergent.js +21 -10
  240. package/dist/migrations/corpus.d.ts +78 -0
  241. package/dist/migrations/corpus.js +497 -0
  242. package/dist/migrations/frontmatter-splice.d.ts +15 -0
  243. package/dist/migrations/frontmatter-splice.js +176 -0
  244. package/dist/migrations/registry.d.ts +6 -1
  245. package/dist/migrations/registry.js +7 -2
  246. package/dist/migrations/runner.d.ts +41 -0
  247. package/dist/migrations/runner.js +81 -0
  248. package/dist/migrations/types.d.ts +148 -9
  249. package/dist/migrations/types.js +9 -2
  250. package/dist/pi-extensions/__tests__/canvas-context-intro.test.js +225 -17
  251. package/dist/pi-extensions/__tests__/canvas-goal-capture-envelope.test.js +11 -3
  252. package/dist/pi-extensions/canvas-context-intro.d.ts +3 -5
  253. package/dist/pi-extensions/canvas-context-intro.js +50 -46
  254. package/dist/pi-extensions/canvas-doc-substrate.d.ts +1 -8
  255. package/dist/pi-extensions/canvas-doc-substrate.js +55 -122
  256. package/dist/pi-extensions/canvas-stophook.js +6 -13
  257. package/dist/shared/generated-context.d.ts +0 -3
  258. package/dist/shared/generated-context.js +0 -57
  259. package/dist/shared/tool-groups.js +2 -3
  260. package/package.json +5 -4
  261. package/runtime.lock.json +2 -2
  262. /package/dist/api/__tests__/{serial → integration}/client.test.d.ts +0 -0
  263. /package/dist/api/__tests__/{serial → integration}/client.test.js +0 -0
  264. /package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/{serial → integration}/provider-rotation.test.ts +0 -0
  265. /package/dist/clients/{inbox/__tests__/serial/inbox-controller.test.d.ts → attach/__tests__/pane-tag-successor.test.d.ts} +0 -0
  266. /package/dist/clients/{inbox/__tests__/serial/mount-panel.test.d.ts → attach/__tests__/profile-files.test.d.ts} +0 -0
  267. /package/dist/{core/__tests__/live-mutation-verbs.test.d.ts → clients/inbox/__tests__/integration/inbox-controller.test.d.ts} +0 -0
  268. /package/dist/clients/inbox/__tests__/{serial → integration}/inbox-controller.test.js +0 -0
  269. /package/dist/{core/__tests__/serial/broker-fork-seam.test.d.ts → clients/inbox/__tests__/integration/mount-panel.test.d.ts} +0 -0
  270. /package/dist/clients/inbox/__tests__/{serial → integration}/mount-panel.test.js +0 -0
  271. /package/dist/{core/__tests__/serial/broker-sdk-wiring.test.d.ts → commands/__tests__/surface-reload-target.test.d.ts} +0 -0
  272. /package/dist/{core/__tests__/serial/broker-snapshot-history.test.d.ts → commands/memory/__tests__/command-selector-and-mutation-guards.test.d.ts} +0 -0
  273. /package/dist/{core/__tests__/serial/command-plugins.test.d.ts → commands/memory/__tests__/repository-root-lint.test.d.ts} +0 -0
  274. /package/dist/{core/__tests__/serial/deferred-no-wake.test.d.ts → commands/sys/__tests__/sync-project-guidance.test.d.ts} +0 -0
  275. /package/dist/core/__tests__/{serial/flagship-lifecycle.test.d.ts → config-change-delta.test.d.ts} +0 -0
  276. /package/dist/core/__tests__/{serial/host-teardown-process-group.test.d.ts → integration/broker-fork-seam.test.d.ts} +0 -0
  277. /package/dist/core/__tests__/{serial/human-deliver-e2e.test.d.ts → integration/broker-sdk-wiring.test.d.ts} +0 -0
  278. /package/dist/core/__tests__/{serial/live-mutation.test.d.ts → integration/broker-snapshot-history.test.d.ts} +0 -0
  279. /package/dist/core/__tests__/{serial/refresh-stall-recycle.test.d.ts → integration/command-plugins.test.d.ts} +0 -0
  280. /package/dist/core/__tests__/{serial/revive.test.d.ts → integration/deferred-no-wake.test.d.ts} +0 -0
  281. /package/dist/core/__tests__/{serial/spawn-root.test.d.ts → integration/flagship-lifecycle.test.d.ts} +0 -0
  282. /package/dist/core/__tests__/{serial/subscription-delivery.test.d.ts → integration/host-teardown-process-group.test.d.ts} +0 -0
  283. /package/dist/core/__tests__/{serial/tmux-surface.test.d.ts → integration/human-deliver-e2e.test.d.ts} +0 -0
  284. /package/dist/core/__tests__/{serial/worktree.test.d.ts → integration/live-mutation-verbs.test.d.ts} +0 -0
  285. /package/dist/core/{human/__tests__/serial/inbox-core.test.d.ts → __tests__/integration/live-mutation.test.d.ts} +0 -0
  286. /package/dist/core/human/__tests__/{serial → integration}/inbox-core.test.js +0 -0
@@ -21,7 +21,7 @@ import type { CancelInboxTicketRequest, CanceledTicketResultDTO, InboxListDTO, I
21
21
  import type { CreateHumanRequestDTO, CreateHumanRequestRequest, HumanRequestDTO, HumanRequestIdDTO, ReplaceHumanRequestRequest, RespondHumanRequestRequest, SettleHumanRequestRequest } from './dto/human-requests.js';
22
22
  import type { AttentionCountsDTO, AttentionDTO, DashboardDTO, DashboardQuery, HistoryGrepQuery, HistoryGrepResultDTO, HistoryReadQuery, HistoryReadResultDTO, HistorySearchQuery, HistorySearchResultDTO, PruneRequest, PruneResultDTO, RebuildIndexResultDTO, RosterDTO, SnapshotDTO } from './dto/canvas.js';
23
23
  import type { CloseWorktreeResultDTO } from './dto/worktree.js';
24
- import type { BrokerExtensionStateDTO, BrokerGeneratedNameRequest, BrokerGeneratedNameResultDTO, BrokerInboxCursorDirective, BrokerInboxCursorRequest, BrokerModelCommitRequest, BrokerModelCommitResultDTO, BrokerPersonaAckRequest, BrokerSessionBoundRequest, BrokerSessionBoundResultDTO, BrokerSettleDirective, BrokerSettleRequest } from './dto/broker-ops.js';
24
+ import type { BrokerExtensionStateDTO, BrokerGeneratedNameRequest, BrokerGeneratedNameResultDTO, BrokerInboxCursorDirective, BrokerInboxCursorRequest, BrokerModelCommitRequest, BrokerModelCommitResultDTO, BrokerPersonaAckRequest, BrokerPersonaAckResultDTO, BrokerSessionBoundRequest, BrokerSessionBoundResultDTO, BrokerSettleDirective, BrokerSettleRequest } from './dto/broker-ops.js';
25
25
  export interface CrtrClientOptions {
26
26
  /** Unix socket path (default local transport). Exactly one of socketPath|baseUrl. */
27
27
  socketPath?: string;
@@ -101,7 +101,7 @@ export declare class CrtrClient {
101
101
  commitBrokerModel(id: string, req: BrokerModelCommitRequest): Promise<BrokerModelCommitResultDTO>;
102
102
  brokerExtensionState(id: string): Promise<BrokerExtensionStateDTO>;
103
103
  commitBrokerGeneratedName(id: string, req: BrokerGeneratedNameRequest): Promise<BrokerGeneratedNameResultDTO>;
104
- commitBrokerPersonaAck(id: string, req: BrokerPersonaAckRequest): Promise<void>;
104
+ commitBrokerPersonaAck(id: string, req: BrokerPersonaAckRequest): Promise<BrokerPersonaAckResultDTO>;
105
105
  closeNode(id: string, req?: CloseRequest): Promise<CloseResultDTO>;
106
106
  recycleNode(id: string): Promise<NodeDetailDTO>;
107
107
  demoteNode(id: string): Promise<NodeDetailDTO>;
@@ -164,9 +164,9 @@ export declare class CrtrClient {
164
164
  /** Read an absolute host path as UTF-8 (capped, `truncated` when clipped) for
165
165
  * the browser file-peek panel. */
166
166
  peekFile(path: string): Promise<FilePeekDTO>;
167
- /** Resolve a `[[name]]` memory-document link to the absolute path the given
168
- * node would read — the node's own precedence chain, not this process's.
169
- * Pair with `peekFile` to render the document. */
167
+ /** Resolve an exact canonical `[[name]]` memory-document link to the winning
168
+ * document's physical origin for the given node — the node's own precedence
169
+ * chain, not this process's. Pair with `peekFile` to render the document. */
170
170
  resolveMemoryDoc(name: string, nodeId: string): Promise<MemoryDocRefDTO>;
171
171
  /** Create-or-return by name. Supplied `projects` are shape-checked even when
172
172
  * the profile already exists; their directories are only required to exist
@@ -290,9 +290,9 @@ export class CrtrClient {
290
290
  return this.request('GET', withQuery(routes.filePeek(), { path }));
291
291
  }
292
292
  // ---- Memory documents --------------------------------------------------
293
- /** Resolve a `[[name]]` memory-document link to the absolute path the given
294
- * node would read — the node's own precedence chain, not this process's.
295
- * Pair with `peekFile` to render the document. */
293
+ /** Resolve an exact canonical `[[name]]` memory-document link to the winning
294
+ * document's physical origin for the given node — the node's own precedence
295
+ * chain, not this process's. Pair with `peekFile` to render the document. */
296
296
  resolveMemoryDoc(name, nodeId) {
297
297
  return this.request('GET', withQuery(routes.memoryResolve(), { name, node: nodeId }));
298
298
  }
@@ -90,7 +90,10 @@ export interface BrokerExtensionNodeDTO {
90
90
  target_file: string;
91
91
  } | null;
92
92
  intent: ExitIntentDTO;
93
+ /** `kind` is absent on rows written before kind joined the drift key; a read
94
+ * resolves it to the node's current kind. */
93
95
  persona_ack?: {
96
+ kind?: string;
94
97
  mode: 'base' | 'orchestrator';
95
98
  lifecycle: 'terminal' | 'resident';
96
99
  };
@@ -145,11 +148,16 @@ export interface BrokerGeneratedNameResultDTO {
145
148
  }
146
149
  export interface BrokerPersonaAckRequest {
147
150
  from: {
151
+ kind: string;
148
152
  mode: 'base' | 'orchestrator';
149
153
  lifecycle: 'terminal' | 'resident';
150
154
  };
151
155
  to: {
156
+ kind: string;
152
157
  mode: 'base' | 'orchestrator';
153
158
  lifecycle: 'terminal' | 'resident';
154
159
  };
155
160
  }
161
+ export interface BrokerPersonaAckResultDTO {
162
+ applied: boolean;
163
+ }
@@ -1,16 +1,17 @@
1
- /** `GET /v1/memory/resolve?name=<name>&node=<id>` result — where the named
2
- * document lives for that node. Resolution runs the node's own precedence
3
- * chain (its context store, its project stack, its profile, user, builtin), so
4
- * the same name can answer with different documents for different nodes. */
1
+ /** `GET /v1/memory/resolve?name=<name>&node=<id>` result. Resolution runs the
2
+ * node's own precedence chain (its context store, its project stack, its
3
+ * profile, user, builtin) and returns the winner for the exact canonical name. */
5
4
  export interface MemoryDocRefDTO {
6
- /** The document's canonical identity (its frontmatter `name`, else its
7
- * path-derived name) — which may differ from the queried name when the query
8
- * was a bare leaf or a directory whose INDEX resolved. */
5
+ /** The winner's canonical identity for the exact resolved query. */
9
6
  name: string;
10
7
  /** Which store it came from: node | project | profile | user | builtin. */
11
8
  scope: string;
12
9
  /** Absolute path to the `.md` file. */
13
10
  path: string;
11
+ /** Absolute path to the physical memory store root. */
12
+ store_root: string;
13
+ /** Store-relative markdown path of the winning document. */
14
+ physical_relative_path: string;
14
15
  /** The owning plugin's name when the doc is mounted from an installed plugin,
15
16
  * absent for a native scope doc. */
16
17
  plugin?: string;
@@ -1,6 +1,6 @@
1
1
  // Memory-document resolution DTO. Backs `GET /v1/memory/resolve` — a client
2
- // holding a `[[name]]` link out of a node's transcript turns it into the
3
- // absolute path of the document that node would read, then peeks that path.
2
+ // holding a canonical `[[name]]` link out of a node's transcript gets the
3
+ // winning document's canonical identity and physical origin.
4
4
  //
5
5
  // PURITY (spec §3.1): Node built-ins + `src/api/*` only.
6
6
  export {};
@@ -3,15 +3,14 @@ kind: preference
3
3
  when-and-why-to-read: When a node is spawned as kind design in base mode, this preference should be read so implementers inherit one coherent architecture instead of reopening load-bearing decisions.
4
4
  gate: {kind: design, mode: base}
5
5
  rationale: >-
6
- senior-engineer architecture thinking — cross-service, high-level decisions (performance, db design, patterns) worked out interactively with the user, deliberately not taking the most obvious solution. Distinct from plan, which is a crutch for model intelligence (steps a dumber model can mindlessly execute); design decides how it SHOULD be put together. Schema/key-field definitions belong; verbatim controller code does not, unless naming a template pattern others will replicate.
6
+ A bounded design needs one owner across evidence gathering, user decisions, and artifact delivery. The shared method lives in [[design/guide]] so this role layer carries only bounded-node lifecycle and promotion behavior.
7
7
  surfaces:
8
8
  - on: boot
9
9
  at: content
10
10
  ---
11
11
 
12
12
  ## When designing a bounded system
13
- You are a design agent. Given a bounded design task — a component, subsystem, or interaction surface — you produce one design document an implementer can build from without re-deciding anything you left open. That, not emitting a document, is the bar for done. When a decision turns on judgment the user should own — a performance tradeoff, a data-model shape, which pattern to adopt — work it out with them via `crtr human send` rather than picking the obvious option alone, because the obvious option is usually not the right one.
14
13
 
15
- Read your task for the scope, the constraints, and the interface contracts you must honor. Write the design to `design-<subject>.md` in your context dir, in the standard shape: Context & constraints, Architecture (lead with a diagram, then prose), Components & responsibilities, Interfaces & contracts, Data model, Key flows, Decisions, Open risks. Two things make it a design rather than a description: every decision that closes a real option is captured in Decisions with the alternatives you rejected and why — resolve the choice, never hand the implementer a branch to pick; and every interface is concrete enough that both sides can build to it without negotiating.
14
+ Given one bounded component, subsystem, or interaction surface, follow [[design/guide]] and produce a design an implementer can build from without re-deciding architecture. If decisive evidence is unavailable, report the blocker instead of presenting an unresolved design as settled.
16
15
 
17
- Deliver the design file path plus a tight summary — one sentence per decision, what was chosen and what it closed off. Promote into a design orchestrator only when settled boundaries expose independent design surfaces; tightly coupled architecture stays base across yields so one mind owns its coherence.
16
+ Deliver the design path plus one sentence per consequential decision stating what was chosen and what it closed off. Promote into a design orchestrator only when settled contracts expose independent design surfaces large enough for parallel work to repay synthesis cost; keep tightly coupled architecture in one base node across yields.
@@ -2,14 +2,15 @@
2
2
  kind: preference
3
3
  when-and-why-to-read: When a node is spawned as kind design in orchestrator mode, this preference should be read so parallel sub-designs compose across their interfaces instead of producing a fragmented or contradictory architecture.
4
4
  gate: {kind: design, mode: orchestrator}
5
+ rationale: >-
6
+ A design orchestrator owns contract-first delegation and integration. Decomposition mechanics live in [[design/roadmap]] so this role layer does not duplicate them.
5
7
  surfaces:
6
8
  - on: boot
7
9
  at: content
8
10
  ---
9
11
 
10
12
  ## Coordinating a design effort
11
- You are a **design orchestrator** — you own a design effort whose independent surfaces make parallel design worthwhile, and you deliver one coherent result by delegating each bounded sub-design to a `design` child and integrating what returns into a unified artifact.
12
13
 
13
- Before you shape the roadmap, read `crtr memory read design/roadmap` for the decomposition discipline. Your first act after reading it is to define the shared interface contracts between the sub-designs and write them to `design-contracts.md` in your context dir before any child starts — those contracts are the seams that let parallel sub-designs compose instead of collide. Each child gets the overall architecture framing, the contracts doc, and the explicit scope of its piece.
14
+ Follow [[design/roadmap]] for decomposition and [[design/guide]] for the integrated artifact. You own the shared contracts before delegation and the coherent whole after children return; sub-designs are evidence, not sections to concatenate.
14
15
 
15
- Integration is the work, not a formality: read every sub-design, verify each contract is honored on *both* sides, reconcile the inconsistencies that only surface with the whole picture loaded, and synthesize a single document that reads as one voice — not a concatenation of pieces with the decision rationale lost between them. The design is done only when an implementer could build any piece from it without discovering that two pieces disagree.
16
+ Deliver one integrated design whose responsibilities, sources of truth, interface semantics, data model, and success and failure flows agree across every boundary. Reconcile conflicts before reporting the artifact path and consequential decisions.
@@ -3,17 +3,14 @@ kind: preference
3
3
  when-and-why-to-read: When a node is spawned as kind design, this preference should be read so the design closes the expensive decisions at the right altitude instead of drifting into implementation or over-specifying what the implementer could safely decide.
4
4
  gate: {kind: design}
5
5
  rationale: >-
6
- The design personas described how to write the artifact but routed to no design guidance, so a base design node booted with no altitude rule and no bound on over-specification. Gates on the kind with no mode so design orchestrators load it too. Carries the contract only — the artifact shape and the decomposition decision stay in the docs it points at.
6
+ The design personas described how to write the artifact but routed to no shared design guidance, so a design node booted with no stable altitude rule and duplicated a fixed template that later diverged. Gates on the kind with no mode so design orchestrators load it too.
7
7
  surfaces:
8
8
  - on: boot
9
9
  at: content
10
10
  ---
11
11
 
12
12
  ## What a design must settle
13
- A design fixes the load-bearing structure before anyone writes code: component boundaries and responsibilities, interface contracts and data models, key flows, and the decisions that close real options with their rationale and rejected alternatives.
14
13
 
15
- It is not requirements — those state the behavior the system must satisfy, while the design states how it is structured to produce that behavior. It is not a plan — plans order implementation work against the design. The altitude ceiling: a planner reading the design has no design questions left, and a coder reading it still has implementation choices to make. No function bodies, no algorithm walkthroughs, no library calls, no ordering of implementation steps; anything that could be pasted into source belongs downstream.
14
+ A design fixes the consequential, expensive-to-reverse structure before implementation. It is not requirements, which state the behavior the system must satisfy, and it is not a plan, which maps implementation work against the settled design. A planner should inherit no architectural choice; a coder should retain cheap local implementation choices.
16
15
 
17
- Design enough to unblock parallelism and close the decisions that are expensive to reverse, and no further. Over-specification is as harmful as under-specification — it creates brittleness and deferred rework when reality does not match the paper — so leave the implementer what they can decide without risk. Name a genuinely unclear sub-section that is off the critical path as open rather than filling it with a plausible guess.
18
-
19
- Read `crtr memory read design/guide` for what each section of the artifact must contain and the top-down versus bottom-up call.
16
+ Follow `crtr memory read design/guide` as the single design method and artifact format. Use `crtr memory read design/roadmap` only when settled contracts expose genuinely independent design surfaces worth parallelizing.
@@ -3,15 +3,14 @@ kind: preference
3
3
  when-and-why-to-read: When a node is spawned as kind plan in base mode, this preference should be read so ambiguities and unsafe task boundaries are resolved before implementation makes them expensive.
4
4
  gate: {kind: plan, mode: base}
5
5
  rationale: >-
6
- a performance boost, not ceremony — issues are far cheaper to spot in a plan than in implemented code, and a plan lets a dumber model mindlessly execute successfully. Leverage compounds upstream: 1.1x off in spec -> 2x work at planning -> 4x at implementation; stop polishing when polish cost outweighs risk-chance x cost x size of a next-stage mistake. "A plan 80% right costs more than no plan" is from real incidents — agents build the wrong thing confidently.
6
+ A bounded planning task needs one owner across repository grounding and artifact delivery. The shared implementation-unit method lives in [[plan/guide]] so this role layer carries only bounded-node lifecycle and promotion behavior.
7
7
  surfaces:
8
8
  - on: boot
9
9
  at: content
10
10
  ---
11
11
 
12
12
  ## When planning from a contract
13
- You are a planning agent. Given a spec, design, or requirement, you produce a concrete, navigable plan an implementer builds from without guessing — every decision resolved, not a document that defers the hard calls to the build. A plan that is 80% right costs more than no plan, because agents build the wrong thing confidently.
14
13
 
15
- A plan is a map, not a script: resolve the ambiguity, define the boundaries, and structure the work for parallelism. Agents read the codebase themselves — point at the pattern to follow ("follow src/jobs/index.ts") rather than re-describing code they will rewrite anyway. Break the work into phased tasks with explicit dependencies and flag which can run in parallel. Every design choice lands on a concrete answer; do not hand the implementer a branch to pick. The plan is a living current-state artifact, not a log of how you reached it — state the resolved approach, fold every answer into the task it governs, and carry no decision history, superseded ideas, or standing open questions. Do not implement — plan only.
14
+ Given one bounded requirement, specification, or design, follow [[plan/guide]] and produce a concrete plan a fresh implementer can execute without guessing. Do not implement. When repository evidence exposes an unresolved expensive-to-reverse choice, return it to design instead of settling architecture inside the plan.
16
15
 
17
- If you are planning one slice of a larger effort, stay in your lane: where your slice touches another, surface it as an integration point or constraint for whoever synthesizes — do not solve the other slice. Promote into a plan orchestrator only when settled boundaries create independent planning slices; a large sequential plan stays base across yields so later decisions can build on earlier ones.
16
+ If your task is one slice of a larger effort, stay within its ownership boundary and expose cross-slice dependencies for the synthesizer. Promote into a plan orchestrator only when settled dependencies and non-overlapping edit ownership expose independent planning slices large enough for parallel work to repay synthesis cost; keep a large sequential plan in one base node across yields.
@@ -3,15 +3,14 @@ kind: preference
3
3
  when-and-why-to-read: When a node is spawned as kind plan in orchestrator mode, this preference should be read so cross-domain work becomes one parallel-safe, reviewed execution map rather than conflicting part-plans.
4
4
  gate: {kind: plan, mode: orchestrator}
5
5
  rationale: >-
6
- The always-loaded plan persona mandated five parallel review lenses and told load-bearing plans to loop review → revise → re-review until quiet. That instruction directly generated repeated reviewer waves instead of making the plan owner resolve one independent verdict.
6
+ The prior orchestrator prompt defaulted to splitting by domain and duplicated index mechanics, which produced part-plans before dependencies and ownership made them independent. Decomposition and synthesis now live in [[plan/roadmap]].
7
7
  surfaces:
8
8
  - on: boot
9
9
  at: content
10
10
  ---
11
11
 
12
- ## When planning needs a roadmap
13
- Planning is the sharpest test of owning a goal: a plan's flaws are invisible until implementation makes them expensive, so a flaw you resolve here is orders of magnitude cheaper than the same flaw caught in the diff. Before you shape the roadmap, read `crtr memory read plan/roadmap` for the flat-versus-decomposed call and the synthesis a split demands.
12
+ ## Coordinating a planning effort
14
13
 
15
- Decompose by **domain seam, not raw size** — what forces a split is a boundary the integration seam runs through, not a file count. When in doubt, split: a sub-planner is cheap, a shallow plan that misses a cross-domain seam costs a whole implementation cycle. For an **enormous feature, plan one phase at a time** — what you learn implementing phase N is what makes phase N+1's plan correct, so do not commit later phases to paper before the earlier ones are built; reserve planning for where the *how* is genuinely open, and send mechanical, wrapper-shaped phases straight to implementation.
14
+ Follow [[plan/roadmap]] for the decomposition decision and index synthesis, and [[plan/guide]] for every part-plan's units and proof. You own the dependency graph, edit ownership, cross-lane acceptance coverage, and final runtime gate; children own only their bounded slices.
16
15
 
17
- When you split, **synthesis is the load-bearing step — not the splitting.** As the only agent holding the whole picture, edit the part-plans into one coherent voice: resolve file-ownership conflicts, align naming and shared types across slices, and stress-test the seams no single sub-planner could see. Keep the master a small navigable index — a dependency task table over linked part-plans — because that is what forces the decomposition to be real instead of a flat dump.
16
+ Deliver one navigable index over coherent part-plans. Reconcile conflicts and integration gaps before review, and do not claim parallelism or acceptance coverage that the synthesized dependency and proof map does not establish.
@@ -1,28 +1,20 @@
1
1
  ---
2
2
  kind: preference
3
- when-and-why-to-read: When a node is spawned as kind plan, this preference should be read so the plan stays inside the specified contract and hands implementation tasks that can be executed cold and in parallel.
3
+ when-and-why-to-read: When a node is spawned as kind plan, this preference should be read so the plan stays inside the approved contract and hands implementation units that can be executed cold and in parallel where dependencies permit.
4
4
  gate: {kind: plan}
5
5
  rationale: >-
6
- Planners turned plausible improvements outside the specification into implementation tasks without asking, silently expanding scope. An earlier playbook also required five parallel plan reviewers and made “passes all five lenses” the ready bar, turning lenses into agents and resolution into reviewer polling rather than plan-owner judgment. Gates on the kind with no mode so plan orchestrators load it too — this is the planning contract itself, and it binds whoever writes or synthesizes a plan whether or not the effort ever needs a roadmap.
6
+ Planners turned plausible improvements outside the specification into implementation tasks, silently expanded scope, and duplicated a task format that diverged from the shared guide. An earlier playbook also turned review lenses into five agents. Gates on the kind with no mode so plan orchestrators load the same scope and review contract.
7
7
  surfaces:
8
8
  - on: boot
9
9
  at: content
10
10
  ---
11
11
 
12
- ## Hold the specified scope
12
+ ## Hold the approved scope
13
13
 
14
- Plan the simplest complete implementation of the specification and what it necessarily requires. Codebase opportunities do not expand the contract: speculative features, future extensibility, adjacent cleanup, and other merely plausible additions stay out.
15
-
16
- When something seems likely desirable but is not explicitly or implicitly required by the specification, ask the user through `crtr human` before finishing the plan, wait for their answer, and make the resulting boundary explicit. Do not hide the addition in an assumption, recommendation, or optional task.
17
-
18
- ## What a good task looks like
19
-
20
- A task is the atomic unit one implementation node picks up cold and executes in a single context window. It names the file path (or the small set of paths it exclusively owns), what changes in each, its hard dependencies, and its output — the type, signature, or export the next task can assume exists. A dependency on a type a sibling task defines in the same phase is stated in the task row.
21
-
22
- A task is **parallel-safe**: no other task in its phase owns its files. Two tasks that must touch one file are serialized across phases and say so; sharing a file without serialization is a merge conflict waiting to happen. A task is **bounded**: finishable in one window without re-reading the plan. A task description longer than a short paragraph is too large — split it.
14
+ Follow `crtr memory read plan/guide` as the single planning method and artifact format. The approved requirements, specification, and design are fixed inputs. Merely plausible additions stay out; ask the user only when an input is genuinely ambiguous or the requested outcome cannot be completed without a scope decision. Return an expensive-to-reverse architectural gap to design.
23
15
 
24
16
  ## Plan review
25
17
 
26
18
  Give a consequential plan one independent review pass. Use one base `review` node for a coherent review across yields; use one bounded `review` orchestrator only when the artifact splits into independent review surfaces large enough for parallel coverage to repay synthesis cost. The assignment applies whichever lenses matter — requirements coverage, pattern consistency, code smells, security, architecture fit — within one verdict. Lenses are questions, not separate reviewer assignments.
27
19
 
28
- Fold that report into the plan once. Resolve every Critical, Major, or implementation-blocking finding; dismiss a false positive or out-of-scope finding with a reason. The revised plan is ready when you can trace each finding to its disposition and the plan still clears its exit criteria. Implementation and acceptance evidence validate the revision; reviewer silence is not the bar.
20
+ Fold the report into the plan once. Resolve every Critical, Major, or implementation-blocking finding; dismiss a false positive or out-of-scope finding with a reason. The revised plan is ready when each finding has a disposition and the artifact still clears the acceptance-proof contract in [[plan/guide]].
@@ -1,35 +1,57 @@
1
1
  ---
2
2
  kind: knowledge
3
- when-and-why-to-read: When writing an architecture or interface design, this knowledge should be read so each section of the artifact carries what a planner and implementer need and the design opens from the end that is actually hard.
4
- short-form: Use when writing a design artifact — what each section must contain, and the top-down versus bottom-up call.
3
+ when-and-why-to-read: When writing an architecture or interface design, this knowledge should be read so the design closes the consequential structure from grounded evidence without dictating cheap implementation detail.
4
+ short-form: Use when producing a design — grounding, decision depth, the artifact core, conditional detail, and evidence probes.
5
5
  rationale: >-
6
- Carries the artifact shape and the style call only. The design contract — what a design is, its altitude ceiling, and how much to design up front — lives in the design kind layer, and decomposition lives in [[design/roadmap]]. Ungated and boot-silent like [[spec/guide]], because /dev:design runs on a general node that a kind gate would hide it from.
6
+ Carries the shared design method and artifact shape used by design-kind nodes and the optional /dev:design front door. Decomposition alone lives in [[design/roadmap]], so both entry paths use one format instead of carrying contradictory templates.
7
7
  ---
8
8
 
9
- # The design-artifact shape
9
+ # Designing a change
10
10
 
11
- Write the design to `$CRTR_CONTEXT_DIR/design-<subject>.md`. Structure it with these sections, in order:
11
+ Ground the design in every applicable requirement, specification, and current code path. When the blast radius is unclear — what the change touches, who depends on it, or what constrains its shape — use `explore` scouts to map it before writing, and draw the constraints from evidence rather than an assumption.
12
12
 
13
- **Context & constraints** — the problem being solved, the non-goals, the constraints that are not negotiable (existing systems, performance envelopes, team conventions). This is the frame everything else hangs on.
13
+ Scale depth with reversal cost, the number of owners, and operational burden. If the change has no consequential structural choice, skip the design instead of filling a template.
14
14
 
15
- **Architecture** — the high-level structure: what major components or layers exist, how they are arranged, what the topology looks like. Lead with a diagram (mermaid `graph TD`) before prose. Keep it at the level a new engineer would use to orient themselves.
15
+ Resolve every consequential, expensive-to-reverse choice; never hand one to the implementer. When such a choice turns on judgment the user genuinely owns, work it out with them through `crtr human` before finishing the document and reflect their decision in the design. Leave cheap local choices to implementation.
16
16
 
17
- **Components & responsibilities** — for each component: one-sentence description of what it owns, a responsibilities table, and explicit boundaries (what it does NOT own). Every responsibility must land in exactly one component; gaps and overlaps here become integration bugs.
17
+ A question that only runtime evidence can answer is not a paper choice. Define its hypothesis and success or failure criteria, run or obtain the cheapest decisive probe, then finish the design from that evidence. If the evidence is unavailable and can change the load-bearing structure, report that the design is blocked and do not present an unresolved artifact as settled. An empirical unknown may remain only when it does not hand architecture to the implementer.
18
18
 
19
- **Interfaces & contracts** — how components talk to each other. Expressed as prose or sequence diagrams, not API specs or type declarations. "Component A sends X to Component B when Y" is the right level. Include error cases and who owns recovery.
19
+ Write the design to `$CRTR_CONTEXT_DIR/design-<subject>.md`. Keep it pure: settled structure, runtime contracts, decisions, and only explicitly bounded empirical unknowns belong in the artifact; concerns, commentary, recommendations, implementation ordering, function bodies, and library calls do not.
20
20
 
21
- **Data model** — the key entities, their fields with semantic types ("session ID string", "ISO timestamp"), and their relationships. Tables are the right format. No TypeScript, no SQL — shape and semantics only.
21
+ ## Required core
22
22
 
23
- **Key flows** — the end-to-end flows that matter most. Walk from trigger to final state, naming which component handles each step and what state changes. This is where seam problems surface; a step whose output doesn't match the next step's expected input is a design gap.
23
+ ### Context and decision frame
24
24
 
25
- **Decisions** — every non-obvious architectural choice, structured as: decision → choice made → alternatives rejected → rationale. If the decision is obvious, omit it. If it closes a real option, it belongs here. This section is what distinguishes a design from a description.
25
+ Name the governing inputs, relevant current state, problem, goals, plausible non-goals, and non-negotiable constraints. Carry only the facts needed to judge the structure; do not repeat the specification.
26
26
 
27
- **Open risks** — unresolved questions and known unknowns that a reviewer or the implementer will need to address. Not a wish list — only things that could affect the design's validity.
27
+ ### Proposed design
28
28
 
29
- ## Design styles — when to use each
29
+ Orient the reader to the chosen structure, then name component or subsystem ownership, responsibilities, boundaries, and sources of truth. Use a diagram when topology, sequence, lifecycle, or data movement is clearer visually. A local design needs neither a component table nor a diagram, but every load-bearing responsibility still has one owner.
30
30
 
31
- **Top-down, interface-first**: fix the contracts between components first, then fill in what sits behind each contract. Use this when the integration surface is the hard problem — when multiple teams or systems must connect, when the seams will be expensive to change, or when you are designing an API or protocol. The contract is the design; the implementation fills in around it.
31
+ ### Contracts and runtime behavior
32
32
 
33
- **Bottom-up, primitives-first**: identify and nail the core data structures or algorithms that the design depends on, then build the component model up from them. Use this when the primitives are the hard part — a novel data model, a performance-critical kernel, a constraint that flows upward and determines everything else.
33
+ Include the seams independent implementers must preserve: interface meaning and compatibility, invariants, state transitions, data movement, ordering, idempotency, retention and deletion, and success, partial-success, failure, degraded, and recovery behavior. State who owns recovery and what remains authoritative when a step fails.
34
+
35
+ Use prose, diagrams, or compact examples according to the ambiguity. A targeted schema, algorithm, or type sketch belongs here when it is the expensive shared decision; otherwise link the authoritative formal contract instead of copying it.
36
+
37
+ ### Decisions and alternatives
38
+
39
+ For each consequential choice, state the chosen option, the forces that made it consequential, credible alternatives, why the choice won, and what it closes off. Omit obvious and cheap choices.
40
+
41
+ ## Conditional detail
42
+
43
+ Add a section only when its trigger applies:
44
+
45
+ - **Persistent or shared state:** entities, relationships, ownership, lifecycle, consistency, retention, and deletion.
46
+ - **Migration or shared compatibility:** compatibility states, authority at each state, transition criteria, partial-failure recovery, stop or rollback conditions, and the destructive-cleanup boundary.
47
+ - **Security, privacy, or trust:** trust boundaries, authorization, secrets, exposure, deletion, and audit behavior.
48
+ - **Capacity, performance, or cost:** the required envelope and the structural choices it forces.
49
+ - **Operations:** detection, observability, on-call ownership, degraded modes, and recovery when they affect architecture.
50
+ - **Empirical unknown:** the hypothesis, probe, criteria, and why the unknown does not block the settled structure.
51
+ - **Cross-team or durable review:** status, decision owner, affected owners, approvers, and child-design links.
52
+
53
+ ## Design direction
54
+
55
+ Use **top-down, interface-first** design when integration seams are the hard or expensive part. Fix the contracts, then place responsibilities behind them. Use **bottom-up, primitives-first** design when a novel data structure, algorithm, or performance constraint determines the component model above it.
34
56
 
35
57
  For a design large enough to split across nodes, read [[design/roadmap]].
@@ -12,10 +12,10 @@ surfaces:
12
12
 
13
13
  # Decomposing a design for parallel work
14
14
 
15
- Decompose only when settled contracts expose genuinely independent surfaces and the design is large enough that parallel work materially improves intelligence, productivity, or elapsed time after synthesis cost. Split along clean seams — by component, subsystem, or interaction surface. A long but tightly coupled design stays with one base agent across yields so one mind owns its coherence. Each delegated sub-design is a bounded unit that covers one component or subsystem end-to-end: its own context, architecture, interfaces, data model, flows, and decisions.
15
+ Decompose only when settled contracts expose genuinely independent surfaces with non-overlapping responsibility and ownership, and the design is large enough that parallel work materially improves intelligence, productivity, or elapsed time after synthesis cost. A long but tightly coupled design stays with one base agent across yields so one mind owns its coherence.
16
16
 
17
- Before delegating sub-designs, define the shared interface contracts between them explicitly. These contracts are the seams; they must be written down before sub-design begins so that parallel sub-designs don't invent incompatible assumptions. Capture these contracts in `$CRTR_CONTEXT_DIR/design-contracts.md` and give that absolute path to every sub-design agent.
17
+ Before delegating, write the shared interface contracts in `$CRTR_CONTEXT_DIR/design-contracts.md`. Fix the overall structure, source-of-truth boundaries, interaction meaning, invariants, and assumptions every sub-design must preserve. Give that absolute path, the overall orientation, the sub-design scope, and the governing constraints to every child.
18
18
 
19
- Each sub-design agent gets: the overall architecture diagram, the contracts doc, the scope of its piece, and any constraints from the parent design. It writes `design-<component>.md` in its own context directory and reports the absolute path.
19
+ Each child owns one component, subsystem, or interaction surface end to end. It follows [[design/guide]] and includes only the conditional detail its surface triggers. It writes `design-<component>.md` in its context directory and reports the absolute path.
20
20
 
21
- After sub-designs land, integration is your job: read every sub-design, check that every contract is honored on both sides, that responsibilities don't overlap or gap, that the data models are consistent, and that the key flows compose correctly across component boundaries. Write the integrated design to `$CRTR_CONTEXT_DIR/design-<subject>.md`, synthesizing all sub-designs into one coherent artifact — don't just concatenate them. Reconcile any inconsistencies before declaring the design done.
21
+ After the sub-designs land, synthesize one design at `$CRTR_CONTEXT_DIR/design-<subject>.md`; do not concatenate them. Check each shared contract from both sides, reconcile names and data semantics, close responsibility gaps and overlaps, and walk the cross-boundary success and failure flows before declaring the integrated design settled.
@@ -28,11 +28,11 @@ Choose the narrowest durable scope that reaches every future conversation where
28
28
 
29
29
  Infer the scope from the request and current workspace. Ask through `crtr human send` only when more than one scope is genuinely plausible, and settle scope before writing anything. Never use node scope for an ongoing listener.
30
30
 
31
- Search the chosen scope before creating. If `insights/<topic>` already represents the same domain, refine that listener rather than creating an overlapping directory.
31
+ Search the chosen scope before creating. Use `<namespace>/insights/<topic>` for project scope and `insights/<topic>` for profile or user scope; if that canonical address already represents the same domain, refine that listener rather than creating an overlapping directory.
32
32
 
33
33
  ## Create the listener
34
34
 
35
- Run `crtr memory write -h`, then create `insights/<topic>/INDEX.md` at the chosen scope as a preference surfaced `{on: boot, at: preview}`.
35
+ Run `crtr memory write -h`, then create the directory document at the chosen scope under its canonical address: `<namespace>/insights/<topic>` for project scope and `insights/<topic>` for profile or user scope, as a preference surfaced `{on: boot, at: preview}`. Its physical front door remains `insights/<topic>/INDEX.md`.
36
36
 
37
37
  Its routing line must name the actual domain trigger: when user-supplied information, a correction, or a user response relates to this domain, read the preference because recognizing the underlying principle preserves knowledge future decisions can use.
38
38
 
@@ -52,7 +52,7 @@ When `--active` is present, do not stop after creating the listener. After initi
52
52
 
53
53
  ### 1. Create the listener first
54
54
 
55
- Follow the passive mode steps above through "Initialization is complete." The listener INDEX must exist before spawning the explorer.
55
+ Follow the passive mode steps above through "Initialization is complete." The listener directory document must exist before spawning the explorer.
56
56
 
57
57
  ### 2. Spawn the explorer child
58
58
 
@@ -81,8 +81,8 @@ When the explorer reports, share its claims with the user. For each claim, ask:
81
81
  - Is it incomplete or wrong?
82
82
  - What's the actual principle?
83
83
 
84
- For each user response, use [[insights/capture]] to extract and review the insight. Apply approved insights directly to the listener INDEX's `Approved insights` section.
84
+ For each user response, use [[insights/capture]] to extract and review the insight. Apply approved insights directly to the listener directory document's `Approved insights` section.
85
85
 
86
86
  ### 4. Report completion
87
87
 
88
- Once claims have been surfaced and user guidance has generated approved insights, report that active initialization is complete. The listener INDEX now passively captures this domain as new user material emerges.
88
+ Once claims have been surfaced and user guidance has generated approved insights, report that active initialization is complete. The listener directory document now passively captures this domain as new user material emerges.
@@ -25,4 +25,4 @@ Adjacent, outside this dir: authoring memory documents (kind, surfaces routing,
25
25
 
26
26
  Briefly: **plugins** package docs and commands, with command execution selected by `plugin.json.transport` (`exec` for a trusted local executable or `http` for a fetched remote REST manifest); **marketplaces** index and distribute plugins. Plugin commands enter the **external-command** fallthrough, leaving the core fast-path untouched.
27
27
 
28
- The individual files surface at `name` (their titles route; open the one the situation calls for); this index surfaces at `preview` so the dir announces when to come looking.
28
+ The individual files surface at their canonical names (open the one the situation calls for); this directory document surfaces at `internal` at `preview`, and `crtr memory read internal` returns its body followed by the directory's immediate listing.
@@ -13,4 +13,4 @@ The other internal/ docs explain the primitives one at a time; this dir shows th
13
13
 
14
14
  - **imessage-assistant** — an OpenClaw-style always-on assistant: resident root node with its own dir and persona, woken event-style by a launchd watcher via `node message send`, reading `chat.db` (with the attributedBody gotcha), replying via osascript, remembering people through project-scope memory.
15
15
 
16
- Add an example here when a composition was non-obvious enough that the next builder shouldn't have to re-derive it.
16
+ Add an example here when a composition was non-obvious enough that the next builder shouldn't have to re-derive it. Read `internal/examples` for this overview and its immediate example listing; the physical front door remains `INDEX.md`, but `INDEX` is not part of the canonical address.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  kind: knowledge
3
3
  when-and-why-to-read: When you need to know why a memory doc did or didn't load — or are deciding how a new doc should surface — this reference should be read because it names the event, rung, gate, and ordering that produced the behavior, so you fix loading by turning the right dial instead of guessing at frontmatter.
4
- short-form: The complete load model — the five surface events, the rung ladder, gates, listings, transcript dedup, boot-render ordering, and store mounting/precedence.
4
+ short-form: The complete load model — the five surface events, the rung ladder, gates, listings, context exposure, boot-render ordering, and store mounting/precedence.
5
5
  surfaces:
6
6
  - on: boot
7
7
  at: name
@@ -15,10 +15,10 @@ Every memory doc declares its own delivery in frontmatter `surfaces` entries; th
15
15
 
16
16
  A doc with no `surfaces` does exactly one thing: appears in its directory's listing. Everything beyond that is an explicit entry — `{on: <event>, match?, match-frontmatter?, gate?, at: <rung>}`. An entry's event constraints and optional node-config `gate` must both match; participating entries OR across and fold to their highest rung (`content` > `preview` > `name`), with no cross-entry deny precedence. Multiple entries per event are legal. The events:
17
17
 
18
- - **boot** — the catalog assembled into every node's system prompt at revive. No match; the entry's presence is the match.
18
+ - **boot** — the frozen preference system snapshot and first-message knowledge catalog assembled when a context begins. No match; the entry's presence is the match.
19
19
  - **workspace-open** — first-message context when cwd/profile mounts the doc's project store. Project stores only.
20
20
  - **read** — a `read` tool call returned a matching file: path globs vs the file's absolute path and basename, `./`-anchored globs vs its path relative to the store's owning repo dir, `match-frontmatter` predicates over the read file's own YAML frontmatter.
21
- - **memory-read** — a `crtr memory read` resolved a matching doc: name globs vs its canonical name, `./` anchored to this doc's own name directory.
21
+ - **memory-read** — a `crtr memory read` resolved a matching doc: name globs vs its canonical name, `./` anchored to this doc's canonical routing anchor (a collapsed directory document anchors at its own directory name).
22
22
  - **command** — a matching shell command ran: globs vs the whole command string, `*` crossing `/`. Delivery is post-execution — right for "you are now in this territory," never for "don't run this at all."
23
23
 
24
24
  Nothing positional fires from where a doc happens to sit on disk — only from its declared entries and its listing.
@@ -39,9 +39,9 @@ A document-level `gate` is the hard eligibility predicate over the node's own co
39
39
 
40
40
  ## Listings and dedup
41
41
 
42
- Reading a doc discloses where it sits: `crtr memory read <doc>` also renders, once per transcript, the listing of the doc's directory and each ancestor — one routing line per member doc, one bare name per subdirectory. `crtr memory read <dir>` (or a bare-dir `[[ref]]`) returns the listing itself; no doc answers for a directory. `unlisted: true` suppresses a doc from every listing. Store roots are never auto-listed — `crtr memory list` is the deliberate root browse.
42
+ Reading a doc discloses where it sits: `crtr memory read <doc>` also renders, once per loaded context, the listing of the doc's directory and each ancestor — one routing line per member doc, one bare name per subdirectory. A directory document owns its canonical directory node, so `crtr memory read <dir>` (or a bare-dir `[[ref]]`) returns that document's body followed by the directory's immediate listing without repeating the document; a directory without a document returns its listing. `unlisted: true` suppresses a doc from every listing. Store roots are never auto-listed — `crtr memory list` is the deliberate root browse.
43
43
 
44
- Every delivery dedups per transcript keyed on (doc, rung), higher rungs piercing lower: a listing line is a preview-rank render, boot renders seed the set at their boot rung, and a content delivery silences everything after it.
44
+ Every delivery registers its document or listing identity and rung in the loaded context's exposure ledger. System and transcript ranks max-fold, so a higher rung pierces a lower one while a content delivery silences later lower-rung deliveries. A strict resume preserves that ledger and the byte-stable preference snapshot; yield or another new-context boundary replaces them with exactly the new system and first-message snapshots.
45
45
 
46
46
  ## Store mounting and precedence
47
47
 
@@ -53,7 +53,7 @@ The maximum reaches those two events and nothing else. Read, memory-read, and co
53
53
 
54
54
  A workspace's front door is an ordinary doc carrying the entry pair `{on: workspace-open, at: content}` + `{on: read, match: "./**", at: content}` — the operating guide loads when that workspace mounts or its files are read, not in every boot catalog. `crtr memory lint` requires exactly one workspace-open content doc per profile-managed project store. Multiple mounted roots render broad-to-specific.
55
55
 
56
- A `.crouter/memory/` store nested BELOW a mounted root (a package or subsystem dir) is delivered by the read path, not by boot: reading any file beneath its owning dir surfaces its read-routed docs, deduplicated against everything already in the transcript. Addressability is separate — the `crtr memory` leaves (list/read/find/lint/delete/origin) discover nested stores through a bounded walk (git-aware, depth- and time-capped), while the boot catalog stays ancestor+profile only, which is why a nested doc's boot entries are inert (lint warns; drop them).
56
+ A `.crouter/memory/` store nested BELOW a mounted root (a package or subsystem dir) is delivered by the read path, not by boot: reading any file beneath its owning dir surfaces its read-routed docs, filtered against what the loaded context already contains. Addressability is separate — the `crtr memory` leaves (list/read/find/lint/delete/origin) discover nested stores through a bounded walk (git-aware, depth- and time-capped), while the boot catalog stays ancestor+profile only, which is why a nested doc's boot entries are inert (lint warns; drop them).
57
57
 
58
58
  ## Ordering
59
59
 
@@ -33,7 +33,7 @@ If it's a one-off note for yourself, scope-owned memory docs are simpler. Promot
33
33
  └── memory/
34
34
  ├── <name>.md # a kind:knowledge or kind:preference doc
35
35
  └── <area>/
36
- ├── INDEX.md # optional — an ordinary doc; a bare-dir read answers with the listing
36
+ ├── INDEX.md # optional physical front door; its canonical address is the directory and read combines body + immediate listing
37
37
  └── <name>.md
38
38
  ```
39
39
 
@@ -0,0 +1,53 @@
1
+ ---
2
+ kind: knowledge
3
+ when-and-why-to-read: When writing an implementation plan from approved requirements or design, this knowledge should be read so a fresh implementer can locate each change, respect its dependencies, and prove the requested behavior without reconstructing the repository.
4
+ short-form: Use when producing an implementation plan — grounded units, dependency order, conditional transitions, and acceptance proof.
5
+ rationale: >-
6
+ Carries the shared planning method and artifact shape used by plan-kind nodes and the optional /dev:plan front door. The old entry paths repeated broad affected-area and verification categories while leaving files, dependencies, and proof ambiguous.
7
+ ---
8
+
9
+ # Planning a change
10
+
11
+ Ground the plan in the current repository and every applicable approved requirement, specification, and design. When the blast radius is unclear — what the change touches, who depends on it, or what breaks — use `explore` scouts to map it before writing, and draw the implementation surfaces from evidence rather than an assumption.
12
+
13
+ Treat the approved inputs as fixed. Resolve cheap local implementation detail when the plan needs it. When repository evidence contradicts the design or exposes an expensive-to-reverse choice, return that gap to design instead of silently deciding it in the plan.
14
+
15
+ Hold scope to the approved outcome and the implementation work it necessarily requires. Speculative features, future extensibility, adjacent cleanup, and other merely plausible additions stay out. Ask the user only when an approved input is genuinely ambiguous or the requested outcome cannot be completed without a scope decision.
16
+
17
+ Write the plan to `$CRTR_CONTEXT_DIR/plan-<subject>.md`. Keep it pure: approved inputs, implementation units, dependencies, and acceptance proof belong in the plan; concerns, commentary, recommendations, decision history, and live progress do not. Keep live execution state in a separate record when the work needs one.
18
+
19
+ ## Inputs and implementation approach
20
+
21
+ Link every applicable approved input, state the implementation strategy in one paragraph, and point to the existing repository patterns the work follows. If no design exists because the structure is local and cheap to reverse, state that in one clause rather than manufacturing one. Repeat a scope boundary only when the linked inputs leave it easy to misread.
22
+
23
+ ## Ordered implementation units
24
+
25
+ Each unit states:
26
+
27
+ - **Outcome:** the independently meaningful result.
28
+ - **Change:** what must become true, without pseudocode or pasted source.
29
+ - **Surfaces:** exact current files, symbols, callers, tests, migrations, generated artifacts, or operational assets.
30
+ - **Dependencies:** prerequisite units and edit-surface ownership constraints.
31
+ - **Proof:** the narrowest deterministic or runtime evidence that establishes the outcome.
32
+
33
+ Group units into phases only when a phase has one coherent outcome and proof gate. Derive parallel lanes from dependency and edit ownership, not labels such as frontend and backend. Start with a thin central end-to-end slice when it can exercise the real integration path. Put an implementation unknown before routine polish when a working probe can retire it.
34
+
35
+ ## Acceptance proof
36
+
37
+ Map every acceptance criterion to the unit or final runtime check that proves it. Include integration and manual runtime evidence when static checks cannot establish the behavior. A phase gate is a safe stopping point; dependent work does not proceed through a failed gate.
38
+
39
+ ## Conditional units
40
+
41
+ Add units only when their trigger applies:
42
+
43
+ - **Migration:** source of truth, compatible reader and writer states, backfill, reconciliation, cutover, observation, reversal, and old-path deletion.
44
+ - **Rollout:** staged exposure, deployment order, stop criteria, monitoring, rollback, and adoption proof.
45
+ - **Operational adoption:** docs or runbooks, alerts, support or on-call handoff, prevention of new legacy use, and decommissioning.
46
+ - **Bulk transformation:** one common mechanism and proof gate plus an explicit queue for judgment-heavy exceptions.
47
+ - **Long or concurrent execution:** a separate live record with the current phase, remaining unknown or blocker, last passed proof, and commit, PR, or deploy evidence. Do not mutate the approved plan into a progress log.
48
+
49
+ ## Plan depth
50
+
51
+ Scale detail with cross-cutting impact, dependency complexity, interruption risk, and proof difficulty. A familiar one-file change needs no plan. Keep units small enough to review, reject, or reverse, but do not fragment a coherent outcome into line-edit chores.
52
+
53
+ For work that genuinely needs independent part-plans, read [[plan/roadmap]].