@aitne-sh/aitne 0.1.9 → 0.1.11

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 (218) hide show
  1. package/README.md +41 -11
  2. package/agent-assets/agent-profiles/background-task.md +53 -0
  3. package/agent-assets/agent-profiles/conversational.md +1 -0
  4. package/agent-assets/agent-profiles/routine-fetch-window.md +14 -75
  5. package/agent-assets/agent-profiles/routine.md +1 -1
  6. package/agent-assets/agents/{hourly-check → activity-scan}/agent.md +22 -17
  7. package/agent-assets/agents/monthly-review/agent.md +6 -5
  8. package/agent-assets/docs/concepts/agent-day.md +6 -7
  9. package/agent-assets/docs/concepts/auth-health.md +23 -20
  10. package/agent-assets/docs/concepts/backends-and-tiers.md +13 -9
  11. package/agent-assets/docs/concepts/costs-and-quotas.md +14 -12
  12. package/agent-assets/docs/concepts/delegated-mode.md +18 -17
  13. package/agent-assets/docs/concepts/memory-model.md +16 -9
  14. package/agent-assets/docs/concepts/observations.md +24 -20
  15. package/agent-assets/docs/concepts/process-keys.md +10 -9
  16. package/agent-assets/docs/concepts/routines.md +34 -31
  17. package/agent-assets/docs/concepts/safety-and-execution.md +11 -7
  18. package/agent-assets/docs/concepts/safety-model.md +39 -25
  19. package/agent-assets/docs/concepts/skills.md +12 -10
  20. package/agent-assets/docs/features/integrations/browser-history.md +23 -18
  21. package/agent-assets/docs/features/integrations/calendar.md +28 -17
  22. package/agent-assets/docs/features/integrations/git.md +13 -11
  23. package/agent-assets/docs/features/integrations/github.md +22 -14
  24. package/agent-assets/docs/features/integrations/mail.md +25 -22
  25. package/agent-assets/docs/features/integrations/notion.md +35 -11
  26. package/agent-assets/docs/features/integrations/obsidian.md +8 -8
  27. package/agent-assets/docs/features/lifestyle/git.md +27 -23
  28. package/agent-assets/docs/features/lifestyle/reading.md +20 -11
  29. package/agent-assets/docs/features/lifestyle/receipts.md +11 -10
  30. package/agent-assets/docs/features/lifestyle/travel-bookings.md +4 -3
  31. package/agent-assets/docs/features/memory-files/agent-journal.md +53 -26
  32. package/agent-assets/docs/features/memory-files/agent-lessons.md +178 -0
  33. package/agent-assets/docs/features/memory-files/projects.md +11 -8
  34. package/agent-assets/docs/features/memory-files/roadmap.md +17 -14
  35. package/agent-assets/docs/features/memory-files/schedule.md +6 -3
  36. package/agent-assets/docs/features/memory-files/today.md +10 -7
  37. package/agent-assets/docs/features/memory-files/user-profile.md +14 -9
  38. package/agent-assets/docs/features/messaging/bang-commands.md +21 -6
  39. package/agent-assets/docs/features/messaging/overview.md +17 -14
  40. package/agent-assets/docs/features/messaging/telegram.md +10 -9
  41. package/agent-assets/docs/features/operations/activity-and-conversations.md +6 -5
  42. package/agent-assets/docs/features/operations/approvals.md +6 -5
  43. package/agent-assets/docs/features/operations/browser-tasks.md +184 -0
  44. package/agent-assets/docs/features/operations/cost-tracking.md +11 -1
  45. package/agent-assets/docs/features/operations/managed-chromium.md +4 -2
  46. package/agent-assets/docs/features/operations/notifications.md +11 -1
  47. package/agent-assets/docs/features/operations/quiet-hours.md +41 -11
  48. package/agent-assets/docs/features/operations/schedule-approaching.md +2 -2
  49. package/agent-assets/docs/features/routines/activity-scan.md +220 -0
  50. package/agent-assets/docs/features/routines/custom-routines.md +82 -134
  51. package/agent-assets/docs/features/routines/evening-review.md +23 -13
  52. package/agent-assets/docs/features/routines/morning-routine.md +7 -5
  53. package/agent-assets/docs/features/routines/weekly-review.md +24 -3
  54. package/agent-assets/docs/features/wiki/commands.md +4 -4
  55. package/agent-assets/docs/features/wiki/cost-and-approval.md +4 -3
  56. package/agent-assets/docs/features/wiki/dashboard.md +7 -6
  57. package/agent-assets/docs/features/wiki/overview.md +3 -3
  58. package/agent-assets/docs/features/wiki/search.md +5 -5
  59. package/agent-assets/docs/features/wiki/workspaces.md +2 -2
  60. package/agent-assets/docs/getting-started/01-what-is-this.md +3 -3
  61. package/agent-assets/docs/getting-started/02-first-steps.md +5 -3
  62. package/agent-assets/docs/getting-started/04-first-day.md +27 -30
  63. package/agent-assets/docs/glossary.md +8 -8
  64. package/agent-assets/docs/guides/add-a-custom-routine.md +122 -68
  65. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +2 -2
  66. package/agent-assets/docs/guides/connect-a-new-mail-account.md +4 -2
  67. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +5 -4
  68. package/agent-assets/docs/guides/install-and-run.md +2 -2
  69. package/agent-assets/docs/guides/maintain-wiki-health.md +2 -2
  70. package/agent-assets/docs/guides/pause-the-agent.md +27 -21
  71. package/agent-assets/docs/guides/reinstall-cleanly.md +2 -0
  72. package/agent-assets/docs/guides/setup-wizard.md +12 -6
  73. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +6 -6
  74. package/agent-assets/docs/reference/api.md +26 -5
  75. package/agent-assets/docs/reference/cli-commands.md +3 -3
  76. package/agent-assets/docs/reference/config.md +51 -24
  77. package/agent-assets/docs/reference/disallowed-tools.md +6 -4
  78. package/agent-assets/docs/reference/keyboard-shortcuts.md +2 -2
  79. package/agent-assets/docs/reference/knowledge-layout.md +25 -12
  80. package/agent-assets/docs/reference/process-keys.md +9 -9
  81. package/agent-assets/docs/reference/skills.md +10 -6
  82. package/agent-assets/docs/troubleshooting/auth-failed.md +9 -8
  83. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +16 -9
  84. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +2 -2
  85. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +32 -16
  86. package/agent-assets/docs/troubleshooting/observation-not-detected.md +26 -24
  87. package/agent-assets/docs/troubleshooting/quota-exhausted.md +7 -6
  88. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +3 -3
  89. package/agent-assets/skills/agent-actions/SKILL.md +23 -39
  90. package/agent-assets/skills/agent-create/SKILL.md +26 -6
  91. package/agent-assets/skills/attach/SKILL.md +8 -27
  92. package/agent-assets/skills/background-task/SKILL.md +184 -0
  93. package/agent-assets/skills/background-task-reply/SKILL.md +100 -0
  94. package/agent-assets/skills/browser-history/SKILL.md +60 -29
  95. package/agent-assets/skills/browser-history-respond/SKILL.md +6 -1
  96. package/agent-assets/skills/browser-task/SKILL.md +33 -31
  97. package/agent-assets/skills/context/SKILL.md +26 -34
  98. package/agent-assets/skills/context/curation.json +12 -12
  99. package/agent-assets/skills/context/references/api.md +22 -20
  100. package/agent-assets/skills/context/references/required-frontmatter.md +10 -9
  101. package/agent-assets/skills/context/references/snapshot-files.md +16 -15
  102. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +5 -5
  103. package/agent-assets/skills/context/seeds/frontmatter-requirements.seed.json +3 -3
  104. package/agent-assets/skills/docs-search/SKILL.md +19 -31
  105. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +8 -95
  106. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +8 -94
  107. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +8 -94
  108. package/agent-assets/skills/external-services/SKILL.native.claude.md +15 -9
  109. package/agent-assets/skills/external-services/SKILL.native.codex.md +11 -5
  110. package/agent-assets/skills/external-services/SKILL.native.gemini.md +11 -5
  111. package/agent-assets/skills/external-services/references/exec-errors.md +32 -0
  112. package/agent-assets/skills/external-services/references/skills-crud.md +5 -5
  113. package/agent-assets/skills/gmail-lifestyle/SKILL.md +3 -2
  114. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +4 -0
  115. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +9 -0
  116. package/agent-assets/skills/mail/SKILL.delegated.claude.md +13 -25
  117. package/agent-assets/skills/mail/SKILL.delegated.codex.md +3 -2
  118. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +3 -2
  119. package/agent-assets/skills/mail/SKILL.md +12 -20
  120. package/agent-assets/skills/mail/SKILL.native.claude.md +24 -16
  121. package/agent-assets/skills/mail/SKILL.native.codex.md +16 -9
  122. package/agent-assets/skills/mail/SKILL.native.gemini.md +12 -6
  123. package/agent-assets/skills/mail/references/api.md +6 -1
  124. package/agent-assets/skills/mail/references/examples.md +2 -1
  125. package/agent-assets/skills/managed-tasks/SKILL.md +44 -77
  126. package/agent-assets/skills/managed-tasks/references/errors.md +25 -14
  127. package/agent-assets/skills/managed-tasks/references/output-path.md +33 -17
  128. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +26 -16
  129. package/agent-assets/skills/management-policy/SKILL.md +36 -28
  130. package/agent-assets/skills/management-policy/curation.json +1 -1
  131. package/agent-assets/skills/management-policy/references/policy-workflow.md +30 -18
  132. package/agent-assets/skills/notify/SKILL.md +16 -13
  133. package/agent-assets/skills/notify/references/priority.md +42 -26
  134. package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
  135. package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
  136. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
  137. package/agent-assets/skills/notion/SKILL.md +18 -18
  138. package/agent-assets/skills/notion/SKILL.native.claude.md +4 -4
  139. package/agent-assets/skills/notion/SKILL.native.codex.md +3 -3
  140. package/agent-assets/skills/notion/SKILL.native.gemini.md +3 -3
  141. package/agent-assets/skills/observations/SKILL.md +9 -24
  142. package/agent-assets/skills/observations/references/fetch-fallback.md +22 -0
  143. package/agent-assets/skills/project-doc/SKILL.md +9 -6
  144. package/agent-assets/skills/project-doc/curation.json +3 -3
  145. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +2 -2
  146. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
  147. package/agent-assets/skills/reading/SKILL.md +8 -42
  148. package/agent-assets/skills/reading/references/reading-taste.md +5 -5
  149. package/agent-assets/skills/roadmap/SKILL.md +3 -19
  150. package/agent-assets/skills/roadmap/references/api.md +23 -8
  151. package/agent-assets/skills/roadmap/references/horizon-tags.md +11 -0
  152. package/agent-assets/skills/roadmap/references/migration.md +8 -6
  153. package/agent-assets/skills/roadmap/references/retention.md +18 -0
  154. package/agent-assets/skills/schedule/SKILL.md +20 -28
  155. package/agent-assets/skills/schedule/references/importance.md +23 -0
  156. package/agent-assets/skills/schedule/references/recurrence-rule.md +26 -16
  157. package/agent-assets/skills/scheduled-managed-task/SKILL.md +46 -46
  158. package/agent-assets/skills/today/SKILL.md +38 -81
  159. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +9 -4
  160. package/agent-assets/skills/today/references/agent-plan-revision.md +28 -0
  161. package/agent-assets/skills/today/references/today-skeleton.md +66 -0
  162. package/agent-assets/skills/today/seeds/agent-notes-flavors.seed.json +1 -1
  163. package/agent-assets/skills/today/seeds/section-shape.seed.json +6 -6
  164. package/agent-assets/skills/user-interview/SKILL.md +15 -90
  165. package/agent-assets/skills/user-interview/references/op-briefing.md +1 -1
  166. package/agent-assets/skills/user-interview/references/op-dm-handler.md +88 -0
  167. package/agent-assets/skills/user-interview/references/op-morning.md +2 -2
  168. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +1 -1
  169. package/agent-assets/skills/user-profile/SKILL.md +16 -26
  170. package/agent-assets/skills/user-profile/curation.json +3 -3
  171. package/agent-assets/skills/user-profile/references/character-preferences.md +3 -3
  172. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +1 -1
  173. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +5 -4
  174. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +32 -5
  175. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +6 -50
  176. package/agent-assets/skills/wiki/wiki-ingest/references/curl-errors.md +58 -0
  177. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +20 -14
  178. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +10 -5
  179. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +2 -0
  180. package/agent-assets/system-prompts/routine-research-cluster-update.md +71 -0
  181. package/agent-assets/task-flows/_partials/feedback-capture.md +30 -0
  182. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +47 -21
  183. package/agent-assets/task-flows/background_task.md +81 -0
  184. package/agent-assets/task-flows/git.local_ahead.stale.md +1 -1
  185. package/agent-assets/task-flows/git.push.detected.md +1 -1
  186. package/agent-assets/task-flows/git.tag.created.md +1 -1
  187. package/agent-assets/task-flows/github.assigned.md +1 -1
  188. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  189. package/agent-assets/task-flows/github.security_alert.md +1 -1
  190. package/agent-assets/task-flows/message.received.dm.md +11 -3
  191. package/agent-assets/task-flows/message.received.dm_first.md +8 -2
  192. package/agent-assets/task-flows/{routine.hourly_check.md → routine.activity_scan.md} +31 -23
  193. package/agent-assets/task-flows/{routine.hourly_check.triage.md → routine.activity_scan.triage.md} +3 -3
  194. package/agent-assets/task-flows/routine.evening_review.md +80 -0
  195. package/agent-assets/task-flows/routine.monthly_review.md +81 -8
  196. package/agent-assets/task-flows/routine.research_cluster_update.md +33 -19
  197. package/agent-assets/task-flows/routine.roadmap_refresh.md +2 -2
  198. package/agent-assets/task-flows/routine.today_refresh.md +1 -1
  199. package/agent-assets/task-flows/routine.weekly_review.md +124 -4
  200. package/agent-assets/task-flows/schedule.approaching.md +2 -2
  201. package/agent-assets/task-flows/scheduled.dm.md +77 -1
  202. package/agent-assets/task-flows/scheduled.task.md +7 -1
  203. package/agent-assets/task-flows/wiki.trace.md +1 -1
  204. package/agent-assets/templates/_manifest.json +2 -2
  205. package/agent-assets/templates/knowledge/dossiers/_index.md +1 -1
  206. package/agent-assets/templates/knowledge/dossiers/{hourly.md → activity-scan.md} +1 -1
  207. package/agent-assets/templates/policies/journal-format.md +1 -1
  208. package/agent-assets/templates/policies/mcp.md +1 -1
  209. package/agent-assets/templates/policies/routines/_index.md +1 -1
  210. package/agent-assets/templates/policies/routines/{hourly.md → activity-scan.md} +5 -5
  211. package/bin/aitne.mjs +45 -11
  212. package/package.json +6 -5
  213. package/scripts/commands/doctor.mjs +11 -2
  214. package/scripts/lib/process-identity.d.mts +46 -0
  215. package/scripts/lib/process-identity.mjs +193 -0
  216. package/scripts/lib/read-api-token.mjs +1 -1
  217. package/scripts/start.mjs +14 -4
  218. package/agent-assets/docs/features/routines/hourly-check.md +0 -205
