@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
@@ -11,17 +11,17 @@ allowed-tools:
11
11
  A **management policy** is a durable, ongoing rule the user wants the
12
12
  agent to keep applying. It is NOT a one-off task.
13
13
 
14
- Each policy lives at `rules/policies/<slug>.md` and may link to:
14
+ Each policy lives at `policies/management-captures/<slug>.md` and may link to:
15
15
 
16
- - `routines/custom/<slug>.md` — the cron-driven execution rulebook
17
- - `dossiers/<topic>.md` — where the policy's accumulating data lands
16
+ - `policies/routines/custom/<slug>.md` — the cron-driven execution rulebook
17
+ - `knowledge/dossiers/<topic>.md` — where the policy's accumulating data lands
18
18
 
19
- A readable summary of every policy lives at `rules/policies/_index.md`,
19
+ A readable summary of every policy lives at `policies/management-captures/_index.md`,
20
20
  which the daemon's policy-index reconciler **auto-maintains** from the
21
- policy files on disk. The directory listing under `rules/policies/` is
21
+ policy files on disk. The directory listing under `policies/management-captures/` is
22
22
  the source of truth; `_index.md` is a derived snapshot — **do not
23
23
  PATCH or PUT it by hand**. The same reconciler also re-renders the
24
- `## Active Policies` section in `rules/management.md` so it stays in
24
+ `## Active Policies` section in `policies/management.md` so it stays in
25
25
  sync. Both files refresh within ~10 s of any policy file write.
26
26
 
27
27
  ## When to use this skill
@@ -42,7 +42,7 @@ Use when the user expresses a **durable, ongoing management rule**:
42
42
  | "Reply more tersely from now on" / tone, voice, style | `user-profile` (routes to `character`) |
43
43
  | "I'm an NYC-based dev" / single user fact | `user-profile` |
44
44
  | "Add a project for the Q3 roadmap" | `context` (`projects/*.md`) |
45
- | Pure data write — "log this transaction" | direct context write to the relevant `dossiers/<topic>.md` |
45
+ | Pure data write — "log this transaction" | direct context write to the relevant `knowledge/dossiers/<topic>.md` |
46
46
 
47
47
  If the user's request is **a recurring task with no need for a recorded
48
48
  reason** (e.g. "ping me every Monday at 9 to start standup prep"), use
@@ -60,12 +60,12 @@ the directory listing if you need authoritative state.
60
60
  ```bash
61
61
  # Auto-maintained by the daemon — fastest read for slug / status /
62
62
  # cadence / linked routine + dossier / one-line why.
63
- curl -s "http://localhost:8321/api/context/rules/policies/_index"
63
+ curl -s "http://localhost:8321/api/context/policies/management-captures/_index"
64
64
 
65
65
  # Directory listing — authoritative source of truth. Use this if a
66
66
  # specific policy file looks newer than the index (the reconciler
67
67
  # debounces ~10 s; fresh writes may not be reflected yet).
68
- curl -s "http://localhost:8321/api/context/list/rules"
68
+ curl -s "http://localhost:8321/api/context/list/policies"
69
69
  ```
70
70
 
71
71
  If the listing and `_index.md` rows disagree, **prefer the listing**
@@ -103,14 +103,14 @@ wait again.
103
103
 
104
104
  ### Step 4 — Build the policy file
105
105
 
106
- Emit the full `rules/policies/<slug>.md` content as a fenced markdown
106
+ Emit the full `policies/management-captures/<slug>.md` content as a fenced markdown
107
107
  block in the DM **before** writing, so the user sees what's about to be
108
108
  saved. The slug must:
109
109
 
110
110
  - equal the filename stem
111
111
  - match `^[a-z0-9][a-z0-9-]*[a-z0-9]$` (or a single `[a-z0-9]`)
112
112
  - be ≤ 64 chars
113
- - equal the linked `routines/custom/<slug>.md` slug (if any) — keep
113
+ - equal the linked `policies/routines/custom/<slug>.md` slug (if any) — keep
114
114
  them aligned in v1
115
115
 
116
116
  ### Step 5 — Wire the dependencies (strict order; on failure, roll back in reverse)
@@ -152,7 +152,7 @@ the active policies first and ask.
152
152
  `updated: <today>`, PUT back. (The frontmatter parser is
153
153
  line-scalar so a per-field PATCH section call would not target a
154
154
  frontmatter key — always GET-merge-PUT for frontmatter edits.)
155
- 2. If `linked.routine` is set: GET `routines/custom/<slug>`, flip
155
+ 2. If `linked.routine` is set: GET `policies/routines/custom/<slug>`, flip
156
156
  frontmatter `enabled: false`, PUT back. The reload hook flips the
157
157
  cron job off automatically.
158
158
 
@@ -173,7 +173,7 @@ Same fan-out, with `status: active` and `enabled: true`.
173
173
  1. GET the policy file, flip frontmatter `status: removed` and
