@aitne-sh/aitne 0.1.8 → 0.1.9

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 (276) hide show
  1. package/README.md +218 -161
  2. package/agent-assets/agent-profiles/_safety.md +3 -3
  3. package/agent-assets/agent-profiles/browser-task.md +108 -0
  4. package/agent-assets/agent-profiles/conversational.md +3 -3
  5. package/agent-assets/agent-profiles/profile-importer.md +2 -2
  6. package/agent-assets/agent-profiles/routine-fetch-window.md +30 -19
  7. package/agent-assets/agents/context-index-reconcile/agent.md +52 -0
  8. package/agent-assets/agents/evening-review/agent.md +53 -0
  9. package/agent-assets/agents/hourly-check/agent.md +62 -0
  10. package/agent-assets/agents/monthly-review/agent.md +55 -0
  11. package/agent-assets/agents/morning-routine/agent.md +78 -0
  12. package/agent-assets/agents/roadmap-maintenance/agent.md +52 -0
  13. package/agent-assets/agents/skill-curation/agent.md +52 -0
  14. package/agent-assets/agents/user-profile-sweep-evening/agent.md +48 -0
  15. package/agent-assets/agents/user-profile-sweep-morning/agent.md +53 -0
  16. package/agent-assets/agents/weekly-review/agent.md +51 -0
  17. package/agent-assets/docs/concepts/agent-day.md +13 -11
  18. package/agent-assets/docs/concepts/auth-health.md +47 -10
  19. package/agent-assets/docs/concepts/backends-and-tiers.md +66 -31
  20. package/agent-assets/docs/concepts/costs-and-quotas.md +50 -15
  21. package/agent-assets/docs/concepts/delegated-mode.md +52 -13
  22. package/agent-assets/docs/concepts/memory-model.md +72 -32
  23. package/agent-assets/docs/concepts/observations.md +49 -11
  24. package/agent-assets/docs/concepts/process-keys.md +56 -22
  25. package/agent-assets/docs/concepts/routines.md +60 -33
  26. package/agent-assets/docs/concepts/safety-and-execution.md +50 -21
  27. package/agent-assets/docs/concepts/safety-model.md +42 -34
  28. package/agent-assets/docs/concepts/skills.md +33 -17
  29. package/agent-assets/docs/features/integrations/browser-history.md +195 -0
  30. package/agent-assets/docs/features/integrations/calendar.md +39 -29
  31. package/agent-assets/docs/features/integrations/git.md +18 -7
  32. package/agent-assets/docs/features/integrations/github.md +84 -33
  33. package/agent-assets/docs/features/integrations/mail.md +59 -16
  34. package/agent-assets/docs/features/integrations/notion.md +18 -6
  35. package/agent-assets/docs/features/integrations/obsidian.md +28 -5
  36. package/agent-assets/docs/features/lifestyle/git.md +42 -38
  37. package/agent-assets/docs/features/lifestyle/reading.md +50 -22
  38. package/agent-assets/docs/features/lifestyle/receipts.md +51 -21
  39. package/agent-assets/docs/features/lifestyle/travel-bookings.md +76 -14
  40. package/agent-assets/docs/features/memory-files/agent-journal.md +111 -50
  41. package/agent-assets/docs/features/memory-files/projects.md +71 -17
  42. package/agent-assets/docs/features/memory-files/roadmap.md +50 -10
  43. package/agent-assets/docs/features/memory-files/schedule.md +113 -70
  44. package/agent-assets/docs/features/memory-files/today.md +46 -21
  45. package/agent-assets/docs/features/memory-files/user-profile.md +63 -33
  46. package/agent-assets/docs/features/messaging/bang-commands.md +113 -36
  47. package/agent-assets/docs/features/messaging/dashboard-chat.md +43 -21
  48. package/agent-assets/docs/features/messaging/discord.md +35 -4
  49. package/agent-assets/docs/features/messaging/overview.md +37 -19
  50. package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +94 -27
  51. package/agent-assets/docs/features/messaging/slack.md +67 -14
  52. package/agent-assets/docs/features/messaging/telegram.md +18 -5
  53. package/agent-assets/docs/features/messaging/whatsapp.md +71 -17
  54. package/agent-assets/docs/features/operations/activity-and-conversations.md +44 -15
  55. package/agent-assets/docs/features/operations/approvals.md +48 -16
  56. package/agent-assets/docs/features/operations/backend-routing.md +68 -16
  57. package/agent-assets/docs/features/operations/cost-tracking.md +84 -17
  58. package/agent-assets/docs/features/operations/managed-chromium.md +221 -0
  59. package/agent-assets/docs/features/operations/notifications.md +52 -11
  60. package/agent-assets/docs/features/operations/quiet-hours.md +63 -40
  61. package/agent-assets/docs/features/operations/schedule-approaching.md +54 -24
  62. package/agent-assets/docs/features/routines/custom-routines.md +88 -20
  63. package/agent-assets/docs/features/routines/evening-review.md +74 -21
  64. package/agent-assets/docs/features/routines/hourly-check.md +149 -29
  65. package/agent-assets/docs/features/routines/morning-routine.md +53 -35
  66. package/agent-assets/docs/features/routines/weekly-review.md +40 -21
  67. package/agent-assets/docs/features/wiki/commands.md +26 -16
  68. package/agent-assets/docs/features/wiki/cost-and-approval.md +240 -0
  69. package/agent-assets/docs/features/wiki/dashboard.md +255 -0
  70. package/agent-assets/docs/features/wiki/overview.md +68 -10
  71. package/agent-assets/docs/features/wiki/search.md +248 -0
  72. package/agent-assets/docs/features/wiki/workspaces.md +254 -0
  73. package/agent-assets/docs/getting-started/01-what-is-this.md +34 -23
  74. package/agent-assets/docs/getting-started/02-first-steps.md +13 -8
  75. package/agent-assets/docs/getting-started/03-what-can-this-do.md +25 -14
  76. package/agent-assets/docs/getting-started/04-first-day.md +38 -20
  77. package/agent-assets/docs/glossary.md +235 -24
  78. package/agent-assets/docs/guides/add-a-custom-routine.md +63 -23
  79. package/agent-assets/docs/guides/backup-and-restore.md +80 -16
  80. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +56 -25
  81. package/agent-assets/docs/guides/build-your-wiki.md +22 -9
  82. package/agent-assets/docs/guides/change-which-model-handles-x.md +64 -10
  83. package/agent-assets/docs/guides/connect-a-new-mail-account.md +64 -15
  84. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +28 -11
  85. package/agent-assets/docs/guides/import-knowledge-file.md +50 -40
  86. package/agent-assets/docs/guides/install-and-run.md +48 -19
  87. package/agent-assets/docs/guides/maintain-wiki-health.md +35 -10
  88. package/agent-assets/docs/guides/migrate-machines.md +74 -18
  89. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +111 -60
  90. package/agent-assets/docs/guides/pause-the-agent.md +65 -24
  91. package/agent-assets/docs/guides/reinstall-cleanly.md +88 -18
  92. package/agent-assets/docs/guides/setup-wizard.md +113 -54
  93. package/agent-assets/docs/guides/switch-default-backend.md +62 -16
  94. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +26 -10
  95. package/agent-assets/docs/reference/api.md +143 -32
  96. package/agent-assets/docs/reference/cli-commands.md +38 -17
  97. package/agent-assets/docs/reference/config.md +224 -49
  98. package/agent-assets/docs/reference/disallowed-tools.md +29 -10
  99. package/agent-assets/docs/reference/keyboard-shortcuts.md +34 -10
  100. package/agent-assets/docs/reference/knowledge-layout.md +620 -0
  101. package/agent-assets/docs/reference/process-keys.md +61 -5
  102. package/agent-assets/docs/reference/skills.md +38 -12
  103. package/agent-assets/docs/troubleshooting/auth-failed.md +48 -19
  104. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +90 -28
  105. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +86 -22
  106. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +68 -24
  107. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +80 -20
  108. package/agent-assets/docs/troubleshooting/observation-not-detected.md +73 -21
  109. package/agent-assets/docs/troubleshooting/quota-exhausted.md +29 -5
  110. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +126 -54
  111. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +29 -12
  112. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +1 -1
  113. package/agent-assets/optimizer-skills/knowledge-map/SKILL.md +1 -1
  114. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +1 -1
  115. package/agent-assets/sandbox/linux/aitne-chromium.apparmor +91 -0
  116. package/agent-assets/sandbox/macos/aitne-chromium.sb +156 -0
  117. package/agent-assets/skills/agent-actions/SKILL.md +2 -2
  118. package/agent-assets/skills/agent-create/SKILL.md +149 -0
  119. package/agent-assets/skills/attach/SKILL.md +2 -2
  120. package/agent-assets/skills/browser-history/SKILL.md +198 -0
  121. package/agent-assets/skills/browser-history-respond/SKILL.md +106 -0
  122. package/agent-assets/skills/browser-task/SKILL.md +169 -0
  123. package/agent-assets/skills/context/SKILL.md +12 -12
  124. package/agent-assets/skills/context/curation.json +2 -2
  125. package/agent-assets/skills/context/references/api.md +43 -31
  126. package/agent-assets/skills/context/references/required-frontmatter.md +3 -3
  127. package/agent-assets/skills/context/references/snapshot-files.md +6 -6
  128. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +3 -3
  129. package/agent-assets/skills/docs-search/SKILL.md +4 -3
  130. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +11 -21
  131. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +11 -21
  132. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +11 -21
  133. package/agent-assets/skills/external-services/SKILL.md +3 -3
  134. package/agent-assets/skills/external-services/SKILL.native.claude.md +5 -5
  135. package/agent-assets/skills/external-services/SKILL.native.codex.md +7 -7
  136. package/agent-assets/skills/external-services/SKILL.native.gemini.md +4 -4
  137. package/agent-assets/skills/external-services/references/calendar-apple.md +2 -2
  138. package/agent-assets/skills/external-services/references/calendar-outlook.md +1 -1
  139. package/agent-assets/skills/external-services/references/obsidian.md +2 -2
  140. package/agent-assets/skills/gmail-lifestyle/SKILL.md +9 -82
  141. package/agent-assets/skills/mail/SKILL.delegated.claude.md +14 -5
  142. package/agent-assets/skills/mail/SKILL.delegated.codex.md +8 -4
  143. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +8 -4
  144. package/agent-assets/skills/mail/references/api.md +4 -2
  145. package/agent-assets/skills/mail/references/providers.md +1 -1
  146. package/agent-assets/skills/managed-tasks/SKILL.md +9 -9
  147. package/agent-assets/skills/managed-tasks/references/errors.md +9 -6
  148. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +1 -1
  149. package/agent-assets/skills/management-policy/SKILL.md +32 -31
  150. package/agent-assets/skills/management-policy/curation.json +1 -1
  151. package/agent-assets/skills/management-policy/references/policy-workflow.md +9 -9
  152. package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +1 -1
  153. package/agent-assets/skills/notify/SKILL.md +4 -4
  154. package/agent-assets/skills/notify/references/priority.md +9 -4
  155. package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
  156. package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
  157. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
  158. package/agent-assets/skills/notion/SKILL.native.claude.md +10 -6
  159. package/agent-assets/skills/notion/SKILL.native.codex.md +9 -4
  160. package/agent-assets/skills/notion/SKILL.native.gemini.md +9 -4
  161. package/agent-assets/skills/observations/SKILL.md +24 -8
  162. package/agent-assets/skills/project-doc/SKILL.md +1 -1
  163. package/agent-assets/skills/project-doc/curation.json +3 -3
  164. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +7 -4
  165. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
  166. package/agent-assets/skills/reading/SKILL.md +10 -0
  167. package/agent-assets/skills/reading/references/reading-taste.md +2 -2
  168. package/agent-assets/skills/roadmap/SKILL.md +5 -5
  169. package/agent-assets/skills/roadmap/curation.json +1 -1
  170. package/agent-assets/skills/roadmap/references/api.md +7 -7
  171. package/agent-assets/skills/roadmap/references/cross-check.md +15 -8
  172. package/agent-assets/skills/roadmap/references/migration.md +4 -4
  173. package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +1 -1
  174. package/agent-assets/skills/schedule/SKILL.md +42 -34
  175. package/agent-assets/skills/schedule/references/batch.md +2 -2
  176. package/agent-assets/skills/schedule/references/errors.md +7 -4
  177. package/agent-assets/skills/schedule/references/model-selection.md +3 -3
  178. package/agent-assets/skills/schedule/references/recurrence-rule.md +1 -1
  179. package/agent-assets/skills/scheduled-managed-task/SKILL.md +46 -36
  180. package/agent-assets/skills/today/SKILL.md +9 -9
  181. package/agent-assets/skills/today/curation.json +3 -3
  182. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +6 -5
  183. package/agent-assets/skills/today/seeds/section-shape.seed.json +1 -1
  184. package/agent-assets/skills/user-interview/SKILL.md +12 -9
  185. package/agent-assets/skills/user-interview/references/op-briefing.md +2 -2
  186. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +8 -0
  187. package/agent-assets/skills/user-profile/SKILL.md +17 -17
  188. package/agent-assets/skills/user-profile/curation.json +2 -2
  189. package/agent-assets/skills/user-profile/references/character-preferences.md +2 -2
  190. package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +8 -8
  191. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +6 -6
  192. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +4 -4
  193. package/agent-assets/system-prompts/routine-fetch-window.md +22 -12
  194. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +4 -2
  195. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +4 -2
  196. package/agent-assets/task-flows/_partials/capture-user-info.md +2 -2
  197. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +1 -1
  198. package/agent-assets/task-flows/_partials/dm-intent.project.md +9 -9
  199. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +3 -2
  200. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +10 -5
  201. package/agent-assets/task-flows/browser_task.md +84 -0
  202. package/agent-assets/task-flows/github.assigned.md +1 -1
  203. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  204. package/agent-assets/task-flows/github.workflow_run.failed.md +2 -2
  205. package/agent-assets/task-flows/knowledge.import.md +14 -14
  206. package/agent-assets/task-flows/message.received.dm.md +9 -4
  207. package/agent-assets/task-flows/message.received.dm_first.md +3 -3
  208. package/agent-assets/task-flows/routine.custom.md +3 -3
  209. package/agent-assets/task-flows/routine.evening_review.md +8 -8
  210. package/agent-assets/task-flows/routine.fetch_window.md +2 -2
  211. package/agent-assets/task-flows/routine.hourly_check.md +16 -12
  212. package/agent-assets/task-flows/routine.monthly_review.md +21 -21
  213. package/agent-assets/task-flows/routine.morning_routine_journal.md +119 -97
  214. package/agent-assets/task-flows/routine.morning_routine_today.md +43 -43
  215. package/agent-assets/task-flows/routine.research_cluster_update.md +35 -0
  216. package/agent-assets/task-flows/routine.research_dispatch.md +38 -0
  217. package/agent-assets/task-flows/routine.research_offer_dm.md +125 -0
  218. package/agent-assets/task-flows/routine.research_wiki_summary.md +53 -0
  219. package/agent-assets/task-flows/routine.roadmap_refresh.md +10 -10
  220. package/agent-assets/task-flows/routine.today_refresh.md +4 -4
  221. package/agent-assets/task-flows/routine.user_profile_sweep.md +10 -10
  222. package/agent-assets/task-flows/routine.weekly_review.md +93 -24
  223. package/agent-assets/task-flows/schedule.approaching.md +0 -1
  224. package/agent-assets/task-flows/scheduled.dm.md +5 -5
  225. package/agent-assets/task-flows/scheduled.task.md +4 -4
  226. package/agent-assets/task-flows/setup.initial.md +21 -21
  227. package/agent-assets/task-flows/setup.update.md +2 -2
  228. package/agent-assets/templates/README.md +27 -20
  229. package/agent-assets/templates/_index.md +42 -26
  230. package/agent-assets/templates/_manifest.json +34 -99
  231. package/agent-assets/templates/{user → identity}/_index.md +1 -1
  232. package/agent-assets/templates/{user → identity}/profile.md +2 -2
  233. package/agent-assets/templates/{dossiers → knowledge/dossiers}/_index.md +1 -1
  234. package/agent-assets/templates/{projects → plans/projects}/_active.base +1 -1
  235. package/agent-assets/templates/policies/_index.md +21 -0
  236. package/agent-assets/templates/{rules → policies}/journal-export.md +1 -1
  237. package/agent-assets/templates/{rules → policies}/journal-format.md +5 -5
  238. package/agent-assets/templates/{rules/policies → policies/management-captures}/_index.md +2 -2
  239. package/agent-assets/templates/{rules → policies}/management.md +3 -3
  240. package/agent-assets/templates/{rules → policies}/mcp.md +1 -1
  241. package/agent-assets/templates/{rules → policies}/redaction.md +1 -1
  242. package/agent-assets/templates/{routines → policies/routines}/_index.md +1 -1
  243. package/agent-assets/templates/{routines → policies/routines}/evening.md +2 -2
  244. package/agent-assets/templates/{routines → policies/routines}/hourly.md +1 -1
  245. package/agent-assets/templates/{routines → policies/routines}/monthly.md +2 -2
  246. package/bin/aitne.mjs +13 -4
  247. package/package.json +5 -4
  248. package/scripts/commands/doctor.mjs +14 -8
  249. package/scripts/commands/run-now.mjs +6 -21
  250. package/scripts/lib/ports.d.mts +27 -0
  251. package/scripts/lib/ports.mjs +36 -0
  252. package/scripts/lib/read-api-token.mjs +176 -0
  253. package/scripts/start.mjs +2 -1
  254. package/agent-assets/docs/features/lifestyle/travel-time.md +0 -58
  255. package/agent-assets/skills/gmail-lifestyle/references/travel-time-api.md +0 -59
  256. package/agent-assets/skills/schedule/references/recurring.md +0 -185
  257. package/agent-assets/templates/context-index.md +0 -42
  258. package/agent-assets/templates/rules/_index.md +0 -19
  259. /package/agent-assets/templates/{user → identity}/expertise.md +0 -0
  260. /package/agent-assets/templates/{user → identity}/goals.md +0 -0
  261. /package/agent-assets/templates/{user → identity}/people.md +0 -0
  262. /package/agent-assets/templates/{user → identity}/personal.md +0 -0
  263. /package/agent-assets/templates/{user → identity}/work.md +0 -0
  264. /package/agent-assets/templates/{agent/journal.md → journal/agent.md} +0 -0
  265. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/evening.md +0 -0
  266. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/hourly.md +0 -0
  267. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/monthly.md +0 -0
  268. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/morning.md +0 -0
  269. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/roadmap.md +0 -0
  270. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/weekly.md +0 -0
  271. /package/agent-assets/templates/{projects → plans/projects}/_index.md +0 -0
  272. /package/agent-assets/templates/{roadmap.md → plans/roadmap.md} +0 -0
  273. /package/agent-assets/templates/{routines → policies/routines}/morning.md +0 -0
  274. /package/agent-assets/templates/{routines → policies/routines}/weekly.md +0 -0
  275. /package/agent-assets/templates/{agent → state}/profile-questions.md +0 -0
  276. /package/agent-assets/templates/{today.md → state/today.md} +0 -0
