@amoree-code/ocean 2.22.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 (382) hide show
  1. package/README.md +46 -53
  2. package/dist/application/clients/bundles.js +220 -0
  3. package/dist/application/clients/chat-plugin.js +4 -42
  4. package/dist/application/clients/client-detect.js +291 -0
  5. package/dist/application/clients/clients.js +104 -25
  6. package/dist/application/clients/desktop-link.js +40 -0
  7. package/dist/application/clients/desktop-watcher.js +6 -4
  8. package/dist/application/clients/hook-trust.js +106 -0
  9. package/dist/application/clients/hooks.js +7 -1
  10. package/dist/application/clients/mcp-schema-cost.js +74 -0
  11. package/dist/application/clients/native.js +38 -2
  12. package/dist/application/clients/registry.js +51 -9
  13. package/dist/application/clients/status.js +7 -2
  14. package/dist/application/clients/zip.js +44 -0
  15. package/dist/application/gateway/webhook-gateway.js +1 -1
  16. package/dist/application/integrations/charter-copies.js +1 -1
  17. package/dist/application/integrations/engine-entry-repair.js +4 -3
  18. package/dist/application/integrations/skill-auto-sync.js +2 -2
  19. package/dist/application/integrations/skill-filter.js +1 -1
  20. package/dist/application/integrations/skill-router.js +134 -90
  21. package/dist/application/layout/layout-apply.js +1 -1
  22. package/dist/application/layout/workspace-template.js +1 -1
  23. package/dist/application/onboarding/steps.js +121 -30
  24. package/dist/application/profiles/profile-doctor.js +118 -0
  25. package/dist/application/profiles/profile-migration-service.js +208 -0
  26. package/dist/application/profiles/profile-suggestion.js +3 -7
  27. package/dist/application/profiles/profile-upgrade-service.js +98 -86
  28. package/dist/application/pull/history-index.js +1 -1
  29. package/dist/application/pull/project-match.js +3 -3
  30. package/dist/application/pull/pull.js +1 -1
  31. package/dist/application/pull/server-capture.js +92 -9
  32. package/dist/application/scheduler/local-scheduler.js +2 -2
  33. package/dist/application/spend/claude-prices.js +55 -0
  34. package/dist/application/spend/claude-spend.js +365 -0
  35. package/dist/application/uninstall/uninstall.js +25 -3
  36. package/dist/application/upkeep/nightly-upkeep.js +4 -4
  37. package/dist/composition/runtime.js +2 -2
  38. package/dist/infrastructure/desktop/claude-export.js +1 -1
  39. package/dist/infrastructure/desktop/desktop-chat.js +60 -13
  40. package/dist/infrastructure/desktop/indexeddb.js +4 -4
  41. package/dist/infrastructure/desktop/leveldb.js +2 -2
  42. package/dist/infrastructure/filesystem/profile-loader.js +3 -45
  43. package/dist/infrastructure/filesystem/runtime-config-loader.js +1 -1
  44. package/dist/infrastructure/observability/runtime-logger.js +1 -1
  45. package/dist/infrastructure/process/agent-tool-executor.js +3 -3
  46. package/dist/infrastructure/process/process-supervisor.js +1 -1
  47. package/dist/infrastructure/process/service.js +8 -8
  48. package/dist/infrastructure/providers/openai-compatible.js +2 -2
  49. package/dist/infrastructure/providers/provider-invocation.js +1 -1
  50. package/dist/infrastructure/providers/session-facts-completer.js +78 -5
  51. package/dist/interfaces/cli/auth-command.js +2 -2
  52. package/dist/interfaces/cli/brief-command.js +1 -1
  53. package/dist/interfaces/cli/browser-command.js +6 -6
  54. package/dist/interfaces/cli/browser-findings.js +6 -9
  55. package/dist/interfaces/cli/browser-settings.js +10 -10
  56. package/dist/interfaces/cli/capture-command.js +6 -6
  57. package/dist/interfaces/cli/client-test-command.js +3 -3
  58. package/dist/interfaces/cli/clients-command.js +55 -6
  59. package/dist/interfaces/cli/command-aliases.js +56 -0
  60. package/dist/interfaces/cli/command-registry.js +48 -1414
  61. package/dist/interfaces/cli/commands/browser.js +5 -0
  62. package/dist/interfaces/cli/commands/capture.js +19 -0
  63. package/dist/interfaces/cli/commands/catalog.js +9 -0
  64. package/dist/interfaces/cli/commands/client.js +135 -0
  65. package/dist/interfaces/cli/commands/clients.js +33 -0
  66. package/dist/interfaces/cli/commands/connectors.js +14 -0
  67. package/dist/interfaces/cli/commands/context.js +9 -0
  68. package/dist/interfaces/cli/commands/cost.js +15 -0
  69. package/dist/interfaces/cli/commands/daily.js +11 -0
  70. package/dist/interfaces/cli/commands/day.js +25 -0
  71. package/dist/interfaces/cli/commands/dispatch.js +31 -0
  72. package/dist/interfaces/cli/commands/doctor.js +60 -0
  73. package/dist/interfaces/cli/commands/env.js +5 -0
  74. package/dist/interfaces/cli/commands/gateway.js +16 -0
  75. package/dist/interfaces/cli/commands/handoff.js +11 -0
  76. package/dist/interfaces/cli/commands/health.js +17 -0
  77. package/dist/interfaces/cli/commands/hook.js +142 -0
  78. package/dist/interfaces/cli/commands/idea.js +11 -0
  79. package/dist/interfaces/cli/commands/install.js +31 -0
  80. package/dist/interfaces/cli/commands/intent.js +14 -0
  81. package/dist/interfaces/cli/commands/intercept.js +22 -0
  82. package/dist/interfaces/cli/commands/layout.js +11 -0
  83. package/dist/interfaces/cli/commands/lifecycle.js +5 -0
  84. package/dist/interfaces/cli/commands/loop.js +73 -0
  85. package/dist/interfaces/cli/commands/market.js +11 -0
  86. package/dist/interfaces/cli/commands/mcp.js +57 -0
  87. package/dist/interfaces/cli/commands/memory.js +5 -0
  88. package/dist/interfaces/cli/commands/migrate.js +5 -0
  89. package/dist/interfaces/cli/commands/observe.js +11 -0
  90. package/dist/interfaces/cli/commands/obsidian.js +111 -0
  91. package/dist/interfaces/cli/commands/operate.js +7 -0
  92. package/dist/interfaces/cli/commands/policy.js +16 -0
  93. package/dist/interfaces/cli/commands/project.js +207 -0
  94. package/dist/interfaces/cli/commands/repair.js +20 -0
  95. package/dist/interfaces/cli/commands/run.js +52 -0
  96. package/dist/interfaces/cli/commands/schedule.js +58 -0
  97. package/dist/interfaces/cli/commands/service.js +21 -0
  98. package/dist/interfaces/cli/commands/session.js +182 -0
  99. package/dist/interfaces/cli/commands/sessions.js +12 -0
  100. package/dist/interfaces/cli/commands/setup.js +21 -0
  101. package/dist/interfaces/cli/commands/skill.js +159 -0
  102. package/dist/interfaces/cli/commands/tasks.js +10 -0
  103. package/dist/interfaces/cli/commands/update-remove.js +25 -0
  104. package/dist/interfaces/cli/connectors-command.js +150 -0
  105. package/dist/interfaces/cli/context-command.js +39 -3
  106. package/dist/interfaces/cli/cost-command.js +104 -0
  107. package/dist/interfaces/cli/curator-command.js +1 -1
  108. package/dist/interfaces/cli/daily-command.js +7 -1
  109. package/dist/interfaces/cli/desktop-command.js +43 -7
  110. package/dist/interfaces/cli/distill-command.js +7 -2
  111. package/dist/interfaces/cli/express-command.js +1 -1
  112. package/dist/interfaces/cli/failures-command.js +4 -4
  113. package/dist/interfaces/cli/gateway-findings.js +2 -2
  114. package/dist/interfaces/cli/governance-command.js +23 -16
  115. package/dist/interfaces/cli/handoff-command.js +1 -1
  116. package/dist/interfaces/cli/harvest-command.js +2 -2
  117. package/dist/interfaces/cli/help-command.js +53 -169
  118. package/dist/interfaces/cli/hygiene-command.js +1 -1
  119. package/dist/interfaces/cli/idea-command.js +1 -1
  120. package/dist/interfaces/cli/intercept-command.js +8 -7
  121. package/dist/interfaces/cli/interests-command.js +1 -1
  122. package/dist/interfaces/cli/layout-command.js +2 -0
  123. package/dist/interfaces/cli/market-command.js +9 -9
  124. package/dist/interfaces/cli/mcp-gateway-command.js +124 -7
  125. package/dist/interfaces/cli/mcp-probe-command.js +186 -0
  126. package/dist/interfaces/cli/mcp-status-command.js +5 -5
  127. package/dist/interfaces/cli/memory-command.js +41 -7
  128. package/dist/interfaces/cli/migrate-command.js +2 -2
  129. package/dist/interfaces/cli/note-command.js +1 -1
  130. package/dist/interfaces/cli/onboard-command.js +14 -0
  131. package/dist/interfaces/cli/operate-command.js +5 -5
  132. package/dist/interfaces/cli/profiles-command.js +61 -1
  133. package/dist/interfaces/cli/rhythm-command.js +11 -5
  134. package/dist/interfaces/cli/running-server-findings.js +1 -1
  135. package/dist/interfaces/cli/scorecard-command.js +8 -8
  136. package/dist/interfaces/cli/session-facts-command.js +2 -2
  137. package/dist/interfaces/cli/sessions-command.js +145 -0
  138. package/dist/interfaces/cli/setup-command.js +15 -2
  139. package/dist/interfaces/cli/tasks-command.js +63 -13
  140. package/dist/interfaces/cli/telemetry-command.js +4 -4
  141. package/dist/interfaces/cli/uninstall-command.js +1 -1
  142. package/dist/interfaces/cli/week-failures.js +32 -0
  143. package/dist/main.js +12 -0
  144. package/node_modules/@ocean/brain/dist/{infrastructure/brain/brain-index.js → brain-index.js} +2 -2
  145. package/node_modules/@ocean/brain/dist/{brain/brain-markdown.js → brain-markdown.js} +1 -1
  146. package/node_modules/@ocean/brain/dist/{brain/brain-service.js → brain-service.js} +12 -2
  147. package/node_modules/@ocean/brain/dist/memory/brain-dump.js +92 -16
  148. package/node_modules/@ocean/brain/dist/memory/extraction-log.js +125 -0
  149. package/node_modules/@ocean/brain/dist/memory/extraction-retry.js +54 -0
  150. package/node_modules/@ocean/brain/dist/memory/fact-routing.js +44 -1
  151. package/node_modules/@ocean/brain/dist/memory/lesson-activation.js +2 -2
  152. package/node_modules/@ocean/brain/dist/memory/lesson-learning.js +2 -2
  153. package/node_modules/@ocean/brain/dist/memory/lessons.js +1 -1
  154. package/node_modules/@ocean/brain/dist/memory/memory-audit.js +2 -2
  155. package/node_modules/@ocean/brain/dist/memory/memory-harvest.js +1 -1
  156. package/node_modules/@ocean/brain/dist/memory/memory-paths.js +8 -0
  157. package/node_modules/@ocean/brain/dist/memory/memory-review.js +31 -3
  158. package/node_modules/@ocean/brain/dist/memory/memory-trash.js +29 -0
  159. package/node_modules/@ocean/brain/dist/memory/memory-write.js +4 -2
  160. package/node_modules/@ocean/brain/dist/memory/model-narrative.js +2 -2
  161. package/node_modules/@ocean/brain/dist/memory/profile-facts.js +1 -1
  162. package/node_modules/@ocean/brain/dist/memory/routing.json +6 -6
  163. package/node_modules/@ocean/{market/dist/skills → brain/dist/memory}/signal-detection.js +1 -1
  164. package/node_modules/@ocean/brain/dist/{memory → people}/people.js +1 -1
  165. package/node_modules/@ocean/brain/dist/sessions-capture/session-facts.js +625 -0
  166. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-promotion.js +7 -15
  167. package/node_modules/@ocean/brain/dist/{memory → sessions-capture}/session-summary.js +1 -1
  168. package/node_modules/@ocean/brain/dist/sessions-capture/session-triage.js +52 -0
  169. package/node_modules/@ocean/brain/package.json +1 -1
  170. package/node_modules/@ocean/connect/dist/connectors/connector-hub.js +173 -0
  171. package/node_modules/@ocean/{market → connect}/dist/install/default-marketplace.js +6 -2
  172. package/node_modules/@ocean/{market → connect}/dist/install/marketplace-service.js +1 -1
  173. package/node_modules/@ocean/connect/dist/mcp/mcp-gateway.js +987 -0
  174. package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-launch.js +102 -5
  175. package/node_modules/@ocean/{market → connect}/dist/registry/official-registry.js +1 -1
  176. package/node_modules/@ocean/{market → connect}/dist/security/permissions.js +1 -1
  177. package/node_modules/@ocean/{market → connect}/dist/skills/skill-hub.js +104 -6
  178. package/node_modules/@ocean/{market → connect}/package.json +2 -2
  179. package/node_modules/@ocean/context/dist/{context/context-ladder.js → context-ladder.js} +3 -3
  180. package/node_modules/@ocean/context/dist/{context/context-references.js → context-references.js} +5 -4
  181. package/node_modules/@ocean/context/dist/{context/context-cost.js → context-size.js} +6 -6
  182. package/node_modules/@ocean/context/dist/{context/intent-router.js → intent-router.js} +1 -1
  183. package/node_modules/@ocean/context/dist/{context/resource-injection.js → resource-injection.js} +3 -1
  184. package/node_modules/@ocean/context/package.json +1 -1
  185. package/node_modules/@ocean/core/dist/domain/brain/brain-record.js +1 -1
  186. package/node_modules/@ocean/core/dist/domain/capabilities/capability-manifest.js +5 -5
  187. package/node_modules/@ocean/core/dist/domain/connector-entry.js +86 -0
  188. package/node_modules/@ocean/core/dist/domain/context/context.js +1 -1
  189. package/node_modules/@ocean/core/dist/domain/context/project-id.js +8 -2
  190. package/node_modules/@ocean/core/dist/domain/{evidence/evidence.js → evidence.js} +1 -1
  191. package/node_modules/@ocean/core/dist/domain/mcp/memory-contract.js +4 -1
  192. package/node_modules/@ocean/core/dist/domain/ports/brain-index-port.js +1 -1
  193. package/node_modules/@ocean/core/dist/domain/profiles/profile-markdown.js +40 -0
  194. package/node_modules/@ocean/core/dist/domain/profiles/profile-resolution.js +276 -0
  195. package/node_modules/@ocean/core/dist/domain/profiles/profile-selection.js +23 -60
  196. package/node_modules/@ocean/core/dist/domain/profiles/profile-upgrade.js +2 -2
  197. package/node_modules/@ocean/core/dist/domain/profiles/profile.js +66 -6
  198. package/node_modules/@ocean/core/dist/domain/profiles/runtime-config.js +1 -1
  199. package/node_modules/@ocean/core/dist/domain/runs/agent-tools.js +2 -2
  200. package/node_modules/@ocean/core/dist/domain/sessions/session-identity.js +53 -0
  201. package/node_modules/@ocean/core/dist/domain/sessions/session-metadata.js +208 -0
  202. package/node_modules/@ocean/core/dist/domain/{tasks/task-id.js → task-id.js} +2 -2
  203. package/node_modules/@ocean/core/dist/profiles/profile-files.js +57 -0
  204. package/node_modules/@ocean/core/dist/profiles/profile-loader.js +97 -0
  205. package/node_modules/@ocean/core/dist/profiles/project-profile-fill.js +33 -0
  206. package/node_modules/@ocean/core/dist/profiles/session-profile.js +158 -0
  207. package/node_modules/@ocean/core/dist/shared/charter.js +110 -0
  208. package/node_modules/@ocean/core/dist/shared/context-ack.js +1 -1
  209. package/node_modules/@ocean/core/dist/shared/context-triggers.js +67 -0
  210. package/node_modules/@ocean/core/dist/shared/paths.js +6 -6
  211. package/node_modules/@ocean/core/dist/shared/project-legacy.js +232 -0
  212. package/node_modules/@ocean/core/dist/shared/project-manifest.js +308 -0
  213. package/node_modules/@ocean/core/dist/shared/project-names.js +87 -0
  214. package/node_modules/@ocean/core/dist/shared/project-register.js +560 -0
  215. package/node_modules/@ocean/core/dist/shared/project-resolution.js +83 -861
  216. package/node_modules/@ocean/core/dist/shared/repo-signals.js +45 -0
  217. package/node_modules/@ocean/core/dist/shared/task-reference.js +1 -1
  218. package/node_modules/@ocean/core/dist/shared/text-tokens.js +37 -0
  219. package/node_modules/@ocean/core/dist/shared/tool-groups.js +224 -0
  220. package/node_modules/@ocean/core/package.json +4 -1
  221. package/node_modules/@ocean/services/dist/day/day.js +45 -3
  222. package/node_modules/@ocean/services/dist/{distill → day}/distill.js +29 -3
  223. package/node_modules/@ocean/services/dist/{harvest → day}/harvest.js +54 -14
  224. package/node_modules/@ocean/services/dist/{brief → day}/interest-discovery.js +3 -3
  225. package/node_modules/@ocean/services/dist/day/note.js +2 -2
  226. package/node_modules/@ocean/services/dist/{onboarding → day}/onboarding.js +1 -1
  227. package/node_modules/@ocean/services/dist/day/patterns.js +68 -0
  228. package/node_modules/@ocean/services/dist/{curator → health}/curator.js +5 -5
  229. package/node_modules/@ocean/services/dist/{journey → health}/failures.js +7 -5
  230. package/node_modules/@ocean/services/dist/{hygiene → health}/hygiene.js +2 -2
  231. package/node_modules/@ocean/services/dist/{journey → health}/lesson-effect.js +1 -1
  232. package/node_modules/@ocean/services/dist/{scorecard → health}/scorecard.js +3 -3
  233. package/node_modules/@ocean/services/dist/{upkeep → health}/upkeep.js +2 -2
  234. package/node_modules/@ocean/services/dist/{doctor → health}/workspace-doctor.js +57 -17
  235. package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-session.js +1 -1
  236. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/call-ledger.js +3 -0
  237. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-client.js +19 -3
  238. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/obsidian-server.js +4 -4
  239. package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/ocean-server.js +423 -34
  240. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/conflict-log.js +1 -1
  241. package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/folder-templates.js +8 -5
  242. package/node_modules/@ocean/services/dist/projects/project-doctor.js +173 -0
  243. package/node_modules/@ocean/services/dist/projects/project-snippet.js +9 -0
  244. package/node_modules/@ocean/services/dist/projects/projects-overview.js +2 -2
  245. package/node_modules/@ocean/services/package.json +1 -1
  246. package/node_modules/@ocean/{loop/dist/loops → work/dist/runs}/guard-runtime.js +3 -3
  247. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/memory-knowledge-operations.js +4 -12
  248. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-contract.js +2 -2
  249. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/project-operations.js +2 -1
  250. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/task-operations.js +4 -4
  251. package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/write-guard.js +1 -1
  252. package/node_modules/@ocean/{loop → work}/dist/runs/prompt-assembly.js +2 -2
  253. package/node_modules/@ocean/{loop → work}/dist/runs/run-agent.js +4 -4
  254. package/node_modules/@ocean/{loop → work}/dist/runs/tool-loop.js +4 -4
  255. package/node_modules/@ocean/work/dist/sessions/hooks/desktop-facts.js +309 -0
  256. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-end-hook.js +36 -5
  257. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-facts-hook.js +144 -14
  258. package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/session-start-hook.js +129 -12
  259. package/node_modules/@ocean/work/dist/sessions/hooks/start-brief.js +110 -0
  260. package/node_modules/@ocean/work/dist/sessions/hooks/unlinked-warning.js +68 -0
  261. package/node_modules/@ocean/{loop → work}/dist/sessions/session-closeout.js +4 -4
  262. package/node_modules/@ocean/{loop → work}/dist/sessions/session-projects.js +13 -3
  263. package/node_modules/@ocean/work/dist/sessions/session-relink.js +300 -0
  264. package/node_modules/@ocean/{loop → work}/dist/sessions/session-retention.js +1 -1
  265. package/node_modules/@ocean/{loop → work}/dist/tasks/list-tasks.js +7 -2
  266. package/node_modules/@ocean/{loop → work}/dist/tasks/renumber-tasks.js +4 -2
  267. package/node_modules/@ocean/{loop → work}/dist/tasks/session-task.js +2 -2
  268. package/node_modules/@ocean/{loop → work}/dist/tasks/sync-task-prs.js +77 -7
  269. package/node_modules/@ocean/work/dist/tasks/task-git.js +63 -0
  270. package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop.js +4 -4
  271. package/node_modules/@ocean/{loop → work}/dist/tasks/verification-readiness.js +1 -1
  272. package/node_modules/@ocean/{loop → work}/dist/tasks/verify-task.js +1 -1
  273. package/node_modules/@ocean/{loop → work}/package.json +2 -2
  274. package/ocean-marketplace.json +41 -41
  275. package/package.json +12 -11
  276. package/skills/core/daily-harvest/SKILL.md +1 -1
  277. package/skills/core/ocean-memory/SKILL.md +4 -0
  278. package/skills/core/use-browser/SKILL.md +30 -7
  279. package/skills/index.json +1 -1
  280. package/templates/profiles/default.md +44 -0
  281. package/templates/profiles/developer.md +45 -0
  282. package/templates/profiles/reviewer.md +44 -0
  283. package/templates/profiles/strategist.md +44 -0
  284. package/templates/profiles-v3/analysis.md +16 -0
  285. package/templates/profiles-v3/backend.md +16 -0
  286. package/templates/profiles-v3/base.md +57 -0
  287. package/templates/profiles-v3/code-review.md +16 -0
  288. package/templates/profiles-v3/devops.md +16 -0
  289. package/templates/profiles-v3/docs-office.md +16 -0
  290. package/templates/profiles-v3/frontend.md +16 -0
  291. package/templates/profiles-v3/learning.md +16 -0
  292. package/templates/profiles-v3/marketing-ads.md +16 -0
  293. package/templates/profiles-v3/marketing-content-seo.md +16 -0
  294. package/templates/profiles-v3/ocean-ops.md +16 -0
  295. package/templates/profiles-v3/product-strategy.md +16 -0
  296. package/templates/profiles-v3/qa-testing.md +16 -0
  297. package/templates/profiles-v3/security.md +16 -0
  298. package/templates/workspace/MANIFEST.json +1 -0
  299. package/templates/workspace/charter/core.md +22 -90
  300. package/templates/workspace/charter/policies/README.md +7 -1
  301. package/templates/workspace/charter/policies/claude-code-context.md +6 -1
  302. package/templates/workspace/charter/policies/concise-output.md +5 -0
  303. package/templates/workspace/charter/policies/context.md +5 -0
  304. package/templates/workspace/charter/policies/contracts/task.md +2 -2
  305. package/templates/workspace/charter/policies/git.md +5 -0
  306. package/templates/workspace/charter/policies/graph.md +6 -1
  307. package/templates/workspace/charter/policies/knowledge.md +11 -4
  308. package/templates/workspace/charter/policies/layout.md +23 -0
  309. package/templates/workspace/charter/policies/lifecycle.md +5 -0
  310. package/templates/workspace/charter/policies/memory.md +5 -0
  311. package/templates/workspace/charter/policies/minimal-change.md +5 -0
  312. package/templates/workspace/charter/policies/models.md +5 -0
  313. package/templates/workspace/charter/policies/response.md +5 -0
  314. package/templates/workspace/charter/policies/skill-observer.md +12 -0
  315. package/templates/workspace/charter/policies/stack.md +5 -0
  316. package/templates/workspace/charter/policies/task.md +17 -3
  317. package/templates/workspace/charter/policies/verification.md +5 -0
  318. package/node_modules/@ocean/brain/dist/evidence/verification-report.js +0 -13
  319. package/node_modules/@ocean/brain/dist/memory/daily-narrative.js +0 -142
  320. package/node_modules/@ocean/brain/dist/memory/session-facts.js +0 -283
  321. package/node_modules/@ocean/context/dist/context/context-compression.js +0 -66
  322. package/node_modules/@ocean/loop/dist/hooks/desktop-facts.js +0 -174
  323. package/node_modules/@ocean/loop/dist/operations/task-linker.js +0 -40
  324. package/node_modules/@ocean/loop/dist/sessions/session-pointer.js +0 -133
  325. package/node_modules/@ocean/loop/dist/tasks/task-git.js +0 -28
  326. package/node_modules/@ocean/market/dist/mcp/mcp-gateway.js +0 -533
  327. package/templates/profiles/default.json +0 -51
  328. package/templates/profiles/developer.json +0 -51
  329. package/templates/profiles/reviewer.json +0 -51
  330. package/templates/profiles/strategist.json +0 -51
  331. /package/node_modules/@ocean/brain/dist/{brain/brain-eval.js → brain-eval.js} +0 -0
  332. /package/node_modules/@ocean/brain/dist/{brain/brain-reindex.js → brain-reindex.js} +0 -0
  333. /package/node_modules/@ocean/brain/dist/{capture → sessions-capture}/inbox-sync.js +0 -0
  334. /package/node_modules/@ocean/{market → connect}/dist/adapters/mcp-adapter.js +0 -0
  335. /package/node_modules/@ocean/{market → connect}/dist/adapters/owned-directory.js +0 -0
  336. /package/node_modules/@ocean/{market → connect}/dist/adapters/plugin-adapter.js +0 -0
  337. /package/node_modules/@ocean/{market → connect}/dist/adapters/skill-adapter.js +0 -0
  338. /package/node_modules/@ocean/{market → connect}/dist/capability/adapter.js +0 -0
  339. /package/node_modules/@ocean/{market → connect}/dist/capability/catalog.js +0 -0
  340. /package/node_modules/@ocean/{market → connect}/dist/capability/content-digest.js +0 -0
  341. /package/node_modules/@ocean/{market → connect}/dist/capability/registry.js +0 -0
  342. /package/node_modules/@ocean/{market → connect}/dist/install/lock.js +0 -0
  343. /package/node_modules/@ocean/{market → connect}/dist/install/own-server.js +0 -0
  344. /package/node_modules/@ocean/{market → connect}/dist/mcp/chrome-debugging.js +0 -0
  345. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-connection.js +0 -0
  346. /package/node_modules/@ocean/{market → connect}/dist/mcp/mcp-runner.js +0 -0
  347. /package/node_modules/@ocean/{market → connect}/dist/security/description-scan.js +0 -0
  348. /package/node_modules/@ocean/{market → connect}/dist/security/secrets.js +0 -0
  349. /package/node_modules/@ocean/{market → connect}/dist/skills/core-skill-sync.js +0 -0
  350. /package/node_modules/@ocean/context/dist/{context/context-packet.js → context-packet.js} +0 -0
  351. /package/node_modules/@ocean/core/dist/domain/{process/process-events.js → process-events.js} +0 -0
  352. /package/node_modules/@ocean/core/dist/domain/{redaction/redaction.js → redaction.js} +0 -0
  353. /package/node_modules/@ocean/services/dist/{brief → day}/brief.js +0 -0
  354. /package/node_modules/@ocean/services/dist/{express → day}/express.js +0 -0
  355. /package/node_modules/@ocean/services/dist/{brief → day}/source-registry.json +0 -0
  356. /package/node_modules/@ocean/services/dist/{journey → health}/telemetry.js +0 -0
  357. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-service.js +0 -0
  358. /package/node_modules/@ocean/services/dist/{browser → integrations/browser}/browser-task-runner.js +0 -0
  359. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/mcp-session.js +0 -0
  360. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/server-version.js +0 -0
  361. /package/node_modules/@ocean/services/dist/{infrastructure → integrations}/mcp/tool-registry.js +0 -0
  362. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/inbox-promotion.js +0 -0
  363. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-discovery.js +0 -0
  364. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-ingestion.js +0 -0
  365. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-sync.js +0 -0
  366. /package/node_modules/@ocean/services/dist/{obsidian → integrations/obsidian}/vault-writer.js +0 -0
  367. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/operation-scope.js +0 -0
  368. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-io.js +0 -0
  369. /package/node_modules/@ocean/{loop/dist → work/dist/runs}/operations/record-operations.js +0 -0
  370. /package/node_modules/@ocean/{loop → work}/dist/runs/run-authorization.js +0 -0
  371. /package/node_modules/@ocean/{loop → work}/dist/runs/session-tokens.js +0 -0
  372. /package/node_modules/@ocean/{loop/dist/handoff → work/dist/sessions}/handoff-service.js +0 -0
  373. /package/node_modules/@ocean/{loop/dist → work/dist/sessions}/hooks/lifecycle-hooks.js +0 -0
  374. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-store.js +0 -0
  375. /package/node_modules/@ocean/{loop/dist/infrastructure/persistence → work/dist/sessions}/session-validator.js +0 -0
  376. /package/node_modules/@ocean/{loop → work}/dist/tasks/archive-tasks.js +0 -0
  377. /package/node_modules/@ocean/{loop → work}/dist/tasks/checkpoint-task.js +0 -0
  378. /package/node_modules/@ocean/{loop → work}/dist/tasks/claim-task.js +0 -0
  379. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/iteration-graph.js +0 -0
  380. /package/node_modules/@ocean/{loop → work}/dist/tasks/new-task.js +0 -0
  381. /package/node_modules/@ocean/{loop/dist/loops → work/dist/tasks}/task-loop-record.js +0 -0
  382. /package/node_modules/@ocean/{loop → work}/dist/tasks/task-verification.js +0 -0