@@ -13,7 +13,11 @@ agent to keep applying. It is NOT a one-off task.
13
13
 
14
14
  Each policy lives at `policies/management-captures/<slug>.md` and may link to:
15
15
 
16
- - `policies/routines/custom/<slug>.md` the cron-driven execution rulebook
16
+ - a recurring **Agent** (`policies/agents/<slug>/agent.md`, created via
17
+ `POST /api/agents`) — the cron-driven execution vehicle, recorded in the
18
+ policy frontmatter under `linked.routine` (legacy field name; the value is
19
+ the Agent slug — legacy `policies/routines/custom/` files no longer fire
20
+ and were auto-converted to same-slug Agents at upgrade).
17
21
  - `knowledge/dossiers/<topic>.md` — where the policy's accumulating data lands
18
22
 
19
23
  A readable summary of every policy lives at `policies/management-captures/_index.md`,
@@ -69,8 +73,8 @@ curl -s "http://localhost:8321/api/context/list/policies"
69
73
  ```
70
74
 
71
75
  If the listing and `_index.md` rows disagree, **prefer the listing**
72
- and trust the next reconcile pass to refresh the index. Do **not**
73
- hand-PATCH `_index.md` to fix the drift that just creates more churn.
76
+ and trust the next reconcile pass to refresh the index (`_index.md` is
77
+ reconciler-ownedsee body intro).
74
78
 
75
79
  ### Step 2 — Detect similarity
76
80
 
@@ -79,7 +83,7 @@ Heuristics to compare against existing policies:
79
83
  | Signal | Likely interpretation |
80
84
  |---|---|
81
85
  | Same `linked.dossier` topic | Likely a duplicate or extension of an existing policy |
82
- | Same cron expression on the linked routine | Likely a duplicate cadence |
86
+ | Same cron expression on the linked Agent | Likely a duplicate cadence |
83
87
  | Slug stem matches an existing slug ("finance", "inbox", …) | Likely related |
84
88
 
85
89
  If a candidate matches, ask the user **before** creating:
@@ -110,12 +114,13 @@ saved. The slug must:
110
114
  - equal the filename stem
111
115
  - match `^[a-z0-9][a-z0-9-]*[a-z0-9]$` (or a single `[a-z0-9]`)
112
116
  - be ≤ 64 chars
113
- - equal the linked `policies/routines/custom/<slug>.md` slug (if any) — keep
114
- them aligned in v1
117
+ - equal the linked Agent's slug (if any) — keep them aligned in v1; Agent
118
+ slugs must start with a lowercase letter, so avoid digit-first slugs when
119
+ scheduling.
115
120
 
116
121
  ### Step 5 — Wire the dependencies (strict order; on failure, roll back in reverse)
117
122
 
118
- 5.1 dossier → 5.2 routine → 5.3 policy file → 5.4 (auto-index — no
123
+ 5.1 dossier → 5.2 Agent → 5.3 policy file → 5.4 (auto-index — no
119
124
  manual step). Each step gates the next. The full curl recipes,
120
125
  when-to-skip rules, and rollback table are in the policy-workflow
121
126
  reference below.
@@ -152,13 +157,12 @@ the active policies first and ask.
152
157
  `updated: <today>`, PUT back. (The frontmatter parser is
153
158
  line-scalar so a per-field PATCH section call would not target a
154
159
  frontmatter key — always GET-merge-PUT for frontmatter edits.)
155
- 2. If `linked.routine` is set: GET `policies/routines/custom/<slug>`, flip
156
- frontmatter `enabled: false`, PUT back. The reload hook flips the
157
- cron job off automatically.
160
+ 2. If `linked.routine` is set: `PATCH /api/agents/<slug>` with
161
+ `{"enabled": false}`. (User Agents stop without a warning ack; the
162
+ scheduler's fire-time gate takes effect immediately.)
158
163
 
159
- The policy-index reconciler picks the change up on the FS event and
160
- re-renders both `_index.md` and the management.md section within
161
- ~10 s. Do not PATCH them manually.
164
+ The policy-index reconciler re-renders both `_index.md` and the
165
+ management.md section within ~10 s (reconciler-owned — see body intro).
162
166
 
163
167
  If step 2 fails after step 1 succeeded, **attempt to roll back step 1**
164
168
  (`status` back to `active`). If the rollback itself fails, report the
@@ -166,20 +170,22 @@ partial state to the user and tell them which file is in which state.
166
170
 
167
171
  ### Resume
168
172
 
169
- Same fan-out, with `status: active` and `enabled: true`.
173
+ Same fan-out, with `status: active` and `PATCH /api/agents/<slug>`
174
+ `{"enabled": true}`.
170
175
 
171
176
  ### Remove
172
177
 
173
178
  1. GET the policy file, flip frontmatter `status: removed` and
174
179
  `updated: <today>`, PUT back.
175
- 2. If `linked.routine` is set: `DELETE
176
- /api/context/policies/routines/custom/<slug>` (whitelisted).
180
+ 2. If `linked.routine` is set: `DELETE /api/agents/<slug>` with body
181
+ `{"keep_history": false}` — removes the Agent definition, schedule,
182
+ and execution history (the default `true` would merely disable it).
177
183
 
178
184
  The reconciler moves the row from `## Active` to `## Removed`