@@ -16,12 +16,12 @@ morning briefing). This skill is how every callsite touches that queue.
16
16
 
17
17
  ## Source-of-truth file
18
18
 
19
- **`agent/profile-questions.md`** — agent-internal markdown. Three
19
+ **`state/profile-questions.md`** — agent-internal markdown. Three
20
20
  top-level sections: `## Pending`, `## In Progress`, `## Answered`.
21
21
  Never auto-injected into prompts; load only when this skill is in use.
22
22
 
23
23
  ```bash
24
- curl -s http://localhost:8321/api/context/agent/profile-questions
24
+ curl -s http://localhost:8321/api/context/state/profile-questions
25
25
  ```
26
26
 
27
27
  ### Pending row format
@@ -34,7 +34,7 @@ curl -s http://localhost:8321/api/context/agent/profile-questions
34
34
  |---|---|
35
35
  | `PRIO` | `HIGH` / `MID` / `LOW` — selection priority |
36
36
  | `<id>` | snake_case unique. Doubles as the correlation id in any scheduled DM description (`profile_interview:<id> — <hint>`) |
37
- | `target_path` | which user file the answer should land in, e.g. `user/profile.md` |
37
+ | `target_path` | which user file the answer should land in, e.g. `identity/profile.md` |
38
38
  | `## Section` | optional — narrows to a section within the target file |