@@ -0,0 +1,45 @@
1
+ import { readdir, readFile, stat } from "node:fs/promises";
2
+ import path from "node:path";
3
+ // Words the working directory names: its package.json dependencies and its top-level file
4
+ // names (`vitest.config.ts` → vitest, `graphify-out` → graphify).
5
+ export async function projectSignals(cwd) {
6
+ const terms = new Set();
7
+ const dirs = [cwd];
8
+ let current = cwd;
9
+ for (let depth = 0; depth < 5; depth++) {
10
+ const marker = await stat(path.join(current, "package.json")).catch(() => stat(path.join(current, ".git")).catch(() => null));
11
+ if (marker) {
12
+ if (current !== cwd)
13
+ dirs.push(current);
14
+ break;
15
+ }
16
+ const parent = path.dirname(current);
17
+ if (parent === current)
18
+ break;
19
+ current = parent;
20
+ }
21
+ for (const dir of dirs) {
22
+ try {
23
+ for (const entry of await readdir(dir))
24
+ terms.add(entry.toLowerCase().split(/[.\-_]/)[0]);
25
+ }
26
+ catch { }
27
+ try {
28
+ const pkg = JSON.parse(await readFile(path.join(dir, "package.json"), "utf8"));
29
+ for (const deps of [pkg?.dependencies, pkg?.devDependencies])
30
+ if (deps && typeof deps === "object")
31
+ for (const dep of Object.keys(deps)) {
32
+ const [scope, name] = dep.startsWith("@")
33
+ ? dep.slice(1).split("/")
34
+ : [dep, ""];
35
+ terms.add(`dep:${scope.toLowerCase()}`);
36
+ if (name)
37
+ terms.add(`dep:${name.toLowerCase()}`);
38
+ }
39
+ }
40
+ catch { }
41
+ }
42
+ terms.delete("");
43
+ return terms;
44
+ }
45
+ //# sourceMappingURL=repo-signals.js.map
@@ -1,6 +1,6 @@
1
1
  import { access, readdir } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { parseTaskId, taskIdSpellings } from "../domain/tasks/task-id.js";