179
185
  automatically — the `removedAt` cell is read from the policy file's
180
186
  `updated` field, which step 1 set to today.
181
187
 
182
- The policy file itself is **kept for history** — DELETE on `rules/*`
188
+ The policy file itself is **kept for history** — DELETE on `policies/management-captures/*`
183
189
  is intentionally not whitelisted (see MANAGEMENT-POLICY-CAPTURE-PLAN
184
190
  §5.1).
185
191
 
@@ -187,11 +193,10 @@ is intentionally not whitelisted (see MANAGEMENT-POLICY-CAPTURE-PLAN
187
193
 
188
194
  - Does NOT touch `policies/management.md` body sections (Source of Truth
189
195
  table, Notification Rules, Schedule, etc.). Those are wizard-only.
190
- - Does NOT create rows in the `recurring_schedules` DB table defer to
191
- `policies/routines/custom/` for cron, which gives the user a visible MD file
192
- to edit.
193
- - Does NOT migrate existing custom routines into policy files
194
- retroactively. Migration is a separate one-time operation.
196
+ - Does NOT write `recurring_schedules` rows or `agent.md` files by hand
197
+ scheduling goes through `POST /api/agents`, which materialises the
198
+ user-visible `policies/agents/<slug>/agent.md` and pairs the schedule row
199
+ itself.
195
200
 
196
201
  ## Cross-skill pointers
197
202
 
@@ -217,17 +222,20 @@ skill targets these paths:
217
222
  - `GET /api/context/list/policies` (Step 1 authoritative — entries prefixed `management-captures/`)
218
223
  - `GET /api/context/policies/management-captures/<slug>` (read before pause / resume / remove)
219
224
  - `PUT /api/context/knowledge/dossiers/<topic>` (Step 5.1 — if new)
220
- - `PUT /api/context/policies/routines/custom/<slug>` (Step 5.2 — if scheduling)
225
+ - `POST /api/agents` (Step 5.2 — if scheduling; the only non-context call)
221
226
  - `PUT /api/context/policies/management-captures/<slug>` (Step 5.3)
222
227
  - `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)
228
+ - `PATCH /api/agents/<slug>` (pause / resume — `{"enabled": …}`)
229
+ - `DELETE /api/agents/<slug>` (remove only — `{"keep_history": false}`)
224
230
 
225
231
  `policies/management-captures/_index.md` and the `## Active Policies` section in
226
- `policies/management.md` are written by the daemon's policy-index
227
- reconciler — they are NOT in the agent's write surface for this skill.
232
+ `policies/management.md` are reconciler-owned (see body intro) — NOT in
233
+ the agent's write surface for this skill.
228
234
 
229
- Frontmatter validation enforces `kind: policy`, `owner: agent`, and
230
- the slug rules in Step 4. Malformed writes return 422 with the failing
235
+ Frontmatter validation enforces `type: rule`, `kind: policy`,
236
+ `owner: agent`, `status`, `created_at` (YYYY-MM-DD), `origin`,
237
+ `updated` (ISO), an H1, and the slug rules in Step 4 — see 5.3 for the
238
+ full required set. Malformed writes return 422 with the failing
231
239
  field — surface that text to the user verbatim rather than retrying
232
240
  blindly.
233
241
 
@@ -6,7 +6,7 @@
6
6
  "kind": "knowledge_layout",
7
7
  "anchor": "<!-- CURATION:knowledge_layout id=\"policy-file-shape\" -->",
8
8
  "human_label": "Policy file section shape",
9
- "description": "Required sections inside rules/policies/<slug>.md and what each holds",
9
+ "description": "Required sections inside policies/management-captures/<slug>.md and what each holds",
10
10
  "scope_paths": ["policies/management-captures/*.md"]
11
11
  }