174
174
  `updated: <today>`, PUT back.
175
175
  2. If `linked.routine` is set: `DELETE
176
- /api/context/routines/custom/<slug>` (whitelisted).
176
+ /api/context/policies/routines/custom/<slug>` (whitelisted).
177
177
 
178
178
  The reconciler moves the row from `## Active` to `## Removed`
179
179
  automatically — the `removedAt` cell is read from the policy file's
@@ -185,10 +185,10 @@ is intentionally not whitelisted (see MANAGEMENT-POLICY-CAPTURE-PLAN
185
185
 
186
186
  ## What this skill does NOT do
187
187
 
188
- - Does NOT touch `rules/management.md` body sections (Source of Truth
188
+ - Does NOT touch `policies/management.md` body sections (Source of Truth
189
189
  table, Notification Rules, Schedule, etc.). Those are wizard-only.
190
190
  - Does NOT create rows in the `recurring_schedules` DB table — defer to
191
- `routines/custom/` for cron, which gives the user a visible MD file
191
+ `policies/routines/custom/` for cron, which gives the user a visible MD file
192
192
  to edit.
193
193
  - Does NOT migrate existing custom routines into policy files
194
194
  retroactively. Migration is a separate one-time operation.
@@ -197,11 +197,12 @@ is intentionally not whitelisted (see MANAGEMENT-POLICY-CAPTURE-PLAN
197
197
 
198
198
  - **Need a one-off wake-up?** Use `schedule` (`/api/schedule` or
199
199
  `/api/schedule/dm`) — no policy file needed.
200
- - **Need a recurring DB-driven task with no recorded `## Why`?** Use
201
- `schedule`'s `/api/recurring-schedules` supports hourly / daily /
202
- weekly / monthly cadences. Default to `tier:"medium"`; pin a
203
- specific model id (`claude-opus-4-7`, `gpt-5.4`, …) only when the
204
- rule needs to outlive a `/settings/models` re-route.
200
+ - **Need a recurring task with no recorded `## Why`?** Recurring autonomous
201
+ **work** create an Agent via the `agent-create` skill (`POST /api/agents`);
202
+ recurring scheduled **DM / briefing** `schedule`'s
203
+ `/api/recurring-schedules` with `taskType: "dm_session"`. Default to
204
+ `tier:"medium"`; pin a specific model id only when the rule needs to
205
+ outlive a `/settings/models` re-route.
205
206
  - **Tone / voice / language preference?** Belongs in `user-profile`
206
207
  (which routes to `PATCH /api/config/character`), NOT a policy file.
207
208
  Full recipe in `user-profile/references/character-preferences.md`.
@@ -212,17 +213,17 @@ All writes go through `/api/context/*` — see the **context** skill's
212
213
  `references/api.md` for verb / mode / error envelope details. This
213
214
  skill targets these paths:
214
215
 
215
- - `GET /api/context/rules/policies/_index` (Step 1 summary)
216
- - `GET /api/context/list/rules` (Step 1 authoritative — entries prefixed `policies/`)
217
- - `GET /api/context/rules/policies/<slug>` (read before pause / resume / remove)
218
- - `PUT /api/context/dossiers/<topic>` (Step 5.1 — if new)
219
- - `PUT /api/context/routines/custom/<slug>` (Step 5.2 — if scheduling)
220
- - `PUT /api/context/rules/policies/<slug>` (Step 5.3)
221
- - `PATCH /api/context/rules/policies/<slug>` (pause / resume / remove; frontmatter via GET-merge-PUT only — line-scalar parser)
222
- - `DELETE /api/context/routines/custom/<slug>` (remove only)
223
-
224
- `rules/policies/_index.md` and the `## Active Policies` section in
225
- `rules/management.md` are written by the daemon's policy-index
216
+ - `GET /api/context/policies/management-captures/_index` (Step 1 summary)
217
+ - `GET /api/context/list/policies` (Step 1 authoritative — entries prefixed `management-captures/`)
218
+ - `GET /api/context/policies/management-captures/<slug>` (read before pause / resume / remove)
219
+ - `PUT /api/context/knowledge/dossiers/<topic>` (Step 5.1 — if new)
220
+ - `PUT /api/context/policies/routines/custom/<slug>` (Step 5.2 — if scheduling)
221
+ - `PUT /api/context/policies/management-captures/<slug>` (Step 5.3)
222
+ - `PATCH /api/context/policies/management-captures/<slug>` (pause / resume / remove; frontmatter via GET-merge-PUT only — line-scalar parser)
223
+ - `DELETE /api/context/policies/routines/custom/<slug>` (remove only)
224
+
225
+ `policies/management-captures/_index.md` and the `## Active Policies` section in
226
+ `policies/management.md` are written by the daemon's policy-index
226
227
  reconciler — they are NOT in the agent's write surface for this skill.
227
228
 
228
229
  Frontmatter validation enforces `kind: policy`, `owner: agent`, and
@@ -7,7 +7,7 @@
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"policy-file-shape\" -->",
8
8
  "human_label": "Policy file section shape",
9
9
  "description": "Required sections inside rules/policies/<slug>.md and what each holds",
10
- "scope_paths": ["rules/policies/*.md"]
10
+ "scope_paths": ["policies/management-captures/*.md"]
11
11
  }
12
12
  ]
13
13
  }
