mirror-mind 0.0.1 → 0.33.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 (474) hide show
  1. package/.claude/hooks/log-assistant-reply.sh +85 -0
  2. package/.claude/hooks/log-session-end.sh +85 -0
  3. package/.claude/hooks/log-user-prompt.sh +85 -0
  4. package/.claude/hooks/mirror-inject.sh +85 -0
  5. package/.claude/hooks/session-start.sh +85 -0
  6. package/.gemini/hooks/log-assistant.sh +85 -0
  7. package/.gemini/hooks/log-user.sh +85 -0
  8. package/.gemini/hooks/session-end.sh +85 -0
  9. package/.gemini/hooks/session-start.sh +85 -0
  10. package/.pi/extensions/mirror-logger.ts +646 -0
  11. package/.pi/skills/mm-backup/SKILL.md +21 -0
  12. package/.pi/skills/mm-build/SKILL.md +1206 -0
  13. package/.pi/skills/mm-consolidate/SKILL.md +112 -0
  14. package/.pi/skills/mm-consult/SKILL.md +70 -0
  15. package/.pi/skills/mm-conversations/SKILL.md +16 -0
  16. package/.pi/skills/mm-discard/SKILL.md +39 -0
  17. package/.pi/skills/mm-explore/SKILL.md +255 -0
  18. package/.pi/skills/mm-help/SKILL.md +74 -0
  19. package/.pi/skills/mm-identity/SKILL.md +96 -0
  20. package/.pi/skills/mm-journal/SKILL.md +16 -0
  21. package/.pi/skills/mm-journey/SKILL.md +23 -0
  22. package/.pi/skills/mm-journeys/SKILL.md +15 -0
  23. package/.pi/skills/mm-memories/SKILL.md +17 -0
  24. package/.pi/skills/mm-mirror/SKILL.md +98 -0
  25. package/.pi/skills/mm-mute/SKILL.md +18 -0
  26. package/.pi/skills/mm-new/SKILL.md +18 -0
  27. package/.pi/skills/mm-recall/SKILL.md +17 -0
  28. package/.pi/skills/mm-release-notes/SKILL.md +52 -0
  29. package/.pi/skills/mm-seed/SKILL.md +19 -0
  30. package/.pi/skills/mm-shadow/SKILL.md +117 -0
  31. package/.pi/skills/mm-soul/SKILL.md +502 -0
  32. package/.pi/skills/mm-tasks/SKILL.md +24 -0
  33. package/.pi/skills/mm-update/SKILL.md +32 -0
  34. package/.pi/skills/mm-week/SKILL.md +28 -0
  35. package/.pi/skills/mm-welcome/SKILL.md +24 -0
  36. package/AGENTS.md +188 -0
  37. package/README.md +126 -9
  38. package/bin/loader.js +67 -0
  39. package/bin/mirror-hook.js +7 -0
  40. package/bin/mirror.js +7 -0
  41. package/docs/releases/index.md +100 -0
  42. package/docs/releases/pending-cutoffs.md +510 -0
  43. package/docs/releases/v0.10.0.md +123 -0
  44. package/docs/releases/v0.10.1.md +66 -0
  45. package/docs/releases/v0.10.10.md +51 -0
  46. package/docs/releases/v0.10.11.md +39 -0
  47. package/docs/releases/v0.10.12.md +57 -0
  48. package/docs/releases/v0.10.13.md +35 -0
  49. package/docs/releases/v0.10.14.md +42 -0
  50. package/docs/releases/v0.10.15.md +53 -0
  51. package/docs/releases/v0.10.16.md +35 -0
  52. package/docs/releases/v0.10.17.md +43 -0
  53. package/docs/releases/v0.10.2.md +64 -0
  54. package/docs/releases/v0.10.3.md +78 -0
  55. package/docs/releases/v0.10.4.md +42 -0
  56. package/docs/releases/v0.10.5.md +57 -0
  57. package/docs/releases/v0.10.6.md +47 -0
  58. package/docs/releases/v0.10.7.md +53 -0
  59. package/docs/releases/v0.10.8.md +49 -0
  60. package/docs/releases/v0.10.9.md +37 -0
  61. package/docs/releases/v0.11.0.md +86 -0
  62. package/docs/releases/v0.12.0.md +67 -0
  63. package/docs/releases/v0.13.0.md +64 -0
  64. package/docs/releases/v0.14.0.md +68 -0
  65. package/docs/releases/v0.15.0.md +48 -0
  66. package/docs/releases/v0.16.0.md +50 -0
  67. package/docs/releases/v0.16.1.md +55 -0
  68. package/docs/releases/v0.16.2.md +36 -0
  69. package/docs/releases/v0.17.0.md +50 -0
  70. package/docs/releases/v0.17.1.md +58 -0
  71. package/docs/releases/v0.17.2.md +42 -0
  72. package/docs/releases/v0.17.3.md +58 -0
  73. package/docs/releases/v0.18.0.md +84 -0
  74. package/docs/releases/v0.18.1.md +51 -0
  75. package/docs/releases/v0.18.2.md +69 -0
  76. package/docs/releases/v0.19.0.md +85 -0
  77. package/docs/releases/v0.19.1.md +46 -0
  78. package/docs/releases/v0.20.0.md +85 -0
  79. package/docs/releases/v0.21.0.md +61 -0
  80. package/docs/releases/v0.21.1.md +47 -0
  81. package/docs/releases/v0.22.0.md +77 -0
  82. package/docs/releases/v0.22.1.md +42 -0
  83. package/docs/releases/v0.23.0.md +105 -0
  84. package/docs/releases/v0.24.0.md +125 -0
  85. package/docs/releases/v0.25.0.md +107 -0
  86. package/docs/releases/v0.26.0.md +139 -0
  87. package/docs/releases/v0.26.1.md +65 -0
  88. package/docs/releases/v0.26.2.md +43 -0
  89. package/docs/releases/v0.27.0.md +63 -0
  90. package/docs/releases/v0.28.0.md +59 -0
  91. package/docs/releases/v0.29.0.md +61 -0
  92. package/docs/releases/v0.29.1.md +59 -0
  93. package/docs/releases/v0.29.2.md +59 -0
  94. package/docs/releases/v0.29.3.md +93 -0
  95. package/docs/releases/v0.30.0.md +75 -0
  96. package/docs/releases/v0.30.1.md +93 -0
  97. package/docs/releases/v0.30.2.md +66 -0
  98. package/docs/releases/v0.31.0.md +122 -0
  99. package/docs/releases/v0.31.1.md +142 -0
  100. package/docs/releases/v0.31.10.md +118 -0
  101. package/docs/releases/v0.31.11.md +88 -0
  102. package/docs/releases/v0.31.12.md +105 -0
  103. package/docs/releases/v0.31.13.md +99 -0
  104. package/docs/releases/v0.31.14.md +97 -0
  105. package/docs/releases/v0.31.2.md +115 -0
  106. package/docs/releases/v0.31.3.md +142 -0
  107. package/docs/releases/v0.31.4.md +117 -0
  108. package/docs/releases/v0.31.5.md +155 -0
  109. package/docs/releases/v0.31.6.md +132 -0
  110. package/docs/releases/v0.31.7.md +132 -0
  111. package/docs/releases/v0.31.8.md +120 -0
  112. package/docs/releases/v0.31.9.md +120 -0
  113. package/docs/releases/v0.32.0.md +261 -0
  114. package/docs/releases/v0.32.1.md +59 -0
  115. package/docs/releases/v0.33.0.md +164 -0
  116. package/docs/releases/v0.8.0.md +118 -0
  117. package/docs/releases/v0.9.0.md +98 -0
  118. package/docs/releases/v0.9.1.md +83 -0
  119. package/package.json +102 -6
  120. package/plugins/mirror-mind/.claude-plugin/plugin.json +17 -0
  121. package/plugins/mirror-mind/hooks/hooks.json +62 -0
  122. package/plugins/mirror-mind/hooks/log-assistant-reply.sh +98 -0
  123. package/plugins/mirror-mind/hooks/log-session-end.sh +98 -0
  124. package/plugins/mirror-mind/hooks/log-user-prompt.sh +98 -0
  125. package/plugins/mirror-mind/hooks/mirror-inject.sh +98 -0
  126. package/plugins/mirror-mind/hooks/session-start.sh +98 -0
  127. package/plugins/mirror-mind/skills/mm-backup/SKILL.md +27 -0
  128. package/plugins/mirror-mind/skills/mm-build/SKILL.md +1206 -0
  129. package/plugins/mirror-mind/skills/mm-consolidate/SKILL.md +112 -0
  130. package/plugins/mirror-mind/skills/mm-consult/SKILL.md +83 -0
  131. package/plugins/mirror-mind/skills/mm-conversations/SKILL.md +17 -0
  132. package/plugins/mirror-mind/skills/mm-discard/SKILL.md +40 -0
  133. package/plugins/mirror-mind/skills/mm-explore/SKILL.md +241 -0
  134. package/plugins/mirror-mind/skills/mm-help/SKILL.md +104 -0
  135. package/plugins/mirror-mind/skills/mm-identity/SKILL.md +96 -0
  136. package/plugins/mirror-mind/skills/mm-journal/SKILL.md +21 -0
  137. package/plugins/mirror-mind/skills/mm-journey/SKILL.md +37 -0
  138. package/plugins/mirror-mind/skills/mm-journeys/SKILL.md +15 -0
  139. package/plugins/mirror-mind/skills/mm-memories/SKILL.md +20 -0
  140. package/plugins/mirror-mind/skills/mm-mirror/SKILL.md +67 -0
  141. package/plugins/mirror-mind/skills/mm-mute/SKILL.md +18 -0
  142. package/plugins/mirror-mind/skills/mm-new/SKILL.md +18 -0
  143. package/plugins/mirror-mind/skills/mm-recall/SKILL.md +17 -0
  144. package/plugins/mirror-mind/skills/mm-release-notes/SKILL.md +31 -0
  145. package/plugins/mirror-mind/skills/mm-seed/SKILL.md +15 -0
  146. package/plugins/mirror-mind/skills/mm-shadow/SKILL.md +117 -0
  147. package/plugins/mirror-mind/skills/mm-soul/SKILL.md +488 -0
  148. package/plugins/mirror-mind/skills/mm-tasks/SKILL.md +36 -0
  149. package/plugins/mirror-mind/skills/mm-update/SKILL.md +30 -0
  150. package/plugins/mirror-mind/skills/mm-week/SKILL.md +46 -0
  151. package/plugins/mirror-mind/skills/mm-welcome/SKILL.md +22 -0
  152. package/scripts/codex-hooks/session-end.sh +85 -0
  153. package/scripts/codex-hooks/session-start.sh +85 -0
  154. package/scripts/codex-mirror.sh +48 -0
  155. package/templates/identity/README.md +119 -0
  156. package/templates/identity/ego/behavior.yaml +52 -0
  157. package/templates/identity/ego/constraints.yaml +15 -0
  158. package/templates/identity/ego/identity.yaml +43 -0
  159. package/templates/identity/journeys/personal-growth.yaml +39 -0
  160. package/templates/identity/organization/identity.yaml +24 -0
  161. package/templates/identity/organization/principles.yaml +17 -0
  162. package/templates/identity/personas/coach.yaml +94 -0
  163. package/templates/identity/personas/designer.yaml +93 -0
  164. package/templates/identity/personas/doctor.yaml +96 -0
  165. package/templates/identity/personas/engineer.yaml +77 -0
  166. package/templates/identity/personas/financial.yaml +97 -0
  167. package/templates/identity/personas/prompt-engineer.yaml +122 -0
  168. package/templates/identity/personas/researcher.yaml +88 -0
  169. package/templates/identity/personas/strategist.yaml +91 -0
  170. package/templates/identity/personas/teacher.yaml +95 -0
  171. package/templates/identity/personas/therapist.yaml +91 -0
  172. package/templates/identity/personas/thinker.yaml +74 -0
  173. package/templates/identity/personas/writer.yaml +76 -0
  174. package/templates/identity/self/config.yaml +16 -0
  175. package/templates/identity/self/soul.yaml +105 -0
  176. package/templates/identity/user/identity.yaml +30 -0
  177. package/ts/src/backup/staging.ts +62 -0
  178. package/ts/src/backup/zipBackup.ts +267 -0
  179. package/ts/src/backup/zipReader.ts +109 -0
  180. package/ts/src/backup/zipWriter.ts +148 -0
  181. package/ts/src/builder/activeCheckpoint.ts +134 -0
  182. package/ts/src/builder/aggregateStatus.ts +34 -0
  183. package/ts/src/builder/approve.ts +149 -0
  184. package/ts/src/builder/argv.ts +292 -0
  185. package/ts/src/builder/ariadMethod.ts +536 -0
  186. package/ts/src/builder/artifacts/artifactSurfaces.ts +106 -0
  187. package/ts/src/builder/artifacts/artifactWriter.ts +113 -0
  188. package/ts/src/builder/artifacts/closureArtifacts.ts +199 -0
  189. package/ts/src/builder/artifacts/deliveryStoryArtifacts.ts +316 -0
  190. package/ts/src/builder/artifacts/planArtifacts.ts +242 -0
  191. package/ts/src/builder/artifacts/scaffoldSections.ts +273 -0
  192. package/ts/src/builder/artifacts/scaffoldState.ts +227 -0
  193. package/ts/src/builder/artifacts/storyFiles.ts +61 -0
  194. package/ts/src/builder/artifacts/storyIndex.ts +166 -0
  195. package/ts/src/builder/cadence.ts +59 -0
  196. package/ts/src/builder/card.ts +192 -0
  197. package/ts/src/builder/checkpointRefused.ts +66 -0
  198. package/ts/src/builder/closure.ts +964 -0
  199. package/ts/src/builder/commands.ts +2053 -0
  200. package/ts/src/builder/cursorPosition.ts +176 -0
  201. package/ts/src/builder/cursorTransitions.ts +77 -0
  202. package/ts/src/builder/deliveryCursor.ts +577 -0
  203. package/ts/src/builder/deliveryStoryClosure.ts +521 -0
  204. package/ts/src/builder/deliveryStoryPlan.ts +536 -0
  205. package/ts/src/builder/deliveryStoryReady.ts +160 -0
  206. package/ts/src/builder/deliveryStoryRoadmapClosure.ts +151 -0
  207. package/ts/src/builder/expand.ts +336 -0
  208. package/ts/src/builder/flowUnit.ts +339 -0
  209. package/ts/src/builder/homeSurface.ts +122 -0
  210. package/ts/src/builder/implementationGuard.ts +125 -0
  211. package/ts/src/builder/index.ts +11 -0
  212. package/ts/src/builder/lifecycleRefusal.ts +92 -0
  213. package/ts/src/builder/lifecycleRibbon.ts +159 -0
  214. package/ts/src/builder/load.ts +313 -0
  215. package/ts/src/builder/methodAdoption.ts +113 -0
  216. package/ts/src/builder/methodDefinition.ts +429 -0
  217. package/ts/src/builder/methodInspection.ts +371 -0
  218. package/ts/src/builder/plan.ts +408 -0
  219. package/ts/src/builder/planPreauthorization.ts +265 -0
  220. package/ts/src/builder/prepare.ts +225 -0
  221. package/ts/src/builder/projectPaths.ts +64 -0
  222. package/ts/src/builder/pull.ts +356 -0
  223. package/ts/src/builder/pullCandidates.ts +463 -0
  224. package/ts/src/builder/pullCandidatesRender.ts +238 -0
  225. package/ts/src/builder/refinementField.ts +93 -0
  226. package/ts/src/builder/releaseIntent.ts +173 -0
  227. package/ts/src/builder/resumeState.ts +84 -0
  228. package/ts/src/builder/resumeSurface.ts +149 -0
  229. package/ts/src/builder/roadmapGrammar.ts +300 -0
  230. package/ts/src/builder/roadmapScan.ts +97 -0
  231. package/ts/src/builder/roadmapScope.ts +210 -0
  232. package/ts/src/builder/scopePhrases.ts +146 -0
  233. package/ts/src/builder/storyPaths.ts +196 -0
  234. package/ts/src/builder/storyPlanPreauthorization.ts +287 -0
  235. package/ts/src/builder/surfaceProtocol.ts +42 -0
  236. package/ts/src/builder/templateGeneration.ts +148 -0
  237. package/ts/src/builder/transition.ts +178 -0
  238. package/ts/src/consult/args.ts +99 -0
  239. package/ts/src/consult/core.ts +122 -0
  240. package/ts/src/consult/modelCatalog.ts +55 -0
  241. package/ts/src/consult/render.ts +47 -0
  242. package/ts/src/conversation/append.ts +414 -0
  243. package/ts/src/conversation/backfill.ts +387 -0
  244. package/ts/src/conversation/closeTail.ts +467 -0
  245. package/ts/src/conversation/extraction.ts +333 -0
  246. package/ts/src/conversation/extractionDriver.ts +130 -0
  247. package/ts/src/conversation/extractionRun.ts +70 -0
  248. package/ts/src/conversation/hookPayload.ts +51 -0
  249. package/ts/src/conversation/journeyInference.ts +165 -0
  250. package/ts/src/conversation/journeyRepair.ts +114 -0
  251. package/ts/src/conversation/lifecycleFaces.ts +197 -0
  252. package/ts/src/conversation/lifecycleWrites.ts +313 -0
  253. package/ts/src/conversation/listing.ts +77 -0
  254. package/ts/src/conversation/logger.ts +851 -0
  255. package/ts/src/conversation/loggerCli.ts +321 -0
  256. package/ts/src/conversation/loggerRuntime.ts +259 -0
  257. package/ts/src/conversation/metadataLifecycle.ts +443 -0
  258. package/ts/src/conversation/recall.ts +66 -0
  259. package/ts/src/conversation/sessionComposites.ts +258 -0
  260. package/ts/src/conversation/sessionImport.ts +90 -0
  261. package/ts/src/conversation/transcriptBackfill.ts +141 -0
  262. package/ts/src/cultivation/applyActions.ts +241 -0
  263. package/ts/src/cultivation/cluster.ts +86 -0
  264. package/ts/src/cultivation/consolidationStore.ts +281 -0
  265. package/ts/src/cultivation/promptContext.ts +62 -0
  266. package/ts/src/cultivation/propose.ts +305 -0
  267. package/ts/src/cultivation/scan.ts +155 -0
  268. package/ts/src/db/backupGate.ts +47 -0
  269. package/ts/src/db/bootstrap.ts +108 -0
  270. package/ts/src/db/bootstrapLock.ts +223 -0
  271. package/ts/src/db/copyGuard.ts +60 -0
  272. package/ts/src/db/database.ts +397 -0
  273. package/ts/src/db/decode.ts +66 -0
  274. package/ts/src/db/ftsIntegrity.ts +41 -0
  275. package/ts/src/db/migrateOnOpen.ts +214 -0
  276. package/ts/src/db/migrations.ts +576 -0
  277. package/ts/src/db/readyOnOpen.ts +35 -0
  278. package/ts/src/db/rowDecode.ts +42 -0
  279. package/ts/src/db/schema.ts +432 -0
  280. package/ts/src/db/schemaInventory.ts +225 -0
  281. package/ts/src/db/schemaInventorySnapshot.ts +2107 -0
  282. package/ts/src/db/schemaState.ts +91 -0
  283. package/ts/src/db/schemaTsDivergence.ts +114 -0
  284. package/ts/src/descriptor/descriptorRead.ts +49 -0
  285. package/ts/src/docs/docsLint.ts +265 -0
  286. package/ts/src/explorer/handoff.ts +522 -0
  287. package/ts/src/explorer/render.ts +335 -0
  288. package/ts/src/explorer/story.ts +769 -0
  289. package/ts/src/explorer/transition.ts +72 -0
  290. package/ts/src/extensions/bindings.ts +170 -0
  291. package/ts/src/extensions/catalog.ts +249 -0
  292. package/ts/src/extensions/catalogCommands.ts +513 -0
  293. package/ts/src/extensions/catalogWrites.ts +652 -0
  294. package/ts/src/extensions/contextRuntime.ts +325 -0
  295. package/ts/src/extensions/dispatch.ts +374 -0
  296. package/ts/src/extensions/errors.ts +24 -0
  297. package/ts/src/extensions/manifest.ts +356 -0
  298. package/ts/src/extensions/migrations.ts +350 -0
  299. package/ts/src/extraction/conversation.ts +304 -0
  300. package/ts/src/extraction/conversationMetadata.ts +206 -0
  301. package/ts/src/extraction/fencing.ts +106 -0
  302. package/ts/src/extraction/json.ts +17 -0
  303. package/ts/src/extraction/prompts.ts +470 -0
  304. package/ts/src/frontDoor/args.ts +30 -0
  305. package/ts/src/frontDoor/argvShape.ts +106 -0
  306. package/ts/src/frontDoor/buildLoadRuntime.ts +139 -0
  307. package/ts/src/frontDoor/buildRoute.ts +398 -0
  308. package/ts/src/frontDoor/cli.ts +1872 -0
  309. package/ts/src/frontDoor/cloneRoleGuard.ts +98 -0
  310. package/ts/src/frontDoor/consultRoute.ts +50 -0
  311. package/ts/src/frontDoor/contentTailRoute.ts +239 -0
  312. package/ts/src/frontDoor/conversationLoggerRoute.ts +83 -0
  313. package/ts/src/frontDoor/cultivationRoute.ts +210 -0
  314. package/ts/src/frontDoor/dbPath.ts +131 -0
  315. package/ts/src/frontDoor/dbSafetyToolsRoute.ts +240 -0
  316. package/ts/src/frontDoor/exploreRoute.ts +572 -0
  317. package/ts/src/frontDoor/extensionCatalogRoute.ts +252 -0
  318. package/ts/src/frontDoor/frontDoorLog.ts +57 -0
  319. package/ts/src/frontDoor/identityWrite.ts +36 -0
  320. package/ts/src/frontDoor/journeyWriteRoute.ts +26 -0
  321. package/ts/src/frontDoor/lifecycleWriteRoute.ts +110 -0
  322. package/ts/src/frontDoor/liveBackup.ts +100 -0
  323. package/ts/src/frontDoor/mirrorModeRoute.ts +163 -0
  324. package/ts/src/frontDoor/namedRefusal.ts +35 -0
  325. package/ts/src/frontDoor/nodeSupport.ts +24 -0
  326. package/ts/src/frontDoor/render/consolidate.ts +199 -0
  327. package/ts/src/frontDoor/render/conversations.ts +33 -0
  328. package/ts/src/frontDoor/render/cultivationShared.ts +21 -0
  329. package/ts/src/frontDoor/render/descriptor.ts +20 -0
  330. package/ts/src/frontDoor/render/detectPersona.ts +50 -0
  331. package/ts/src/frontDoor/render/icons.ts +13 -0
  332. package/ts/src/frontDoor/render/identity.ts +59 -0
  333. package/ts/src/frontDoor/render/identityRows.ts +17 -0
  334. package/ts/src/frontDoor/render/inspectPersona.ts +53 -0
  335. package/ts/src/frontDoor/render/journeyStatus.ts +78 -0
  336. package/ts/src/frontDoor/render/journeys.ts +79 -0
  337. package/ts/src/frontDoor/render/list.ts +41 -0
  338. package/ts/src/frontDoor/render/memories.ts +67 -0
  339. package/ts/src/frontDoor/render/recall.ts +49 -0
  340. package/ts/src/frontDoor/render/shadow.ts +155 -0
  341. package/ts/src/frontDoor/render/tasks.ts +99 -0
  342. package/ts/src/frontDoor/render/tasksImportSync.ts +63 -0
  343. package/ts/src/frontDoor/render/week.ts +113 -0
  344. package/ts/src/frontDoor/routing.ts +1001 -0
  345. package/ts/src/frontDoor/runtimeRoute.ts +623 -0
  346. package/ts/src/frontDoor/searchRoute.ts +166 -0
  347. package/ts/src/frontDoor/seedPaths.ts +98 -0
  348. package/ts/src/frontDoor/sessionStartWelcomeRoute.ts +166 -0
  349. package/ts/src/frontDoor/soulRoute.ts +433 -0
  350. package/ts/src/frontDoor/stdinSource.ts +37 -0
  351. package/ts/src/frontDoor/tasksImportSyncRoute.ts +110 -0
  352. package/ts/src/frontDoor/tasksWriteRoute.ts +101 -0
  353. package/ts/src/frontDoor/usage.ts +176 -0
  354. package/ts/src/guards/claudePlugin.ts +298 -0
  355. package/ts/src/guards/packContents.ts +306 -0
  356. package/ts/src/guards/piSourcedSkills.ts +70 -0
  357. package/ts/src/guards/retiredRouteShadows.ts +57 -0
  358. package/ts/src/guards/retiredSurfaces.ts +564 -0
  359. package/ts/src/hooks/claude.ts +214 -0
  360. package/ts/src/hooks/codex.ts +45 -0
  361. package/ts/src/hooks/gemini.ts +126 -0
  362. package/ts/src/hooks/main.ts +109 -0
  363. package/ts/src/hooks/mirrorState.ts +71 -0
  364. package/ts/src/hooks/payload.ts +73 -0
  365. package/ts/src/hooks/runtime.ts +179 -0
  366. package/ts/src/hooks/runtimeDetection.ts +34 -0
  367. package/ts/src/identity/applyConsolidationIdentityUpdate.ts +67 -0
  368. package/ts/src/identity/descriptorGenerate.ts +162 -0
  369. package/ts/src/identity/identityEdit.ts +143 -0
  370. package/ts/src/identity/identityKey.ts +77 -0
  371. package/ts/src/identity/identityRead.ts +69 -0
  372. package/ts/src/identity/identityStore.ts +80 -0
  373. package/ts/src/identity/journeyListing.ts +53 -0
  374. package/ts/src/identity/personaInspect.ts +44 -0
  375. package/ts/src/identity/personaListing.ts +37 -0
  376. package/ts/src/identity/setIdentity.ts +64 -0
  377. package/ts/src/index.ts +231 -0
  378. package/ts/src/init/init.ts +111 -0
  379. package/ts/src/journey/journeyOptions.ts +131 -0
  380. package/ts/src/journey/journeyRemoval.ts +158 -0
  381. package/ts/src/journey/journeyStatus.ts +149 -0
  382. package/ts/src/journey/journeySyncFile.ts +87 -0
  383. package/ts/src/journey/journeyWrite.ts +203 -0
  384. package/ts/src/journey/parentJourney.ts +41 -0
  385. package/ts/src/journey/validateParentJourney.ts +55 -0
  386. package/ts/src/mcp/boundary.ts +151 -0
  387. package/ts/src/mcp/guards.ts +244 -0
  388. package/ts/src/mcp/main.ts +121 -0
  389. package/ts/src/mcp/payload.ts +141 -0
  390. package/ts/src/mcp/protocol.ts +141 -0
  391. package/ts/src/mcp/readModels.ts +241 -0
  392. package/ts/src/mcp/registry.ts +201 -0
  393. package/ts/src/mcp/serve.ts +120 -0
  394. package/ts/src/mcp/tools/deterministic.ts +137 -0
  395. package/ts/src/mcp/tools/providerCrossing.ts +187 -0
  396. package/ts/src/mcp/wire.ts +8 -0
  397. package/ts/src/memory/journal.ts +180 -0
  398. package/ts/src/memory/listing.ts +107 -0
  399. package/ts/src/memory/memoryWrite.ts +88 -0
  400. package/ts/src/memory/reinforcement.ts +35 -0
  401. package/ts/src/mirror/context.ts +161 -0
  402. package/ts/src/mirror/defaultResolution.ts +199 -0
  403. package/ts/src/mirror/mirrorForm.ts +43 -0
  404. package/ts/src/mirror/orchestration.ts +364 -0
  405. package/ts/src/mirror/reception.ts +194 -0
  406. package/ts/src/mirror/render.ts +75 -0
  407. package/ts/src/mirror/runtimeSession.ts +205 -0
  408. package/ts/src/mode/operatingMode.ts +148 -0
  409. package/ts/src/observability/callOutcome.ts +115 -0
  410. package/ts/src/observability/inspectLedger.ts +329 -0
  411. package/ts/src/observability/ledgerHooks.ts +126 -0
  412. package/ts/src/observability/llmCalls.ts +154 -0
  413. package/ts/src/persona/detectPersona.ts +81 -0
  414. package/ts/src/planning/promptAssembly.ts +111 -0
  415. package/ts/src/planning/weekPending.ts +81 -0
  416. package/ts/src/planning/weekPlan.ts +183 -0
  417. package/ts/src/planning/weekSave.ts +117 -0
  418. package/ts/src/providers/config.ts +189 -0
  419. package/ts/src/providers/cost.ts +64 -0
  420. package/ts/src/providers/credits.ts +204 -0
  421. package/ts/src/providers/embedding.ts +321 -0
  422. package/ts/src/providers/familyProviders.ts +147 -0
  423. package/ts/src/providers/llm.ts +334 -0
  424. package/ts/src/providers/openrouter.ts +244 -0
  425. package/ts/src/providers/redaction.ts +110 -0
  426. package/ts/src/providers/replay.ts +15 -0
  427. package/ts/src/providers/transport.ts +410 -0
  428. package/ts/src/repair/encodingRepair.ts +253 -0
  429. package/ts/src/runtime/backup.ts +151 -0
  430. package/ts/src/runtime/channel.ts +146 -0
  431. package/ts/src/runtime/config.ts +168 -0
  432. package/ts/src/runtime/diagnose.ts +686 -0
  433. package/ts/src/runtime/git.ts +510 -0
  434. package/ts/src/runtime/installKind.ts +220 -0
  435. package/ts/src/runtime/migrate.ts +154 -0
  436. package/ts/src/runtime/packageIdentity.ts +102 -0
  437. package/ts/src/runtime/releaseNotes.ts +244 -0
  438. package/ts/src/runtime/status.ts +557 -0
  439. package/ts/src/runtime/strategies/clone.ts +200 -0
  440. package/ts/src/runtime/strategies/package.ts +328 -0
  441. package/ts/src/runtime/treeRoot.ts +30 -0
  442. package/ts/src/runtime/update.ts +445 -0
  443. package/ts/src/runtime/updateGate.ts +40 -0
  444. package/ts/src/runtime/updatePipeline.ts +159 -0
  445. package/ts/src/runtime/version.ts +36 -0
  446. package/ts/src/runtime/wiring.ts +130 -0
  447. package/ts/src/search/memorySearch.ts +338 -0
  448. package/ts/src/search/ranker.ts +154 -0
  449. package/ts/src/seed/seed.ts +256 -0
  450. package/ts/src/seed/seedYaml.ts +133 -0
  451. package/ts/src/soul/apply.ts +218 -0
  452. package/ts/src/soul/harvest.ts +267 -0
  453. package/ts/src/soul/prompts/soul_beauty_voice.md +103 -0
  454. package/ts/src/soul/prompts/soul_self_voice.md +219 -0
  455. package/ts/src/soul/prompts/soul_wisdom_voice.md +121 -0
  456. package/ts/src/soul/prompts.ts +85 -0
  457. package/ts/src/soul/render.ts +358 -0
  458. package/ts/src/soul/state.ts +212 -0
  459. package/ts/src/soul/transition.ts +37 -0
  460. package/ts/src/tasks/journeyPathParse.ts +113 -0
  461. package/ts/src/tasks/taskImportSync.ts +142 -0
  462. package/ts/src/tasks/taskStore.ts +312 -0
  463. package/ts/src/tasks/weekView.ts +120 -0
  464. package/ts/src/util/clipCodePoints.ts +26 -0
  465. package/ts/src/util/paths.ts +63 -0
  466. package/ts/src/util/program.ts +9 -0
  467. package/ts/src/util/pyGenerators.ts +144 -0
  468. package/ts/src/util/pythonText.ts +317 -0
  469. package/ts/src/util/semver.ts +45 -0
  470. package/ts/src/util/shellWord.ts +25 -0
  471. package/ts/src/util/slug.ts +64 -0
  472. package/ts/src/welcome/card.ts +339 -0
  473. package/ts/src/welcome/statusLine.ts +101 -0
  474. package/ts/src/welcome/updateCache.ts +129 -0