12
12
  ]
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  kind: reference
3
3
  name: policy-workflow
4
- description: Step 5.1-5.4 dossier → routine → policy file → auto-index fan-out, with curl recipes and rollback ordering.
4
+ description: Step 5.1-5.4 dossier → Agent → policy file → auto-index fan-out, with curl recipes and rollback ordering.
5
5
  ---
6
6
 
7
- # Step 5 fan-out — dossier → routine → policy file → auto-index
7
+ # Step 5 fan-out — dossier → Agent → policy file → auto-index
8
8
 
9
9
  Each step gates the next. If step `N` fails, attempt to roll back
10
10
  steps `N-1 … 1` in reverse before reporting the failure to the user.
@@ -24,18 +24,29 @@ Skip this step if `linked.dossier` is not set or the dossier already
24
24
  exists. The dossier file is data only — no harm if it ends up empty
25
25
  when the rest of the flow rolls back.
26
26
 
27
- ## 5.2 Create the custom routine (only if scheduling is needed)
27
+ ## 5.2 Create the execution Agent (only if scheduling is needed)
28
28
 
29
29
  ```bash
30
- curl -sS -X PUT http://localhost:8321/api/context/policies/routines/custom/<slug> \
30
+ curl -sS -X POST http://localhost:8321/api/agents \
31
31
  -H 'Content-Type: application/json' \
32
32
  -d @- <<'JSON'
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"}
33
+ {
34
+ "slug": "<slug>",
35
+ "name": "<Title>",
36
+ "description": "Scheduled enforcement for management policy <slug>.",
37
+ "schedule": { "kind": "cron", "expression": "0 7 * * *" },
38
+ "backend": { "tier": "lite" },
39
+ "limits": { "max_budget_usd": 0.20 },
40
+ "prompt": "# <Title>\n\n## Checks\n\n### <step label>\n**Action**: …"
41
+ }
34
42
  JSON
35
43
  ```