@@ -13,7 +13,7 @@ steps `N-1 … 1` in reverse before reporting the failure to the user.
13
13
 
14
14
  ```bash
15
15
  # Optional — only if the policy accumulates data into a new topic.
16
- curl -sS -X PUT http://localhost:8321/api/context/dossiers/<topic> \
16
+ curl -sS -X PUT http://localhost:8321/api/context/knowledge/dossiers/<topic> \
17
17
  -H 'Content-Type: application/json' \
18
18
  -d @- <<'JSON'
19
19
  {"content":"---\ntype: dossier\nowner: agent\nupdated: 2026-04-24\n---\n# <Topic>\n\n## Daily Log\n"}
@@ -27,7 +27,7 @@ when the rest of the flow rolls back.
27
27
  ## 5.2 Create the custom routine (only if scheduling is needed)
28
28
 
29
29
  ```bash
30
- curl -sS -X PUT http://localhost:8321/api/context/routines/custom/<slug> \
30
+ curl -sS -X PUT http://localhost:8321/api/context/policies/routines/custom/<slug> \
31
31
  -H 'Content-Type: application/json' \
32
32
  -d @- <<'JSON'
33
33
  {"content":"---\ntype: rule\nslug: <slug>\nprocess_key: routine.custom.<slug>\ncron: \"0 7 * * *\"\nbackend_tier: light\nmax_budget_usd: 0.20\nenabled: true\n---\n# <Title>\n\n## Checks\n\n### <step label>\n**Action**: …\n"}
@@ -52,7 +52,7 @@ line, write a short summary in `origin` and put the verbatim quote in
52
52
  a body section called `## Captured From`.
53
53
 
54
54
  ```bash
55
- curl -sS -X PUT http://localhost:8321/api/context/rules/policies/<slug> \
55
+ curl -sS -X PUT http://localhost:8321/api/context/policies/management-captures/<slug> \
56
56
  -H 'Content-Type: application/json' \
57
57
  -d @- <<'JSON'
58
58
  {"content":"---\ntype: rule\nkind: policy\nowner: agent\nupdated: 2026-04-24\nslug: <slug>\nstatus: active\ncreated_at: 2026-04-24\ncreated_via: dm\norigin: \"User DM 2026-04-24T14:30Z: <one-line summary or short quote>\"\nlinked:\n routine: <slug>\n dossier: <topic>\ntemplate_version: 1\n---\n# <Title>\n\n## Why\n<one short paragraph>\n\n## How\n1. …\n\n## Source of Truth\n- Authoritative: …\n- Local cache: dossiers/<topic>.md\n\n## Captured From\n> <verbatim DM quote, only when too long for the origin line>\n\n## Notes\n- …\n"}
@@ -62,7 +62,7 @@ JSON
62
62
  The global FS-watch reconciler picks this up within ~1 s and the
63
63
  policy appears in `context-index.md` automatically. The policy-index
64
64
  reconciler also fires on the same FS event (chained off the same
65
- debounce), so `rules/policies/_index.md` and `rules/management.md`'s
65
+ debounce), so `policies/management-captures/_index.md` and `policies/management.md`'s
66
66
  `## Active Policies` section refresh within ~10 s — no manual PATCH
67
67
  needed.
68
68
 
@@ -76,14 +76,14 @@ reconciler can resolve them.
76
76
 
77
77
  ## 5.4 _(no manual step required)_
78
78
 
79
- `rules/policies/_index.md` is auto-maintained by the daemon's
79
+ `policies/management-captures/_index.md` is auto-maintained by the daemon's
80
80
  policy-index reconciler — it re-renders within ~10 s of step 5.3's
81
81
  write. Same for the `## Active Policies` section in
82
- `rules/management.md`. **Do not PATCH or PUT either path manually**;
82
+ `policies/management.md`. **Do not PATCH or PUT either path manually**;
83
83
  doing so just races the reconciler and creates snapshot churn.
84
84
 
85
85
  If you need to confirm the index is up to date before replying to the
86
- user, GET `rules/policies/_index` after a short wait. The
86
+ user, GET `policies/management-captures/_index` after a short wait. The
87
87
  reconciler's last-run record lives at `runtime_state` key
88
88
  `reconciler.policy_index.last_run` for diagnostics.
89
89
 
@@ -91,8 +91,8 @@ reconciler's last-run record lives at `runtime_state` key
91
91
 
92
92
  | Failure at | Roll back |
93
93
  |---|---|
