@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
@@ -37,14 +37,14 @@ in the session preamble.
37
37
  The same two files documented in the direct-mode body are still
38
38
  authoritative for non-Calendar routing:
39
39
 
40
- 1. **`rules/management.md` → `## Source of Truth`** — durable
40
+ 1. **`policies/management.md` → `## Source of Truth`** — durable
41
41
  user-authored answers ("Schedule = Google Calendar", "Tasks =
42
42
  Notion", etc.).
43
43
  2. **`~/.personal-agent/integrations.md` → `## Note Sources`** — the
44
44
  daemon-rendered snapshot for the user's external Obsidian vault path
45
45
  plus Notion's mode.
46
46
 
47
- If `rules/management.md` Schedule = Apple Calendar or Outlook Calendar,
47
+ If `policies/management.md` Schedule = Apple Calendar or Outlook Calendar,
48
48
  the user's chosen provider is **not** Google Calendar and the
49
49
  native-Claude binding is irrelevant — route to `/api/apple-calendar/*`
50
50
  or `/api/calendar/outlook/*` exactly as the direct-mode body documents.
@@ -149,7 +149,7 @@ the window and intersect.
149
149
  <!-- service:apple-calendar -->
150
150
  ## Apple Calendar (iCloud CalDAV) — direct, unchanged
151
151
 
152
- If `rules/management.md` Schedule = Apple Calendar, use the
152
+ If `policies/management.md` Schedule = Apple Calendar, use the
153
153
  `/api/apple-calendar/*` routes documented in the base body. Apple
154
154
  Calendar has no MCP connector; native-mode gating does not apply.
155
155
 
@@ -165,7 +165,7 @@ native binding above is Google-only.
165
165
  <!-- service:outlook-calendar -->
166
166
  ## Outlook Calendar (Microsoft Graph) — direct, unchanged
167
167
 
168
- If `rules/management.md` Schedule = Outlook Calendar, use
168
+ If `policies/management.md` Schedule = Outlook Calendar, use
169
169
  `/api/calendar/outlook/*` per the direct-mode body. Microsoft does not
170
170
  ship a hosted Outlook Calendar connector for Claude / Codex / Gemini
171
171
  today; native-mode gating does not apply.
@@ -178,7 +178,7 @@ today; native-mode gating does not apply.
178
178
 
179
179
  **Scope**: this skill targets the **separate** Obsidian vault the user
180
180
  maintains alongside this app — never the agent's primary management
181
- store (`today.md`, `roadmap.md`, `projects/`, `rules/`, `routines/`,
181
+ store (`state/today.md`, `plans/roadmap.md`, `projects/`, `rules/`, `routines/`,
182
182
  `user/`, `agent/`). Those are reached via `/api/context/*` (see the
183
183
  `context` skill).
184
184
 
@@ -32,9 +32,9 @@ and the `<integration-routing-table>` block in the session preamble.
32
32
 
33
33
  ## Source of Truth (READ FIRST)
34
34
 
35
- Same as the direct-mode body — `rules/management.md` →
35
+ Same as the direct-mode body — `policies/management.md` →
36
36
  `## Source of Truth` and `~/.personal-agent/integrations.md` →
37
- `## Note Sources`. If `rules/management.md` Schedule != Google
37
+ `## Note Sources`. If `policies/management.md` Schedule != Google
38
38
  Calendar, the native binding is irrelevant; route through the
39
39
  provider-specific direct route (`/api/apple-calendar/*` or
40
40
  `/api/calendar/outlook/*`).
@@ -120,7 +120,7 @@ this file.
120
120
  <!-- service:apple-calendar -->
121
121
  ## Apple Calendar (iCloud CalDAV) — direct, unchanged
122
122
 
123
- If `rules/management.md` Schedule = Apple Calendar, use the
123
+ If `policies/management.md` Schedule = Apple Calendar, use the
124
124
  `/api/apple-calendar/*` routes documented in the base body. Apple
125
125
  Calendar has no MCP connector; native-mode gating does not apply.
126
126
  <!-- /service:apple-calendar -->
@@ -130,7 +130,7 @@ Calendar has no MCP connector; native-mode gating does not apply.
130
130
  <!-- service:outlook-calendar -->
131
131
  ## Outlook Calendar (Microsoft Graph) — direct, unchanged
132
132
 
133
- If `rules/management.md` Schedule = Outlook Calendar, use
133
+ If `policies/management.md` Schedule = Outlook Calendar, use
134
134
  `/api/calendar/outlook/*` per the direct-mode body. No Outlook
135
135
  connector ships for Codex today; native-mode gating does not apply.
136
136
  <!-- /service:outlook-calendar -->
@@ -143,7 +143,7 @@ connector ships for Codex today; native-mode gating does not apply.
143
143
  Same surface as the direct-mode body. Full CRUD via
144
144
  `/api/obsidian/*`; requires the Obsidian app running. Omit `.md`
145
145
  extensions from paths. Never use this skill to read or write the
146
- agent's primary management vault (`today.md`, `roadmap.md`,
146
+ agent's primary management vault (`state/today.md`, `plans/roadmap.md`,
147
147
  `projects/`, `rules/`, …) — that lives behind `/api/context/*`.
148
148
 
149
149
  ```bash
@@ -171,10 +171,10 @@ curl -s -X DELETE http://localhost:8321/api/obsidian/notes/Projects/Old
171
171
 
172
172
  ```bash
173
173
  curl -s http://localhost:8321/api/github/repos
174
- curl -s "http://localhost:8321/api/github/pulls?state=open"
174
+ curl -s "http://localhost:8321/api/github/pulls?owner=user&repo=repo&state=open"
175
175
  curl -s -X POST http://localhost:8321/api/github/pulls/comment \
176
176
  -H 'Content-Type: application/json' \
177
- -d '{"owner": "user", "repo": "repo", "pullNumber": 42, "body": "LGTM"}'
177
+ -d '{"owner": "user", "repo": "repo", "pull_number": 42, "comment": "LGTM"}'
178
178
  ```
179
179
  <!-- /service:github -->
180
180
 
@@ -33,7 +33,7 @@ and the `<integration-routing-table>` block in the session preamble.
33
33
 
34
34
  ## Source of Truth (READ FIRST)
35
35
 
36
- Same files as the direct-mode body — `rules/management.md` →
36
+ Same files as the direct-mode body — `policies/management.md` →
37
37
  `## Source of Truth` and `~/.personal-agent/integrations.md` →
38
38
  `## Note Sources`. If Schedule != Google Calendar, route through the
39
39
  provider-specific direct route (`/api/apple-calendar/*` or
@@ -124,7 +124,7 @@ materialised event to `/api/observations` per the section below.
124
124
  ## Apple Calendar (iCloud CalDAV) — direct, unchanged
125
125
 
126
126
  Use `/api/apple-calendar/*` per the direct-mode body if
127
- `rules/management.md` Schedule = Apple Calendar.
127
+ `policies/management.md` Schedule = Apple Calendar.
128
128
  <!-- /service:apple-calendar -->
129
129
 
130
130
  ---
@@ -170,10 +170,10 @@ curl -s -X DELETE http://localhost:8321/api/obsidian/notes/Projects/Old
170
170
 
171
171
  ```bash
172
172
  curl -s http://localhost:8321/api/github/repos
173
- curl -s "http://localhost:8321/api/github/pulls?state=open"
173
+ curl -s "http://localhost:8321/api/github/pulls?owner=user&repo=repo&state=open"
174
174
  curl -s -X POST http://localhost:8321/api/github/pulls/comment \
175
175
  -H 'Content-Type: application/json' \
176
- -d '{"owner": "user", "repo": "repo", "pullNumber": 42, "body": "LGTM"}'
176
+ -d '{"owner": "user", "repo": "repo", "pull_number": 42, "comment": "LGTM"}'
177
177
  ```
178
178
  <!-- /service:github -->
179
179
 
@@ -7,7 +7,7 @@ description: Apple Calendar (iCloud CalDAV) reference — list/get/create/update
7
7
  <!-- service:apple-calendar -->
8
8
  ## Apple Calendar (iCloud CalDAV)
9
9
 
10
- Use this section **only when `rules/management.md` Schedule = Apple Calendar**. The provider-routing table at the top of this skill is non-negotiable.
10
+ Use this section **only when `policies/management.md` Schedule = Apple Calendar**. The provider-routing table at the top of this skill is non-negotiable.
11
11
 
12
12
  The route shape mirrors `/api/calendar/*` so prose patterns transfer: list → get → patch / create / delete. Differences are flagged below.
13
13
 
@@ -43,7 +43,7 @@ curl -s -X POST http://localhost:8321/api/apple-calendar/events \
43
43
  -H 'Content-Type: application/json' \
44
44
  -d '{"summary": "Team meeting", "start": "2026-04-26T14:00:00+09:00", "end": "2026-04-26T15:00:00+09:00"}'
45
45
  ```
46
- Optional: `description`, `location`. **[Apple only]** `attendees`, `reminders`, `recurrence`, `visibility` from the Google shape are accepted by the Zod schema but are silently dropped iCloud invitations and reminder defaults belong to the user's Apple ID and the agent should not author them. If a user asks for those, tell them and stop.
46
+ Optional: `description`, `location`. **[Apple only]** `attendees`, `reminders`, `recurrence`, `visibility` from the Google shape are **rejected** the Apple schema is `.strict()`, so including any of them fails the whole request with `400 validation_error` and no event is created (the same applies to PATCH). iCloud invitations and reminder defaults belong to the user's Apple ID and the agent should not author them. If a user asks for those, tell them and stop — do not include the fields in the request.
47
47
 
48
48
  ### Update event (write — Autonomous)
49
49
  ```bash
@@ -7,7 +7,7 @@ description: Outlook Calendar reference (Microsoft Graph) — read-only on-deman
7
7
  <!-- service:outlook-calendar -->
8
8
  ## Outlook Calendar (Microsoft Graph)
9
9
 
10
- Use this section **only when `rules/management.md` Schedule = Outlook Calendar**. The provider-routing table at the top of this skill is non-negotiable.
10
+ Use this section **only when `policies/management.md` Schedule = Outlook Calendar**. The provider-routing table at the top of this skill is non-negotiable.
11
11
 
12
12
  v1 is **read-only and on-demand** — there is no Outlook calendar poller, so `schedule.approaching` events do not fire for Outlook calendars (the user's own Outlook clients fill that gap). Write surfaces (create / update / delete) are deferred. If the user asks the agent to schedule or change an Outlook event, tell them you can read the calendar but must defer the write to them.
13
13
 
@@ -9,8 +9,8 @@ description: External Obsidian vault CRUD — separate from the agent's primary
9
9
 
10
10
  **Scope**: this skill targets a **separate** Obsidian vault the user maintains
11
11
  alongside this app — e.g. a personal knowledge base. It is **not** the agent's
12
- own primary management store. The agent's primary files (`today.md`,
13
- `roadmap.md`, `projects/`, `rules/`, `routines/`, `user/`, `agent/`, …) live
12
+ own primary management store. The agent's primary files (`state/today.md`,
13
+ `plans/roadmap.md`, `projects/`, `rules/`, `routines/`, `user/`, `agent/`, …) live
14
14
  in the primary vault and are reached via `/api/context/*` (see the `context`
15
15
  skill). **Never** use this skill to read or write the primary vault.
16
16
 
@@ -1,26 +1,24 @@
1
1
  ---
2
2
  name: gmail-lifestyle
3
- description: Load when the user mentions receipts / expenses / flights / hotels / trains / commute / travel time / a booking — Gmail-observer-derived travel bookings, calendar-event commute calculations, and receipt save-to-external-vault all live here.
3
+ description: Load when the user mentions receipts / expenses / flights / hotels / trains / a booking — Gmail-observer-derived travel bookings and receipt save-to-external-vault both live here.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
6
  - Read
7
7
  ---
8
8
 
9
- # Gmail Lifestyle — travel bookings, commute, receipts
9
+ # Gmail Lifestyle — travel bookings, receipts
10
10
 
11
- This skill merges three closely-related surfaces that all depend on
12
- data the daemon's **Gmail observer** has scanned: travel bookings,
13
- commute / travel-time calculations over calendar events, and receipt
14
- attachments saved into the user's external Obsidian vault.
11
+ This skill merges two closely-related surfaces that both depend on
12
+ data the daemon's **Gmail observer** has scanned: travel bookings and
13
+ receipt attachments saved into the user's external Obsidian vault.
15
14
 
16
15
  It is conditionally loaded — see the manifest predicate
17
16
  `gmailLifestyleActive(db)` / `gmailLifestyleActiveForDm(db, msg)`
18
17
  in `packages/daemon/src/core/skills-manifest.ts`. Routines load it
19
18
  when there is fresh-or-pending data; DM events also load it on
20
- trigger phrases (`receipt`, `expense`, `flight`, `train`,
21
- `commute`, `travel time`, plus the user's primary-language
22
- equivalents the predicate handles both the structured triggers
23
- and the message-text triggers).
19
+ trigger phrases (`receipt`, `expense`, `flight`, `train`, plus the
20
+ user's primary-language equivalents the predicate handles both the
21
+ structured triggers and the message-text triggers).
24
22
 
25
23
  Output language: Policy C for user-facing summaries — see
26
24
  `<output_language_policy>`. Path patterns and external API field
@@ -85,77 +83,6 @@ Reservation.
85
83
 
86
84
  ---
87
85
 
88
- ## Travel time / commute
89
-
90
- Uses the Google Maps Directions API to estimate travel time between
91
- locations. Computes departure times for calendar events with a
92
- `location` field.
93
-
94
- **Prerequisite**: `googleMapsApiKey` configured in the daemon's
95
- secret store, with the Directions API enabled.
96
-
97
- ### When to use
98
-
99
- - **Morning routine** — for today's calendar events with a location,
100
- compute departure times and add to today.md `## Commute & Travel`.
101
- - **User asks about commute / travel time** — query specific routes.
102
- - **Pre-event reminders** — DM departure-time suggestions.
103
-
104
- ### Sourcing today's events
105
-
106
- The right fetch path depends on Google Calendar's current mode
107
- (read `<integration_modes>` injected at session start):
108
-
109
- <!-- mode:direct:google_calendar -->
110
- Direct mode → `GET /api/calendar/events?date=today&days=1`
111
- (see the `external-services` skill).
112
- <!-- /mode:direct:google_calendar -->
113
- <!-- mode:delegated-same:google_calendar -->
114
- Same-backend delegated → use this session backend's native Calendar
115
- list-events MCP tool. `/api/calendar/events` returns 410.
116
- <!-- /mode:delegated-same:google_calendar -->
117
- <!-- mode:delegated-cross:google_calendar -->
118
- Cross-backend delegated → `POST /api/integrations/google_calendar/exec`
119
- with a natural-language `task` + `outputSchema` (see the
120
- `external-services` skill — cross-backend variant for worked
121
- examples).
122
- <!-- /mode:delegated-cross:google_calendar -->
123
- <!-- mode:native:google_calendar -->
124
- Native mode → use this session backend's native Calendar list-events
125
- MCP tool (same call shape as `delegated-same`). The materialized
126
- `external-services` skill body (`SKILL.native.<session-backend>.md`)
127
- lists the per-backend tool names. The daemon does not proxy in
128
- native mode; `/api/calendar/events` returns 410 and
129
- `/api/integrations/google_calendar/exec` returns 410 too.
130
- <!-- /mode:native:google_calendar -->
131
- <!-- mode:disabled:google_calendar -->
132
- Disabled → skip this section; there is no calendar to source events
133
- from.
134
- <!-- /mode:disabled:google_calendar -->
135
-
136
- ### API
137
-
138
- Full `/api/travel-time` reference (point-to-point + for-event) is in
139
- the dedicated reference below.
140
-
141
- {{> ref:travel-time-api }}
142
-
143
- ### Formatting — today.md
144
-
145
- ```
146
- ## Commute & Travel
147
- 14:00 Team meeting @ WeWork Times Square — depart by 13:15 (transit, 40 min)
148
- 18:30 Dinner @ Restaurant ABC — depart by 18:00 (transit, 25 min)
149
- ```
150
-
151
- Only include events that have a `location` field. Omit the section
152
- when no events have locations today.
153
-
154
- Mode display names: transit → Transit, driving → Driving, walking →
155
- Walking, bicycling → Bicycle.
156
-
157
- ---
158
-
159
86
  ## Receipts
160
87
 
161
88
  The daemon's Gmail observer scans travel-booking emails for PDF /
@@ -170,7 +97,7 @@ user's **external Obsidian vault**.
170
97
  > **external** Obsidian vault (user's personal knowledge base reached
171
98
  > via `/api/obsidian/*`), **not** the primary management store
172
99
  > reached via `/api/context/*`. The agent's own state files
173
- > (`today.md`, `roadmap.md`, `projects/*`, `user/*`, `rules/*`,
100
+ > (`state/today.md`, `plans/roadmap.md`, `projects/*`, `user/*`, `rules/*`,
174
101
  > `routines/*`, `agent/*`) live in the primary store and must
175
102
  > **never** receive receipt attachments. See the
176
103
  > `external-services` skill's obsidian reference for the external
@@ -90,7 +90,7 @@ Response shape on success:
90
90
  `outputSchema` is **required** — the subprocess emits exactly one JSON
91
91
  object as its final message and the daemon validates it. Schemas
92
92
  larger than 4 KB are rejected (`schema_too_large`). Caps default to
93
- `maxToolCalls=7`, `maxBudgetUsd=0.05`, `timeoutMs=60000` — bump them via
93
+ `maxToolCalls=8`, `maxBudgetUsd=0.05`, `timeoutMs=60000` — bump them via
94
94
  the request body up to the hard caps (15 / 0.50 / 300000) when a task
95
95
  genuinely needs more.
96
96
 
@@ -206,10 +206,18 @@ curl -s -X POST http://localhost:8321/api/integrations/gmail/exec \
206
206
 
207
207
  The setup wizard pre-populates `gmail.deniedTools` with the connector's
208
208
  destructive defaults (send / batch label mutate / etc.). `/exec`
209
- honors the deny list: a task that requires a denied tool surfaces as
210
- `tool_unavailable` (not 403) — the subprocess reports the gap and the
211
- daemon returns 502. Surface that to the user and ask whether to lift
212
- the deny before retrying.
209
+ honors the deny list, and the response distinguishes two cases:
210
+
211
+ - **Every connector tool is denied** `403 denied_tool`. There is no
212
+ surface to plan against, so the daemon rejects the task up front
213
+ without spawning the subprocess.
214
+ - **The connector still has usable tools but the specific tool a planned
215
+ task needs is denied (or no tool fits)** → `502 tool_unavailable`. The
216
+ subprocess plans, finds no permitted tool for the intent, and reports
217
+ the gap.
218
+
219
+ In both cases, surface that to the user and ask whether to lift the
220
+ relevant deny before retrying.
213
221
 
214
222
  ## Decision rules
215
223
 
@@ -236,6 +244,7 @@ Discriminator: `body.mode === "delegated"`.
236
244
  | 400 | `validation_error` / `schema_too_large` | no | Fix the request body. |
237
245
  | 409 | `mode_mismatch` | no | Gmail isn't delegated, OR your DM backend matches `delegatedBackend`. Re-read `integrations.md` and stop. |
238
246
  | 409 | `precondition` | no | Mode/backend was flipped while the call queued. Re-read `integrations.md` and re-plan. |
247
+ | 403 | `denied_tool` | no | Every tool in the connector is denied — task mode has no surface to plan against. Surface to the user and ask whether to lift the deny. |
239
248
  | 429 | `task_quota_exhausted` | no | Daily cap reached; wait or surface. |
240
249
  | 502 | `parse_error` / `schema_violation` | no (daemon already retried once) | Consider a simpler schema. |
241
250
  | 502 | `tool_unavailable` | no | No connector tool fits the intent. Surface the gap to the user. |
@@ -85,7 +85,7 @@ Response shape on success:
85
85
  `outputSchema` is **required** — the subprocess emits exactly one JSON
86
86
  object as its final message and the daemon validates it. Schemas
87
87
  larger than 4 KB are rejected (`schema_too_large`). Caps default to
88
- `maxToolCalls=7`, `maxBudgetUsd=0.05`, `timeoutMs=60000` — bump them
88
+ `maxToolCalls=8`, `maxBudgetUsd=0.05`, `timeoutMs=60000` — bump them
89
89
  via the request body up to the hard caps (15 / 0.50 / 300000) when a
90
90
  task genuinely needs more.
91
91
 
@@ -193,9 +193,12 @@ curl -sS -X POST http://localhost:8321/api/integrations/gmail/exec \
193
193
  ## Default deny floor
194
194
 
195
195
  The setup wizard pre-populates `gmail.deniedTools` with the connector's
196
- destructive defaults. `/exec` honors the deny list: a task that
197
- requires a denied tool surfaces as `tool_unavailable` — surface that
198
- to the user and ask whether to lift the deny before retrying.
196
+ destructive defaults. `/exec` honors the deny list, distinguishing two
197
+ cases: if **every** connector tool is denied `403 denied_tool` (no
198
+ surface to plan against, rejected up front); if usable tools remain but
199
+ the specific tool a planned task needs is denied (or no tool fits) →
200
+ `502 tool_unavailable`. In both cases, surface that to the user and ask
201
+ whether to lift the relevant deny before retrying.
199
202
 
200
203
  ## Decision rules
201
204
 
@@ -218,6 +221,7 @@ Discriminator: `body.mode === "delegated"`.
218
221
  | 400 | `validation_error` / `schema_too_large` | no | Fix the request body. |
219
222
  | 409 | `mode_mismatch` | no | Gmail isn't delegated, OR your DM backend matches `delegatedBackend`. Re-read `integrations.md` and stop. |
220
223
  | 409 | `precondition` | no | Mode/backend was flipped during queue wait. Re-read `integrations.md` and re-plan. |
224
+ | 403 | `denied_tool` | no | Every tool in the connector is denied — no surface to plan against. Surface to the user and ask whether to lift the deny. |
221
225
  | 429 | `task_quota_exhausted` | no | Daily cap reached; wait or surface. |
222
226
  | 502 | `parse_error` / `schema_violation` | no (daemon already retried once) | Consider a simpler schema. |
223
227
  | 502 | `tool_unavailable` | no | No connector tool fits. Surface the gap. |
@@ -83,7 +83,7 @@ Response shape on success:
83
83
  `outputSchema` is **required** — the subprocess emits exactly one JSON
84
84
  object as its final message and the daemon validates it. Schemas
85
85
  larger than 4 KB are rejected (`schema_too_large`). Caps default to
86
- `maxToolCalls=7`, `maxBudgetUsd=0.05`, `timeoutMs=60000` — bump them
86
+ `maxToolCalls=8`, `maxBudgetUsd=0.05`, `timeoutMs=60000` — bump them
87
87
  via the request body up to the hard caps (15 / 0.50 / 300000) when a
88
88
  task genuinely needs more.
89
89
 
@@ -187,9 +187,12 @@ curl -sS -X POST http://localhost:8321/api/integrations/gmail/exec \
187
187
  ## Default deny floor
188
188
 
189
189
  The setup wizard pre-populates `gmail.deniedTools` with the connector's
190
- destructive defaults. `/exec` honors the deny list: a task that
191
- requires a denied tool surfaces as `tool_unavailable` — surface that
192
- to the user and ask whether to lift the deny before retrying.
190
+ destructive defaults. `/exec` honors the deny list, distinguishing two
191
+ cases: if **every** connector tool is denied `403 denied_tool` (no
192
+ surface to plan against, rejected up front); if usable tools remain but
193
+ the specific tool a planned task needs is denied (or no tool fits) →
194
+ `502 tool_unavailable`. In both cases, surface that to the user and ask
195
+ whether to lift the relevant deny before retrying.
193
196
 
194
197
  ## Decision rules
195
198
 
@@ -212,6 +215,7 @@ Discriminator: `body.mode === "delegated"`.
212
215
  | 400 | `validation_error` / `schema_too_large` | no | Fix the request body. |
213
216
  | 409 | `mode_mismatch` | no | Gmail isn't delegated, OR your DM backend matches `delegatedBackend`. Re-read `integrations.md` and stop. |
214
217
  | 409 | `precondition` | no | Mode/backend was flipped during queue wait. Re-read `integrations.md` and re-plan. |
218
+ | 403 | `denied_tool` | no | Every tool in the connector is denied — no surface to plan against. Surface to the user and ask whether to lift the deny. |
215
219
  | 429 | `task_quota_exhausted` | no | Daily cap reached; wait or surface. |
216
220
  | 502 | `parse_error` / `schema_violation` | no (daemon already retried once) | Consider a simpler schema. |
217
221
  | 502 | `tool_unavailable` | no | No connector tool fits. Surface the gap. |
@@ -70,8 +70,10 @@ skill body.
70
70
  ## Send / draft
71
71
 
72
72
  ```bash
73
- # Direct send — Autonomous; rejected with 403 when the user has denied
74
- # the send tool. Call /api/notify yourself if the user should know.
73
+ # Direct send — Autonomous. Direct mode has NO deny-tool gate: this
74
+ # route validates the body and sends unconditionally (no 403/denied_tool
75
+ # path; `deniedTools` only applies to delegated-mode connector tools).
76
+ # Call /api/notify yourself if the user should know.
75
77
  curl -sX POST "http://localhost:8321/api/mail/ACCT/messages/send" \
76
78
  -H "Content-Type: application/json" \
77
79
  -d '{"to": [...], "subject": "...", "textBody": "...", "reply"?: {...}}'
@@ -16,7 +16,7 @@ on this kind — do NOT retry; tell the user and fall back.
16
16
  | Thread read (`GET /threads/:id`) | yes | yes | partial (client-walked; `status: "partial"` possible) |
17
17
  | Draft read (`GET /drafts`, `GET /drafts/:id`) | yes | yes | yes |
18
18
  | Draft write (`POST`/`PATCH`/`DELETE /drafts`, `POST /drafts/:id/send`) | yes | yes | no — **501** — direct `/messages/send` only |
19
- | Attachment download (via `/receipts/:id/file`) | yes | no — 501 | no — 501 |
19
+ | Attachment download (via `POST /api/receipts/:id/download`) | yes | no — 501 | no — 501 |
20
20
 
21
21
  **IMAP drafts** (Yahoo / iCloud): every draft *write* returns 501. To
22
22
  queue outbound mail for a non-Gmail IMAP user, send directly via
@@ -11,7 +11,7 @@ allowed-tools:
11
11
  A **managed task** is a user-delegated commitment: the agent runs a
12
12
  recurring fetch against a specific App at a user-specified Cadence and
13
13
  writes the resulting entities into a primary L2 directory (the
14
- `Output path`). Each row lives in `rules/management.md` §B. The
14
+ `Output path`). Each row lives in `policies/management.md` §B. The
15
15
  authoritative store is the `managed_tasks` SQLite table; the file is
16
16
  re-rendered from the table after every mutation, so do **not** PUT the
17
17
  file yourself — every legal mutation goes through `/api/managed-tasks`
@@ -54,7 +54,7 @@ dedup contract. Do not register a duplicate.
54
54
  ### Step 1 — Read current state
55
55
 
56
56
  ```bash
57
- curl -s "http://localhost:8321/api/context/rules/management" | jq -r .content
57
+ curl -s "http://localhost:8321/api/context/policies/management" | jq -r .content
58
58
  ```
59
59
 
60
60
  Extract §B (Managed tasks) and §A (Source-of-Truth bindings). §A
@@ -213,7 +213,7 @@ instead of registering twice.
213
213
  transaction rolls back and you get a 5xx — surface the body verbatim.
214
214
 
215
215
  **File render**: post-transaction the daemon re-renders
216
- `rules/management.md` from DB (locked, snapshotted into
216
+ `policies/management.md` from DB (locked, snapshotted into
217
217
  `md_file_snapshots`). You do NOT touch the file.
218
218
 
219
219
  ### Step 7 — Confirm to user
@@ -307,7 +307,7 @@ for safety.
307
307
 
308
308
  Server-side transaction: UPDATE `recurring_schedules` (if
309
309
  `recurrenceRule` changed) → UPDATE `managed_tasks` → re-render
310
- `rules/management.md` → INSERT one `agent_actions` row
310
+ `policies/management.md` → INSERT one `agent_actions` row
311
311
  (`action_type='management_task.modified', detail={changed, from, to}`).
312
312
 
313
313
  `mt_id`, `last_run_at`, `last_result`, and `consecutive_failures`
@@ -377,7 +377,7 @@ curl -sS -X DELETE http://localhost:8321/api/managed-tasks/mt_42
377
377
  Server-side transaction (atomic): snapshot the row's full state into
378
378
  `agent_actions.detail` → DELETE `managed_tasks` (cascades to
379
379
  `recurring_schedules` via FK) → cancel pending `agent_schedule`
380
- rows → re-render `rules/management.md` → INSERT one `agent_actions`
380
+ rows → re-render `policies/management.md` → INSERT one `agent_actions`
381
381
  row (`action_type='management_task.deleted'`).
382
382
 
383
383
  The pre-delete row snapshot in `agent_actions`
@@ -392,7 +392,7 @@ One DM:
392
392
  > Stopped `mt_42` Zoom check. The row is gone from the registry; ask
393
393
  > me to register a new one any time.
394
394
 
395
- `_activity/<source>.md`'s "Recently changed (90d)" section
395
+ `state/activity/<source>.md`'s "Recently changed (90d)" section
396
396
  auto-updates within ~10 s. You do NOT touch that file.
397
397
 
398
398
  ---
@@ -436,7 +436,7 @@ Idempotency-Key contract are in the errors reference below.
436
436
 
437
437
  - Does NOT hardcode connector tool names — all tool selection is
438
438
  LLM-judged.
439
- - Does NOT PUT `rules/management.md` directly — the daemon owns the
439
+ - Does NOT PUT `policies/management.md` directly — the daemon owns the
440
440
  write. The only legal write is the `/api/managed-tasks` chokepoint.
441
441
  - Does NOT INSERT `recurring_schedules` directly. POST
442
442
  `/api/managed-tasks` keeps the FK pair consistent.
@@ -451,7 +451,7 @@ Idempotency-Key contract are in the errors reference below.
451
451
  - Does NOT register a task that has no probe-passing connector.
452
452
  Probe failure is a hard stop.
453
453
  - Does NOT delete entity files produced by past runs on stop.
454
- - Does NOT regenerate `_activity/<source>.md`. The reconciler does.
454
+ - Does NOT regenerate `state/activity/<source>.md`. The reconciler does.
455
455
  - Does NOT bulk-stop without per-row confirmation. "Stop all gmail
456
456
  tasks" is a series of DM round-trips, one per row.
457
457
 
@@ -459,7 +459,7 @@ Idempotency-Key contract are in the errors reference below.
459
459
 
460
460
  | Verb + path | Used in |
461
461
  |---|---|
462
- | `GET /api/context/rules/management` | Register Step 1 (read §A + §B) |
462
+ | `GET /api/context/policies/management` | Register Step 1 (read §A + §B) |
463
463
  | `GET /api/entities?source=<app>` | Register Step 4a (output-path bias) |
464
464
  | `GET /api/managed-tasks` / `/api/managed-tasks/:id` | Locate row (Modify / Stop Step 1; Register Step 1 alternate) |
465
465
  | `POST /api/managed-tasks` | Register Step 6 (Notify tier; daemon DMs confirmation) |
@@ -18,12 +18,15 @@ Every endpoint returns the standard daemon error shape:
18
18
  ```
19
19
 
20
20
  `body.message` is intended for the user — preserve it verbatim. The
21
- daemon does NOT emit `cron_too_tight` (the recurrence schema only
22
- accepts daily / weekly / monthly, so sub-daily asks never reach the
23
- POST refuse them client-side per the recurrence-rule reference) or
24
- `cadence_partial` (the recurrence rule is one structured field, so
25
- there is no partial-cadence shape to reject). A future schema gain
26
- would surface those codes for the first time; surface verbatim.
21
+ daemon does NOT emit `cron_too_tight`. Note: the recurrence schema
22
+ DOES accept `hourly` (the engine supports `hourly`/`daily`/`weekly`/
23
+ `monthly`), so a sub-daily POST is NOT rejected server-side it
24
+ succeeds (201). The daily-or-coarser floor for managed tasks is a
25
+ **client-side** refusal only: YOU must refuse sub-daily cadences per
26
+ the recurrence-rule reference (`§ Consumer-specific refusal`) before
27
+ POSTing — do not expect the server to 400 an `hourly` rule. The daemon
28
+ also does not emit `cadence_partial` (the recurrence rule is one
29
+ structured field, so there is no partial-cadence shape to reject).
27
30
 
28
31
  ## POST /api/managed-tasks
29
32
 
@@ -76,7 +76,7 @@ Same template applies to "every 5 minutes", "every 30 minutes",
76
76
  ## Cadence string vs structured rule
77
77
 
78
78
  Always send both `cadence` (human-readable, rendered in
79
- `rules/management.md` §B) and `recurrenceRule` (structured, what the
79
+ `policies/management.md` §B) and `recurrenceRule` (structured, what the
80
80
  scheduler executes). They must agree — if they drift, the rendered
81
81
  file misleads the user about what the scheduler will actually do.
82
82