36
44
 
37
- The route's `onCustomRoutinesChanged` hook reloads the cron scheduler
38
- automatically no separate reload call.
45
+ The `prompt` becomes the Agent's task body verbatim; the daemon writes the
46
+ user-visible `policies/agents/<slug>/agent.md` and pairs the recurring
47
+ schedule row itself — no reload call needed. A 409 means the slug is taken
48
+ (go back to Step 2 dedup); a 400 `invalid_definition` returns the failing
49
+ field — surface it verbatim.
39
50
 
40
51
  Skip this step if the policy is purely passive (e.g. "from now on,
41
52
  when the user mentions X in DM, also …"). The policy file itself
@@ -68,19 +79,20 @@ needed.
68
79
 
69
80
  The `linked:` mapping uses nested YAML for human / LLM readability.
70
81
  The daemon's frontmatter validator does not parse nested keys, but
71
- the **policy-index reconciler does** — it reads `linked.routine` to
72
- populate the cadence column (by reading the routine file's `cron`
73
- field) and `linked.dossier` for the dossier column. Keep the slug
74
- values aligned with the filenames you created at 5.1 / 5.2 so the
75
- reconciler can resolve them.
82
+ the **policy-index reconciler does** — it reads `linked.routine` (the
83
+ Agent slug; field name kept from the pre-Agents era) to populate the
84
+ cadence column (from `policies/agents/<slug>/agent.md`'s schedule
85
+ expression, falling back to a legacy `policies/routines/custom/<slug>.md`
86
+ cron) and `linked.dossier` for the dossier column. Keep the slug values
87
+ aligned with what you created at 5.1 / 5.2 so the reconciler can
88
+ resolve them.
76
89
 
77
90
  ## 5.4 _(no manual step required)_
78
91
 
79
- `policies/management-captures/_index.md` is auto-maintained by the daemon's
80
- policy-index reconciler it re-renders within ~10 s of step 5.3's
81
- write. Same for the `## Active Policies` section in
82
- `policies/management.md`. **Do not PATCH or PUT either path manually**;
83
- doing so just races the reconciler and creates snapshot churn.
92
+ Both `policies/management-captures/_index.md` and the `## Active Policies`
93
+ section in `policies/management.md` are reconciler-owned and re-render
94
+ within ~10 s of step 5.3's write (see SKILL.md body intro no manual
95
+ PATCH/PUT).
84
96
 
85
97
  If you need to confirm the index is up to date before replying to the
86
98
  user, GET `policies/management-captures/_index` after a short wait. The
@@ -92,7 +104,7 @@ reconciler's last-run record lives at `runtime_state` key
92
104
  | Failure at | Roll back |
93
105
  |---|---|
94
106
  | 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 |
107
+ | 5.3 | undo 5.2 `DELETE /api/agents/<slug>` with `{"keep_history": false}` (you created it new at 5.2, so a hard delete leaves no orphan), then undo 5.1 as above |
96
108
  | 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
109
 
98
110
  If any rollback step itself fails, **report the partial state to the
@@ -41,10 +41,9 @@ language-agnostic** — it applies whatever language the agent uses
41
41
  with the user.
42
42
 