94
- | 5.2 | undo 5.1 (`DELETE` the dossier file you just created only if you created it; do not delete a pre-existing dossier) |
95
- | 5.3 | undo 5.2 (PUT routines file back to `enabled: false` and the next reconcile clears the cron job; or `DELETE` if you created it new), then undo 5.1 as above |
94
+ | 5.2 | undo 5.1 the dossier path does **not** accept `DELETE` (`knowledge/dossiers/*` is PUT/PATCH only; a `DELETE` returns `403 context.write_forbidden`). If you created it new, PUT it to empty content / `status: removed`; an empty dossier is harmless (per 5.1). Leave a pre-existing dossier untouched. |
95
+ | 5.3 | undo 5.2 (PUT routines file back to `enabled: false` and the next reconcile clears the cron job; or `DELETE` if you created it new — `policies/routines/custom/*` is DELETE-whitelisted), then undo 5.1 as above |
96
96
  | 5.4 | none required — there is no manual 5.4. If the reconciler does not pick the change up within ~30 s, surface the diagnostics record (`runtime_state` key above) to the user rather than rolling back. |
97
97
 
98
98
  If any rollback step itself fails, **report the partial state to the
@@ -2,7 +2,7 @@
2
2
  "kind": "knowledge_layout",
3
3
  "files": [
4
4
  {
5
- "path": "rules/policies/*.md",
5
+ "path": "policies/management-captures/*.md",
6
6
  "purpose": "Durable management policy capturing why a recurring rule exists, how it runs, and where data lands",
7
7
  "sections": [
8
8
  { "heading": "## Why", "contains": "one short paragraph stating the motivation behind the policy" },
@@ -48,7 +48,7 @@ these in any language also fail the positive rule.
48
48
 
49
49
  ### No internal mechanism names
50
50
 
51
- Never mention `today.md`, `user/profile.md`, `roadmap.md`, `## Agent
51
+ Never mention `state/today.md`, `identity/profile.md`, `plans/roadmap.md`, `## Agent
52
52
  Plan`, `## Agent Log`, `## Handoff`, `did-not-fire`, "Morning
53
53
  Routine", "Evening Review", "scheduled.task", "scheduled.dm",
54
54
  "dm_session", "sub_flow", or any other internal mechanism in
@@ -71,7 +71,7 @@ rule above bars *introducing* such enumeration in any other surface.)
71
71
  ### Language and style
72
72
 
73
73
  Output language: follow `<output_language_policy>`. Tone: follow
74
- `user/profile.md` Communication Style and the Character block in your
74
+ `identity/profile.md` Communication Style and the Character block in your
75
75
  system prompt. Keep technical terms in original form.
76
76
 
77
77
  ### Compactness
@@ -91,13 +91,13 @@ Notify when **all three** are true: (1) **actionable** or requires awareness, (2
91
91
  `[cal] ... — reminder sent` referencing the same item within the
92
92
  last 4 hours. If the injected log is truncated (`[...N earlier
93
93
  entries omitted ...]` marker) and you can't rule out a prior
94
- notification, `GET /api/context/today` for the full log before
94
+ notification, `GET /api/context/state/today` for the full log before
95
95
  firing. Duplicate notifications are the #1 cause of noise.
96
96
  - **A pending Agent Plan row / scheduled DM is already set to fire
97
97
  for this item within the next 2 hours** — let the planned channel
98
98
  deliver; don't pre-empt it.
99
99
  - **Quiet hours (default 22:00-08:00, configurable)** unless `critical` — schedule for after instead
100
- - **Rate-limited (429)** — do NOT retry; log skip to Agent Log. If time-critical, upgrade priority at next opportunity
100
+ - **Over the rate-limit caps (3/hour, 12/day; `critical` bypasses both)** — do NOT spam-retry. The endpoint does NOT signal this: `/api/notify` returns `200 {status:"sent"}` even when quiet-hours or the rate-limit silently drops the message, so a `"sent"` response is not proof of delivery. Self-throttle by checking `<today>` `## Agent Log` before firing; if you suspect suppression, log the skip rather than re-posting. If time-critical, upgrade priority at next opportunity
101
101
  - **Routine file changes** or **agent internal state** — use Agent Log instead
102
102
  - **When in doubt — prefer silence**
103
103
 
@@ -54,7 +54,12 @@ The agent CANNOT query `notification_log` directly (Approve-tier). Use
54
54
  `<today>` `## Agent Log` as the authoritative dedup source (look for
55
55
  `notify sent` / `DM sent` lines).
56
56
 
57
- A 429 response is final for this attempt — do NOT retry. Log `notify
58
- skipped (rate_limited)` to Agent Log. If the message is time-critical
59
- and the next opportunity arises, upgrade to `high` (or `critical` if
60
- the situation has escalated) rather than re-sending at the same level.
57
+ `/api/notify` does NOT report rate-limit or quiet-hours suppression
58
+ back to you — it returns `200 {status:"sent"}` even when the message is
59
+ silently dropped inside the delivery layer. A `"sent"` response is
60
+ therefore not proof the user saw it. Do NOT re-post the same item
61
+ hoping for delivery; self-throttle by scanning `<today>` `## Agent Log`
62
+ first and log `notify skipped (rate_limited)` when you choose to hold.
63
+ If the message is time-critical and the next opportunity arises,
64
+ upgrade to `high` (or `critical` if the situation has escalated)
65
+ rather than re-sending at the same level.
@@ -53,7 +53,7 @@ The daemon:
53
53
  tool against the per-task allowed-tools envelope, validates the
54
54
  final JSON against your `outputSchema`, returns it.
55
55
 
56
- `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=7`,
56
+ `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=8`,
57
57
  `maxBudgetUsd=0.05`, `timeoutMs=60000`. Bump up to 15 / 0.50 / 300000
58
58
  for genuinely larger intents.
59
59
 
@@ -48,7 +48,7 @@ The daemon:
48
48
  tool against the per-task allowed-tools envelope, validates the
49
49
  final JSON against your `outputSchema`, returns it.
50
50
 
51
- `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=7`,
51
+ `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=8`,
52
52
  `maxBudgetUsd=0.05`, `timeoutMs=60000`. Bump up to 15 / 0.50 / 300000
53
53
  for genuinely larger intents.
54
54
 
@@ -48,7 +48,7 @@ The daemon:
48
48
  tool against the per-task allowed-tools envelope, validates the
49
49
  final JSON against your `outputSchema`, returns it.
50
50
 
51
- `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=7`,
51
+ `outputSchema` is **required** (4 KB cap). Defaults: `maxToolCalls=8`,
52
52
  `maxBudgetUsd=0.05`, `timeoutMs=60000`. Bump up to 15 / 0.50 / 300000
53
53
  for genuinely larger intents.
54
54
 
@@ -11,12 +11,16 @@ allowed-tools:
11
11
  > **Refusal directive — read first.** Notion is in `native` mode bound
12
12
  > to Claude. Do **NOT** call any of:
13
13
  >
14
- > - `POST /api/integrations/notion/exec` (returns `410` with
15
- > `X-Integration-Mode: native`)
16
- > - `POST /api/integrations/notion/reconcile` (410)
17
- > - `/api/notion/query`, `/api/notion/search`, `/api/notion/pages`,
18
- > `/api/notion/pages/<id>/content` (each route-prefix 410 in native
14
+ > - `POST /api/integrations/notion/exec` (returns `409 mode_mismatch`
15
+ > in native mode — this route is NOT route-gated and carries no
16
+ > `X-Integration-Mode` header; `/exec` only succeeds in `delegated`
19
17
  > mode)
18
+ > - `POST /api/integrations/notion/reconcile` (not route-gated either;
19
+ > an LLM-issued notion reconcile returns `400 validation_error` on the
20
+ > window-key allowlist, which is calendar-only)
21
+ > - `/api/notion/query`, `/api/notion/search`, `/api/notion/pages`,
22
+ > `/api/notion/pages/<id>/content` (each route-prefix returns `410`
23
+ > with `X-Integration-Mode: native` — these ARE route-gated)
20
24
  >
21
25
  > Reach Notion through the in-session Notion connector your harness
22
26
  > exposes. Your tool menu lists every available tool at session start
@@ -150,7 +154,7 @@ instead).
150
154
  When `routine.hourly_check.native.claude.md`'s Step 0c fetches recent
151
155
  Notion edits, POST each materialised page to `/api/observations`. The
152
156
  daemon computes `contentHash` server-side via
153
- `@personal-agent/shared/observations-hash.ts`; pass `payload` verbatim.
157
+ `@aitne/shared/observations-hash.ts`; pass `payload` verbatim.
154
158
 
155
159
  **Batch when you have more than one page.** Use
156
160
  `POST /api/observations/batch` with up to 200 items in one
@@ -11,11 +11,16 @@ allowed-tools:
11
11
  > **Refusal directive — read first.** Notion is in `native` mode bound
12
12
  > to Codex. Do **NOT** call any of:
13
13
  >
14
- > - `POST /api/integrations/notion/exec` (returns `410` with
15
- > `X-Integration-Mode: native`)
16
- > - `POST /api/integrations/notion/reconcile` (410)
14
+ > - `POST /api/integrations/notion/exec` (returns `409 mode_mismatch`
15
+ > in native mode — this route is NOT route-gated and carries no
16
+ > `X-Integration-Mode` header; `/exec` only succeeds in `delegated`
17
+ > mode)
18
+ > - `POST /api/integrations/notion/reconcile` (not route-gated either;
19
+ > an LLM-issued notion reconcile returns `400 validation_error` on the
20
+ > window-key allowlist, which is calendar-only)
17
21
  > - `/api/notion/query`, `/api/notion/search`, `/api/notion/pages`,
18
- > `/api/notion/pages/<id>/content` (each route-prefix 410)
22
+ > `/api/notion/pages/<id>/content` (each route-prefix returns `410`
23
+ > with `X-Integration-Mode: native` — these ARE route-gated)
19
24
  >
20
25
  > Reach Notion through the in-session Notion connector your harness
21
26
  > exposes. Your tool menu lists every available tool at session start
@@ -11,11 +11,16 @@ allowed-tools:
11
11
  > **Refusal directive — read first.** Notion is in `native` mode bound
12
12
  > to Gemini. Do **NOT** call any of:
13
13
  >
14
- > - `POST /api/integrations/notion/exec` (returns `410` with
15
- > `X-Integration-Mode: native`)
16
- > - `POST /api/integrations/notion/reconcile` (410)
14
+ > - `POST /api/integrations/notion/exec` (returns `409 mode_mismatch`
15
+ > in native mode — this route is NOT route-gated and carries no
16
+ > `X-Integration-Mode` header; `/exec` only succeeds in `delegated`
17
+ > mode)
18
+ > - `POST /api/integrations/notion/reconcile` (not route-gated either;
19
+ > an LLM-issued notion reconcile returns `400 validation_error` on the
20
+ > window-key allowlist, which is calendar-only)
17
21
  > - `/api/notion/query`, `/api/notion/search`, `/api/notion/pages`,
18
- > `/api/notion/pages/<id>/content` (each route-prefix 410)
22
+ > `/api/notion/pages/<id>/content` (each route-prefix returns `410`
23
+ > with `X-Integration-Mode: native` — these ARE route-gated)
19
24
  >
20
25
  > Reach Notion through the in-session Notion connector your harness
21
26
  > exposes (typically a user-installed Notion MCP server registered
@@ -17,8 +17,8 @@ Output language: write-ups inherit the destination file's policy via the `today`
17
17
  2. Group related observations before acting.
18
18
  3. For each group, apply the **fetch decision** (below) — `summary_text` + `novelty_score` are pre-computed by the daemon's per-observation summarizer; only `novelty_score >= 2` warrants full content fetch.
19
19
  4. Decide actionability:
20
- - Update `today.md` for TODOs, blockers, decisions, or deadlines
21
- - Update `roadmap.md` or `projects/*.md` only for material project-state changes
20
+ - Update `state/today.md` for TODOs, blockers, decisions, or deadlines
21
+ - Update `plans/roadmap.md` or `projects/*.md` only for material project-state changes
22
22
  - Schedule a wake-up if the observation implies a future reminder
23
23
  5. Apply the smallest meaningful set of context updates.
24
24
  6. Mark processed observations consumed via the bulk endpoint
@@ -138,6 +138,16 @@ that caps each curl invocation at one HTTP request and strips heredoc
138
138
  bodies before URL validation. The batch endpoint resolves the
139
139
  cardinality mismatch without weakening either hook.
140
140
 
141
+ > **If `mcp__aitne-observations__submit_observations` is in your allowed
142
+ > tools (the `routine.fetch_window` pre-pass on Claude), submit the batch
143
+ > through that MCP tool instead of the curl below.** The structured
144
+ > transport never goes through the SDK bash preflight, so Unicode-bearing
145
+ > payloads (NBSP/ZWS in subjects, U+3000 in titles) can't trip its
146
+ > `too-complex` gate and cascade to a denied curl / wasted retry /
147
+ > `budget-cap`. The tool input is the same `{"observations":[…]}` envelope
148
+ > and the response is identical. The curl form below is the fallback for
149
+ > sessions without the MCP tool (the hourly check, Codex/Gemini).
150
+
141
151
  ```bash
142
152
  curl -s -X POST http://localhost:8321/api/observations/batch \
143
153
  -H 'Content-Type: application/json' \
@@ -190,8 +200,8 @@ Hard limits:
190
200
  ### POST /api/observations/consume
191
201
 
192
202
  Marks one or more observations consumed. **Bulk-only** — there is no
193
- per-id endpoint (`POST /api/observations/<id>/consume` returns 404).
194
- Always use this shape, even for a single id.
203
+ per-id endpoint (`POST /api/observations/<id>/consume` returns 405
204
+ `use_bulk_endpoint`). Always use this shape, even for a single id.
195
205
 
196
206
  Copy the `correlationId` value verbatim from the
197
207
  `<event_correlation_id>…</event_correlation_id>` tag in your turn
@@ -230,7 +240,9 @@ you to.**
230
240
 
231
241
  ### GET /api/observations/stats
232
242
 
233
- `curl -s http://localhost:8321/api/observations/stats` → `{ "total", "pending", "bySource": {...}, "byActor": {...} }`
243
+ `curl -s http://localhost:8321/api/observations/stats` → `{ "totalPending", "oldestPendingObservedAt", "bySource": [{ "source", "pendingCount", "oldestObservedAt" }], "summaryStatusCounts": {...}, "noveltyDistribution": [...] }`
244
+
245
+ `totalPending` is the single count of unconsumed observations (no separate `total` / `pending` keys). `bySource` is an **array** of per-source rows, not a map. There is no `byActor`. `summaryStatusCounts` / `noveltyDistribution` are summarizer-health telemetry.
234
246
 
235
247
  ---
236
248
 
@@ -267,7 +279,10 @@ current state.
267
279
 
268
280
  <!-- mode:direct:notion -->
269
281
  ```bash
270
- curl -s "http://localhost:8321/api/notion/query?databaseId=xxx"
282
+ # ?database= takes a database LABEL (default "tasks"), not a UUID.
283
+ # An unrecognized label returns 404 notion.database_not_found with the
284
+ # list of valid labels; an absent param silently uses "tasks".
285
+ curl -s "http://localhost:8321/api/notion/query?database=tasks"
271
286
  ```
272
287
  <!-- /mode:direct:notion -->
273
288
  <!-- mode:delegated-same:notion -->
@@ -331,8 +346,9 @@ names and the canonical search / fetch call shapes. Resolve
331
346
  `<databaseId>` first via the un-gated config dump
332
347
  (`curl -s http://localhost:8321/api/notion/databases`) and pass the
333
348
  UUID to the connector's data-source / search tool. Do NOT call
334
- `/api/notion/*` (410) or `/api/integrations/notion/exec` (also 410
335
- in native mode).
349
+ `/api/notion/*` (410) or `/api/integrations/notion/exec` (returns 409
350
+ `mode_mismatch` in native mode — the `/exec` path is not route-gated,
351
+ so it is the handler, not the 410 gate, that rejects it).
336
352
  <!-- /mode:native:notion -->
337
353
  <!-- mode:disabled:notion -->
338
354
  Notion is disabled — there is no live source. Treat the observation
@@ -28,7 +28,7 @@ carries (project keeps `## Lifecycle Phases`, repo-only stays light).
28
28
  ## Hard rules
29
29
 
30
30
  - Write only through `/api/context/*`. Never edit files directly on disk.
31
- - Do not modify `today.md`, `roadmap.md`, `user/*`, `rules/*`, or
31
+ - Do not modify `state/today.md`, `plans/roadmap.md`, `user/*`, `rules/*`, or
32
32
  unrelated context files.
33
33
  - Preserve valid frontmatter. The overview file uses `type: git-project`,
34
34
  the journal file uses `type: git-journal`. Both carry an ISO `updated`
@@ -6,8 +6,8 @@
6
6
  "kind": "knowledge_layout",
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"project-shape\" -->",
8
8
  "human_label": "Project / git-repo file shape",
9
- "description": "Required sections in projects/*.md and git-repos/*.md, and what each section holds",
10
- "scope_paths": ["projects/*.md", "git-repos/*.md"]
9
+ "description": "Required sections in git/<slug>/overview.md (git-managed repos) and projects/*.md (non-git manual projects), and what each section holds",
10
+ "scope_paths": ["projects/*.md", "git/*/overview.md"]
11
11
  },
12
12
  {
13
13
  "id": "slug-grammar",
@@ -15,7 +15,7 @@
15
15
  "anchor": "<!-- CURATION:convention_notes id=\"slug-grammar\" -->",
16
16
  "human_label": "Project slug grammar",
17
17
  "description": "Slug format, length cap, reserved stems",
18
- "scope_paths": ["projects/*.md", "git-repos/*.md"]
18
+ "scope_paths": ["projects/*.md", "git/*/overview.md"]
19
19
  }
20
20
  ]
21
21
  }
@@ -14,11 +14,14 @@
14
14
  ]