39
39
  | `match=<anchor>` | optional — bullet key (English, like `Name`, `Timezone`, `Sleep`, `Working hours`). Required when multiple rows share a section, or when setup pre-seeds the section with an unrelated bullet |
40
40
  | `ask-hint` | English brief of WHAT to ask (agent-internal, Policy A). Render the actual DM per `<output_language_policy>` — this skill intentionally splits the two surfaces |
@@ -150,11 +150,11 @@ composing the reply.
150
150
  b. After the reply is ready (final assistant text already includes
151
151
  the question), issue **two PATCH replaces** (separate calls —
152
152
  they target different files):
153
- - `PATCH /api/context/agent/profile-questions` section=in_progress
153
+ - `PATCH /api/context/state/profile-questions` section=in_progress
154
154
  — flip the entry to
155
155
  `state=asked :: since=<unchanged> :: asked_at=<current_time>`
156
156
  (preserve the original `since=` date).
157
- - `PATCH /api/context/today` section=agent_notes — replace the
157
+ - `PATCH /api/context/state/today` section=agent_notes — replace the
158
158
  parenthetical from `(latent)` to `(asked HH:MM)` and append
159
159
  `(asked HH:MM)` to the same line; preserve every other Agent
160
160
  Notes line byte-for-byte.
@@ -231,7 +231,7 @@ The heuristic anchor lookup matches against bullet keys written by the
231
231
  - Sleep: 23:00–07:00
232
232
  ```
233
233
 
234
- Anchors in `agent/profile-questions.md` MUST match these English keys —
234
+ Anchors in `state/profile-questions.md` MUST match these English keys —
235
235
  not the user's primary-language phrasing. If a future `user-profile`
236
236
  schema change introduces non-English keys, Layers 1–3 silently miss
237
237
  those bullets and the system degrades to Layer-4-only protection
@@ -255,20 +255,23 @@ those bullets and the system degrades to Layer-4-only protection
255
255
 
256
256
  ```bash