3
+ import { parseTaskId, taskIdSpellings } from "../domain/task-id.js";
4
4
  import { FRONTMATTER_READ_BYTES, readFrontmatterFile } from "./fs-utils.js";
5
5
  import { isWorkspaceProject, oceanRoot, PROJECTS_DIR, projectSubdir, resolveWithin, } from "./paths.js";
6
6
  import { folderProject, projectForPrefix, projectsWithTasks, } from "./project-resolution.js";
@@ -0,0 +1,37 @@
1
+ // The words a text is matched on, shared by the skill router and the profile resolver so a
2
+ // prompt meets a skill and a profile the same way: lowercased, NFKC, letters and digits only,
3
+ // stop words out, a light suffix strip.
4
+ const STOP_WORDS = new Set(("a an the and or but if of to in on at by for with from as is are was were be been being " +
5
+ "it its this that these those i me my we our us you your he she they them their what which " +
6
+ "who whom how when where why can could should would will shall do does did done doing have " +
7
+ "has had not no yes so than then there here about into over under up down out any all some " +
8
+ "each every more most other such only own same too very just also use used using user users " +
9
+ "owner says say said ask asks asked want wants need needs please let lets get got make made " +
10
+ "via per etc skill skills like one two new now way well really thing things help").split(" "));
11
+ export const isContentWord = (word) => word.length >= 2 && !STOP_WORDS.has(word);
12
+ export function normalizeText(text) {
13
+ return (text
14
+ .toLowerCase()
15
+ .normalize("NFKC")
16
+ .match(/[\p{L}\p{N}]+/gu)
17
+ ?.join(" ") ?? "");
18
+ }
19
+ // Light suffix stripping so "writing tests" meets "write a test"; the same on both sides.
20
+ export function stem(word) {
21
+ let out = word;
22
+ if (out.length > 5 && out.endsWith("ing"))
23
+ out = out.slice(0, -3);
24
+ else if (out.length > 4 && out.endsWith("ed"))
25
+ out = out.slice(0, -2);
26
+ else if (out.length > 4 && out.endsWith("es"))
27
+ out = out.slice(0, -2);
28
+ else if (out.length > 3 && out.endsWith("s") && !out.endsWith("ss"))
29
+ out = out.slice(0, -1);
30
+ if (out.length > 3 && out.endsWith("e"))
31
+ out = out.slice(0, -1);
32
+ return out;
33
+ }
34
+ export function tokenize(text) {
35
+ return normalizeText(text).split(" ").filter(isContentWord).map(stem);
36
+ }
37
+ //# sourceMappingURL=text-tokens.js.map
@@ -0,0 +1,224 @@
1
+ import { createHash } from "node:crypto";
2
+ import { realpathSync } from "node:fs";
3
+ import { mkdir, readFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { atomicWrite } from "./fs-utils.js";
6
+ import { oceanPath, SYSTEM_DIR } from "./paths.js";
7
+ // Ocean MCP tool groups (T-339 P2). Eight core tools are listed to every client; every other
8
+ // tool sits in a group opened by the conversation (the prompt hook matches a group's triggers),
9
+ // by the session's profile (`tools:`), or by `ocean_tools`. A tool off the list still answers
10
+ // `tools/call`, and `ocean_call` runs one by name for a client that refuses unlisted names.
11
+ export const CORE_TOOLS = [
12
+ "brain_search",
13
+ "brain_read",
14
+ "memory_read",
15
+ "memory_write",
16
+ "memory_propose",
17
+ "ocean_context",
18
+ "ocean_tools",
19
+ "ocean_call",
20
+ ];
21
+ export const TOOL_GROUPS = {
22
+ "memory-admin": {
23
+ tools: ["memory_delete", "memory_history", "memory_restore"],
24
+ triggers: [
25
+ "delete memory",
26
+ "forget",
27
+ "memory history",
28
+ "restore memory",
29
+ "undo memory",
30
+ "انسى",
31
+ "امسح الذاكره",
32
+ "رجع الذاكره",
33
+ ],
34
+ },
35
+ "brain-extra": {
36
+ tools: ["brain_neighbors"],
37
+ triggers: [
38
+ "related notes",
39
+ "neighbors",
40
+ "linked notes",
41
+ "backlinks",
42
+ "مرتبط",
43
+ ],
44
+ },
45
+ sessions: {
46
+ tools: [
47
+ "ocean_session_get",
48
+ "ocean_session_events",
49
+ "ocean_session_summary",
50
+ "ocean_session_save",
51
+ "ocean_session_promote",
52
+ ],
53
+ triggers: [
54
+ "session",
55
+ "last session",
56
+ "save session",
57
+ "transcript",
58
+ "الجلسه",
59
+ "جلسه",
60
+ "احفظ",
61
+ ],
62
+ },
63
+ handoffs: {
64
+ tools: ["ocean_handoff_create", "ocean_handoff_get", "ocean_handoffs_list"],
65
+ triggers: ["handoff", "hand off", "continue in", "تسليم", "سلم"],
66
+ },
67
+ tasks: {
68
+ tools: ["ocean_tasks_list", "ocean_task_get"],
69
+ triggers: [
70
+ "task",
71
+ "tasks",
72
+ "ticket",
73
+ "backlog",
74
+ "todo",
75
+ "تاسك",
76
+ "مهمه",
77
+ "مهام",
78
+ "تكت",
79
+ ],
80
+ },
81
+ projects: {
82
+ tools: ["ocean_projects_list", "ocean_project_link"],
83
+ triggers: [
84
+ "project",
85
+ "projects",
86
+ "link folder",
87
+ "register",
88
+ "مشروع",
89
+ "مشاريع",
90
+ ],
91
+ },
92
+ profiles: {
93
+ tools: ["ocean_profiles_list", "ocean_profile_get"],
94
+ triggers: ["profile", "profiles", "بروفايل", "الملف الشخصي"],
95
+ },
96
+ ops: {
97
+ tools: ["ocean_doctor", "ocean_status", "ocean_ping", "ocean_capabilities"],
98
+ triggers: [
99
+ "doctor",
100
+ "ocean status",
101
+ "health check",
102
+ "ping",
103
+ "capabilities",
104
+ "restart ocean",
105
+ "صحه",
106
+ "حاله اوشن",
107
+ ],
108
+ },
109
+ people: {
110
+ tools: ["people_lookup"],
111
+ triggers: ["who is", "colleague", "teammate", "person", "منو", "زميل"],
112
+ },
113
+ skills: {
114
+ tools: ["ocean_chat_skill"],
115
+ triggers: ["chat skill", "install skill", "سكل"],
116
+ },
117
+ // Kept callable for saved instructions; `ocean_context` with `policy` replaces it.
118
+ rules: { tools: ["ocean_policy"], triggers: [] },
119
+ };
120
+ export const GROUP_NAMES = Object.keys(TOOL_GROUPS);
121
+ // The groups a profile opens. `ocean-ops` opens ops and what it maintains.
122
+ export const PROFILE_DEFAULT_GROUPS = {
123
+ "ocean-ops": [
124
+ "ops",
125
+ "profiles",
126
+ "projects",
127
+ "sessions",
128
+ "handoffs",
129
+ "skills",
130
+ ],
131
+ };
132
+ function _groupOf(tool) {
133
+ for (const [name, group] of Object.entries(TOOL_GROUPS))
134
+ if (group.tools.includes(tool))
135
+ return name;
136
+ return null;
137
+ }
138
+ const SELECTION_TTL_MS = 24 * 60 * 60 * 1000;
139
+ // One key per folder however it is spelled: the hook and the server may see a symlinked path,
140
+ // or (Windows) an 8.3 short name or another letter case, for the same folder.
141
+ function selectionKey(cwd) {
142
+ let folder = path.resolve(cwd);
143
+ try {
144
+ folder = realpathSync.native(folder);
145
+ }
146
+ catch {
147
+ // Not there yet: hash the resolved spelling.
148
+ }
149
+ if (process.platform === "win32")
150
+ folder = folder.toLowerCase();
151
+ return createHash("sha256").update(folder).digest("hex").slice(0, 16);
152
+ }
153
+ export function selectionPath(cwd) {
154
+ return oceanPath(SYSTEM_DIR, "state", "profiles", "current", `${selectionKey(cwd)}.json`);
155
+ }
156
+ export async function readToolSelection(cwd) {
157
+ try {
158
+ const parsed = JSON.parse(await readFile(selectionPath(cwd), "utf8"));
159
+ if (parsed?.version !== 1 || !Array.isArray(parsed.groups))
160
+ return null;
161
+ return parsed;
162
+ }
163
+ catch {
164
+ return null;
165
+ }
166
+ }
167
+ // Merges into what is there (union of groups and secondaries) unless the file is a day old.
168
+ // Returns the written selection, or null when nothing changed.
169
+ export async function writeToolSelection(cwd, next, now = Date.now()) {
170
+ const current = await readToolSelection(cwd);
171
+ const fresh = current && now - current.updatedAt < SELECTION_TTL_MS;
172
+ const groups = [
173
+ ...new Set([...(fresh ? current.groups : []), ...next.groups]),
174
+ ]
175
+ .filter((name) => name in TOOL_GROUPS)
176
+ .sort();
177
+ const secondary = [
178
+ ...new Set([...(fresh ? current.secondary : []), ...next.secondary]),
179
+ ].sort();
180
+ if (fresh &&
181
+ current.primary === next.primary &&
182
+ current.groups.join() === groups.join() &&
183
+ current.secondary.join() === secondary.join())
184
+ return null;
185
+ const selection = {
186
+ version: 1,
187
+ cwd: path.resolve(cwd),
188
+ updatedAt: now,
189
+ primary: next.primary,
190
+ secondary,
191
+ groups,
192
+ };
193
+ const file = selectionPath(cwd);
194
+ await mkdir(path.dirname(file), { recursive: true, mode: 0o700 });
195
+ await atomicWrite(file, `${JSON.stringify(selection, null, 2)}\n`);
196
+ return selection;
197
+ }
198
+ // T-339 P2 (plan §2.5): whether a client re-lists on `notifications/tools/list_changed` (layer 2)
199
+ // or must reach a newly opened tool through `ocean_call` (layer 3). Keyed by the MCP
200
+ // `clientInfo.name` it sends at initialize. Every value comes from an `ocean mcp probe-client`
201
+ // run (docs: client-matrix.md); a client missing here has not been probed yet.
202
+ const CLIENT_RELISTS = {
203
+ "codex-mcp-client": false, // Codex 0.156.1, 2026-11-28
204
+ "gemini-cli-mcp-client": true, // Gemini CLI 0.61.0, 2026-11-28
205
+ Cursor: false, // cursor-agent (clientInfo 1.0.0), 2026-11-28
206
+ // Hermes 0.19.0 sends the Python SDK default name. It re-lists, but `hermes -z` keeps the
207
+ // model's tool list fixed for the turn, so an opened tool is not callable until later.
208
+ mcp: false, // 2026-11-28
209
+ "claude-ai": false, // Claude Desktop app host, 2026-11-28
210
+ };
211
+ // Clients whose `clientInfo.name` ends in the MCP server's own name (`<prefix><server>`), so one
212
+ // entry covers `ocean`, `ocean-gateway` and any other server name.
213
+ const CLIENT_RELISTS_BY_PREFIX = {
214
+ "local-agent-mode-": false, // Claude Desktop chat agent (clientInfo 1.0.0), 2026-11-28
215
+ };
216
+ export function clientRelists(clientName) {
217
+ if (clientName === undefined)
218
+ return undefined;
219
+ if (Object.hasOwn(CLIENT_RELISTS, clientName))
220
+ return CLIENT_RELISTS[clientName];
221
+ const prefix = Object.keys(CLIENT_RELISTS_BY_PREFIX).find((candidate) => clientName.startsWith(candidate) && clientName.length > candidate.length);
222
+ return prefix === undefined ? undefined : CLIENT_RELISTS_BY_PREFIX[prefix];
223
+ }
224
+ //# sourceMappingURL=tool-groups.js.map
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@ocean/core",
3
- "version": "2.22.0",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./domain/*.js": {
8
8
  "import": "./dist/domain/*.js"
9
9
  },
10
+ "./profiles/*.js": {
11
+ "import": "./dist/profiles/*.js"
12
+ },
10
13
  "./shared/*.js": {
11
14
  "import": "./dist/shared/*.js"
12
15
  }
@@ -3,8 +3,8 @@ import path from "node:path";
3
3
  import { memoryDigest } from "@ocean/brain/memory/memory-digest.js";
4
4
  import { atomicWrite, withFileLock } from "@ocean/core/shared/fs-utils.js";
5
5
  import { DAILY_DIR, oceanPath, PERSONAL_DIR, REPORTS_DIR, } from "@ocean/core/shared/paths.js";
6
- import { listTasks } from "@ocean/loop/tasks/list-tasks.js";
7
- import { buildBrief } from "../brief/brief.js";
6
+ import { listTasks } from "@ocean/work/tasks/list-tasks.js";
7
+ import { buildBrief } from "./brief.js";
8
8
  import { keepTicks, loopKey, noteFile, noteRelative, putBlock, readBlock, } from "./note.js";
9
9
  // The morning half of the daily note (T-314), with no model: what to focus on (open tasks), what
10
10
  // is coming (dated lines in the owner's records within 30 days), what was left open (unticked
@@ -120,6 +120,44 @@ async function schedule() {
120
120
  lines.push(line);
121
121
  return lines.slice(0, 5);
122
122
  }
123
+ const WRITE_TOOLS = new Set([
124
+ "memory_write",
125
+ "memory_propose",
126
+ "memory_delete",
127
+ "memory_restore",
128
+ "ocean_handoff_create",
129
+ "ocean_session_promote",
130
+ ]);
131
+ // Ledger bookkeeping rows, not a model using a tool.
132
+ const NOT_A_USE = new Set(["context_ack", "unknown"]);
133
+ // The day before `date` on the local clock: which clients read Ocean and which wrote to it
134
+ // (T-328). One line, from the ledger's names only — never what was read or written.
135
+ export function oceanActivity(calls, date) {
136
+ const start = new Date(`${date}T00:00:00`);
137
+ const from = new Date(start);
138
+ from.setDate(from.getDate() - 1);
139
+ const counts = new Map();
140
+ for (const call of calls) {
141
+ const at = Date.parse(call.ts);
142
+ if (!(at >= from.getTime() && at < start.getTime()))
143
+ continue;
144
+ if (NOT_A_USE.has(call.tool))
145
+ continue;
146
+ const row = counts.get(call.client) ?? { reads: 0, writes: 0 };
147
+ if (WRITE_TOOLS.has(call.tool))
148
+ row.writes += 1;
149
+ else
150
+ row.reads += 1;
151
+ counts.set(call.client, row);
152
+ }
153
+ if (!counts.size)
154
+ return "- No client used Ocean yesterday.";
155
+ const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
156
+ const parts = [...counts.entries()]
157
+ .sort((a, b) => b[1].reads + b[1].writes - (a[1].reads + a[1].writes))
158
+ .map(([client, { reads, writes }]) => `${client} ${[reads ? plural(reads, "read") : "", writes ? plural(writes, "write") : ""].filter(Boolean).join(", ")}`);
159
+ return `- Yesterday: ${parts.join(" · ")}`;
160
+ }
123
161
  const section = (title, lines, empty) => lines.length || empty
124
162
  ? ["", `### ${title}`, "", ...(lines.length ? lines : [`- ${empty}`])]
125
163
  : [];
@@ -134,6 +172,9 @@ export async function prepareDay(options) {
134
172
  const deadlines = (await upcoming(date)).map((line) => `- ${line}`);
135
173
  const loops = await openLoops(date);
136
174
  const hours = await schedule();
175
+ const activity = options.calls
176
+ ? [oceanActivity(await options.calls().catch(() => []), date)]
177
+ : [];
137
178
  const waiting = (await memoryDigest({ stale: null })).map((line) => `- ${line}`);
138
179
  const brief = await buildBrief({
139
180
  date,
@@ -168,6 +209,7 @@ export async function prepareDay(options) {
168
209
  ...section("Open loops", loops),
169
210
  ...section("Your hours", hours),
170
211
  ...section("Waiting on you", waiting),
212
+ ...section("Ocean", activity),
171
213
  "",
172
214
  "## Brief",
173
215
  "",
@@ -183,6 +225,7 @@ export async function prepareDay(options) {
183
225
  loops,
184
226
  schedule: hours,
185
227
  waiting,
228
+ activity,
186
229
  brief: briefLines,
187
230
  };
188
231
  if (!options.apply)
@@ -201,5 +244,4 @@ export async function prepareDay(options) {
201
244
  export function dropEmptyStubs(note) {
202
245
  return note.replace(/^## (Focus|Work log|Decisions|Problems|Next|Observations)\n+(?=## |<!-- ocean:|$(?![\s\S]))/gm, "");
203
246
  }
204
- export { readBlock };
205
247
  //# sourceMappingURL=day.js.map
@@ -2,10 +2,13 @@ import { mkdir, readdir, readFile, rename } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { proposeMemory } from "@ocean/brain/memory/memory-write.js";
4
4
  import { MemoryContractError } from "@ocean/core/domain/mcp/memory-contract.js";
5
+ import { readMetadata, } from "@ocean/core/domain/sessions/session-metadata.js";
5
6
  import { cleanTitle } from "@ocean/core/shared/clean-title.js";
6
7
  import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
7
8
  import { DAILY_DIR, INBOX_DIR, KNOWLEDGE_DIR, oceanPath, PERSONAL_DIR, REPORTS_DIR, } from "@ocean/core/shared/paths.js";
8
- import { listMilestones } from "../express/express.js";
9
+ import { projectDoctor } from "../projects/project-doctor.js";
10
+ import { listMilestones } from "./express.js";
11
+ import { weeklyPatterns } from "./patterns.js";
9
12
  // The weekly distill (T-314): a week's session records and briefs become one digest in
10
13
  // 01-daily/reports/weekly/, the Decisions and Learned sections become knowledge candidates for review,
11
14
  // each record read is marked `distilled: true`, and inbox captures marked processed move to
@@ -69,8 +72,19 @@ export async function distillWeek(options) {
69
72
  continue;
70
73
  if (!inWeek(fields.date))
71
74
  continue;
72
- const title = cleanTitle(/^# (.+)$/m.exec(text)?.[1] ?? "", fields.project || path.basename(file, ".md"));
73
- sessions.push({ file, text, title, status: fields.status ?? "" });
75
+ const own = cleanTitle(/^# (.+)$/m.exec(text)?.[1] ?? "", "");
76
+ const title = own || fields.project || path.basename(file, ".md");
77
+ sessions.push({
78
+ file,
79
+ text,
80
+ title,
81
+ status: fields.status ?? "",
82
+ project: fields.project ?? "",
83
+ provider: fields.provider ?? "",
84
+ // A title that is only the project's name is a fallback, not a title.
85
+ untitled: !own || own === fields.project,
86
+ meta: readMetadata(fields),
87
+ });
74
88
  }
75
89
  const briefs = (await markdownIn(oceanPath(REPORTS_DIR, "briefs"))).filter((file) => inWeek(/(\d{4}-\d{2}-\d{2})/.exec(path.basename(file))?.[1]));
76
90
  const captures = [];
@@ -110,6 +124,8 @@ export async function distillWeek(options) {
110
124
  result.digest = digestRelative;
111
125
  if (!options.apply)
112
126
  return result;
127
+ const patterns = weeklyPatterns(sessions, (await options.failures?.(week).catch(() => [])) ?? []);
128
+ const nameWarnings = (await projectDoctor().catch(() => [])).length;
113
129
  const body = [
114
130
  "---",
115
131
  "type: weekly",
@@ -126,6 +142,16 @@ export async function distillWeek(options) {
126
142
  ...(sessions.length
127
143
  ? sessions.map((item) => `- ${link(item.file, item.title)} — ${item.status || "unknown"}`)
128
144
  : ["- none"]),
145
+ ...(patterns.length ? ["", "## Patterns", "", ...patterns] : []),
146
+ // T-332: drifted project names, counted; `ocean project doctor` lists each with its fix.
147
+ ...(nameWarnings
148
+ ? [
149
+ "",
150
+ "## Projects",
151
+ "",
152
+ `- ${nameWarnings} project name warning(s) — run \`ocean project doctor\``,
153
+ ]
154
+ : []),
129
155
  ...(decisions.length ? ["", "## Decisions", "", ...list(decisions)] : []),
130
156
  ...(problems.length
131
157
  ? ["", "## Problems → fixes", "", ...list(problems)]
@@ -1,12 +1,14 @@
1
1
  import { copyFile, mkdir, readdir, readFile, rename, rm, } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { syncMemoryIndexes } from "@ocean/brain/memory/index-sync.js";
4
- import { containsKnownSecret } from "@ocean/core/domain/redaction/redaction.js";
4
+ import { filedFromSessions, itemEvidence, untagged, } from "@ocean/brain/sessions-capture/session-facts.js";
5
+ import { isValidProjectId } from "@ocean/core/domain/context/project-id.js";
6
+ import { containsKnownSecret } from "@ocean/core/domain/redaction.js";
5
7
  import { cleanTitle } from "@ocean/core/shared/clean-title.js";
6
8
  import { atomicWrite, parseFrontmatter, withFileLock, } from "@ocean/core/shared/fs-utils.js";
7
- import { DAILY_DIR, INBOX_DIR, KNOWLEDGE_DIR, oceanPath, SYSTEM_DIR, } from "@ocean/core/shared/paths.js";
8
- import { keepTicks, noteFile, putBlock, readBlock } from "../day/note.js";
9
- import { section } from "../distill/distill.js";
9
+ import { DAILY_DIR, INBOX_DIR, KNOWLEDGE_DIR, oceanPath, SYSTEM_DIR, WORKSPACE_PROJECT_ID, } from "@ocean/core/shared/paths.js";
10
+ import { section } from "./distill.js";
11
+ import { keepTicks, noteFile, putBlock, readBlock } from "./note.js";
10
12
  // The daily harvest (T-314): every session of a day, from every AI client, becomes one summary in
11
13
  // that day's note, and what the sessions decided, fixed and learned is filed into 05-knowledge on
12
14
  // its own, with no review step (owner's decision, 2026-11-16). Safety instead of review: a record
@@ -23,11 +25,13 @@ const JOURNAL_NEXT = 3;
23
25
  // "Completed." is a status, not an outcome (older closeout records wrote it on every session).
24
26
  const PLACEHOLDER = /^(not stated|no objective was captured|none|n\/a|completed)\.?$/i;
25
27
  const SAME_TITLE = 0.6;
26
- // Where each kind of harvested item is filed, and the record type it carries.
28
+ // Where each kind of harvested item is filed, and the record type it carries. 05-knowledge holds
29
+ // two folders (T-329 phase 4): decisions, and lessons for everything work taught; a lesson
30
+ // record names what it was born as in `kind:`.
27
31
  const KINDS = {
28
32
  decision: { heading: "Decisions", folder: "decisions" },
29
- solution: { heading: "Problems → fixes", folder: "solutions" },
30
- discovery: { heading: "Learned", folder: "discoveries" },
33
+ solution: { heading: "Problems → fixes", folder: "lessons" },
34
+ discovery: { heading: "Learned", folder: "lessons" },
31
35
  };
32
36
  const relativeOf = (file) => path.relative(oceanPath(), file).split(path.sep).join("/");
33
37
  const sessionsRoot = () => oceanPath(DAILY_DIR, "sessions");
@@ -48,7 +52,7 @@ async function markdownIn(dir, skipArchive = true) {
48
52
  }
49
53
  return files.sort();
50
54
  }
51
- export async function daySessions(date) {
55
+ async function daySessions(date) {
52
56
  const sessions = [];
53
57
  for (const file of await markdownIn(path.join(sessionsRoot(), date.slice(0, 7)))) {
54
58
  const text = (await readFile(file, "utf8")).replace(/\r\n/g, "\n");
@@ -88,13 +92,19 @@ export function sectionItems(text, heading) {
88
92
  }
89
93
  // A record written with sections (Goal, Outcome, Decisions, …) can be mined here; an older dump
90
94
  // (one "What happened" paragraph) needs the skill's reading.
91
- export const structured = (session) => /^## (Goal|Outcome|Decisions|Learned)$/m.test(session.text);
95
+ const structured = (session) => /^## (Goal|Outcome|Decisions|Learned)$/m.test(session.text);
96
+ // An item tagged [unverified] (T-329 phase 2) is an assistant claim nobody confirmed and no tool
97
+ // showed: it stays in the session record and is never filed. [user] and [tool] items are filed
98
+ // without their tag; an untagged item is from a record written before tags existed.
92
99
  export function harvestItems(sessions) {
93
100
  const items = [];
94
101
  for (const session of sessions)
95
102
  for (const kind of Object.keys(KINDS))
96
- for (const text of sectionItems(session.text, KINDS[kind].heading))
97
- items.push({ kind, text, session });
103
+ for (const text of sectionItems(session.text, KINDS[kind].heading)) {
104
+ if (itemEvidence(text) === "unverified")
105
+ continue;
106
+ items.push({ kind, text: untagged(text), session });
107
+ }
98
108
  return items;
99
109
  }
100
110
  // What the owner said to correct an AI ("no, not like that", "غلط", "don't …"): candidates for a
@@ -170,10 +180,25 @@ function similarity(a, b) {
170
180
  shared++;
171
181
  return shared / Math.min(left.size, right.size);
172
182
  }
183
+ // A record's title: the first sentence, or for a "problem → fix" line the problem (the fix is
184
+ // the body). A long one is cut at a word, never mid-word.
185
+ const TITLE_CHARS = 90;
173
186
  const titleOf = (text) => {
174
- const sentence = text.split(/(?<=[.!?])\s/)[0] ?? text;
175
- return sentence.length > 90 ? `${sentence.slice(0, 87).trim()}…` : sentence;
187
+ const head = text.split(" → ")[0] ?? text;
188
+ const sentence = (head.split(/(?<=[.!?])\s/)[0] ?? head).trim();
189
+ if (sentence.length <= TITLE_CHARS)
190
+ return sentence;
191
+ const cut = sentence.slice(0, TITLE_CHARS - 1);
192
+ const space = cut.lastIndexOf(" ");
193
+ const kept = space > TITLE_CHARS / 2 ? cut.slice(0, space) : cut;
194
+ return `${kept.replace(/[\s,;:–-]+$/, "")}…`;
176
195
  };
196
+ // A lesson from one project's session is that project's (T-256 scope), so a search from
197
+ // another project does not surface it. Ocean's own lessons stay global: every session on
198
+ // this machine runs on Ocean.
199
+ const scopeOf = (project) => project && project !== WORKSPACE_PROJECT_ID && isValidProjectId(project)
200
+ ? [`scope: project:${project}`]
201
+ : [];
177
202
  function setField(text, key, value) {
178
203
  const end = text.startsWith("---\n") ? text.indexOf("\n---", 3) : -1;
179
204
  if (end < 0)
@@ -224,6 +249,7 @@ async function fileItem(item, ledger) {
224
249
  const file = path.join(folder, `${slug(item.text) || "untitled"}.md`);
225
250
  const body = [
226
251
  "---",
252
+ ...(KINDS[item.kind].folder === "lessons" ? [`kind: ${item.kind}`] : []),
227
253
  `type: ${item.kind}`,
228
254
  `title: ${JSON.stringify(title)}`,
229
255
  "status: active",
@@ -232,6 +258,7 @@ async function fileItem(item, ledger) {
232
258
  ...(item.session.project
233
259
  ? [`project: ${JSON.stringify(item.session.project)}`]
234
260
  : []),
261
+ ...scopeOf(item.session.project),
235
262
  `created: ${item.session.date}`,
236
263
  `last_verified: ${item.session.date}`,
237
264
  "---",
@@ -308,6 +335,14 @@ function dayBlock(input) {
308
335
  ...(input.captures.length
309
336
  ? ["", "### Captured", "", ...input.captures]
310
337
  : []),
338
+ ...(input.sessionFiled.length
339
+ ? [
340
+ "",
341
+ "## Filed",
342
+ "",
343
+ ...input.sessionFiled.map((item) => `- \`${item.path}\` — undo: \`ocean memory undo ${item.auditId}\``),
344
+ ]
345
+ : []),
311
346
  ...(input.filed.size
312
347
  ? [
313
348
  "",
@@ -369,7 +404,11 @@ export async function harvestDay(options) {
369
404
  minutes,
370
405
  };
371
406
  const captures = await dayCaptures(date);
372
- if (!sessions.length && !ofDay.length && !captures.length)
407
+ const sessionFiled = await filedFromSessions(date);
408
+ if (!sessions.length &&
409
+ !ofDay.length &&
410
+ !captures.length &&
411
+ !sessionFiled.length)
373
412
  return result;
374
413
  result.note = `${DAILY_DIR}/${date}.md`;
375
414
  if (!options.apply) {
@@ -396,6 +435,7 @@ export async function harvestDay(options) {
396
435
  corrections,
397
436
  minutes,
398
437
  captures,
438
+ sessionFiled,
399
439
  date,
400
440
  });
401
441
  await withFileLock(file, async () => {
@@ -6,12 +6,12 @@ import { MemoryContractError } from "@ocean/core/domain/mcp/memory-contract.js";
6
6
  import { atomicWrite, parseFrontmatter } from "@ocean/core/shared/fs-utils.js";
7
7
  import { localDate } from "@ocean/core/shared/local-date.js";
8
8
  import { DAILY_DIR, oceanPath } from "@ocean/core/shared/paths.js";
9
- import { expandHome, listProjectManifests, projectSlug, } from "@ocean/core/shared/project-resolution.js";
9
+ import { expandHome, listProjectManifests, projectSlug, } from "@ocean/core/shared/project-manifest.js";
10
10
  import { INTERESTS_DIR, listInterests } from "./brief.js";
11
11
  import registry from "./source-registry.json" with { type: "json" };
12
12
  const SOURCES = registry;
13
13
  // Packages the registered projects depend on, mapped through the source registry.
14
- export async function discoverStack() {
14
+ async function discoverStack() {
15
15
  const byTopic = new Map();
16
16
  for (const manifest of await listProjectManifests()) {
17
17
  for (const folder of manifest.paths ?? []) {
@@ -130,7 +130,7 @@ export function topicProposal(topic, reason) {
130
130
  const SIGNAL_SESSIONS = 3;
131
131
  // Implicit signal: a registry topic named in at least three session records of the last `weeks`
132
132
  // weeks (or a tag they carry) is proposed as an interest. Proposed, never added.
133
- export async function sessionSignals(options) {
133
+ async function sessionSignals(options) {
134
134
  const cutoff = new Date(Date.parse(options.today ?? localDate()) -
135
135
  (options.weeks ?? 4) * 7 * 24 * 60 * 60 * 1000)
136
136
  .toISOString()
@@ -12,10 +12,10 @@ const WEEKDAYS = [
12
12
  "Friday",
13
13
  "Saturday",
14
14
  ];
15
- export function weekday(date) {
15
+ function weekday(date) {
16
16
  return WEEKDAYS[new Date(`${date}T12:00:00Z`).getUTCDay()];
17
17
  }
18
- export function newNote(date) {
18
+ function newNote(date) {
19
19
  return `---\ntype: daily\ndate: ${date}\n---\n\n# ${date} — ${weekday(date)}\n\n## Notes\n`;
20
20
  }
21
21
  export function hasBlock(note, name) {