15
15
  },
16
16
  {
17
- "path": "git-repos/*.md",
18
- "purpose": "Per-repository context for non-project watched repositories",
17
+ "path": "git/*/overview.md",
18
+ "purpose": "Per-repository overview for every git-managed repo (replaces the retired git-repos/*.md layout)",
19
19
  "sections": [
20
- { "heading": "## Activity", "contains": "summarised recent activity for the watched repo" },
21
- { "heading": "## Recent Pushes", "contains": "list of push events with dates and short summaries" }
20
+ { "heading": "## Summary", "contains": "one-paragraph description of the repo and its current state" },
21
+ { "heading": "## Architecture", "contains": "structural notes on the repo's layout and components" },
22
+ { "heading": "## Notable Changes", "contains": "human-readable notes on important commits or decisions" },
23
+ { "heading": "## Open Threads", "contains": "manual prose; follow-ups and pending questions, preserved verbatim" },
24
+ { "heading": "## Daily Activity Log", "contains": "rolling 30-day window of summarised activity" }
22
25
  ]
23
26
  }
24
27
  ]
@@ -4,17 +4,17 @@
4
4
  {
5
5
  "topic": "Slug format",
6
6
  "rule": "Project and repo slugs are kebab-case, lowercase letters with hyphens between words.",
7
- "example": "projects/cost-explorer.md, git-repos/personal-agent.md"
7
+ "example": "plans/projects/cost-explorer.md, git/personal-agent/overview.md"
8
8
  },