43
43
  Anti-examples (non-exhaustive — the positive rule above is
44
- load-bearing, not this list): "Good morning!", "Evening check-in —",
45
- "Morning briefing —", "Summary:", "Done.", "Sent.", "OK.", "Here's
46
- your day:", "Heads-up —", "FYI:", "Quick update:". Near-synonyms of
47
- these in any language also fail the positive rule.
44
+ load-bearing, not this list): "Good morning!", "Summary:", "Done.",
45
+ "Heads-up —". Near-synonyms of these in any language also fail the
46
+ positive rule.
48
47
 
49
48
  ### No internal mechanism names
50
49
 
@@ -56,9 +55,8 @@ user-visible text. Those go in Agent Log only.
56
55
 
57
56
  ### No filler timing commentary
58
57
 
59
- Forbidden — "Just a heads-up", "Still about N hours to go", "About N
60
- hours left", "FYI". If timing matters, the deadline / event time
61
- itself carries it.
58
+ Forbidden — "Just a heads-up", "About N hours left", "FYI". If timing
59
+ matters, the deadline / event time itself carries it.
62
60
 
63
61
  ### No table-of-contents readback
64
62
 
@@ -96,16 +94,17 @@ Notify when **all three** are true: (1) **actionable** or requires awareness, (2
96
94
  - **A pending Agent Plan row / scheduled DM is already set to fire
97
95
  for this item within the next 2 hours** — let the planned channel
98
96
  deliver; don't pre-empt it.
99
- - **Quiet hours (default 22:00-08:00, configurable)** unless `critical` schedule for after instead
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
97
+ - **Already delivered this item** — a `200 {status:"sent"}` is proof of delivery and a `200 {status:"deferred_quiet_hours"}` is proof of queued delivery, so do NOT re-post on either. Self-throttle via `<today>` `## Agent Log` before firing and log the skip rather than re-posting. (The endpoint defers during quiet hours and enforces rate caps, but dedup and noise control are still your job.)
101
98
  - **Routine file changes** or **agent internal state** — use Agent Log instead
102
99
  - **When in doubt — prefer silence**
103
100
 
104
101
  ## Priority
105
102
 
106
103
  **Default to `normal`.** Reserve `high` for 8h-delay-matters. Reserve
107
- `critical` for 3am-matters. Full per-level table, examples, and
108
- rate-limit caps are in the priority reference below.
104
+ `critical` for 3am-matters it is the only level that bypasses the
105
+ endpoint's quiet-hours deferral and rate caps; everything else is
106
+ metadata recorded in the notification log. Full per-level table,
107
+ examples, and delivery semantics are in the priority reference below.
109
108
 
110
109
  {{> ref:priority }}
111
110
 
@@ -120,5 +119,9 @@ curl -s -X POST http://localhost:8321/api/notify \
120
119
  -H 'Content-Type: application/json' \
121
120
  -d '{"message": "Design review starts in 15 minutes.", "priority": "normal"}'
122
121
  ```
123
- Fields: `message` (required, markdown), `priority` (optional: critical/high/normal/low), `platform` (optional, override target).
124
- Response: `{ "status": "sent", "notificationId": "..." }`. Risk tier: `Autonomous` — the agent decides when to notify; recorded in `notification_log` for the on-demand retrospective.
122
+ Fields: `message` (required, markdown), `priority` (optional: critical/high/normal/low), `platform` (optional, override target) OR `platforms` (optional, array of targets) — mutually exclusive, not both.
123
+ Responses:
124
+ - `200 { "status": "sent", "notificationId": "...", "dispatchId": "..." }` = delivered to ≥1 channel; a total delivery failure returns HTTP 500 (not a silent 200-drop).
125
+ - `200 { "status": "deferred_quiet_hours", "scheduleId": "...", "deliverAfter": "..." }` = fired inside the user's quiet hours; queued as a scheduled DM that delivers at `deliverAfter`. Treat as delivered — do NOT re-post. If the item will be stale by then, `DELETE /api/schedule/{scheduleId}` and use `<today>` `## Agent Log` instead.
126
+ - `429 { "status": "rate_limited", "retryAfter": "..." }` = hourly/daily notification cap spent; nothing sent or queued. Don't retry-loop — drop to `<today>` `## Agent Log`.
127
+ `critical` priority bypasses both gates and always sends immediately. Risk tier: `Autonomous` — the agent decides when to notify; recorded in `notification_log` for the on-demand retrospective.
@@ -1,20 +1,25 @@
1
1
  ---
2
2
  kind: reference
3
3
  name: priority
4
- description: Notification priority levels — critical / high / normal / low — with quiet-hours behavior and per-level examples.
4
+ description: Notification priority levels — critical / high / normal / low — as metadata you set, with per-level usage examples.
5
5
  ---
6
6
 
7
7
  # Notification priority levels
8
8
 
9
- Pick the lowest priority that still preserves the user-visible
10
- behavior the message needs. **Default to `normal`.**
11
-
12
- | Priority | Quiet-hours | Use for |
13
- |---|---|---|
14
- | `critical` | Bypasses | Security alerts (credential leak, account lockout), data-loss risk (about to overwrite without backup, irreversible deletion in flight), system errors blocking the user from working. Wakes the user. |
15
- | `high` | Bypasses | Hard deadlines firing in the next 8 hours, urgent inbound messages from people the user has flagged as priority, "meeting starting now". User wants to see this even during quiet hours but not at 3 am. |
16
- | `normal` | Respects (dropped during quiet hours) | Regular reminders (`15 min until standup`), digest-style summaries, single-recipient FYIs the user opted into. **Default.** |
17
- | `low` | Respects (dropped during quiet hours) | Background updates, observational FYIs the user did not explicitly ask for, optional context. Often better as an Agent Log entry instead of a notification at all. |
9
+ `priority` is a metadata field you set on the `/api/notify` call. It
10
+ travels into `notification_log` and helps the user (and the
11
+ retrospective) gauge how urgent each message was. One level changes
12
+ delivery: `critical` bypasses the endpoint's quiet-hours deferral and
13
+ rate caps and always sends immediately — every other level rides the
14
+ gates below. Pick the lowest priority that still honestly describes
15
+ the message. **Default to `normal`.**
16
+
17
+ | Priority | Use for |
18
+ |---|---|
19
+ | `critical` | Security alerts (credential leak, account lockout), data-loss risk (about to overwrite without backup, irreversible deletion in flight), system errors blocking the user from working. The "wake the user at 3 am" tier. |
20
+ | `high` | Hard deadlines firing in the next 8 hours, urgent inbound messages from people the user has flagged as priority, "meeting starting now". Important but not 3 am. |
21
+ | `normal` | Regular reminders (`15 min until standup`), digest-style summaries, single-recipient FYIs the user opted into. **Default.** |
22
+ | `low` | Background updates, observational FYIs the user did not explicitly ask for, optional context. Often better as an Agent Log entry instead of a notification at all. |
18
23
 
19
24
  ## Examples by level
20
25
 
@@ -47,19 +52,30 @@ If the next morning would still be soon enough, it is not `high`.
47
52
  If the user did not opt in to receiving this category of update, do not
48
53
  send `low`. Drop it to an Agent Log entry instead.
49
54
 
50
- ## Rate-limit defaults
51
-
52
- 3/hour, 12/day across all priorities (`critical` bypasses both caps).
53
- The agent CANNOT query `notification_log` directly (Approve-tier). Use
54
- `<today>` `## Agent Log` as the authoritative dedup source (look for
55
- `notify sent` / `DM sent` lines).
56
-
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.
55
+ ## Delivery semantics
56
+
57
+ `/api/notify` returns one of three envelopes:
58
+
59
+ - `200 {status:"sent", ...}` delivered to at least one channel right
60
+ now. `"sent"` IS proof of delivery — do NOT re-post the same item on
61
+ a 200. A total delivery failure THROWS and surfaces as HTTP 500 (not
62
+ a silent 200-drop).
63
+ - `200 {status:"deferred_quiet_hours", scheduleId, deliverAfter}`
64
+ you fired inside the user's quiet hours; the message was queued as a
65
+ scheduled DM that delivers at `deliverAfter` (quiet-hours end).
66
+ Nothing was lost; do NOT re-post. Repeat calls from the same origin
67
+ coalesce into the same pending DM. If the item will be stale by
68
+ `deliverAfter`, `DELETE /api/schedule/{scheduleId}` and record it in
69
+ `<today>` `## Agent Log` instead. `critical` priority bypasses this
70
+ gate entirely.
71
+ - `429 {status:"rate_limited", retryAfter}` — the proactive hourly or
72
+ daily notification cap is spent. Nothing was sent or queued. Do not
73
+ retry-loop; drop the item to `<today>` `## Agent Log` (or escalate
74
+ honestly to `critical` if it truly cannot wait).
75
+
76
+ Noise control is still YOUR job, not the endpoint's. The agent CANNOT
77
+ query `notification_log` directly (Approve-tier), so use `<today>`
78
+ `## Agent Log` as the authoritative dedup source (look for `notify
79
+ sent` / `DM sent` lines) and self-throttle before firing. Don't
80
+ re-send the same item at the same level; if the situation has
81
+ genuinely escalated, raise the priority metadata to reflect that.
@@ -29,7 +29,7 @@ delegated mode:
29
29
 
30
30
  ```bash
31
31
  curl -s http://localhost:8321/api/notion/databases
32
- # → { databases: { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
32
+ # → { databases: [ { "label": "<label>", "id": "<uuid>" }, ... ] }
33
33
  ```
34
34
 
35
35
  Resolve label → UUID here BEFORE the `/exec` call so your `task`
@@ -26,7 +26,7 @@ delegated mode:
26
26
 
27
27
  ```bash
28
28
  curl -sS http://localhost:8321/api/notion/databases
29
- # → { databases: { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
29
+ # → { databases: [ { "label": "<label>", "id": "<uuid>" }, ... ] }
30
30
  ```
31
31
 
32
32
  Resolve label → UUID here BEFORE the `/exec` call so your `task`
@@ -26,7 +26,7 @@ delegated mode:
26
26
 
27
27
  ```bash
28
28
  curl -sS http://localhost:8321/api/notion/databases
29
- # → { databases: { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
29
+ # → { databases: [ { "label": "<label>", "id": "<uuid>" }, ... ] }
30
30
  ```
31
31
 
32
32
  Resolve label → UUID here BEFORE the `/exec` call so your `task`
@@ -14,11 +14,10 @@ Base URL: `http://localhost:8321`. All calls via `curl -s` with
14
14
  `Content-Type: application/json` on POST/PATCH/PUT. URL-encode spaces in paths.
15
15
 
16
16
  Full CRUD over Notion pages plus workspace search. Reads and writes are
17
- Autonomous; writes are still serialized per-process and pre-marked
18
- `notion:<pageId>` for write attribution. The daemon does not DM the
19
- owner before a write — the user's `deniedTools` setting is the gate.
20
- Call `POST /api/notify` yourself when you judge the user would
21
- want immediate awareness.
17
+ Autonomous; writes are serialized per-process and pre-marked
18
+ `notion:<pageId>` for attribution. The daemon does not DM the owner before
19
+ a write — the `deniedTools` setting is the gate. Call `POST /api/notify`
20
+ yourself when you judge the user would want immediate awareness.
22
21
 
23
22
  **Parent shorthand**: `parent` accepts a label string (`"tasks"`),
24
23
  `{ database: "tasks" }`, `{ data_source_id }`, `{ database_id }`, or
@@ -34,8 +33,10 @@ curl -s "http://localhost:8321/api/notion/search?q=launch+plan" # se
34
33
  curl -s http://localhost:8321/api/notion/pages/abc123... # retrieve page
35
34
  ```
36
35
 
37
- Pagination: `page_size` (1–100, default 20) + `start_cursor` from response's
38
- `next_cursor`. Check `has_more` to know if more pages exist.
36
+ Query also accepts `sorts` (URL-encoded JSON) alongside `filter`, and
37
+ `in_trash=true` to query trashed rows. Pagination: `page_size` (1–100,
38
+ default 20) + `start_cursor` from response's `next_cursor`; check
39
+ `has_more` to know if more pages exist.
39
40
 
40
41
  ## Create a page (write — Autonomous)
41
42
 
@@ -55,12 +56,13 @@ curl -s -X PATCH http://localhost:8321/api/notion/pages/abc123... \
55
56
 
56
57
  ## Update page content (write — Autonomous)
57
58
 
58
- **Concurrency warning**: Notion v5 has no etags. If another client edits
59
- between GET and PATCH, `oldStr` may fail silently. For high-risk edits,
60
- prefer `mode=replace_all`.
59
+ **Concurrency**: Notion v5 has no etags if another client edits between
60
+ GET and PATCH, `oldStr` may fail silently; for high-risk edits prefer
61
+ `mode=replace_all`.
61
62
 
62
63
  Modes: `append`, `replace_all`, `update` (find-and-replace via
63
- `updates: [{oldStr, newStr}]`).
64
+ `updates: [{oldStr, newStr}]`), `replace_range` (in-place swap of a line
65
+ range; requires `content` + `contentRange`, optional `allowDeleting`).
64
66
 
65
67
  ```bash
66
68
  curl -s -X PATCH http://localhost:8321/api/notion/pages/abc123.../content \
@@ -78,11 +80,9 @@ Moves to trash (~30 days). Restore via `PATCH` with `{ "in_trash": false }`.
78
80
 
79
81
  ## When NOT to act
80
82
 
81
- - During `routine.hourly_check` this skill is **read-only** — no creates,
83
+ - During `routine.activity_scan` this skill is **read-only** — no creates,
82
84
  property updates, content patches, or archives.
83
- - No bulk operations without user confirmation. If you're about to update
84
- 3+ pages at once, stop and ask the user first.
85
- - Writes are Autonomous; the daemon does not DM the owner. Single ops
86
- only the agent's own judgment is the gate, not the daemon. The
87
- message-discipline contract for any `POST /api/notify` call you issue
88
- here is in the `notify` skill — do not invent ad-hoc phrasing rules.
85
+ - No bulk operations without user confirmation: about to touch 3+ pages,
86
+ stop and ask first. Single ops only.
87
+ - For any `POST /api/notify` call you issue, the message-discipline
88
+ contract lives in the `notify` skill do not invent ad-hoc phrasing.
@@ -42,7 +42,7 @@ connector arguments carry concrete UUIDs.
42
42
 
43
43
  ```bash
44
44
  curl -s http://localhost:8321/api/notion/databases
45
- # → { "databases": { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
45
+ # → { "databases": [ { "label": "<label>", "id": "<uuid>" }, ... ] }
46
46
  ```
47
47
 
48
48
  This route is **not** part of the absolute deny set and is intentionally
@@ -135,9 +135,9 @@ instead).
135
135
 