@@ -0,0 +1,142 @@
1
+ ---
2
+ digest: >
3
+ v0.31.3 is a maintenance patch that makes the Ariad Delivery Story plan
4
+ lifecycle's artifacts trustworthy. The `ARTIFACTS_MATERIALIZED` surface claimed
5
+ an `index.md` update and a `test-guide.md` creation that `plan-delivery-story`
6
+ never wrote (AF-002, AF-006), and the DS `plan.md` was both thinner than the
7
+ method's own `plan_contract` and regenerated on approval, silently overwriting
8
+ authored planning work (AF-003). The release drives the surface from the
9
+ writer's real result, materializes the full package without clobbering
10
+ authored content, scaffolds every `plan_contract` section, and — after a
11
+ six-lens technical review chose pure-preserve over a surgical status patcher —
12
+ removes mutable status from the document so approval preserves the authored
13
+ plan instead of rewriting it. Approval now also flags any contract section left
14
+ unfilled. The recurring decision: never duplicate state that already has a
15
+ source of truth, and let a test guard any place two artifacts must agree.
16
+ ---
17
+
18
+ # v0.31.3 — Ariad DS-Plan Artifact Integrity
19
+
20
+ **Date:** 2026-07-22
21
+
22
+ ## Highlights
23
+
24
+ - Fixes phantom `ARTIFACTS_MATERIALIZED` rows: `plan-delivery-story` and
25
+ `approve-delivery-story-plan` reported an `index.md` update and a
26
+ `test-guide.md` creation that never touched disk (AF-002, AF-006). The surface
27
+ is now built from the writer's real return manifest, so every reported path
28
+ exists with a truthful `created`/`existing` label.
29
+ - Materializes the full Delivery Story package: `plan.md` is upserted, while
30
+ `index.md` and `test-guide.md` are scaffolded only when absent, so
31
+ hand-authored or Expand-generated content is never overwritten.
32
+ - Scaffolds every `plan_contract` required output in `plan.md` — Scope,
33
+ Non-Goals, Acceptance Behavior, Validation Route, and Implementation Contract —
34
+ guarded by a contract-drift test so the template and the method's declared
35
+ contract cannot silently diverge (AF-003).
36
+ - Makes the authored plan durable: mutable status (`Status`, Approval Gate,
37
+ Boundary) was removed from the `plan.md` template, and
38
+ `approve-delivery-story-plan` now preserves the document instead of
39
+ regenerating it. Approval state lives only in the Builder delivery cursor and
40
+ the `DELIVERY_STORY_PLAN_CHECKPOINT` surface.
41
+ - Adds a non-blocking completeness advisory: approval lists any contract section
42
+ still carrying its scaffold `Pending` placeholder under "Sections still
43
+ pending".
44
+ - Records conscious exclusions: approval warns rather than hard-blocks on
45
+ unfilled sections, and the artifact-path code-segment sanitization (D-012)
46
+ remains open.
47
+
48
+ ## Where We Started
49
+
50
+ A separate Builder session planning Delivery Story DS-37 noticed that the
51
+ DS-plan lifecycle's `ARTIFACTS_MATERIALIZED` surface listed three artifacts —
52
+ `index.md`, `plan.md`, `test-guide.md` — while only `plan.md` ever reached disk.
53
+ On every `plan-delivery-story` and `approve-delivery-story-plan` call the surface
54
+ claimed a `test-guide.md` that did not exist and an `index.md` "update" that
55
+ never happened. Deterministic Ariad surfaces exist precisely so the Navigator can
56
+ trust them instead of inferring state from prose, and the surface is also
57
+ rendered verbatim into the agent's own context on resume — so a phantom artifact
58
+ does not merely mislead a human, it poisons the model's ground truth. These
59
+ became AF-002 and AF-006 in the Ariad dogfooding ledger.
60
+
61
+ The same ledger carried AF-003: the generated `plan.md` held only metadata, an
62
+ objective, and a child list — none of the `plan_contract` outputs the method
63
+ itself declares. Every Delivery Story plan was born structurally incomplete
64
+ relative to the runtime's own contract.
65
+
66
+ ## What Changed
67
+
68
+ The surface bug was fixed first, and its root cause set the theme for the whole
69
+ release: two sources of truth. The writer wrote files; the reporter independently
70
+ re-derived what it *assumed* had been written. Any time two code paths compute
71
+ the same fact separately, they drift. The fix made the writer return exactly what
72
+ it did and had the surface render that manifest — collapsing the entire
73
+ surface-not-equal-disk class for DS-plan. Materialization also became
74
+ no-clobber: `index.md` and `test-guide.md` are scaffolded only when absent, and a
75
+ preserved file is reported with the established `existing` status rather than a
76
+ false "updated".
77
+
78
+ AF-003 then unfolded in three moves, each pulled and reviewed in turn. First, the
79
+ `plan.md` template gained a scaffolded section for every `plan_contract` output,
80
+ with a contract-drift test that reads the live method definition and fails if the
81
+ template ever falls behind. Grounding that change surfaced a design fork the
82
+ handoff had not: because `approve-delivery-story-plan` regenerated `plan.md` from
83
+ the report, anything a driver authored into those new sections would be clobbered
84
+ on approval — the same failure class as the phantom artifacts, one file over.
85
+
86
+ That fork went to a six-lens technical review — quality-assurance drafting, then
87
+ engineer, database-architect, devops-engineer, ai-engineer, prompt-engineer, and
88
+ security-engineer. The review converged, against the original surgical-patch
89
+ lean, on **pure-preserve**: rather than teach approval to rewrite the document
90
+ carefully, stop duplicating mutable state into it at all. Mutable status was
91
+ removed from the `plan.md` template — the delivery cursor and the checkpoint
92
+ surface already own approval state — and approval now preserves the file. The
93
+ authored plan survives byte-for-byte, with no markdown parser, no anchor-collision
94
+ seam, and no new failure surface. A final increment made approval list any
95
+ section still left as a `Pending` placeholder, so an incomplete plan cannot pass
96
+ approval unnoticed, while leaving the Navigator free to approve a deliberately
97
+ thin plan.
98
+
99
+ Throughout, the section definitions were consolidated into a single source used
100
+ by both the renderer and the completeness detector, so they cannot drift — the
101
+ same principle that fixed the original surface bug, applied to the document
102
+ itself.
103
+
104
+ ## Conscious Exclusions
105
+
106
+ - **Warn, not block.** Approval surfaces unfilled sections but does not refuse
107
+ approval. Ariad checkpoints inform; the Navigator retains authority to approve
108
+ a plan with legitimately thin sections. A hard-block or soft-block mode is left
109
+ as a future increment.
110
+ - **No content-diff on `updated`.** `plan.md` is labeled `updated` by prior
111
+ existence rather than a byte-level diff. It is genuinely rewritten on
112
+ `plan-delivery-story`, so the label is truthful; reporting `unchanged` on a
113
+ byte-identical rewrite across every lifecycle artifact remains a separate
114
+ enhancement.
115
+ - **D-012 — code-segment path sanitization.** The artifact directory is derived
116
+ from the work-item code, which is still only lower-cased and dot-split rather
117
+ than run through `kebab_slug`. This release only adds fixed filenames inside an
118
+ already-used directory, so it widens no path surface; the latent seam carried
119
+ from v0.31.2 stays recorded, not fixed here.
120
+
121
+ ## What We Learned
122
+
123
+ The same lesson arrived three times in one release. A surface that re-derives what
124
+ a writer did, a document that carries a copy of cursor state, and a detector that
125
+ hardcodes the renderer's text are all the same shape: a second copy of a fact that
126
+ already has an owner, free to drift. Each was fixed not by smarter
127
+ synchronization but by removing the duplication — the writer returns its own
128
+ result, the document stops carrying status, the sections live in one table. Where
129
+ two artifacts genuinely must agree, a test that reads the source of truth turned
130
+ out cheaper than vigilance. The review also earned its keep: it inverted the
131
+ release's central decision, replacing a status patcher that would have added a
132
+ parser with a deletion that removed the problem entirely.
133
+
134
+ ## Next Horizon
135
+
136
+ The Delivery Story plan lifecycle is now trustworthy end to end: it materializes
137
+ truthfully, scaffolds completely, preserves authored work, and flags
138
+ incompleteness. Visible from here are the follow-ups this release consciously
139
+ deferred — an optional validating or blocking mode for plan completeness, the
140
+ content-diff refinement that would let every artifact report `unchanged`, and the
141
+ D-012 code-segment sanitization the next time artifact-path derivation is
142
+ touched.
@@ -0,0 +1,117 @@
1
+ ---
2
+ digest: >
3
+ v0.31.4 is a maintenance patch that stops Ariad's Builder from materializing
4
+ a phantom, parallel story-package tree when expanding a Delivery Story.
5
+ `_artifact_directory` derived roadmap folder slugs from the item code plus
6
+ title, but real roadmaps use hand-authored CV/DS slugs
7
+ (`cv3-build-de-producao`) that no title derivation can reproduce — so pulling
8
+ and expanding CV3.DS22 wrote a boilerplate `cv3-manage-100-funcional/cv3-ds22/`
9
+ tree instead of expanding the real node at
10
+ `cv3-build-de-producao/cv3-ds22-manage-100-funcional/`. The fix makes Expand
11
+ resolve the existing on-disk folder first — scanning `docs/project/roadmap`
12
+ for the `index.md` whose `# CODE — Title` heading matches the item code, the
13
+ same scan-and-skip-legacy path the pull inspector already uses — and only
14
+ falls back to title derivation for genuinely new items. A regression test
15
+ pins the nested case, and the fix was validated against the live kia-desktop
16
+ roadmap.
17
+ ---
18
+
19
+ # v0.31.4 — Roadmap-Aligned Story Expansion
20
+
21
+ **Date:** 2026-07-22
22
+
23
+ ## Highlights
24
+
25
+ - Fixes Expand materializing a *parallel* story-package tree at a
26
+ title-derived path instead of expanding the real Delivery Story: for CV3.DS22
27
+ the runtime wrote `docs/project/roadmap/cv3-manage-100-funcional/cv3-ds22/`
28
+ with a boilerplate US1 while the real node lived at
29
+ `docs/project/roadmap/cv3-build-de-producao/cv3-ds22-manage-100-funcional/`.
30
+ - Root cause: `_artifact_directory` derived folder slugs from code plus title,
31
+ but hand-authored roadmaps use CV/DS slugs (`cv3-build-de-producao`) that no
32
+ title derivation can reproduce.
33
+ - Expand now resolves the existing folder by heading code via a new
34
+ `_resolve_existing_item_directory` — scanning `docs/project/roadmap` for the
35
+ `index.md` whose `# CODE — Title` heading matches the item code (the same
36
+ scan plus legacy-path skip the pull inspector uses) — and only falls back to
37
+ title derivation for genuinely new items not yet on disk.
38
+ - Aligns Expand with pull inspection, which already resolved true on-disk
39
+ paths; the writer and the inspector had silently diverged.
40
+ - Ships test-first: a nested-folder regression (child lands under the real
41
+ `cv3-build-de-producao/cv3-ds22-*` dir, no stray `cv3-manage-100-funcional`
42
+ tree) fails before and passes after. Validated against the live kia-desktop
43
+ roadmap (CV3, CV3.DS18, CV3.DS22, CV3.DS18.TS2 all resolve to their true
44
+ folders).
45
+
46
+ ## Where We Started
47
+
48
+ A Builder session pulling a Delivery Story and expanding it produced two
49
+ roadmap trees where there should have been one. Pulling CV3.DS22 ("Manage 100%
50
+ funcional") and expanding it wrote a fresh `cv3-manage-100-funcional/cv3-ds22/`
51
+ folder containing a boilerplate US1, while the real, hand-authored Delivery
52
+ Story sat untouched at `cv3-build-de-producao/cv3-ds22-manage-100-funcional/`.
53
+ The runtime had quietly forked the roadmap: the authored node and a synthetic
54
+ sibling now coexisted, and the expansion landed in the wrong one.
55
+
56
+ The cause was a divergence between two code paths that should agree. Pull
57
+ inspection already resolves the true on-disk location by scanning `index.md`
58
+ headings, so it found the real folder. Expand did not — `_artifact_directory`
59
+ rebuilt a path from the item code plus a title-derived slug. Real roadmaps use
60
+ hand-chosen CV/DS slugs (`cv3-build-de-producao`) that no title derivation can
61
+ reproduce, so the derived path never matched the authored one, and Expand
62
+ created a parallel tree instead.
63
+
64
+ ## What Changed
65
+
66
+ `_artifact_directory` now resolves the existing folder before deriving
67
+ anything. A new `_resolve_existing_item_directory` scans `docs/project/roadmap`
68
+ for the `index.md` whose `# CODE — Title` heading matches the item's code
69
+ (case-insensitive), reusing the same traversal and legacy-path skip the pull
70
+ inspector already relies on. When it finds the authored folder, Expand
71
+ materializes children there. Only for a genuinely new item — one not yet on
72
+ disk — does it fall back to the previous code-plus-title-slug derivation. That
73
+ preserves the ability to scaffold new nodes while keeping existing ones aligned
74
+ with the hand-authored tree.
75
+
76
+ The change is small and surgical: 36 lines in `builder/lifecycle.py`, reusing
77
+ `HEADING_RE` and `is_legacy_path` from `roadmap_grammar` rather than
78
+ introducing a second heading parser. It shipped test-first. A new regression
79
+ builds the real nested structure
80
+ (`cv3-build-de-producao/cv3-ds22-manage-100-funcional/`), expands the Delivery
81
+ Story, and asserts the child lands under the real directory by its real code,
82
+ that no stray `cv3-manage-100-funcional` tree appears, and that every
83
+ materialized path stays under the resolved directory. The test fails before the
84
+ fix and passes after; the full builder unit suite is green and ruff is clean.
85
+ The fix was also validated against the live kia-desktop roadmap, where CV3,
86
+ CV3.DS18, CV3.DS22, and CV3.DS18.TS2 all resolve to their true folders.
87
+
88
+ ## Conscious Exclusions
89
+
90
+ - **Heading resolution, not tree cleanup.** The fix resolves the *existing*
91
+ folder by heading code; it does not retroactively rename or migrate a
92
+ parallel tree that a prior buggy expand already wrote. Any phantom
93
+ `cv3-manage-100-funcional/` folder from before the fix must still be removed
94
+ by hand.
95
+ - **No change to new-item derivation.** Genuinely new items still derive their
96
+ folder from code plus title slug. Title derivation still cannot reproduce a
97
+ hand-authored slug for a node that does not yet exist on disk — by design,
98
+ since there is nothing on disk to resolve against.
99
+
100
+ ## What We Learned
101
+
102
+ Two code paths that answer the same question — "where does this roadmap item
103
+ live?" — must share one resolver, or they drift. Pull inspection had the correct
104
+ answer (scan headings) while Expand carried a plausible-but-wrong shortcut
105
+ (derive from title). The bug was not in either derivation in isolation; it was
106
+ in letting a writer and an inspector disagree about identity. Reusing the
107
+ inspector's scan for the writer closed the gap by construction rather than by
108
+ teaching the derivation to guess better.
109
+
110
+ ## Next Horizon
111
+
112
+ The remaining title-derivation path is now confined to genuinely new items. The
113
+ visible follow-up, the next time this area is touched, is whether new-item
114
+ creation should let authors pin a folder slug explicitly rather than derive
115
+ one — the same authored-slug reality that caused this bug appears whenever a new
116
+ node's human slug matters. Cleaning up any phantom trees written by the old
117
+ behavior is a separate, manual housekeeping task.
@@ -0,0 +1,155 @@
1
+ ---
2
+ digest: >
3
+ v0.31.4 fixed Ariad Expand materializing a phantom, title-derived roadmap
4
+ folder instead of the real, hand-authored one — but only for Expand, and
5
+ only for the case where a package already exists. v0.31.5 closes the class:
6
+ one shared resolver (`story_paths.py`) now backs both Expand and the CLI's
7
+ Plan/checkpoint lookups, silent ambiguity and silent fabrication both become
8
+ a rendered `EXPAND_BLOCKED` refusal, a new CI check makes "one code, one
9
+ package" a build-time guarantee instead of a runtime hope, and a related,
10
+ pre-existing path-sanitization gap (D-012) closes as a direct consequence.
11
+ v0.31.4's same-day, independently-discovered fix is superseded during this
12
+ release, its regression test retained as additional coverage.
13
+ ---
14
+
15
+ # v0.31.5 — One Code, One Package
16
+
17
+ **Date:** 2026-07-23
18
+
19
+ ## Highlights
20
+
21
+ - Supersedes v0.31.4's `_resolve_existing_item_directory` with one shared
22
+ resolver, `memory.builder.story_paths.resolve_story_directory` — heading-based,
23
+ unconditional, used by both Expand (`lifecycle.py`) and the CLI's Plan/checkpoint
24
+ path lookup (`cli/build.py`), which had its own separate, equally fragile
25
+ title-derivation fallback that v0.31.4 never touched.
26
+ - Fail-loud instead of silent, in both directions v0.31.4 left open: two
27
+ packages claiming the same code now raise `StoryPackageAmbiguityError`
28
+ instead of silently resolving to whichever sorts first; a resolved package
29
+ whose candidate table can't be parsed now renders `<<<ARIAD:EXPAND_BLOCKED>>>`
30
+ instead of fabricating a generic story over real, unparseable content.
31
+ - New CI guard — `find_duplicate_roadmap_headings` / `check_roadmap_duplicate_headings`,
32
+ wired into the existing `scripts/check_doc_links.py` and `docs.yml` (no new
33
+ workflow) — fails the build on two `docs/project/roadmap/**/index.md` files
34
+ sharing a heading code, closing the class statically, not just at runtime.
35
+ - **D-012 closed**: the candidate-table *code* cell (Navigator- or
36
+ LLM-authored, unlike the title) is now sanitized the same way the title
37
+ already was, via a new `_sanitize_code_segment`. An unsanitized `/` or `..`
38
+ can no longer create unintended nested directories when Expand materializes
39
+ a child.
40
+ - Canonical candidate-table grammar (`| Code | Story | Type | Outcome | Status |`)
41
+ documented in the DS index template and the mm-build skill's new authoring
42
+ contract, so hand-authored packages are Expand-compatible by construction.
43
+ - Discovered independently on `kia-desktop` (v0.31.4, `b83b8a8`) and on
44
+ `mirror-ts-core`/CV22.DS7 (this release), the same day, before either
45
+ session knew about the other. Reconciled by rebase: v0.31.4's fix is
46
+ retired, its regression test (`test_expand_resolves_existing_nested_roadmap_folder`)
47
+ kept as additional coverage — verified to pass against this release's
48
+ implementation before the rebase was attempted.
49
+
50
+ ## Where We Started
51
+
52
+ Two Ariad sessions hit the identical root cause on the same day, on two
53
+ different projects, without knowing about each other. On `kia-desktop`,
54
+ pulling and expanding `CV3.DS22` wrote a phantom `cv3-manage-100-funcional/cv3-ds22/`
55
+ tree instead of expanding the real, hand-authored
56
+ `cv3-build-de-producao/cv3-ds22-manage-100-funcional/`. That session shipped a
57
+ narrow, same-day fix as v0.31.4: resolve the existing folder by heading code
58
+ before falling back to title derivation.
59
+
60
+ Meanwhile, a handoff from the `mirror-ts-core` journey described the second
61
+ occurrence of a defect first seen as CR048 (`DS6.TS5`, hand-relocated): Expand
62
+ diverging from an authored `CV22.DS7` package because the delivery cursor only
63
+ ever carries a story's *leaf* title, and the old derivation assumed a full
64
+ ancestor-title chain. Investigating that handoff surfaced the same class v0.31.4
65
+ had just patched — but v0.31.4's fix lived entirely inside `lifecycle.py`,
66
+ leaving the CLI's own separate path-resolution implementation untouched, never
67
+ detecting ambiguity, and never addressing the second defect this class
68
+ carries: silent fabrication over content that resolves but doesn't parse.
69
+
70
+ ## What Changed
71
+
72
+ The fix is a DRY consolidation, not a patch on a patch. New
73
+ `src/memory/builder/story_paths.py` gives every path-resolution call site one
74
+ resolver: `resolve_story_directory` is unconditional and heading-based, tried
75
+ first everywhere, and raises `StoryPackageAmbiguityError` the moment two
76
+ packages claim the same code — the actual fix for the divergence class.
77
+ Creating a genuinely new package (nothing exists yet, so nothing can diverge)
78
+ degrades gracefully through three tiers — an existing parent package, the root
79
+ roadmap snapshot's own CV title, or a bare code segment — and never uses
80
+ title-chain arithmetic across code levels, the second, quieter defect in the
81
+ original derivation.
82
+
83
+ Fail-loud is reserved for real ambiguity. When Expand resolves an authored
84
+ package whose `## Candidate Stories` table doesn't parse, or when two packages
85
+ share a code, it now renders a first-class `<<<ARIAD:EXPAND_BLOCKED>>>`
86
+ surface and writes nothing, rather than silently fabricating a generic story
87
+ or silently picking a match. A new CI check makes the "one code, one package"
88
+ invariant a build-time guarantee: `find_duplicate_roadmap_headings` scans the
89
+ whole roadmap tree once, and `check_roadmap_duplicate_headings` wires it into
90
+ the existing documentation-link CI job, so this class fails a pull request
91
+ instead of surfacing in production months later.
92
+
93
+ Pre-flight verification against this project's own 259-package roadmap found
94
+ and fixed two more pre-existing bugs the new invariant depends on: a live
95
+ duplicate heading (`CV20.DS4.US2`, a dropped story whose heading was never
96
+ retitled away from its replacement's code) and a `HEADING_RE` gap that
97
+ silently dropped lowercase sub-story codes like `CV21.E2.S1b`. And touching
98
+ `_story_folder_name` / `_artifact_directory` / `_canonical_package_path` — the
99
+ exact functions [D-012](../project/debt.md#d-012--roadmap-folder-derivation-does-not-sanitize-the-candidate-table-code-cell-for-path-separators)
100
+ named as its revisit trigger — surfaced a real, if low-severity, gap: the
101
+ candidate-table code cell was never sanitized the way the title already was.
102
+ It is now, via `_sanitize_code_segment`, closing the debt in the same release
103
+ rather than carrying it forward again.
104
+
105
+ Reconciling with v0.31.4 required a rebase, not a merge: this release's
106
+ implementation is a strict superset, verified empirically by running v0.31.4's
107
+ own regression test against it before touching any history. The conflict was
108
+ concentrated exactly where expected — `lifecycle.py`'s `_artifact_directory`
109
+ region — and resolved by retiring v0.31.4's `_resolve_existing_item_directory`
110
+ entirely while keeping its test as permanent, independent coverage of the
111
+ `kia-desktop` scenario.
112
+
113
+ ## Conscious Exclusions
114
+
115
+ - **No retroactive tree cleanup.** Any phantom folder a prior buggy Expand
116
+ already wrote — on `kia-desktop`, on `mirror-ts-core`'s CV22.DS7 — is not
117
+ cleaned up by this release. Both v0.31.4 and this release fix resolution
118
+ going forward; relocating already-diverged trees remains separate, manual
119
+ housekeeping, consistent with how the first occurrence of this class
120
+ (CR048 / `DS6.TS5`) was hand-fixed rather than migrated.
121
+ - **`mirror-ts-core` port-branch work stays out of scope.** Deleting the
122
+ divergent CV22.DS7 tree and fixing its authored candidate table's grammar
123
+ happen on that branch, separately.
124
+ - **Exact-code matching, not case-insensitive.** v0.31.4's resolver compared
125
+ codes case-insensitively (`.upper()`); this release's shared resolver
126
+ compares exactly. Every real code in this project's roadmap is
127
+ conventionally uppercase, and case-insensitive matching risks its own
128
+ ambiguity (two literally different headings resolving as one) more than it
129
+ protects against a real, observed failure mode.
130
+
131
+ ## What We Learned
132
+
133
+ v0.31.4's own release note already named the lesson: two code paths answering
134
+ "where does this roadmap item live?" must share one resolver, or they drift.
135
+ This release shows that lesson needed to be pushed one level further. Knowing
136
+ the lesson didn't prevent its own near-recurrence the same day, because the
137
+ first fix was narrow enough to leave a second, unconsolidated implementation
138
+ untouched (the CLI's own path lookup) and to leave the defect's quieter half
139
+ unaddressed (silent fabrication over unparseable content, silent ambiguity).
140
+ Closing a symptom is not the same as closing a class. The class closes when
141
+ there is exactly one resolver everywhere it is needed, when every way that
142
+ resolver can fail is either handled or refused loudly, and when a CI check
143
+ makes the invariant impossible to violate silently — not when the one reported
144
+ reproduction stops happening.
145
+
146
+ ## Next Horizon
147
+
148
+ The roadmap-resolution class is now closed on every path that writes to it
149
+ inside Mirror Mind's own runtime — CLI, Expand, and CI. Any project already
150
+ using Ariad Builder Mode inherits the runtime fix on upgrade automatically.
151
+ Whether the CI guard itself (`check_roadmap_duplicate_headings`) should become
152
+ something consumer projects can wire into their *own* CI, rather than living
153
+ only in Mirror Mind's repository, is now a visible, undecided question —
154
+ `kia-desktop` had no equivalent guard and would not have caught its own
155
+ CV3.DS22 divergence before it shipped.
@@ -0,0 +1,132 @@
1
+ ---
2
+ digest: >
3
+ v0.31.6 makes Refinement shared project knowledge instead of journey-local
4
+ database state. When a repository declares `docs/project/refinement/index.md`,
5
+ that ordinary Markdown file becomes the sole authority for RS/CR focus,
6
+ ordering, and status; linked documents preserve narrative and evidence, and
7
+ Git supplies history, collaboration, conflict handling, and recovery. Builder
8
+ surfaces and Pi/Gemini/Codex guidance now follow that authority without
9
+ inspecting stale SQLite Workbench rows, while projects without the index keep
10
+ the existing compatibility path. The release deliberately rejects automatic
11
+ migration, dual-write, projection, and custom handoff machinery after
12
+ archiving an earlier overbuilt implementation experiment.
13
+ ---
14
+
15
+ # v0.31.6 — Document-First Refinement Authority
16
+
17
+ **Date:** 2026-08-03
18
+
19
+ ## Highlights
20
+
21
+ - Adds `docs/project/refinement/index.md` as the canonical shared Refinement
22
+ surface, with stable project-wide `RSNNN` and `CRNNN` identity, explicit
23
+ ordering and focus, and ordinary linked Markdown documents for context,
24
+ plans, evidence, and outcomes.
25
+ - Routes Builder Home, Orientation, Resume, and natural-language Refinement work
26
+ to project files when the canonical index exists. The file-first runtime path
27
+ does not request or display a legacy Workbench snapshot.
28
+ - Preserves the existing SQLite Workbench for projects without the canonical
29
+ index. Migrations `015_create_builder_workbench` and
30
+ `016_builder_workbench_display_codes` remain supported, with no implicit
31
+ row inspection, migration, reconciliation, deletion, or dual-write.
32
+ - Defines a repair-and-report interaction rule: during already-authorized
33
+ mutable work, Builder repairs deterministic, local, meaning-preserving
34
+ document defects and reports them afterward; read-only requests remain
35
+ read-only, and semantic choices stay with the Navigator.
36
+ - Records why the first DS12 implementation was abandoned. Its filesystem
37
+ projection, mutation recovery, Git-coherence, and cross-clone handoff
38
+ machinery remains available only in a verified private archive, not in the
39
+ production architecture.
40
+ - Validated with 2,399 local unit/integration tests, green Python 3.10/3.12 and
41
+ TypeScript CI, and an isolated staging smoke containing deliberately stale
42
+ SQLite RS/CR canaries. Builder reported only the canonical file-authored
43
+ RS001/CR001 and performed no mutation.
44
+
45
+ ## Where We Started
46
+
47
+ The original Builder Workbench made Refinement a first-class work field, but it
48
+ stored shared meaning in a local SQLite database tied to one journey. That was
49
+ useful for one runtime session and weak as a project artifact: another clone or
50
+ collaborator could not recover the backlog by reading the repository.
51
+
52
+ DS12 initially answered that portability problem with a distributed protocol:
53
+ canonical filesystem artifacts projected into SQLite, mutation journals,
54
+ recovery paths, Git topology checks, remote evidence, and cross-clone handoff.
55
+ The implementation became technically coherent while drifting far beyond the
56
+ actual need. The work was archived before merge and the design was reset around
57
+ a smaller question: what is the least machinery required for Refinement to be
58
+ shared, inspectable, and durable?
59
+
60
+ ## What Changed
61
+
62
+ The repository now carries a real document-first Workbench under
63
+ `docs/project/refinement/`. One root index owns the facts that must have exactly
64
+ one answer: current Refinement Story, current Change Request, backlog order, and
65
+ status. RS and CR documents intentionally do not compete for those fields; they
66
+ own the richer problem framing, plans, evidence, and outcomes. Stable IDs belong
67
+ to the project, not to a journey, database, user, or absolute filesystem path.
68
+
69
+ The contract was dogfooded before runtime routing changed. The project selected
70
+ RS001 and planned CR001 using files alone, proving that a fresh agent could
71
+ recover position without SQLite or conversation history. That dogfood also
72
+ captured CR004, a real Ariad defect where Plan materialization overwrites an
73
+ authored story index, without expanding DS12 to fix it opportunistically.
74
+
75
+ The legacy boundary is explicit. SQLite rows remain compatibility-only local
76
+ state. Their journey-scoped UUIDs, local display codes, different status
77
+ vocabulary, and compressed narrative do not form a deterministic lossless map
78
+ to project artifacts. Any future export must therefore be requested, previewed,
79
+ destination-bound, and confirmed; schema removal requires separate coordinated
80
+ Python/TypeScript version work.
81
+
82
+ Builder now enforces the authority choice by one explicit path check. If
83
+ `docs/project/refinement/index.md` exists, entry surfaces identify project files
84
+ and point to the relative index without loading the Workbench snapshot. The
85
+ skill reads the canonical documents for inspection and mutation. If the path is
86
+ absent, existing SQLite behavior remains available. An unreadable or ambiguous
87
+ canonical document never causes a silent fallback to local state.
88
+
89
+ The resulting architecture is intentionally ordinary: Markdown owns meaning,
90
+ Git owns history and collaboration, and the agent owns file reading and bounded
91
+ editing. No parser, watcher, projection, manifest, recovery journal, or custom
92
+ Git protocol was added.
93
+
94
+ ## Conscious Exclusions
95
+
96
+ - **No automatic legacy migration.** Existing personal Workbench rows are not
97
+ read, mapped, exported, reconciled, frozen, or deleted by this release.
98
+ - **No dual authority.** SQLite is not a cache or projection of the canonical
99
+ documents, and file-first projects do not write both stores.
100
+ - **No Markdown runtime.** Python detects the explicit index path but does not
101
+ parse RS/CR status into another cursor or persistence model.
102
+ - **Claude Builder skill parity remains separate.** Pi is the authored skill
103
+ surface and Gemini CLI/Codex consume its shared `.agents` symlinks. Claude's
104
+ independently tuned `mm-build` skill retains the previously documented
105
+ Refinement parity gap; its generated plugin remains internally consistent.
106
+ - **Captured runtime findings remain separate work.** CR001, CR002, and CR004
107
+ stay in the canonical Refinement backlog rather than being absorbed into the
108
+ release.
109
+ - **No release authorization from project documents.** Refinement purpose,
110
+ status, plans, or readiness never authorize commit, push, merge, publication,
111
+ or release.
112
+
113
+ ## What We Learned
114
+
115
+ The first implementation was not wrong because its pieces were careless. It was
116
+ wrong-sized because each possible failure mode became another protocol before
117
+ the basic document workflow had been proven. Archiving that work made the
118
+ learning durable without forcing its maintenance cost onto the product.
119
+
120
+ A shared artifact does not need a synchronization system when Git already owns
121
+ sharing and history. It needs a clear authority boundary, stable names, ordinary
122
+ links, and an agent that knows where to look. The smaller model also makes
123
+ failures easier to explain: repair a safe structural defect, ask when meaning is
124
+ ambiguous, and never hide uncertainty behind a fallback database.
125
+
126
+ ## Next Horizon
127
+
128
+ The canonical backlog can now generate evidence through normal use. CR001 and
129
+ CR004 are the immediate visible runtime findings, but neither is promised by
130
+ this release. Lightweight structural automation, legacy export, and eventual
131
+ schema retirement remain conditional on repeated operational pain rather than
132
+ architectural anticipation.