9
9
  {
10
10
  "topic": "Slug length",
11
11
  "rule": "Slugs are 32 characters or fewer, including the hyphens but excluding the .md suffix.",
12
- "example": "projects/personal-agent-skills.md is at the upper bound"
12
+ "example": "plans/projects/personal-agent-skills.md is at the upper bound"
13
13
  },
14
14
  {
15
15
  "topic": "Reserved stems",
16
16
  "rule": "Stems _index and _archive are reserved for daemon-maintained files and not in use as project slugs.",
17
- "example": "projects/_index.md is a directory listing, not a project file"
17
+ "example": "plans/projects/_index.md is a directory listing, not a project file"
18
18
  }
19
19
  ]
20
20
  }
@@ -156,9 +156,19 @@ Response:
156
156
 
157
157
  Update book status, rating, or notes.
158
158
 
159
+ **Approve tier (Bearer required).** This is an operator/dashboard-gated
160
+ write — an autonomous agent curl from a session workdir carries no
161
+ `Authorization: Bearer` header and will be rejected with **401** before
162
+ the handler runs. Do NOT call this autonomously and do NOT assume the
163
+ update landed; book status/rating/notes corrections are made by the user
164
+ via the dashboard. (Body shape, for reference: `status` enum
165
+ `reading|completed|abandoned`, `rating` 1-5, `notes`.)
166
+
159
167
  ```bash
168
+ # Operator/dashboard-only — requires Authorization: Bearer (Approve tier).
160
169
  curl -s -X PATCH "http://localhost:8321/api/books/1" \
161
170
  -H "Content-Type: application/json" \
171
+ -H "Authorization: Bearer <operator-token>" \
162
172
  -d '{"status": "completed", "rating": 4}'
163
173
  ```