136
136
  ## 5. Decision rules
137
137
 
138
- - **Hourly check is read-only.** Native variants inherit the
138
+ - **Activity scan is read-only.** Native variants inherit the
139
139
  "External services are read-only this hour" constraint from
140
- `routine.hourly_check.native.claude.md`. No creates, property
140
+ `routine.activity_scan.native.claude.md`. No creates, property
141
141
  updates, content patches, or archives during the hourly pass.
142
142
  - **Mass-update — ask first.** A page-creation call can take up to
143
143
  100 pages in one shot, and move / update batches can touch many
@@ -151,7 +151,7 @@ instead).
151
151
 
152
152
  ## 6. Persisting observations from native fetches
153
153
 
154
- When `routine.hourly_check.native.claude.md`'s Step 0c fetches recent
154
+ When `routine.activity_scan.native.claude.md`'s Step 0c fetches recent
155
155
  Notion edits, POST each materialised page to `/api/observations`. The
156
156
  daemon computes `contentHash` server-side via
157
157
  `@aitne/shared/observations-hash.ts`; pass `payload` verbatim.
@@ -36,7 +36,7 @@ the `<integration-routing-table>` block in the session preamble.
36
36
 
37
37
  ```bash
38
38
  curl -s http://localhost:8321/api/notion/databases
39
- # → { "databases": { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
39
+ # → { "databases": [ { "label": "<label>", "id": "<uuid>" }, ... ] }
40
40
  ```
