@amoree-code/ocean 2.23.0 → 3.0.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 (380) hide show
  1. package/README.md +46 -53
  2. package/dist/application/clients/bundles.js +1 -1
  3. package/dist/application/clients/client-detect.js +291 -0
  4. package/dist/application/clients/clients.js +104 -25
  5. package/dist/application/clients/desktop-link.js +40 -0
  6. package/dist/application/clients/desktop-watcher.js +6 -4
  7. package/dist/application/clients/hook-trust.js +106 -0
  8. package/dist/application/clients/hooks.js +7 -1
  9. package/dist/application/clients/mcp-schema-cost.js +74 -0
  10. package/dist/application/clients/native.js +38 -2
  11. package/dist/application/clients/registry.js +51 -9
  12. package/dist/application/clients/status.js +7 -2
  13. package/dist/application/gateway/webhook-gateway.js +1 -1
  14. package/dist/application/integrations/charter-copies.js +1 -1
  15. package/dist/application/integrations/engine-entry-repair.js +4 -3
  16. package/dist/application/integrations/skill-auto-sync.js +2 -2
  17. package/dist/application/integrations/skill-filter.js +1 -1
  18. package/dist/application/integrations/skill-router.js +134 -90
  19. package/dist/application/layout/layout-apply.js +1 -1
  20. package/dist/application/layout/workspace-template.js +1 -1
  21. package/dist/application/onboarding/steps.js +121 -30
  22. package/dist/application/profiles/profile-doctor.js +118 -0
  23. package/dist/application/profiles/profile-migration-service.js +208 -0
  24. package/dist/application/profiles/profile-suggestion.js +3 -7
  25. package/dist/application/profiles/profile-upgrade-service.js +98 -86
  26. package/dist/application/pull/history-index.js +1 -1
  27. package/dist/application/pull/project-match.js +3 -3
  28. package/dist/application/pull/pull.js +1 -1
  29. package/dist/application/pull/server-capture.js +92 -9
  30. package/dist/application/scheduler/local-scheduler.js +2 -2
  31. package/dist/application/spend/claude-prices.js +55 -0
  32. package/dist/application/spend/claude-spend.js +365 -0
  33. package/dist/application/uninstall/uninstall.js +25 -3
  34. package/dist/application/upkeep/nightly-upkeep.js +4 -4
  35. package/dist/composition/runtime.js +2 -2
  36. package/dist/infrastructure/desktop/claude-export.js +1 -1
  37. package/dist/infrastructure/desktop/desktop-chat.js +60 -13
  38. package/dist/infrastructure/desktop/indexeddb.js +4 -4
  39. package/dist/infrastructure/desktop/leveldb.js +2 -2
  40. package/dist/infrastructure/filesystem/profile-loader.js +3 -45
  41. package/dist/infrastructure/filesystem/runtime-config-loader.js +1 -1
  42. package/dist/infrastructure/observability/runtime-logger.js +1 -1
  43. package/dist/infrastructure/process/agent-tool-executor.js +3 -3
  44. package/dist/infrastructure/process/process-supervisor.js +1 -1
  45. package/dist/infrastructure/process/service.js +8 -8
  46. package/dist/infrastructure/providers/openai-compatible.js +2 -2
  47. package/dist/infrastructure/providers/provider-invocation.js +1 -1
  48. package/dist/infrastructure/providers/session-facts-completer.js +78 -5
  49. package/dist/interfaces/cli/auth-command.js +2 -2
  50. package/dist/interfaces/cli/brief-command.js +1 -1
  51. package/dist/interfaces/cli/browser-command.js +6 -6
  52. package/dist/interfaces/cli/browser-findings.js +6 -9
  53. package/dist/interfaces/cli/browser-settings.js +10 -10
  54. package/dist/interfaces/cli/capture-command.js +6 -6
  55. package/dist/interfaces/cli/client-test-command.js +3 -3
  56. package/dist/interfaces/cli/clients-command.js +33 -6
  57. package/dist/interfaces/cli/command-aliases.js +56 -0
  58. package/dist/interfaces/cli/command-registry.js +48 -1414
  59. package/dist/interfaces/cli/commands/browser.js +5 -0
  60. package/dist/interfaces/cli/commands/capture.js +19 -0
  61. package/dist/interfaces/cli/commands/catalog.js +9 -0
  62. package/dist/interfaces/cli/commands/client.js +135 -0
  63. package/dist/interfaces/cli/commands/clients.js +33 -0
  64. package/dist/interfaces/cli/commands/connectors.js +14 -0
  65. package/dist/interfaces/cli/commands/context.js +9 -0
  66. package/dist/interfaces/cli/commands/cost.js +15 -0
  67. package/dist/interfaces/cli/commands/daily.js +11 -0
  68. package/dist/interfaces/cli/commands/day.js +25 -0
  69. package/dist/interfaces/cli/commands/dispatch.js +31 -0
  70. package/dist/interfaces/cli/commands/doctor.js +60 -0
  71. package/dist/interfaces/cli/commands/env.js +5 -0
  72. package/dist/interfaces/cli/commands/gateway.js +16 -0
  73. package/dist/interfaces/cli/commands/handoff.js +11 -0
  74. package/dist/interfaces/cli/commands/health.js +17 -0
  75. package/dist/interfaces/cli/commands/hook.js +142 -0
  76. package/dist/interfaces/cli/commands/idea.js +11 -0
  77. package/dist/interfaces/cli/commands/install.js +31 -0
  78. package/dist/interfaces/cli/commands/intent.js +14 -0
  79. package/dist/interfaces/cli/commands/intercept.js +22 -0
  80. package/dist/interfaces/cli/commands/layout.js +11 -0
  81. package/dist/interfaces/cli/commands/lifecycle.js +5 -0
  82. package/dist/interfaces/cli/commands/loop.js +73 -0
  83. package/dist/interfaces/cli/commands/market.js +11 -0
  84. package/dist/interfaces/cli/commands/mcp.js +57 -0
  85. package/dist/interfaces/cli/commands/memory.js +5 -0
  86. package/dist/interfaces/cli/commands/migrate.js +5 -0
  87. package/dist/interfaces/cli/commands/observe.js +11 -0
  88. package/dist/interfaces/cli/commands/obsidian.js +111 -0
  89. package/dist/interfaces/cli/commands/operate.js +7 -0
  90. package/dist/interfaces/cli/commands/policy.js +16 -0
  91. package/dist/interfaces/cli/commands/project.js +207 -0
  92. package/dist/interfaces/cli/commands/repair.js +20 -0
  93. package/dist/interfaces/cli/commands/run.js +52 -0
  94. package/dist/interfaces/cli/commands/schedule.js +58 -0
  95. package/dist/interfaces/cli/commands/service.js +21 -0
  96. package/dist/interfaces/cli/commands/session.js +182 -0
  97. package/dist/interfaces/cli/commands/sessions.js +12 -0
  98. package/dist/interfaces/cli/commands/setup.js +21 -0
  99. package/dist/interfaces/cli/commands/skill.js +159 -0
  100. package/dist/interfaces/cli/commands/tasks.js +10 -0
  101. package/dist/interfaces/cli/commands/update-remove.js +25 -0
  102. package/dist/interfaces/cli/connectors-command.js +150 -0
  103. package/dist/interfaces/cli/context-command.js +39 -3
  104. package/dist/interfaces/cli/cost-command.js +104 -0
  105. package/dist/interfaces/cli/curator-command.js +1 -1
  106. package/dist/interfaces/cli/daily-command.js +7 -1
  107. package/dist/interfaces/cli/desktop-command.js +43 -7
  108. package/dist/interfaces/cli/distill-command.js +7 -2
  109. package/dist/interfaces/cli/express-command.js +1 -1
  110. package/dist/interfaces/cli/failures-command.js +4 -4
  111. package/dist/interfaces/cli/gateway-findings.js +2 -2
  112. package/dist/interfaces/cli/governance-command.js +23 -16
  113. package/dist/interfaces/cli/handoff-command.js +1 -1
  114. package/dist/interfaces/cli/harvest-command.js +2 -2
  115. package/dist/interfaces/cli/help-command.js +53 -169
  116. package/dist/interfaces/cli/hygiene-command.js +1 -1
  117. package/dist/interfaces/cli/idea-command.js +1 -1
  118. package/dist/interfaces/cli/intercept-command.js +8 -7
  119. package/dist/interfaces/cli/interests-command.js +1 -1
  120. package/dist/interfaces/cli/layout-command.js +2 -0
  121. package/dist/interfaces/cli/market-command.js +9 -9
  122. package/dist/interfaces/cli/mcp-gateway-command.js +124 -7
  123. package/dist/interfaces/cli/mcp-probe-command.js +186 -0
  124. package/dist/interfaces/cli/mcp-status-command.js +5 -5
  125. package/dist/interfaces/cli/memory-command.js +41 -7
  126. package/dist/interfaces/cli/migrate-command.js +2 -2
  127. package/dist/interfaces/cli/note-command.js +1 -1
  128. package/dist/interfaces/cli/onboard-command.js +14 -0
  129. package/dist/interfaces/cli/operate-command.js +5 -5
  130. package/dist/interfaces/cli/profiles-command.js +61 -1
  131. package/dist/interfaces/cli/rhythm-command.js +11 -5
  132. package/dist/interfaces/cli/running-server-findings.js +1 -1
  133. package/dist/interfaces/cli/scorecard-command.js +8 -8
  134. package/dist/interfaces/cli/session-facts-command.js +2 -2
  135. package/dist/interfaces/cli/sessions-command.js +145 -0
  136. package/dist/interfaces/cli/setup-command.js +15 -2
  137. package/dist/interfaces/cli/tasks-command.js +63 -13
  138. package/dist/interfaces/cli/telemetry-command.js +4 -4
  139. package/dist/interfaces/cli/uninstall-command.js +1 -1
  140. package/dist/interfaces/cli/week-failures.js +32 -0
  141. package/dist/main.js +12 -0
  142. package/node_modules/@ocean/brain/dist/{infrastructure/brain/brain-index.js → brain-index.js} +2 -2
  143. package/node_modules/@ocean/brain/dist/{brain/brain-markdown.js → brain-markdown.js} +1 -1
  144. package/node_modules/@ocean/brain/dist/{brain/brain-service.js → brain-service.js} +12 -2
  145. package/node_modules/@ocean/brain/dist/memory/brain-dump.js +92 -16
  146. package/node_modules/@ocean/brain/dist/memory/extraction-log.js +125 -0
  147. package/node_modules/@ocean/brain/dist/memory/extraction-retry.js +54 -0
  148. package/node_modules/@ocean/brain/dist/memory/fact-routing.js +44 -1
  149. package/node_modules/@ocean/brain/dist/memory/lesson-activation.js +2 -2
  150. package/node_modules/@ocean/brain/dist/memory/lesson-learning.js +2 -2
  151. package/node_modules/@ocean/brain/dist/memory/lessons.js +1 -1
  152. package/node_modules/@ocean/brain/dist/memory/memory-audit.js +2 -2
  153. package/node_modules/@ocean/brain/dist/memory/memory-harvest.js +1 -1
  154. package/node_modules/@ocean/brain/dist/memory/memory-paths.js +8 -0
  155. package/node_modules/@ocean/brain/dist/memory/memory-review.js +31 -3
  156. package/node_modules/@ocean/brain/dist/memory/memory-trash.js +29 -0
  157. package/node_modules/@ocean/brain/dist/memory/memory-write.js +4 -2
  158. package/node_modules/@ocean/brain/dist/memory/model-narrative.js +2 -2
  159. package/node_modules/@ocean/brain/dist/memory/profile-facts.js +1 -1
  160. package/node_modules/@ocean/brain/dist/memory/routing.json +6 -6
  161. package/node_modules/@ocean/{market/dist/skills → brain/dist/memory}/signal-detection.js +1 -1
  162. package/node_modules/@ocean/brain/dist/{memory → people}/people.js +1 -1
  163. package/node_modules/@ocean/brain/dist/sessions-capture/session-facts.js +625 -0
  164. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-promotion.js +7 -15
  165. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-summary.js +1 -1
  166. package/node_modules/@ocean/brain/dist/sessions-capture/session-triage.js +52 -0
  167. package/node_modules/@ocean/brain/package.json +1 -1
  168. package/node_modules/@ocean/connect/dist/connectors/connector-hub.js +173 -0
  169. package/node_modules/@ocean/{market → connect}/dist/install/default-marketplace.js +6 -2
  170. package/node_modules/@ocean/{market → connect}/dist/install/marketplace-service.js +1 -1
  171. package/node_modules/@ocean/connect/dist/mcp/mcp-gateway.js +987 -0
  172. package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-launch.js +102 -5
  173. package/node_modules/@ocean/{market → connect}/dist/registry/official-registry.js +1 -1
  174. package/node_modules/@ocean/{market → connect}/dist/security/permissions.js +1 -1
  175. package/node_modules/@ocean/{market → connect}/dist/skills/skill-hub.js +104 -6
  176. package/node_modules/@ocean/{market → connect}/package.json +2 -2
  177. package/node_modules/@ocean/context/dist/{context/context-ladder.js → context-ladder.js} +3 -3
  178. package/node_modules/@ocean/context/dist/{context/context-references.js → context-references.js} +5 -4
  179. package/node_modules/@ocean/context/dist/{context/context-cost.js → context-size.js} +6 -6
  180. package/node_modules/@ocean/context/dist/{context/intent-router.js → intent-router.js} +1 -1
  181. package/node_modules/@ocean/context/dist/{context/resource-injection.js → resource-injection.js} +3 -1
  182. package/node_modules/@ocean/context/package.json +1 -1
  183. package/node_modules/@ocean/core/dist/domain/brain/brain-record.js +1 -1
  184. package/node_modules/@ocean/core/dist/domain/capabilities/capability-manifest.js +5 -5
  185. package/node_modules/@ocean/core/dist/domain/connector-entry.js +86 -0
  186. package/node_modules/@ocean/core/dist/domain/context/context.js +1 -1
  187. package/node_modules/@ocean/core/dist/domain/context/project-id.js +8 -2
  188. package/node_modules/@ocean/core/dist/domain/{evidence/evidence.js → evidence.js} +1 -1
  189. package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +4 -1
  190. package/node_modules/@ocean/core/dist/domain/ports/brain-index-port.js +1 -1
  191. package/node_modules/@ocean/core/dist/domain/profiles/profile-markdown.js +40 -0
  192. package/node_modules/@ocean/core/dist/domain/profiles/profile-resolution.js +276 -0
  193. package/node_modules/@ocean/core/dist/domain/profiles/profile-selection.js +23 -60
  194. package/node_modules/@ocean/core/dist/domain/profiles/profile-upgrade.js +2 -2
  195. package/node_modules/@ocean/core/dist/domain/profiles/profile.js +66 -6
  196. package/node_modules/@ocean/core/dist/domain/profiles/runtime-config.js +1 -1
  197. package/node_modules/@ocean/core/dist/domain/runs/agent-tools.js +2 -2
  198. package/node_modules/@ocean/core/dist/domain/sessions/session-identity.js +53 -0
  199. package/node_modules/@ocean/core/dist/domain/sessions/session-metadata.js +208 -0
  200. package/node_modules/@ocean/core/dist/domain/{tasks/task-id.js → task-id.js} +2 -2
  201. package/node_modules/@ocean/core/dist/profiles/profile-files.js +57 -0
  202. package/node_modules/@ocean/core/dist/profiles/profile-loader.js +97 -0
  203. package/node_modules/@ocean/core/dist/profiles/project-profile-fill.js +33 -0
  204. package/node_modules/@ocean/core/dist/profiles/session-profile.js +158 -0
  205. package/node_modules/@ocean/core/dist/shared/charter.js +110 -0
  206. package/node_modules/@ocean/core/dist/shared/context-ack.js +1 -1
  207. package/node_modules/@ocean/core/dist/shared/context-triggers.js +67 -0
  208. package/node_modules/@ocean/core/dist/shared/paths.js +6 -6
  209. package/node_modules/@ocean/core/dist/shared/project-legacy.js +232 -0
  210. package/node_modules/@ocean/core/dist/shared/project-manifest.js +308 -0
  211. package/node_modules/@ocean/core/dist/shared/project-names.js +87 -0
  212. package/node_modules/@ocean/core/dist/shared/project-register.js +560 -0
  213. package/node_modules/@ocean/core/dist/shared/project-resolution.js +83 -861
  214. package/node_modules/@ocean/core/dist/shared/repo-signals.js +45 -0
  215. package/node_modules/@ocean/core/dist/shared/task-reference.js +1 -1
  216. package/node_modules/@ocean/core/dist/shared/text-tokens.js +37 -0
  217. package/node_modules/@ocean/core/dist/shared/tool-groups.js +224 -0
  218. package/node_modules/@ocean/core/package.json +4 -1
  219. package/node_modules/@ocean/services/dist/day/day.js +45 -3
  220. package/node_modules/@ocean/services/dist/{distill → day}/distill.js +29 -3
  221. package/node_modules/@ocean/services/dist/{harvest → day}/harvest.js +54 -14
  222. package/node_modules/@ocean/services/dist/{brief → day}/interest-discovery.js +3 -3
  223. package/node_modules/@ocean/services/dist/day/note.js +2 -2
  224. package/node_modules/@ocean/services/dist/{onboarding → day}/onboarding.js +1 -1
  225. package/node_modules/@ocean/services/dist/day/patterns.js +68 -0
  226. package/node_modules/@ocean/services/dist/{curator → health}/curator.js +5 -5
  227. package/node_modules/@ocean/services/dist/{journey → health}/failures.js +7 -5
  228. package/node_modules/@ocean/services/dist/{hygiene → health}/hygiene.js +2 -2
  229. package/node_modules/@ocean/services/dist/{journey → health}/lesson-effect.js +1 -1
  230. package/node_modules/@ocean/services/dist/{scorecard → health}/scorecard.js +3 -3
  231. package/node_modules/@ocean/services/dist/{upkeep → health}/upkeep.js +2 -2
  232. package/node_modules/@ocean/services/dist/{doctor → health}/workspace-doctor.js +57 -17
  233. package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-session.js +1 -1
  234. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/call-ledger.js +3 -0
  235. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-client.js +19 -3
  236. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/obsidian-server.js +4 -4
  237. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/ocean-server.js +423 -34
  238. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/conflict-log.js +1 -1
  239. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/folder-templates.js +8 -5
  240. package/node_modules/@ocean/services/dist/projects/project-doctor.js +173 -0
  241. package/node_modules/@ocean/services/dist/projects/project-snippet.js +9 -0
  242. package/node_modules/@ocean/services/dist/projects/projects-overview.js +2 -2
  243. package/node_modules/@ocean/services/package.json +1 -1
  244. package/node_modules/@ocean/{loop/dist/loops → work/dist/runs}/guard-runtime.js +3 -3
  245. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/memory-knowledge-operations.js +4 -12
  246. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-contract.js +2 -2
  247. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/project-operations.js +2 -1
  248. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/task-operations.js +4 -4
  249. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/write-guard.js +1 -1
  250. package/node_modules/@ocean/{loop → work}/dist/runs/prompt-assembly.js +2 -2
  251. package/node_modules/@ocean/{loop → work}/dist/runs/run-agent.js +4 -4
  252. package/node_modules/@ocean/{loop → work}/dist/runs/tool-loop.js +4 -4
  253. package/node_modules/@ocean/work/dist/sessions/hooks/desktop-facts.js +309 -0
  254. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-end-hook.js +36 -5
  255. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-facts-hook.js +144 -14
  256. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-start-hook.js +129 -12
  257. package/node_modules/@ocean/work/dist/sessions/hooks/start-brief.js +110 -0
  258. package/node_modules/@ocean/work/dist/sessions/hooks/unlinked-warning.js +68 -0
  259. package/node_modules/@ocean/{loop → work}/dist/sessions/session-closeout.js +4 -4
  260. package/node_modules/@ocean/{loop → work}/dist/sessions/session-projects.js +13 -3
  261. package/node_modules/@ocean/work/dist/sessions/session-relink.js +300 -0
  262. package/node_modules/@ocean/{loop → work}/dist/sessions/session-retention.js +1 -1
  263. package/node_modules/@ocean/{loop → work}/dist/tasks/list-tasks.js +7 -2
  264. package/node_modules/@ocean/{loop → work}/dist/tasks/renumber-tasks.js +4 -2
  265. package/node_modules/@ocean/{loop → work}/dist/tasks/session-task.js +2 -2
  266. package/node_modules/@ocean/{loop → work}/dist/tasks/sync-task-prs.js +77 -7
  267. package/node_modules/@ocean/work/dist/tasks/task-git.js +63 -0
  268. package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop.js +4 -4
  269. package/node_modules/@ocean/{loop → work}/dist/tasks/verification-readiness.js +1 -1
  270. package/node_modules/@ocean/{loop → work}/dist/tasks/verify-task.js +1 -1
  271. package/node_modules/@ocean/{loop → work}/package.json +2 -2
  272. package/ocean-marketplace.json +41 -41
  273. package/package.json +12 -11
  274. package/skills/core/daily-harvest/SKILL.md +1 -1
  275. package/skills/core/ocean-memory/SKILL.md +4 -0
  276. package/skills/core/use-browser/SKILL.md +30 -7
  277. package/skills/index.json +1 -1
  278. package/templates/profiles/default.md +44 -0
  279. package/templates/profiles/developer.md +45 -0
  280. package/templates/profiles/reviewer.md +44 -0
  281. package/templates/profiles/strategist.md +44 -0
  282. package/templates/profiles-v3/analysis.md +16 -0
  283. package/templates/profiles-v3/backend.md +16 -0
  284. package/templates/profiles-v3/base.md +57 -0
  285. package/templates/profiles-v3/code-review.md +16 -0
  286. package/templates/profiles-v3/devops.md +16 -0
  287. package/templates/profiles-v3/docs-office.md +16 -0
  288. package/templates/profiles-v3/frontend.md +16 -0
  289. package/templates/profiles-v3/learning.md +16 -0
  290. package/templates/profiles-v3/marketing-ads.md +16 -0
  291. package/templates/profiles-v3/marketing-content-seo.md +16 -0
  292. package/templates/profiles-v3/ocean-ops.md +16 -0
  293. package/templates/profiles-v3/product-strategy.md +16 -0
  294. package/templates/profiles-v3/qa-testing.md +16 -0
  295. package/templates/profiles-v3/security.md +16 -0
  296. package/templates/workspace/MANIFEST.json +1 -0
  297. package/templates/workspace/charter/core.md +22 -90
  298. package/templates/workspace/charter/policies/README.md +7 -1
  299. package/templates/workspace/charter/policies/claude-code-context.md +6 -1
  300. package/templates/workspace/charter/policies/concise-output.md +5 -0
  301. package/templates/workspace/charter/policies/context.md +5 -0
  302. package/templates/workspace/charter/policies/contracts/task.md +2 -2
  303. package/templates/workspace/charter/policies/git.md +5 -0
  304. package/templates/workspace/charter/policies/graph.md +6 -1
  305. package/templates/workspace/charter/policies/knowledge.md +11 -4
  306. package/templates/workspace/charter/policies/layout.md +23 -0
  307. package/templates/workspace/charter/policies/lifecycle.md +5 -0
  308. package/templates/workspace/charter/policies/memory.md +5 -0
  309. package/templates/workspace/charter/policies/minimal-change.md +5 -0
  310. package/templates/workspace/charter/policies/models.md +5 -0
  311. package/templates/workspace/charter/policies/response.md +5 -0
  312. package/templates/workspace/charter/policies/skill-observer.md +12 -0
  313. package/templates/workspace/charter/policies/stack.md +5 -0
  314. package/templates/workspace/charter/policies/task.md +17 -3
  315. package/templates/workspace/charter/policies/verification.md +5 -0
  316. package/node_modules/@ocean/brain/dist/evidence/verification-report.js +0 -13
  317. package/node_modules/@ocean/brain/dist/memory/daily-narrative.js +0 -142
  318. package/node_modules/@ocean/brain/dist/memory/session-facts.js +0 -283
  319. package/node_modules/@ocean/context/dist/context/context-compression.js +0 -66
  320. package/node_modules/@ocean/loop/dist/hooks/desktop-facts.js +0 -174
  321. package/node_modules/@ocean/loop/dist/operations/task-linker.js +0 -40
  322. package/node_modules/@ocean/loop/dist/sessions/session-pointer.js +0 -133
  323. package/node_modules/@ocean/loop/dist/tasks/task-git.js +0 -28
  324. package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +0 -533
  325. package/templates/profiles/default.json +0 -51
  326. package/templates/profiles/developer.json +0 -51
  327. package/templates/profiles/reviewer.json +0 -51
  328. package/templates/profiles/strategist.json +0 -51
  329. /package/node_modules/@ocean/brain/dist/{brain/brain-eval.js → brain-eval.js} +0 -0
  330. /package/node_modules/@ocean/brain/dist/{brain/brain-reindex.js → brain-reindex.js} +0 -0
  331. /package/node_modules/@ocean/brain/dist/{capture → sessions-capture}/inbox-sync.js +0 -0
  332. /package/node_modules/@ocean/{market → connect}/dist/adapters/mcp-adapter.js +0 -0
  333. /package/node_modules/@ocean/{market → connect}/dist/adapters/owned-directory.js +0 -0
  334. /package/node_modules/@ocean/{market → connect}/dist/adapters/plugin-adapter.js +0 -0
  335. /package/node_modules/@ocean/{market → connect}/dist/adapters/skill-adapter.js +0 -0
  336. /package/node_modules/@ocean/{market → connect}/dist/capability/adapter.js +0 -0
  337. /package/node_modules/@ocean/{market → connect}/dist/capability/catalog.js +0 -0
  338. /package/node_modules/@ocean/{market → connect}/dist/capability/content-digest.js +0 -0
  339. /package/node_modules/@ocean/{market → connect}/dist/capability/registry.js +0 -0
  340. /package/node_modules/@ocean/{market → connect}/dist/install/lock.js +0 -0
  341. /package/node_modules/@ocean/{market → connect}/dist/install/own-server.js +0 -0
  342. /package/node_modules/@ocean/{market → connect}/dist/mcp/chrome-debugging.js +0 -0
  343. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-connection.js +0 -0
  344. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-runner.js +0 -0
  345. /package/node_modules/@ocean/{market → connect}/dist/security/description-scan.js +0 -0
  346. /package/node_modules/@ocean/{market → connect}/dist/security/secrets.js +0 -0
  347. /package/node_modules/@ocean/{market → connect}/dist/skills/core-skill-sync.js +0 -0
  348. /package/node_modules/@ocean/context/dist/{context/context-packet.js → context-packet.js} +0 -0
  349. /package/node_modules/@ocean/core/dist/domain/{process/process-events.js → process-events.js} +0 -0
  350. /package/node_modules/@ocean/core/dist/domain/{redaction/redaction.js → redaction.js} +0 -0
  351. /package/node_modules/@ocean/services/dist/{brief → day}/brief.js +0 -0
  352. /package/node_modules/@ocean/services/dist/{express → day}/express.js +0 -0
  353. /package/node_modules/@ocean/services/dist/{brief → day}/source-registry.json +0 -0
  354. /package/node_modules/@ocean/services/dist/{journey → health}/telemetry.js +0 -0
  355. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-service.js +0 -0
  356. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-task-runner.js +0 -0
  357. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-session.js +0 -0
  358. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/server-version.js +0 -0
  359. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/tool-registry.js +0 -0
  360. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/inbox-promotion.js +0 -0
  361. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-discovery.js +0 -0
  362. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-ingestion.js +0 -0
  363. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-sync.js +0 -0
  364. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-writer.js +0 -0
  365. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-scope.js +0 -0
  366. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-io.js +0 -0
  367. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-operations.js +0 -0
  368. /package/node_modules/@ocean/{loop → work}/dist/runs/run-authorization.js +0 -0
  369. /package/node_modules/@ocean/{loop → work}/dist/runs/session-tokens.js +0 -0
  370. /package/node_modules/@ocean/{loop/dist/handoff → work/dist/sessions}/handoff-service.js +0 -0
  371. /package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/lifecycle-hooks.js +0 -0
  372. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-store.js +0 -0
  373. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-validator.js +0 -0
  374. /package/node_modules/@ocean/{loop → work}/dist/tasks/archive-tasks.js +0 -0
  375. /package/node_modules/@ocean/{loop → work}/dist/tasks/checkpoint-task.js +0 -0
  376. /package/node_modules/@ocean/{loop → work}/dist/tasks/claim-task.js +0 -0
  377. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/iteration-graph.js +0 -0
  378. /package/node_modules/@ocean/{loop → work}/dist/tasks/new-task.js +0 -0
  379. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop-record.js +0 -0
  380. /package/node_modules/@ocean/{loop → work}/dist/tasks/task-verification.js +0 -0