164
174
 
@@ -146,12 +146,12 @@ the sweep to write the refreshed metadata and YAML `updated` date.
146
146
 
147
147
  ### First-write registration (_index.md)
148
148
 
149
- The `user/_index.md` file indexes available topic files. When
149
+ The `identity/_index.md` file indexes available topic files. When
150
150
  creating `reading-taste.md` for the first time (GET returned 404),
151
151
  append a one-line entry to the index so other flows can discover it:
152
152
 
153
153
  ```bash
154
- curl -s -X PATCH http://localhost:8321/api/context/user/_index \
154
+ curl -s -X PATCH http://localhost:8321/api/context/identity/_index \
155
155
  -H 'Content-Type: application/json' \
156
156
  -d '{"section": "topics", "mode": "append", "content": "- reading-taste — derived taste profile + rolling book candidates (updated weekly)"}'
157
157
  ```
@@ -10,11 +10,11 @@ allowed-tools:
10
10
 
11
11
  Output language: roadmap.md is Policy B — see `<output_language_policy>`. Section headers stay English skeleton; items, narrative, and preparation-timeline prose are in `<settings primary_language>`. Preserve user-customized headers verbatim.
12
12
 
13
- `roadmap.md` is the single source of truth for **long-horizon user
14
- intent** — everything that does not belong in `today.md`. It aggregates
13
+ `plans/roadmap.md` is the single source of truth for **long-horizon user
14
+ intent** — everything that does not belong in `state/today.md`. It aggregates
15
15
  Calendar events, pending `agent_schedule` rows, DM-captured intent,