41
41
 
42
42
  Resolve label → UUID before any Notion call so the connector arguments
@@ -110,8 +110,8 @@ Surface the choice to the user before issuing.
110
110
 
111
111
  ## 4. Decision rules
112
112
 
113
- - **Hourly check is read-only** — inherits the constraint from
114
- `routine.hourly_check.native.codex.md`.
113
+ - **Activity scan is read-only** — inherits the constraint from
114
+ `routine.activity_scan.native.codex.md`.
115
115
  - **Mass-update — ask first.** Batch page-creation can take up to 100
116
116
  pages; page-move and page-update batches can touch many rows.
117
117
  Summarise and confirm anything >~10 pages.
@@ -46,7 +46,7 @@ the `<integration-routing-table>` block in the session preamble.
46
46
 
47
47
  ```bash
48
48
  curl -s http://localhost:8321/api/notion/databases
49
- # → { "databases": { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
49
+ # → { "databases": [ { "label": "<label>", "id": "<uuid>" }, ... ] }
50
50
  ```
51
51
 
52
52
  Resolve label → UUID before any Notion call.
@@ -114,8 +114,8 @@ Surface the choice to the user.
114
114
 
115
115
  ## 4. Decision rules
116
116
 
117
- - **Hourly check is read-only** — inherits the constraint from
118
- `routine.hourly_check.native.gemini.md`.
117
+ - **Activity scan is read-only** — inherits the constraint from
118
+ `routine.activity_scan.native.gemini.md`.
119
119
  - **Mass-update — ask first.** Batch page-creation can take up to 100
120
120
  pages; batches >~10 pages warrant explicit confirmation.
121
121
  - **Schema admin — Approve-tier.** Database / view / data-source