257
257
  # Read the queue
258
- curl -s http://localhost:8321/api/context/agent/profile-questions
258
+ curl -s http://localhost:8321/api/context/state/profile-questions
259
259
 
260
260
  # Slot-filled probe
261
261
  curl -s "http://localhost:8321/api/profile-questions/slot-filled?path=user/profile.md&section=Identity&anchor=Name"
262
262
 
263
263
  # Section-level edit (queue file uses the standard context API)
264
- curl -s -X PATCH http://localhost:8321/api/context/agent/profile-questions \
264
+ curl -s -X PATCH http://localhost:8321/api/context/state/profile-questions \
265
265
  -H 'Content-Type: application/json' \
266
266
  -d '{"section": "in_progress", "mode": "replace", "content": "- name :: state=latent"}'
267
267
 
268
268
  # Fallback DM scheduling (Operation 5B only)
269
+ # `prompt` is REQUIRED (the wake-up session has NO memory — it is the only
270
+ # instruction). `description` stays as the short label whose
271
+ # `profile_interview:<id>` prefix triggers the Operation 6 sub-flow.
269
272
  curl -s -X POST http://localhost:8321/api/schedule \
270
273
  -H 'Content-Type: application/json' \
271
- -d '{"time":"<ISO>","taskType":"dm_session","description":"profile_interview:<id> — <hint>","tier":"medium","taskContext":{"scheduledBy":"user_profile_sweep_fallback","queueId":"<id>","importance":"low"}}'
274
+ -d '{"time":"<ISO>","taskType":"dm_session","prompt":"profile_interview:<id> — run the scheduled.dm ## Profile interview sub-flow (Operation 6): fire-time slot-filled abort check, then compose one short natural DM around <hint>.","description":"profile_interview:<id> — <hint>","tier":"medium","taskContext":{"scheduledBy":"user_profile_sweep_fallback","queueId":"<id>","importance":"low"}}'
272
275
  ```
273
276
 
274
277
  The PATCH `section` argument is snake_case of the heading: `pending`,
@@ -28,11 +28,11 @@ slip in a question without surfacing a cold standalone DM.
28
28
  closing side note. Same naturalness rules as Operation 2 — no
29
29
  preamble, no separate paragraph.
30
30
  4. After composing, issue two PATCH replaces (separate calls):
31
- - `PATCH /api/context/agent/profile-questions` section=in_progress —
31
+ - `PATCH /api/context/state/profile-questions` section=in_progress —
32
32
  flip the entry to
33
33
  `state=asked :: since=<unchanged> :: asked_at=<current_time>`
34
34
  (preserve the original `since=` date).
35
- - `PATCH /api/context/today` section=agent_notes — flip the
35
+ - `PATCH /api/context/state/today` section=agent_notes — flip the
36
36
  matching `Profile question (latent):` line by changing the
37
37
  parenthetical to `(asked HH:MM)`.
38
38
  ```
@@ -30,10 +30,18 @@ B. LATENT FALLBACK PROMOTION.
30
30
  state=scheduled. Register POST /api/schedule with:
31
31
  {time: tomorrow @ 14:00 local (or quiet_hours_end + 2h),
32
32
  taskType: "dm_session",
33
+ prompt: "profile_interview:<id> — run Operation 6 (the
34
+ scheduled.dm ## Profile interview sub-flow): fire-time
35
+ slot-filled abort check, then compose one short natural
36
+ DM around <ask-hint>.",
33
37
  description: "profile_interview:<id> — <ask-hint>",
34
38
  tier: "medium",
35
39
  taskContext: {scheduledBy: "user_profile_sweep_fallback",
36
40
  queueId: "<id>", importance: "low"}}
41
+ NOTE: `prompt` is REQUIRED by POST /api/schedule (the wake-up
42
+ session has NO memory — the prompt is its only instruction).
43
+ `description` is the short list label whose `profile_interview:<id>`
44
+ prefix triggers Operation 6; keep both fields.
37
45
  Update the In Progress entry to
38
46
  `state=scheduled :: since=<unchanged> :: scheduled_at=<tomorrow 14:00>`.
39
47
  Remove the matching `Profile question (latent): <id>` line from
@@ -8,21 +8,21 @@ allowed-tools:
8
8
 
9
9
  # User Profile Update Guide
10
10
 
11
- Output language: `user/profile.md` and `user/*.md` are Policy B — see `<output_language_policy>`. Template H2 headers stay English skeleton; the facts under them are in `<settings primary_language>`. Preserve user-customized headers verbatim.
11
+ Output language: `identity/profile.md` and `user/*.md` are Policy B — see `<output_language_policy>`. Template H2 headers stay English skeleton; the facts under them are in `<settings primary_language>`. Preserve user-customized headers verbatim.
12
12
 
13
- `user/profile.md` stores the user's identity, preferences, and learned behavioral patterns. It is injected into every agent session via `<user>` tags — keep it concise (target: under ~600 tokens total).
13
+ `identity/profile.md` stores the user's identity, preferences, and learned behavioral patterns. It is injected into every agent session via `<user>` tags — keep it concise (target: under ~600 tokens total).
14
14
 
15
- Detailed, dictionary-like background belongs under `user/*.md`. Read `user/_index.md` first, then fetch only the topic file you need.
15
+ Detailed, dictionary-like background belongs under `user/*.md`. Read `identity/_index.md` first, then fetch only the topic file you need.
16
16
 
17
17
  ## When to Update
18
18
 
19
19
  **Immediately (same turn) when the user shares:**
20
20
  - Identity or role — "I'm a …", "I work at …", "my title is …" → `profile.md ## Identity`
21
- - People they know — names + relationship, e.g. "my sister", "my manager Sarah" → `user/people.md`
22
- - Workplace specifics — company, team, tech stack, tools — "I use Postgres at work" → `user/work.md`
23
- - Expertise or tools they use habitually — "I've been writing Go for ten years", "I'm new to React" → `user/expertise.md` (add a one-line summary in `profile.md ## Expertise` when the fact also shapes how the agent should explain things)
24
- - Hobbies, habits, health, lifestyle (factual) — "I run every morning", "I don't eat meat" → `user/personal.md`
25
- - Goals or learning targets — "I want to get better at Rust", "I want to read 20 books this year" → `user/goals.md`
21
+ - People they know — names + relationship, e.g. "my sister", "my manager Sarah" → `identity/people.md`
22
+ - Workplace specifics — company, team, tech stack, tools — "I use Postgres at work" → `identity/work.md`
23
+ - Expertise or tools they use habitually — "I've been writing Go for ten years", "I'm new to React" → `identity/expertise.md` (add a one-line summary in `profile.md ## Expertise` when the fact also shapes how the agent should explain things)
24
+ - Hobbies, habits, health, lifestyle (factual) — "I run every morning", "I don't eat meat" → `identity/personal.md`
25
+ - Goals or learning targets — "I want to get better at Rust", "I want to read 20 books this year" → `identity/goals.md`
26
26
  - A notification or day-type preference — "no work notifications on weekends" → `profile.md ## Notification Preferences`
27
27
  - A self-reported behavioral pattern the agent should adapt to — "I'm not a morning person", "I tend to skim long messages" → `profile.md ## Learned Context` with today's `[YYYY-MM-DD]` prefix
28
28
 
@@ -35,7 +35,7 @@ Detailed, dictionary-like background belongs under `user/*.md`. Read `user/_inde
35
35
  **Routing edge cases** (for shapes the trigger list above doesn't disambiguate):
36
36
  - "my name is Alex" — explicit identity statement goes to `profile.md ## Identity`, not a topic file.