16
16
  mail-derived bookings, reading goals, and observations; Morning Routine
17
- consumes it to shape `today.md`.
17
+ consumes it to shape `state/today.md`.
18
18
 
19
19
  ## Section schema
20
20
 
@@ -117,9 +117,9 @@ must carry a daemon-minted HTML comment ID:
117
117
  - The `YYYYMMDD` segment is the entry creation date / Source date, not
118
118
  the event date. Keep it stable when dates are refined.
119
119
  - Do not invent IDs in prose. Before adding a new roadmap entry, call
120
- `POST /api/context/roadmap/id`:
120
+ `POST /api/context/plans/roadmap/id`:
121
121
  ```bash
122
- curl -s -X POST http://localhost:8321/api/context/roadmap/id \
122
+ curl -s -X POST http://localhost:8321/api/context/plans/roadmap/id \
123
123
  -H 'Content-Type: application/json' \
124
124
  -d '{"creationDate": "YYYY-MM-DD"}'
125
125
  ```
@@ -7,7 +7,7 @@
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"entry-types\" -->",
8
8
  "human_label": "Roadmap section schema",
9
9
  "description": "Required sections in roadmap.md and what each holds",
10
- "scope_paths": ["roadmap.md"]
10
+ "scope_paths": ["plans/roadmap.md"]
11
11
  }
12
12
  ]
13
13
  }