@@ -1,7 +1,7 @@
1
1
  import { factTarget } from "@ocean/brain/memory/fact-routing.js";
2
2
  import { proposeMemory } from "@ocean/brain/memory/memory-write.js";
3
3
  import { MemoryContractError } from "@ocean/core/domain/mcp/memory-contract.js";
4
- import { proposeInterests, topicProposal, } from "../brief/interest-discovery.js";
4
+ import { proposeInterests, topicProposal, } from "./interest-discovery.js";
5
5
  // Onboarding for any user (T-314): the `interests` step of `ocean onboard` asks three questions
6
6
  // (the identity step already asks the role). The answers are the user's own words, but they still
7
7
  // go to review like every other proposal: goals as a fact candidate, stack and topics as interest
@@ -0,0 +1,68 @@
1
+ // The weekly digest's "## Patterns" (T-329 phase 5): counts, not prose — where the week went
2
+ // (project, client), how it ended (status), what kept coming back (tasks, failures) and what it
3
+ // left open. Deterministic: no model reads anything here. A record's metadata block (T-334)
4
+ // is read where it has one; a record written before it falls back to its body.
5
+ const TOP = 5;
6
+ function tally(values) {
7
+ const counts = new Map();
8
+ for (const value of values)
9
+ counts.set(value, (counts.get(value) ?? 0) + 1);
10
+ return [...counts].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
11
+ }
12
+ const joined = (entries) => entries
13
+ .slice(0, TOP)
14
+ .map(([name, count]) => `${name} ${count}`)
15
+ .join(" · ") +
16
+ (entries.length > TOP ? ` · +${entries.length - TOP} more` : "");
17
+ export function weeklyPatterns(sessions, failures = []) {
18
+ if (!sessions.length)
19
+ return [];
20
+ const total = sessions.length;
21
+ const lines = [
22
+ `- Projects: ${joined(tally(sessions.map((item) => item.project || "none")))}`,
23
+ `- Clients: ${joined(tally(sessions.map((item) => item.provider || "unknown")))}`,
24
+ `- Status: ${joined(tally(sessions.map((item) => item.status || "unknown")))}`,
25
+ ];
26
+ const untitled = sessions.filter((item) => item.untitled).length;
27
+ if (untitled)
28
+ lines.push(`- Untitled: ${untitled} of ${total} (${Math.round((untitled / total) * 100)}%)`);
29
+ // A task counts once per session that names it; only one named in two or more is a pattern.
30
+ // A record with a metadata block names its task in `task`; an older one, somewhere in its body.
31
+ const tasks = tally(sessions.flatMap((item) => item.meta?.projectHow
32
+ ? item.meta.task
33
+ ? [item.meta.task]
34
+ : []
35
+ : [...new Set(item.text.match(/\bT-\d{1,4}\b/g) ?? [])])).filter(([, count]) => count >= 2);
36
+ if (tasks.length)
37
+ lines.push(`- Tasks across sessions: ${joined(tasks)}`);
38
+ const decided = tally(sessions.flatMap((item) => item.meta?.projectHow ? [item.meta.projectHow] : []));
39
+ if (decided.length)
40
+ lines.push(`- Project decided by: ${joined(decided)}`);
41
+ // Hours per project, from each record's own span.
42
+ const minutes = new Map();
43
+ for (const item of sessions)
44
+ if (item.meta?.durationMin)
45
+ minutes.set(item.project || "none", (minutes.get(item.project || "none") ?? 0) + item.meta.durationMin);
46
+ if (minutes.size)
47
+ lines.push(`- Hours: ${[...minutes]
48
+ .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))
49
+ .slice(0, TOP)
50
+ .map(([name, total]) => `${name} ${(total / 60).toFixed(1)}`)
51
+ .join(" · ")}${minutes.size > TOP ? ` · +${minutes.size - TOP} more` : ""}`);
52
+ const tools = new Map();
53
+ for (const item of sessions)
54
+ for (const [name, count] of Object.entries(item.meta?.activity?.tools ?? {}))
55
+ tools.set(name, (tools.get(name) ?? 0) + count);
56
+ if (tools.size)
57
+ lines.push(`- Tools: ${joined([...tools].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])))}`);
58
+ const repeated = failures
59
+ .filter((item) => item.sessions >= 2)
60
+ .sort((a, b) => b.sessions - a.sessions || a.label.localeCompare(b.label));
61
+ if (repeated.length)
62
+ lines.push(`- Repeated failures: ${joined(repeated.map((item) => [item.label, item.sessions]))}`);
63
+ const open = sessions.filter((item) => /\n## Next\n\n\s*\S/.test(item.text)).length;
64
+ if (open)
65
+ lines.push(`- Left a next step: ${open} of ${total}`);
66
+ return lines;
67
+ }
68
+ //# sourceMappingURL=patterns.js.map
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { appendAudit, sha256 } from "@ocean/brain/memory/memory-audit.js";
4
4
  import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
5
5
  import { KNOWLEDGE_DIR, oceanPath, SYSTEM_DIR, } from "@ocean/core/shared/paths.js";
6
- import { setFrontmatterFields } from "@ocean/loop/tasks/task-verification.js";
6
+ import { setFrontmatterFields } from "@ocean/work/tasks/task-verification.js";
7
7
  // The curator (T-322, Hermes pattern): a lesson or skill not used for 30 days is marked `stale`,
8
8
  // for 90 days `archived`; one not reviewed for 90 days is marked `stale` too (forge F8). Every
9
9
  // change is reversible with `review`, which stamps `last_reviewed` and restores the status it had.
@@ -12,9 +12,9 @@ import { setFrontmatterFields } from "@ocean/loop/tasks/task-verification.js";
12
12
  //
13
13
  // No client records a use yet (T-323), so an item's clock starts the first night the curator
14
14
  // sees it (bridge/state/curator.json): missing data is never read as "unused".
15
- export const STALE_DAYS = 30;
16
- export const ARCHIVE_DAYS = 90;
17
- export const REVIEW_DAYS = 90;
15
+ const STALE_DAYS = 30;
16
+ const ARCHIVE_DAYS = 90;
17
+ const REVIEW_DAYS = 90;
18
18
  const DAY_MS = 86_400_000;
19
19
  const USE_FIELDS = [
20
20
  "last_used",
@@ -32,7 +32,7 @@ const latest = (days) => days
32
32
  .filter((day) => day !== null)
33
33
  .sort()
34
34
  .at(-1) ?? null;
35
- export async function listCurated() {
35
+ async function listCurated() {
36
36
  const items = [];
37
37
  const lessons = lessonsDir();
38
38
  for (const [dir, archived] of [
@@ -4,14 +4,14 @@ import { setLessonStatus } from "@ocean/brain/memory/lessons.js";
4
4
  import { atomicWrite, parseFrontmatter, withFileLock, } from "@ocean/core/shared/fs-utils.js";
5
5
  import { localDate } from "@ocean/core/shared/local-date.js";
6
6
  import { KNOWLEDGE_DIR, oceanPath } from "@ocean/core/shared/paths.js";
7
- // Failure records (T-323): one markdown file per failure signature in 05-knowledge/failures/.
7
+ // Failure records (T-323): one markdown file per failure signature in 05-knowledge/lessons/.
8
8
  // A record states the mechanism, not the symptom, and carries a closed status
9
9
  // open → fix-landing → absorbed → superseded-by <id>
10
10
  // changed only by code, one field per update, with a line appended to its status log; the
11
11
  // body above that log is never rewritten. A guardrail ladder (lesson → doctor → test) says
12
12
  // how the failure is guarded: when an absorbed signature comes back, telemetry proposes
13
13
  // climbing one rung and the owner approves with `ocean failures climb`.
14
- export const RUNGS = ["lesson", "doctor", "test"];
14
+ const RUNGS = ["lesson", "doctor", "test"];
15
15
  // F4: absorb with the cheapest mechanism first, in this order.
16
16
  export const ABSORB_MECHANISMS = [
17
17
  "doctor",
@@ -20,7 +20,7 @@ export const ABSORB_MECHANISMS = [
20
20
  "skill-edit",
21
21
  "new-skill",
22
22
  ];
23
- export class FailureRecordError extends Error {
23
+ class FailureRecordError extends Error {
24
24
  }
25
25
  const ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,80}$/;
26
26
  const SIGNATURE_PATTERN = /^[a-z]+\/[A-Za-z_]+\/[0-9a-f]{8}$/;
@@ -30,7 +30,8 @@ const NEXT = {
30
30
  // Back to open only by climbing the ladder.
31
31
  absorbed: [],
32
32
  };
33
- export const failuresDir = () => oceanPath(KNOWLEDGE_DIR, "failures");
33
+ // Failure records live among the lessons (T-329 phase 4), told apart by their signature.
34
+ export const failuresDir = () => oceanPath(KNOWLEDGE_DIR, "lessons");
34
35
  const failureFile = (id) => path.join(failuresDir(), `${id}.md`);
35
36
  function parse(source) {
36
37
  const fields = parseFrontmatter(source);
@@ -62,7 +63,7 @@ function parse(source) {
62
63
  updated: fields.updated ?? "",
63
64
  };
64
65
  }
65
- export async function readFailure(id) {
66
+ async function _readFailure(id) {
66
67
  if (!ID_PATTERN.test(id))
67
68
  throw new FailureRecordError(`Invalid id: ${id}`);
68
69
  const source = await readFile(failureFile(id), "utf8").catch(() => null);
@@ -98,6 +99,7 @@ export async function openFailure(input, now = new Date()) {
98
99
  if (await readFile(file, "utf8").catch(() => null))
99
100
  throw new FailureRecordError(`Failure ${input.id} already exists`);
100
101
  const head = [
102
+ "kind: failure",
101
103
  `id: ${input.id}`,
102
104
  "type: failure",
103
105
  `title: ${JSON.stringify(input.title)}`,
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { appendAudit, readAudit, sha256, } from "@ocean/brain/memory/memory-audit.js";
4
4
  import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
5
5
  import { KNOWLEDGE_DIR, oceanPath, PERSONAL_DIR, PROJECTS_DIR, REPORTS_DIR, SYSTEM_DIR, } from "@ocean/core/shared/paths.js";
6
- import { setFrontmatterFields } from "@ocean/loop/tasks/task-verification.js";
6
+ import { setFrontmatterFields } from "@ocean/work/tasks/task-verification.js";
7
7
  const SKIP_HOSTS = /^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\]|example\.(com|org|net)|[^/]*\.(local|test|example|invalid))$/i;
8
8
  const PLACEHOLDER = /[<>*{}$|]|\.\.\./;
9
9
  // An absolute path is a claim only under a real filesystem root; `/auth/refresh` is an API route.
@@ -194,7 +194,7 @@ export async function writeHygieneReport(month, text) {
194
194
  }
195
195
  // --- Drift (F6) -----------------------------------------------------------------------------
196
196
  const snapshotFile = () => oceanPath(SYSTEM_DIR, "state", "record-hashes.json");
197
- export const driftFile = () => oceanPath(SYSTEM_DIR, "state", "drift.json");
197
+ const driftFile = () => oceanPath(SYSTEM_DIR, "state", "drift.json");
198
198
  export async function checkDrift(options) {
199
199
  const now = (options.now ?? new Date()).toISOString();
200
200
  const root = oceanPath();
@@ -7,7 +7,7 @@ import { failureSignature } from "./telemetry.js";
7
7
  // A lesson that does no better on either, with enough sessions on both sides, is proposed for
8
8
  // retirement; nothing is retired without the owner.
9
9
  // `skill_auto_activated` is the same event under its name before T-323.
10
- export const LESSON_APPLIED_TYPES = new Set([
10
+ const LESSON_APPLIED_TYPES = new Set([
11
11
  "lesson_applied",
12
12
  "skill_auto_activated",
13
13
  ]);
@@ -2,8 +2,8 @@ import { mkdir, readdir, readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
4
4
  import { KNOWLEDGE_DIR, listProjectDirs, oceanPath, REPORTS_DIR, SYSTEM_DIR, } from "@ocean/core/shared/paths.js";
5
- import { sessionTokens } from "@ocean/loop/runs/session-tokens.js";
6
- import { RECURRENCE_WINDOW_DAYS, } from "../journey/failures.js";
5
+ import { sessionTokens } from "@ocean/work/runs/session-tokens.js";
6
+ import { RECURRENCE_WINDOW_DAYS } from "./failures.js";
7
7
  // Moved to the loop package (T-322) so run guards can count tokens; re-exported for callers.
8
8
  export { sessionTokens };
9
9
  const percent = (n, of) => of ? `${Math.round((n / of) * 1000) / 10}%` : "n/a";
@@ -158,7 +158,7 @@ export function failuresRows(failures) {
158
158
  value: `${zero} of ${failures.length}`,
159
159
  n: zero,
160
160
  of: failures.length,
161
- source: "05-knowledge/failures + session signatures",
161
+ source: "05-knowledge/lessons failure records + session signatures",
162
162
  },
163
163
  ...failures.map((entry) => ({
164
164
  id: `failure:${entry.id}`,
@@ -2,7 +2,7 @@ import { mkdir, readdir, readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { atomicWrite } from "@ocean/core/shared/fs-utils.js";
4
4
  import { oceanPath, REPORTS_DIR } from "@ocean/core/shared/paths.js";
5
- import { scorecardFile } from "../scorecard/scorecard.js";
5
+ import { scorecardFile } from "./scorecard.js";
6
6
  const tokens = (n) => n.toLocaleString("en-US");
7
7
  const lastLine = (text) => text.trim().split(/\r?\n/).filter(Boolean).at(-1)?.slice(0, 200) ?? "";
8
8
  export async function runUpkeepJobs(jobs, run, clock = Date.now) {
@@ -86,7 +86,7 @@ export async function previousScorecard(date) {
86
86
  .at(-1);
87
87
  return earlier ? readFile(path.join(dir, earlier), "utf8") : null;
88
88
  }
89
- export const digestFile = (date) => oceanPath(REPORTS_DIR, "digest", `${date}.md`);
89
+ const digestFile = (date) => oceanPath(REPORTS_DIR, "digest", `${date}.md`);
90
90
  export function renderDigest(input) {
91
91
  const failed = input.results.filter((result) => !result.ok);
92
92
  const cell = (text) => text.replace(/\|/g, "\\|");
@@ -6,8 +6,11 @@ import { promisify } from "node:util";
6
6
  import { inTypeLocation } from "@ocean/brain/memory/fact-routing.js";
7
7
  import { doctorMemoryIndexes, syncMemoryIndexes, } from "@ocean/brain/memory/index-sync.js";
8
8
  import { memorySettings } from "@ocean/brain/memory/memory-audit.js";
9
+ import { listProfileEntries, profileCollisions, } from "@ocean/core/profiles/profile-files.js";
9
10
  import { BRAIN_RECORD_DIRS, CHARTER_DIR, enginePath, INBOX_DIR, LEGACY_NOTES_DIR, NOTES_DIR, oceanEnv, oceanPath, POLICIES_DIR, PROJECTS_DIR, projectDir, repoPath, SYSTEM_DIR, workspaceTasksRoot, } from "@ocean/core/shared/paths.js";
10
- import { ensureProjectLayout, listProjectManifests, PROJECT_ROOT_ENTRIES, scanProjectManifests, UNCATEGORIZED, } from "@ocean/core/shared/project-resolution.js";
11
+ import { listProjectManifests, scanProjectManifests, UNCATEGORIZED, } from "@ocean/core/shared/project-manifest.js";
12
+ import { ensureProjectLayout, PROJECT_ROOT_ENTRIES, } from "@ocean/core/shared/project-register.js";
13
+ import { projectDoctor } from "../projects/project-doctor.js";
11
14
  const execFile = promisify(execFileCallback);
12
15
  // The notes root is inside 02-personal (not a record dir of its own) but still checked here.
13
16
  const roots = [...BRAIN_RECORD_DIRS, NOTES_DIR, PROJECTS_DIR, SYSTEM_DIR];
@@ -367,6 +370,35 @@ async function checkClaudeProjects() {
367
370
  ]
368
371
  : [];
369
372
  }
373
+ // Project names that drifted apart (T-332): the count here, each warning and its fix in
374
+ // `ocean project doctor`.
375
+ async function checkProjectNames() {
376
+ const warnings = await projectDoctor().catch(() => null);
377
+ if (!warnings)
378
+ return [
379
+ {
380
+ code: "PROJECT_NAMES_UNCHECKED",
381
+ severity: "WARN",
382
+ message: "project names could not be checked",
383
+ fixable: false,
384
+ },
385
+ ];
386
+ return [
387
+ warnings.length
388
+ ? {
389
+ code: "PROJECT_NAMES",
390
+ severity: "WARN",
391
+ message: `${warnings.length} project name warning(s) — run \`ocean project doctor\` for each fix`,
392
+ fixable: false,
393
+ }
394
+ : {
395
+ code: "PROJECT_NAMES_OK",
396
+ severity: "OK",
397
+ message: "every project name is linked and unified",
398
+ fixable: false,
399
+ },
400
+ ];
401
+ }
370
402
  // A project lives in its category folder (T-311): one still flat under 04-projects or waiting
371
403
  // in uncategorized/ is reported until `ocean project move` files it, and one id in two category
372
404
  // folders is an error, since only the first is read.
@@ -550,26 +582,33 @@ async function checkProfileAuthority() {
550
582
  fixable: false,
551
583
  },
552
584
  ];
553
- const legacy = [];
554
- for (const entry of await readdir(root, { withFileTypes: true })) {
555
- if (entry.isDirectory() &&
556
- (await exists(path.join(root, entry.name, "profile.json"))))
557
- legacy.push(entry.name);
558
- }
559
- return legacy.length
560
- ? [
561
- {
562
- code: "PROFILE_AUTHORITY_DRIFT",
563
- severity: "WARN",
564
- message: `legacy profile directories remain active: ${legacy.join(", ")}`,
565
- fixable: false,
566
- },
567
- ]
585
+ const entries = await listProfileEntries(root);
586
+ const legacy = entries
587
+ .filter((entry) => entry.format === "directory")
588
+ .map((entry) => entry.name);
589
+ const collisions = profileCollisions(entries);
590
+ const findings = [];
591
+ if (collisions.length)
592
+ findings.push({
593
+ code: "PROFILE_COLLISION",
594
+ severity: "FAIL",
595
+ message: `profiles exist in more than one form (keep one): ${collisions.join(", ")}`,
596
+ fixable: false,
597
+ });
598
+ if (legacy.length)
599
+ findings.push({
600
+ code: "PROFILE_AUTHORITY_DRIFT",
601
+ severity: "WARN",
602
+ message: `legacy profile directories remain active: ${legacy.join(", ")}`,
603
+ fixable: false,
604
+ });
605
+ return findings.length
606
+ ? findings
568
607
  : [
569
608
  {
570
609
  code: "PROFILE_AUTHORITY_CANONICAL",
571
610
  severity: "OK",
572
- message: "profiles use canonical root-level JSON authority",
611
+ message: "profiles use canonical root-level Markdown or JSON authority",
573
612
  fixable: false,
574
613
  },
575
614
  ];
@@ -690,6 +729,7 @@ async function scanWorkspace(wrapperManager) {
690
729
  ...(await checkProjectLayout()),
691
730
  ...(await checkClaudeProjects()),
692
731
  ...(await checkProjectCategories()),
732
+ ...(await checkProjectNames()),
693
733
  ...(await checkProfileAuthority()),
694
734
  ];
695
735
  }
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
2
2
  import { mkdir } from "node:fs/promises";
3
3
  import { validateSessionEntryContract } from "@ocean/core/domain/sessions/entry-contract.js";
4
4
  import { oceanPath, oceanRoot, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
5
- import { sessionProjectId } from "@ocean/loop/sessions/session-projects.js";
5
+ import { sessionProjectId } from "@ocean/work/sessions/session-projects.js";
6
6
  function safeProfileKey(value) {
7
7
  const key = value.trim();
8
8
  if (!key ||
@@ -1,5 +1,6 @@
1
1
  import { appendFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import { SELF_CHECK_CLIENT } from "@ocean/core/domain/mcp/memory-contract.js";
3
4
  import { withFileLock } from "@ocean/core/shared/fs-utils.js";
4
5
  import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
5
6
  import { serverVersion } from "./server-version.js";
@@ -89,6 +90,8 @@ export function pruneLedgerText(text, now = new Date()) {
89
90
  let prunedThisProcess = false;
90
91
  // Never throws: a ledger problem must not fail the tool call it records.
91
92
  export async function recordMcpCall(client, tool, ok, now = new Date()) {
93
+ if (client === SELF_CHECK_CLIENT)
94
+ return;
92
95
  const file = callLedgerFile();
93
96
  try {
94
97
  await mkdir(path.dirname(file), { recursive: true, mode: 0o700 });
@@ -44,7 +44,7 @@ export class McpClient {
44
44
  this.child.once("close", () => this.failPending(new Error("MCP server stopped")));
45
45
  const initialized = (await this.request("initialize", {
46
46
  protocolVersion: "2025-06-18",
47
- capabilities: {},
47
+ capabilities: this.options.roots ? { roots: { listChanged: false } } : {},
48
48
  clientInfo: { name: "ocean", version: "0.3.2" },
49
49
  }));
50
50
  const capabilities = initialized?.capabilities;
@@ -152,10 +152,26 @@ export class McpClient {
152
152
  catch {
153
153
  continue;
154
154
  }
155
- if (response.id === undefined)
155
+ if (response.id === undefined) {
156
+ if (typeof response.method === "string")
157
+ this.options.onNotification?.(response.method);
156
158
  continue;
157
- // A request from the server: answer `ping`, decline the rest (no client capabilities).
159
+ }
160
+ // A request from the server: answer `ping` and (when offered) `roots/list`, decline the rest.
158
161
  if (response.method !== undefined) {
162
+ const roots = this.options.roots;
163
+ if (response.method === "roots/list" && roots) {
164
+ const id = response.id;
165
+ void roots().then((list) => this.send({ jsonrpc: "2.0", id, result: { roots: list } }), (error) => this.send({
166
+ jsonrpc: "2.0",
167
+ id,
168
+ error: {
169
+ code: -32603,
170
+ message: error instanceof Error ? error.message : String(error),
171
+ },
172
+ }));
173
+ continue;
174
+ }
159
175
  this.send(response.method === "ping"
160
176
  ? { jsonrpc: "2.0", id: response.id, result: {} }
161
177
  : {
@@ -1,10 +1,10 @@
1
1
  import { readdir, readFile } from "node:fs/promises";
2
2
  import { actionFingerprint, mcpApprovalSchema, } from "@ocean/core/domain/mcp/mcp-contract.js";
3
3
  import { oceanPath, SYSTEM_DIR } from "@ocean/core/shared/paths.js";
4
- import { listInboxCandidates, promoteInboxNote, } from "../../obsidian/inbox-promotion.js";
5
- import { discoverObsidianVault, loadObsidianConnection, validateObsidianVault, } from "../../obsidian/vault-discovery.js";
6
- import { syncObsidianVault } from "../../obsidian/vault-sync.js";
7
- import { resolveObsidianNotePath, writeObsidianNote, } from "../../obsidian/vault-writer.js";
4
+ import { listInboxCandidates, promoteInboxNote, } from "../obsidian/inbox-promotion.js";
5
+ import { discoverObsidianVault, loadObsidianConnection, validateObsidianVault, } from "../obsidian/vault-discovery.js";
6
+ import { syncObsidianVault } from "../obsidian/vault-sync.js";
7
+ import { resolveObsidianNotePath, writeObsidianNote, } from "../obsidian/vault-writer.js";
8
8
  import { serverVersion } from "./server-version.js";
9
9
  import { McpToolRegistry } from "./tool-registry.js";
10
10
  const tools = new McpToolRegistry([