37
37
  - "user has been unusually curt over the last week" — a pattern inferred across multiple turns with no single user statement. Written to `profile.md ## Learned Context` by Evening Review Step 3a only; the DM handler and sweep do not write inferred patterns.
38
- - "my sister just had a baby" → `user/people.md ## Family`. If the section doesn't exist yet (fresh topic file with only the H1), the PATCH returns `section_not_found` — retry with `mode: "append_to_file"` and include `"\n## Family\n- <bullet>"` in `content`. The next write to that section succeeds normally.
38
+ - "my sister just had a baby" → `identity/people.md ## Family`. If the section doesn't exist yet (fresh topic file with only the H1), the PATCH returns `section_not_found` — retry with `mode: "append_to_file"` and include `"\n## Family\n- <bullet>"` in `content`. The next write to that section succeeds normally.
39
39
 
40
40
  The decision rule (profile.md vs `user/<topic>.md` tie-breakers, `section_not_found` → `append_to_file` first-write fallback, and the read-before-write `curl` recipe) is documented in full in this skill — see §"Section ownership", §"File schema", and §"Worked example" below.
41
41
 
@@ -78,7 +78,7 @@ full-file PUT, update `updated` to today's date.
78
78
  - Working hours: Weekdays 09:00–18:00
79
79
  ```
80
80
 
81
- The `user-interview` skill's queue (`agent/profile-questions.md`)
81
+ The `user-interview` skill's queue (`state/profile-questions.md`)
82
82
  matches against these English keys. If you introduce a non-English
83
83
  label here, the queue's slot-filled probe silently misses the bullet
84
84
  and re-asks the same question on the next opportunity. See
@@ -106,7 +106,7 @@ If the user says "I don't want work notifications on weekends", paraphrase into
106
106
  preferences are NOT profile content.** Route them to the `character`
107
107
  runtime-config field via `PATCH /api/config/character` (narrow
108
108
  endpoint, 1000-char cap, read-before-write). Never write tone /
109
- style preferences into `user/profile.md` or any `user/*.md`.
109
+ style preferences into `identity/profile.md` or any `user/*.md`.
110
110
 
111
111
  Full recipe — triggers, merge rules, endpoint note, cap-handling, and
112
112
  where the value ends up — is in the character-preferences reference
@@ -122,7 +122,7 @@ See _safety.md "Common Patterns" for the general rule. Section name in PATCH is
122
122
 
123
123
  User: `"I want to read 20 books this year."` → GET user/profile.md (or topic file), merge new bullet into the right section. For a top-level goal summary bullet:
124
124
  ```bash
125
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
125
+ curl -s -X PATCH http://localhost:8321/api/context/identity/profile \
126
126
  -H 'Content-Type: application/json' \
127
127
  -d '{"section": "learned_context", "mode": "append", "content": "- [2026-04-23] Reading goal: 20 books/year"}'
128
128
  ```
@@ -130,7 +130,7 @@ For a full-section replace, GET first, merge with existing bullets, then PATCH w
130
130
 
131
131
  **WRONG** (erases existing bullets): `curl -s -X PATCH ... -d '{"section": "learned_context", "mode": "replace", "content": "- [2026-04-23] Reading goal: ..."}'` when the section already held other bullets.
132
132
 
133
- For writes to `user/<topic>.md` (people / work / expertise / personal / goals), the same decision rule applies — §"Routing edge cases" above documents the `section_not_found` → `append_to_file` first-write fallback (with a worked `curl` example against `user/people.md`). The read-before-write rule applies identically when merging into an existing `user/<topic>.md` section.
133
+ For writes to `user/<topic>.md` (people / work / expertise / personal / goals), the same decision rule applies — §"Routing edge cases" above documents the `section_not_found` → `append_to_file` first-write fallback (with a worked `curl` example against `identity/people.md`). The read-before-write rule applies identically when merging into an existing `user/<topic>.md` section.
134
134
 
135
135
  ## Learned Context entry format
136
136
 
@@ -155,9 +155,9 @@ Review can prune entries older than 30 days:
155
155
 
156
156
  ## Initial Setup
157
157
 
158
- Populate `user/profile.md` (Identity, Work Pattern, Platforms, Expertise summary, Notification Preferences — leave Learned Context/Raw Signals empty). Read skeleton first → prefer `mode: "append"` → `mode: "replace"` only for full merged body. Tone / style preferences do NOT go into profile.md — see §"Tone / character preferences".
158
+ Populate `identity/profile.md` (Identity, Work Pattern, Platforms, Expertise summary, Notification Preferences — leave Learned Context/Raw Signals empty). Read skeleton first → prefer `mode: "append"` → `mode: "replace"` only for full merged body. Tone / style preferences do NOT go into profile.md — see §"Tone / character preferences".
159
159
 
160
- *During setup, seed `user/profile.md` only. The topic files (`user/people.md`, `work.md`, `expertise.md`, `personal.md`, `goals.md`) stay empty and grow from lived conversation via the DM handler and `routine.user_profile_sweep`.*
160
+ *During setup, seed `identity/profile.md` only. The topic files (`identity/people.md`, `work.md`, `expertise.md`, `personal.md`, `goals.md`) stay empty and grow from lived conversation via the DM handler and `routine.user_profile_sweep`.*
161
161
 
162
162
  ---
163
163
 
@@ -165,7 +165,7 @@ Populate `user/profile.md` (Identity, Work Pattern, Platforms, Expertise summary
165
165
 
166
166
  The generic GET / PATCH surface (modes, fields, error envelopes) is
167
167
  documented in the **context** skill `references/api.md`. user-profile
168
- writes target the two paths `/api/context/user/profile` (the injected
168
+ writes target the two paths `/api/context/identity/profile` (the injected
169
169
  summary file) and `/api/context/user/:topic` (one of `people` /
170
170
  `work` / `expertise` / `personal` / `goals`).
171
171
 
@@ -176,7 +176,7 @@ Two user-profile-specific notes layered on top of the generic surface:
176
176
  concurrent appends. Pass a SQLite-format `cutoff`:
177
177
 
178
178
  ```bash
179
- curl -s -X PATCH http://localhost:8321/api/context/user/profile \
179
+ curl -s -X PATCH http://localhost:8321/api/context/identity/profile \
180
180
  -H 'Content-Type: application/json' \
181
181
  -d '{"section": "raw_signals", "mode": "clear_before", "cutoff": "2026-04-10 02:33:00"}'
182
182
  ```
@@ -7,7 +7,7 @@
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"topic-files\" -->",
8
8
  "human_label": "Topic file layout",
9
9
  "description": "Which user/* file owns which kind of fact",
10
- "scope_paths": ["user/profile.md", "user/*.md"]
10
+ "scope_paths": ["identity/profile.md", "user/*.md"]
11
11
  },
12
12
  {
13
13
  "id": "routing-table",
@@ -23,7 +23,7 @@
23
23
  "anchor": "<!-- CURATION:convention_notes id=\"learned-context-format\" -->",
24
24
  "human_label": "Learned Context bullet conventions",
25
25
  "description": "Date-prefix rule, prune cadence, refresh-on-merge",
26
- "scope_paths": ["user/profile.md"]
26
+ "scope_paths": ["identity/profile.md"]
27
27
  }
28
28
  ]
29
29
  }
@@ -10,7 +10,7 @@ description: Tone / style / voice / language preferences are agent directives
10
10
  are NOT profile content** — they are agent directives, not user facts.
11
11
  Route them to the `character` runtime-config field via `PATCH
12
12
  /api/config/character` (see `docs/design/15-character.md`), never to
13
- `user/profile.md` or any `user/*.md`.
13
+ `identity/profile.md` or any `user/*.md`.
14
14
 
15
15
  ## Triggers
16
16
 
@@ -78,6 +78,6 @@ uniformly — no separate injection per backend.
78
78
  ## What does NOT belong here
79
79
 
80
80
  Facts about the user — identity, role, expertise, hobbies, people,
81
- goals — go to `user/profile.md` or `user/<topic>.md`, not to
81
+ goals — go to `identity/profile.md` or `user/<topic>.md`, not to
82
82
  `character`. The split is: `character` says *how* the agent speaks;
83
83
  `user/*` says *who the user is*.
@@ -3,49 +3,49 @@
3
3
  "rules": [
4
4
  {
5
5
  "trigger_pattern": "user states identity or role (I'm a, I work at, my title is)",
6
- "destination_path": "user/profile.md",
6
+ "destination_path": "identity/profile.md",
7
7
  "destination_section": "## Identity",
8
8
  "destination_mode": "replace"
9
9
  },
10
10
  {
11
11
  "trigger_pattern": "user mentions a person they know with a name plus relationship",
12
- "destination_path": "user/people.md",
12
+ "destination_path": "identity/people.md",
13
13
  "destination_section": "## Family",
14
14
  "destination_mode": "append_to_file"
15
15
  },
16
16
  {
17
17
  "trigger_pattern": "user mentions a workplace specific (company, team, tech stack)",
18
- "destination_path": "user/work.md",
18
+ "destination_path": "identity/work.md",
19
19
  "destination_section": "## Stack",
20
20
  "destination_mode": "append_to_file"
21
21
  },
22
22
  {
23
23
  "trigger_pattern": "user describes hobbies, habits, health, or lifestyle facts",
24
- "destination_path": "user/personal.md",
24
+ "destination_path": "identity/personal.md",
25
25
  "destination_section": "## Habits",
26
26
  "destination_mode": "append_to_file"
27
27
  },
28
28
  {
29
29
  "trigger_pattern": "user states a goal or learning target",
30
- "destination_path": "user/goals.md",
30
+ "destination_path": "identity/goals.md",
31
31
  "destination_section": "## Learning",
32
32
  "destination_mode": "append_to_file"
33
33
  },
34
34
  {
35
35
  "trigger_pattern": "user states expertise level or tools they use habitually",
36
- "destination_path": "user/expertise.md",
36
+ "destination_path": "identity/expertise.md",
37
37
  "destination_section": "## Tools",
38
38
  "destination_mode": "append_to_file"
39
39
  },
40
40
  {
41
41
  "trigger_pattern": "user states a notification or day-type preference",
42
- "destination_path": "user/profile.md",
42
+ "destination_path": "identity/profile.md",
43
43
  "destination_section": "## Notification Preferences",
44
44
  "destination_mode": "replace"
45
45
  },
46
46
  {
47
47
  "trigger_pattern": "user reports a behavioral pattern the agent should adapt to",
48
- "destination_path": "user/profile.md",
48
+ "destination_path": "identity/profile.md",
49
49
  "destination_section": "## Learned Context",
50
50
  "destination_mode": "append"
51
51
  }
@@ -2,7 +2,7 @@
2
2
  "kind": "knowledge_layout",
3
3
  "files": [
4
4
  {
5
- "path": "user/profile.md",
5
+ "path": "identity/profile.md",
6
6
  "purpose": "identity, preferences, learned context",
7
7
  "sections": [
8
8
  { "heading": "## Identity", "contains": "name, role, time zone" },
@@ -15,7 +15,7 @@
15
15
  ]
16
16
  },
17
17
  {
18
- "path": "user/people.md",
18
+ "path": "identity/people.md",
19
19
  "purpose": "people the user knows",
20
20
  "sections": [
21
21
  { "heading": "## Family", "contains": "household members" },
@@ -24,28 +24,28 @@
24
24
  ]
25
25
  },
26
26
  {
27
- "path": "user/work.md",
27
+ "path": "identity/work.md",
28
28
  "purpose": "workplace, team, tech stack",
29
29
  "sections": [
30
30
  { "heading": "## Stack", "contains": "tools, languages, services used at work" }
31
31
  ]
32
32
  },
33
33
  {
34
- "path": "user/expertise.md",
34
+ "path": "identity/expertise.md",
35
35
  "purpose": "domains, tools, skill levels",
36
36
  "sections": [
37
37
  { "heading": "## Tools", "contains": "tools the user uses habitually" }
38
38
  ]
39
39
  },
40
40
  {
41
- "path": "user/personal.md",
41
+ "path": "identity/personal.md",
42
42
  "purpose": "hobbies, health, habits",
43
43
  "sections": [
44
44
  { "heading": "## Habits", "contains": "routines, lifestyle, health" }
45
45
  ]
46
46
  },
47
47
  {
48
- "path": "user/goals.md",
48
+ "path": "identity/goals.md",
49
49
  "purpose": "developmental goals and learning targets",
50
50
  "sections": [
51
51
  { "heading": "## Learning", "contains": "skills the user wants to build" }
@@ -29,7 +29,7 @@ Therefore:
29
29
  | `GET` | `/api/wiki/{{workspace_name}}/search?q=<query>` | Body-substring search for duplicate detection. |
30
30
  | `GET` | `/api/wiki/{{workspace_name}}/files/<path>` | Read raw notes, existing wiki notes, taxonomy, log. |
31
31
  | `POST` | `/api/wiki/{{workspace_name}}/files/20_wiki/<slug>.md` | Create a new wiki note. |
32
- | `PATCH` | `/api/wiki/{{workspace_name}}/files/20_wiki/<slug>.md` | Rewrite an existing wiki note (`mode: "replace"`). |
32
+ | `POST` | `/api/wiki/{{workspace_name}}/files/20_wiki/<slug>.md` | Rewrite an existing wiki note — re-POST to the same path overwrites in place (a `.snapshots/` backup is taken first). |
33
33
  | `PATCH` | `/api/wiki/{{workspace_name}}/files/20_wiki/_index.md` | Append a new wiki note's entry (`mode: "append"`). |
34
34
  | `PATCH` | `/api/wiki/{{workspace_name}}/files/log.md` | Append the per-run summary (`mode: "append"`). |
35
35
 
@@ -52,7 +52,7 @@ Every request must include `-H 'x-process-key: wiki.compile'`. The `wiki-vault-r
52
52
  - Use `90_meta/taxonomy.md` for canonical slugs.
53
53
  - Preserve source URLs and quoted passages verbatim. Mark conflicts and unknowns explicitly.
54
54
  - Each note's frontmatter MUST list every source raw under a `sources:` array and the synthesis date under `compiled_at:`.
55
- - Write via `POST` (new slug) or `PATCH mode: "replace"` (existing slug). Read-before-write any slug you `PATCH`-replace so you preserve material that the new raws didn't cover.
55
+ - Write via `POST` for both new and existing slugs re-POSTing to an existing `20_wiki/<slug>.md` overwrites it in place (the daemon snapshots the prior version to `.snapshots/` first). Read-before-write any slug you overwrite so you preserve material that the new raws didn't cover. (`PATCH` on `20_wiki/<slug>.md` only supports `mode: "append"` / `"prepend"` — there is no `replace` mode.)
56
56
  6. **Append `20_wiki/_index.md`** with one bullet per newly created or modified wiki note (`PATCH mode: "append"`). Skip notes that were unchanged.
57
57
  7. **Append `log.md`** with one operational line summarising the run: `[<ISO>] wiki.compile (<mode>): compiled <N> notes from <M> raws — added <A>, updated <B>, unchanged <C>`.
58
58
 
@@ -98,7 +98,7 @@ Inside `<<'JSON'` (single-quoted marker) the body is verbatim — only JSON's ow
98
98
  - `curl ... -d @/some/path` — `@<filepath>` is blocked by the security hook and the shim. The only acceptable `@…` value is the literal stdin marker `@-`.
99
99
  - `curl http://example.com/...` (non-loopback) — only `http://localhost:8321/api/*` is permitted.
100
100
  - POST to a non-existent path (`/api/send-message`, `/api/notify-user`, `/api/dm`, etc.) — not daemon routes; calls return 401/404 and DO NOT notify anyone. Your completion DM (final assistant text) is what the daemon forwards.
101
- - Re-POSTing to `/api/wiki/.../20_wiki/<slug>.md` to updatePOST is create-only; the second call returns 409. Use `PATCH mode: "replace"` to overwrite, or pick a different slug.
101
+ - Assuming POST to `/api/wiki/.../20_wiki/<slug>.md` is create-onlyit is NOT. Re-POSTing to an existing `20_wiki/<slug>.md` overwrites it in place (with a `.snapshots/` backup first); the `wiki` layer has no create-only guard. The `409 append_only` guard only fires for the `10_raw/` and `log.md` layers. There is no `PATCH mode: "replace"` PATCH only supports `append` / `prepend`.
102
102
 
103
103
  ## Common error codes
104
104
 
@@ -108,7 +108,7 @@ Inside `<<'JSON'` (single-quoted marker) the body is verbatim — only JSON's ow
108
108
  | 400 | `invalid_path` / `invalid_layer` | Slug shape or layer prefix rejected | Path must be exactly `20_wiki/<slug>.md`. Slug matches `^[a-z0-9][a-z0-9-]*$`. |
109
109
  | 403 | `missing_process_key` | Header missing | Add `-H 'x-process-key: wiki.compile'`. |
110
110
  | 403 | `wiki_write_denied` | Trying to write outside `20_wiki/` (or the `_index.md` / `log.md` exceptions) under `wiki.compile` | Fix the target path. Use `wiki-graduate` for inbox-to-wiki promotion (same process key, different source layer). |
111
- | 409 | `append_only` | POST to an existing slug | Use `PATCH mode: "replace"` or pick a different slug. |
111
+ | 409 | `append_only` | POST to an existing `10_raw/` file or `log.md` (those two layers are create-only). Does NOT apply to `20_wiki/<slug>.md` — re-POSTing there overwrites in place. | For `log.md` use `PATCH mode: "append"`. `10_raw/` files cannot be overwritten by design. |
112
112
  | 413 | — | Body exceeds 512 KB | Split the note or trim verbatim extracts. |
113
113
  | 5xx | — | Daemon error | Append a failure line to `log.md`, classify the run as partial, do not retry inside the same turn. |
114
114
 
@@ -12,12 +12,16 @@ rows. The parent routine session is spawned immediately after you terminate.
12
12
  inlined integration partial in your user prompt states the call shape;
13
13
  your bound tools resolve it. If no surface is bound for a row, record a
14
14
  `no-surface` error and move on.
15
- - **One window → one curl → one JSON body.** Each acquired window is sent
16
- as a single `POST /api/observations/batch` call (up to 200 items in
17
- `observations[]`). Do NOT loop over items in a shell `for`. Do NOT write
18
- a script under `/tmp/` and pipe / source / bash it. Do NOT chain
19
- multiple `curl` calls in one Bash invocation. The daemon's hooks block
20
- those shapes.
15
+ - **One window → one observations call.** Each acquired window is posted
16
+ as a single batch (up to 200 items in `observations[]`). On a Claude
17
+ session, post via the `mcp__aitne-observations__submit_observations`
18
+ MCP tool the integration partial names structured transport that
19
+ never goes through the bash preflight, so Unicode-bearing titles /
20
+ subjects can't trip it. On Codex/Gemini, post via one
21
+ `POST /api/observations/batch` curl. Either way: Do NOT loop over items
22
+ in a shell `for`. Do NOT write a script under `/tmp/` and pipe / source
23
+ / bash it. Do NOT chain multiple `curl` calls in one Bash invocation.
24
+ The daemon's hooks block those shapes.
21
25
  - **No interpretation.** Do not summarize, rank, filter, or annotate
22
26
  payloads. The async summarizer worker drains `/api/observations` after
23
27
  you return.
@@ -29,12 +33,18 @@ rows. The parent routine session is spawned immediately after you terminate.
29
33
 
30
34
  ## Tool conventions
31
35
 
32
- - **Bash**: only `curl` against `http://localhost:<apiPort>/*` to call the
33
- daemon's REST API. The localhost-only check, secret-flag scrubber, and
34
- pipe-chain block are enforced as PreToolUse hooks at runtime — the
35
- policy layer is authoritative, not this prompt. One curl per Bash
36
- call; heredoc bodies are fine. **Do not** read or write context MD
37
- files via `/api/context/*`, do not call `/api/notify`.
36
+ - **Bash**: `curl` against `http://localhost:<apiPort>/*` to call the
37
+ daemon's REST API the `<fetch>` reads, and (Codex/Gemini only) the
38
+ `/api/observations/batch` write. On a Claude session the curl
39
+ observations-write path is NOT in your allowlist post observations
40
+ through the `submit_observations` MCP tool instead; a Unicode-bearing
41
+ `-d @-` body would trip the SDK bash preflight and be denied (which
42
+ cascades to a wasted retry and `budget-cap`). The localhost-only check,
43
+ secret-flag scrubber, and pipe-chain block are enforced as PreToolUse
44
+ hooks at runtime — the policy layer is authoritative, not this prompt.
45
+ One curl per Bash call; heredoc bodies are fine for the Codex/Gemini
46
+ curl write. **Do not** read or write context MD files via
47
+ `/api/context/*`, do not call `/api/notify`.
38
48
  - **MCP tools (`mcp__<server>__<tool>`)**: when the integration partial
39
49
  routes through `native` or `delegated-same`, the tool surface is
40
50
  whatever your session has bound. Their schemas may be deferred behind
@@ -19,8 +19,10 @@ windows for the pre-pass.
19
19
 
20
20
  Submit every returned event — for a whole window in **one** call — via the
21
21
  `mcp__aitne-observations__submit_observations` MCP tool when it is in your
22
- allowed tools (preferred — bypasses the SDK bash preflight). Build the
23
- tool input as `{"observations":[…]}` with one entry per event.
22
+ allowed tools (preferred — the structured MCP transport carries
23
+ Unicode-bearing titles / attendee names that would deterministically trip
24
+ `curl … -d '{…}'` on the SDK's bash preflight). Build the tool input as
25
+ `{"observations":[…]}` with one entry per event.
24
26
 
25
27
  If the MCP tool is unavailable (non-Claude session backend), fall back to
26
28
  `POST http://localhost:8321/api/observations/batch` with the same envelope:
@@ -30,8 +30,10 @@ only ships drift / retrospective / imminent windows.
30
30
 
31
31
  Submit every returned event — for a whole window in **one** call — via the
32
32
  `mcp__aitne-observations__submit_observations` MCP tool when it is in your
33
- allowed tools (preferred — bypasses the SDK bash preflight). Build the
34
- tool input as `{"observations":[…]}` with one entry per event.
33
+ allowed tools (preferred — the structured MCP transport carries
34
+ Unicode-bearing titles / attendee names that would deterministically trip
35
+ `curl … -d '{…}'` on the SDK's bash preflight). Build the tool input as
36
+ `{"observations":[…]}` with one entry per event.
35
37
 
36
38
  If the MCP tool is unavailable (non-Claude session backend), fall back to
37
39
  `POST http://localhost:8321/api/observations/batch` with the same envelope:
@@ -17,8 +17,8 @@ Scan for declarative user facts or imperative tone/style directives. If matched,
17
17
 
18
18
  **Declarative facts about the user** → route through the user-profile skill. The skill owns the trigger shapes, the file split (`profile.md` vs `user/<topic>.md`), the read-before-write contract, the `section_not_found` → `append_to_file` first-write fallback, and the Learned-Context-vs-personal.md disambiguator. Key calls:
19
19
 
20
- - Top-level identity / platform / notification fact → `user/profile.md`.
20
+ - Top-level identity / platform / notification fact → `identity/profile.md`.
21
21
  - Detail-heavy fact (specific person, workplace, hobby, tool, goal) → matching `user/<topic>.md` (`people` / `work` / `expertise` / `personal` / `goals`).
22
- - Self-reported behavioral pattern the agent should adapt to ("I'm not a morning person") → `user/profile.md ## Learned Context` with today's `[YYYY-MM-DD]` prefix.
22
+ - Self-reported behavioral pattern the agent should adapt to ("I'm not a morning person") → `identity/profile.md ## Learned Context` with today's `[YYYY-MM-DD]` prefix.
23
23
 
24
24
  Never invent facts the user did not state. Never re-write a fact a paraphrase of which already exists in the target file.
@@ -21,7 +21,7 @@ current day so the DM handler can route them into roadmap.
21
21
  **Not signals:**
22
22
  - Speculative language (*"maybe"*, *"someday"*, *"might"*, *"perhaps"*,
23
23
  *"thinking about"*) without a concrete anchor
24
- - Current-week commitments (those belong in `today.md`)
24
+ - Current-week commitments (those belong in `state/today.md`)
25
25
  - Opinions, preferences, taste statements
26
26
  (those belong in `user/*.md` via the `user-profile` skill)
27
27
 
@@ -51,9 +51,9 @@ can copy the same pattern into their own skills.
51
51
  writing.
52
52
  - **Decline-marker pre-check (Goal 3 — never ask twice).** Before
53
53
  classifying a no-match as new, compute the candidate slug and
54
- read `agent/journal.md ## Declined Intents`:
54
+ read `journal/agent.md ## Declined Intents`:
55
55
  ```bash
56
- curl -s "http://localhost:8321/api/context/agent/journal" \
56
+ curl -s "http://localhost:8321/api/context/journal/agent" \
57
57
  | jq -r '.content // ""' \
58
58
  | awk '/^## Declined Intents/{f=1;next} f && /^## /{exit} f'
59
59
  ```
@@ -175,7 +175,7 @@ can copy the same pattern into their own skills.
175
175
  "confirm_defer_count": 0,
176
176
  "confirm_max_defers": 3,
177
177
  "confirm_decline_marker": {
178
- "path": "agent/journal.md",
178
+ "path": "journal/agent.md",
179
179
  "section": "declined_intents",
180
180
  "match": "create_project:<slug>"
181
181
  },
@@ -270,14 +270,14 @@ can copy the same pattern into their own skills.
270
270
  decline, do NOT write the project file. Two mandatory writes:
271
271
 
272
272
  a. **Write the decline marker** to
273
- `agent/journal.md ## Declined Intents`. Three cases — file
273
+ `journal/agent.md ## Declined Intents`. Three cases — file
274
274
  missing entirely, file present but section missing, file +
275
275
  section both present — are handled in one read-then-branch
276
276
  sequence:
277
277
 
278
278
  ```bash
279
279
  # 1. GET. HTTP 404 means the journal file does not yet exist.
280
- body=$(curl -sS -w '\n%{http_code}' "http://localhost:8321/api/context/agent/journal")
280
+ body=$(curl -sS -w '\n%{http_code}' "http://localhost:8321/api/context/journal/agent")
281
281
  status=$(printf '%s\n' "$body" | tail -n1)
282
282
  content=$(printf '%s\n' "$body" | sed '$d' | jq -r '.content // ""' 2>/dev/null)
283
283
 
@@ -287,19 +287,19 @@ can copy the same pattern into their own skills.
287
287
  # Case A — file missing. CREATE_ONLY_PUT is enabled for
288
288
  # agent/journal, so PUT creates the file in a single call.
289
289
  # Include both the H1 and the Declined Intents section.
290
- curl -s -X PUT "http://localhost:8321/api/context/agent/journal" \
290
+ curl -s -X PUT "http://localhost:8321/api/context/journal/agent" \
291
291
  -H 'Content-Type: application/json' \
292
292
  -d "$(jq -n --arg m "$marker_line" '{content: "# Agent Journal\n\n## Declined Intents\n\($m)\n"}')"
293
293
  elif printf '%s' "$content" | grep -q '^## Declined Intents'; then
294
294
  # Case B — file + section present. Append a bullet to the
295
295
  # existing section.
296
- curl -s -X PATCH "http://localhost:8321/api/context/agent/journal" \
296
+ curl -s -X PATCH "http://localhost:8321/api/context/journal/agent" \
297
297
  -H 'Content-Type: application/json' \
298
298
  -d "$(jq -n --arg m "$marker_line" '{section:"declined_intents",mode:"append",content:$m}')"
299
299
  else
300
300
  # Case C — file present but section missing. append_to_file
301
301
  # adds the section header + bullet to the end of the file.
302
- curl -s -X PATCH "http://localhost:8321/api/context/agent/journal" \
302
+ curl -s -X PATCH "http://localhost:8321/api/context/journal/agent" \
303
303
  -H 'Content-Type: application/json' \
304
304
  -d "$(jq -n --arg m "$marker_line" '{mode:"append_to_file",content:"\n## Declined Intents\n\($m)\n"}')"
305
305
  fi
@@ -326,7 +326,7 @@ can copy the same pattern into their own skills.
326
326
  inline in a fresh DM (the carve-out in Step 1) or as a reply to a
327
327
  confirm DM — run this recipe instead of skipping:
328
328
 
329
- 1. GET `agent/journal.md`, parse the `## Declined Intents`
329
+ 1. GET `journal/agent.md`, parse the `## Declined Intents`
330
330
  section, drop the line whose bracketed dedup_key matches
331
331
  `create_project:<slug>`, and PATCH the section with
332
332
  `mode: "replace"` carrying the rebuilt body (the other lines
@@ -32,8 +32,9 @@ The four non-disabled branches therefore split into two real flows:
32
32
 
33
33
  Submit every returned message — for a whole window in **one** call — via the
34
34
  `mcp__aitne-observations__submit_observations` MCP tool when it is in your
35
- allowed tools (preferred — bypasses the SDK bash preflight which denies
36
- Unicode-whitespace-bearing bodies). Build the tool input as
35
+ allowed tools (preferred — the structured MCP transport carries
36
+ Unicode-bearing subjects / snippets that would deterministically trip
37
+ `curl … -d '{…}'` on the SDK's bash preflight). Build the tool input as
37
38
  `{"observations":[…]}` with one entry per message.
38
39
 
39
40
  If the MCP tool is unavailable (non-Claude session backend), fall back to