@aitne-sh/aitne 0.1.9 → 0.1.10
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.
- package/README.md +36 -6
- package/agent-assets/docs/concepts/agent-day.md +2 -2
- package/agent-assets/docs/concepts/costs-and-quotas.md +4 -3
- package/agent-assets/docs/concepts/delegated-mode.md +5 -5
- package/agent-assets/docs/concepts/memory-model.md +6 -3
- package/agent-assets/docs/concepts/safety-model.md +19 -16
- package/agent-assets/docs/concepts/skills.md +2 -2
- package/agent-assets/docs/features/integrations/browser-history.md +9 -8
- package/agent-assets/docs/features/integrations/calendar.md +4 -4
- package/agent-assets/docs/features/integrations/mail.md +3 -2
- package/agent-assets/docs/features/lifestyle/git.md +3 -3
- package/agent-assets/docs/features/lifestyle/reading.md +15 -8
- package/agent-assets/docs/features/lifestyle/travel-bookings.md +4 -3
- package/agent-assets/docs/features/memory-files/agent-journal.md +30 -12
- package/agent-assets/docs/features/memory-files/agent-lessons.md +177 -0
- package/agent-assets/docs/features/memory-files/projects.md +6 -4
- package/agent-assets/docs/features/memory-files/roadmap.md +17 -14
- package/agent-assets/docs/features/messaging/overview.md +5 -5
- package/agent-assets/docs/features/messaging/telegram.md +10 -9
- package/agent-assets/docs/features/operations/activity-and-conversations.md +5 -4
- package/agent-assets/docs/features/operations/approvals.md +6 -5
- package/agent-assets/docs/features/operations/managed-chromium.md +3 -2
- package/agent-assets/docs/features/operations/quiet-hours.md +4 -3
- package/agent-assets/docs/features/routines/custom-routines.md +11 -7
- package/agent-assets/docs/features/routines/evening-review.md +10 -2
- package/agent-assets/docs/features/routines/morning-routine.md +4 -3
- package/agent-assets/docs/features/routines/weekly-review.md +6 -0
- package/agent-assets/docs/features/wiki/commands.md +4 -4
- package/agent-assets/docs/features/wiki/cost-and-approval.md +4 -3
- package/agent-assets/docs/features/wiki/dashboard.md +7 -6
- package/agent-assets/docs/features/wiki/overview.md +3 -3
- package/agent-assets/docs/features/wiki/search.md +5 -5
- package/agent-assets/docs/features/wiki/workspaces.md +2 -2
- package/agent-assets/docs/getting-started/02-first-steps.md +5 -3
- package/agent-assets/docs/getting-started/04-first-day.md +2 -2
- package/agent-assets/docs/glossary.md +4 -4
- package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +2 -2
- package/agent-assets/docs/guides/connect-a-new-mail-account.md +4 -2
- package/agent-assets/docs/guides/explore-with-trace-and-connect.md +5 -4
- package/agent-assets/docs/guides/install-and-run.md +2 -2
- package/agent-assets/docs/guides/maintain-wiki-health.md +2 -2
- package/agent-assets/docs/guides/pause-the-agent.md +9 -5
- package/agent-assets/docs/guides/setup-wizard.md +8 -5
- package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +6 -6
- package/agent-assets/docs/reference/api.md +15 -5
- package/agent-assets/docs/reference/cli-commands.md +3 -3
- package/agent-assets/docs/reference/config.md +21 -4
- package/agent-assets/docs/reference/disallowed-tools.md +6 -4
- package/agent-assets/docs/reference/knowledge-layout.md +11 -2
- package/agent-assets/docs/reference/process-keys.md +2 -2
- package/agent-assets/docs/reference/skills.md +5 -4
- package/agent-assets/docs/troubleshooting/auth-failed.md +9 -8
- package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +16 -9
- package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +2 -2
- package/agent-assets/docs/troubleshooting/quota-exhausted.md +7 -6
- package/agent-assets/skills/agent-actions/SKILL.md +23 -39
- package/agent-assets/skills/agent-create/SKILL.md +15 -6
- package/agent-assets/skills/attach/SKILL.md +8 -27
- package/agent-assets/skills/browser-history/SKILL.md +29 -16
- package/agent-assets/skills/browser-history-respond/SKILL.md +6 -1
- package/agent-assets/skills/browser-task/SKILL.md +22 -27
- package/agent-assets/skills/context/SKILL.md +23 -32
- package/agent-assets/skills/context/curation.json +12 -12
- package/agent-assets/skills/context/references/api.md +17 -17
- package/agent-assets/skills/context/references/required-frontmatter.md +10 -9
- package/agent-assets/skills/context/references/snapshot-files.md +12 -11
- package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +5 -5
- package/agent-assets/skills/context/seeds/frontmatter-requirements.seed.json +3 -3
- package/agent-assets/skills/docs-search/SKILL.md +19 -31
- package/agent-assets/skills/external-services/SKILL.delegated.claude.md +8 -95
- package/agent-assets/skills/external-services/SKILL.delegated.codex.md +8 -94
- package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +8 -94
- package/agent-assets/skills/external-services/SKILL.native.claude.md +2 -2
- package/agent-assets/skills/external-services/references/exec-errors.md +32 -0
- package/agent-assets/skills/external-services/references/skills-crud.md +5 -5
- package/agent-assets/skills/gmail-lifestyle/SKILL.md +3 -2
- package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +4 -0
- package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +9 -0
- package/agent-assets/skills/mail/SKILL.delegated.claude.md +13 -25
- package/agent-assets/skills/mail/SKILL.delegated.codex.md +3 -2
- package/agent-assets/skills/mail/SKILL.delegated.gemini.md +3 -2
- package/agent-assets/skills/mail/SKILL.md +10 -18
- package/agent-assets/skills/mail/SKILL.native.claude.md +8 -7
- package/agent-assets/skills/mail/SKILL.native.codex.md +1 -1
- package/agent-assets/skills/mail/SKILL.native.gemini.md +1 -1
- package/agent-assets/skills/mail/references/api.md +6 -1
- package/agent-assets/skills/mail/references/examples.md +2 -1
- package/agent-assets/skills/managed-tasks/SKILL.md +44 -77
- package/agent-assets/skills/managed-tasks/references/errors.md +25 -14
- package/agent-assets/skills/managed-tasks/references/output-path.md +33 -17
- package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +6 -4
- package/agent-assets/skills/management-policy/SKILL.md +10 -11
- package/agent-assets/skills/management-policy/references/policy-workflow.md +4 -5
- package/agent-assets/skills/notify/SKILL.md +11 -13
- package/agent-assets/skills/notify/references/priority.md +28 -25
- package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
- package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
- package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
- package/agent-assets/skills/notion/SKILL.md +17 -17
- package/agent-assets/skills/notion/SKILL.native.claude.md +1 -1
- package/agent-assets/skills/notion/SKILL.native.codex.md +1 -1
- package/agent-assets/skills/notion/SKILL.native.gemini.md +1 -1
- package/agent-assets/skills/observations/SKILL.md +5 -20
- package/agent-assets/skills/observations/references/fetch-fallback.md +22 -0
- package/agent-assets/skills/project-doc/SKILL.md +9 -6
- package/agent-assets/skills/project-doc/curation.json +3 -3
- package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +2 -2
- package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
- package/agent-assets/skills/reading/SKILL.md +8 -42
- package/agent-assets/skills/reading/references/reading-taste.md +5 -5
- package/agent-assets/skills/roadmap/SKILL.md +3 -19
- package/agent-assets/skills/roadmap/references/api.md +16 -6
- package/agent-assets/skills/roadmap/references/horizon-tags.md +11 -0
- package/agent-assets/skills/roadmap/references/migration.md +8 -6
- package/agent-assets/skills/roadmap/references/retention.md +18 -0
- package/agent-assets/skills/schedule/SKILL.md +9 -26
- package/agent-assets/skills/schedule/references/importance.md +23 -0
- package/agent-assets/skills/schedule/references/recurrence-rule.md +6 -4
- package/agent-assets/skills/scheduled-managed-task/SKILL.md +34 -37
- package/agent-assets/skills/today/SKILL.md +20 -79
- package/agent-assets/skills/today/references/today-skeleton.md +66 -0
- package/agent-assets/skills/today/seeds/agent-notes-flavors.seed.json +1 -1
- package/agent-assets/skills/today/seeds/section-shape.seed.json +6 -6
- package/agent-assets/skills/user-interview/SKILL.md +15 -90
- package/agent-assets/skills/user-interview/references/op-briefing.md +1 -1
- package/agent-assets/skills/user-interview/references/op-dm-handler.md +88 -0
- package/agent-assets/skills/user-interview/references/op-morning.md +1 -1
- package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +1 -1
- package/agent-assets/skills/user-profile/SKILL.md +16 -26
- package/agent-assets/skills/user-profile/curation.json +3 -3
- package/agent-assets/skills/user-profile/references/character-preferences.md +3 -3
- package/agent-assets/skills/wiki/wiki-ask/SKILL.md +1 -1
- package/agent-assets/skills/wiki/wiki-compile/SKILL.md +5 -4
- package/agent-assets/skills/wiki/wiki-connect/SKILL.md +32 -5
- package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +6 -50
- package/agent-assets/skills/wiki/wiki-ingest/references/curl-errors.md +58 -0
- package/agent-assets/skills/wiki/wiki-lint/SKILL.md +20 -14
- package/agent-assets/skills/wiki/wiki-trace/SKILL.md +10 -5
- package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +2 -0
- package/agent-assets/task-flows/_partials/feedback-capture.md +30 -0
- package/agent-assets/task-flows/message.received.dm.md +4 -0
- package/agent-assets/task-flows/message.received.dm_first.md +4 -0
- package/agent-assets/task-flows/routine.evening_review.md +80 -0
- package/agent-assets/task-flows/routine.monthly_review.md +72 -0
- package/agent-assets/task-flows/routine.weekly_review.md +21 -0
- package/agent-assets/task-flows/wiki.trace.md +1 -1
- package/bin/aitne.mjs +45 -11
- package/package.json +4 -4
- package/scripts/commands/doctor.mjs +11 -2
- package/scripts/lib/process-identity.d.mts +46 -0
- package/scripts/lib/process-identity.mjs +193 -0
- package/scripts/lib/read-api-token.mjs +1 -1
- package/scripts/start.mjs +14 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: schedule
|
|
3
|
-
description:
|
|
3
|
+
description: Schedule future agent wake-ups, pre-composed DMs, or recurring tasks via /api/schedule. Use when registering a timed follow-up, a one-off reminder, or de-duping against pending schedules.
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Bash(curl *)
|
|
6
6
|
- Read
|
|
@@ -33,8 +33,7 @@ user but compound into duplicate DMs/notifications at fire time.
|
|
|
33
33
|
3. **Recurring check.** `GET /api/recurring-schedules?enabled=true` to
|
|
34
34
|
confirm no recurring rule/Agent already covers this cadence (e.g. a
|
|
35
35
|
daily 09:00 inbox triage, or the morning briefing). If covered, skip.
|
|
36
|
-
(
|
|
37
|
-
recurring *DMs* via `POST /api/recurring-schedules` `taskType:dm_session`.)
|
|
36
|
+
(How recurring work/DMs are created — see "Recurring" below.)
|
|
38
37
|
4. **`confirm_dedup_key` check (mandatory for `confirm:` sub-flow rows
|
|
39
38
|
only).** When scheduling a `dm_session` row with
|
|
40
39
|
`taskContext.sub_flow="confirm"`, run the dedup pre-check + shape
|
|
@@ -58,11 +57,7 @@ Y" — switch to the `management-policy` skill instead. It creates a
|
|
|
58
57
|
`policies/management-captures/<slug>.md` that captures the WHY alongside the cadence
|
|
59
58
|
(via `policies/routines/custom/<slug>.md`) so the rule survives a context
|
|
60
59
|
reset. When the cadence is all that matters and there is no intent to
|
|
61
|
-
record
|
|
62
|
-
the `agent-create` skill (`POST /api/agents`); recurring scheduled
|
|
63
|
-
**DM / briefing** → `POST /api/recurring-schedules` with
|
|
64
|
-
`taskType: "dm_session"`. (Creating a recurring `agent.task` row directly
|
|
65
|
-
on `/api/recurring-schedules` is **410 Gone** — use an Agent.)
|
|
60
|
+
record, create the recurring work/DM per the "Recurring" section below.
|
|
66
61
|
|
|
67
62
|
## DM vs Agent Task
|
|
68
63
|
|
|
@@ -77,7 +72,7 @@ on `/api/recurring-schedules` is **410 Gone** — use an Agent.)
|
|
|
77
72
|
|
|
78
73
|
## Writing a Good Prompt (for agent tasks)
|
|
79
74
|
|
|
80
|
-
> **The wake-up agent has NO memory of why it was scheduled.**
|
|
75
|
+
> **The wake-up agent has NO memory of why it was scheduled.** A `scheduled.task` session is self-contained: it receives only `state/today.md` (which carries the day's schedule and state) plus the `prompt` + `taskContext` you provide — **NOT** `identity/profile.md` or `policies/management.md` (the `scheduled.task` injection policy opts those out). Nothing else. (`description` is just an optional list label — never the agent body.)
|
|
81
76
|
|
|
82
77
|
Include all four elements in the `prompt`:
|
|
83
78
|
|
|
@@ -98,21 +93,9 @@ Structured metadata for IDs, URLs, and correlation. Put long identifiers here so
|
|
|
98
93
|
{ "scheduledBy": "morning_routine", "prUrl": "https://github.com/user/repo/pull/42" }
|
|
99
94
|
```
|
|
100
95
|
|
|
101
|
-
**`importance`
|
|
102
|
-
rows become `plans/roadmap.md` `Scheduled:` entries:
|
|
96
|
+
**`importance`** controls whether a row becomes a `plans/roadmap.md` `Scheduled:` entry. Default `transient` for `/api/schedule/dm`, `normal` for `/api/schedule`; use `strategic` only for roadmap-shaped long-prep reminders. Tier table + defaults in the reference below.
|
|
103
97
|
|
|
104
|
-
|
|
105
|
-
|---|---|---|
|
|
106
|
-
| `transient` | Never in roadmap; surfaces in today.md only on the day it fires | Default for `/api/schedule/dm`; short pings like "call mom next Tuesday" |
|
|
107
|
-
| `normal` | In roadmap only when scheduled more than 7 days out | Default for `/api/schedule`; ordinary user-facing follow-ups |
|
|
108
|
-
| `strategic` | In roadmap regardless of horizon | Long-prep commitments such as ESTA / travel / deadline reminders |
|
|
109
|
-
| `low` | Never in roadmap | Internal ticks already visible elsewhere, e.g. Agent Plan rows, recurring-schedule instances, morning retries |
|
|
110
|
-
|
|
111
|
-
For direct DMs, omit `importance` for ordinary one-off pings. If the
|
|
112
|
-
reminder is clearly tied to a long-prep commitment ("remind me in a
|
|
113
|
-
month about ESTA for the LA trip"), either write/promote the roadmap
|
|
114
|
-
item via the roadmap skill and let AAP schedule the reminder, or call
|
|
115
|
-
`/api/schedule/dm` with `"importance":"strategic"`.
|
|
98
|
+
{{> ref:importance }}
|
|
116
99
|
|
|
117
100
|
## Tier / Model selection
|
|
118
101
|
|
|
@@ -158,7 +141,7 @@ curl -s -X POST http://localhost:8321/api/schedule \
|
|
|
158
141
|
| Field | Required | Description |
|
|
159
142
|
|---|---|---|
|
|
160
143
|
| `time` | Yes | ISO 8601 with timezone offset |
|
|
161
|
-
| `taskType` | Yes | Free-form provenance label
|
|
144
|
+
| `taskType` | Yes | Free-form provenance label; use `wake` for agent wake-ups. The closed set `wake`/`dm_session`/`check`/`dm` is enforced only on `/api/schedule/batch`. The label doesn't change firing — every non-`dm`/`dm_session`/`browser_task` row runs as a generic `scheduled.task`. |
|
|
162
145
|
| `prompt` | Yes | The agent's instruction at fire time — its ONLY context (the session has no memory). Self-contained: what + why + who + expected output. See format above. Max 8000 chars (~2000 tokens); move bulk reference material into a file the agent reads at fire time rather than inlining it. |
|
|
163
146
|
| `description` | No | Optional short label shown in the schedule list (max 200 chars). NOT the agent body — that is `prompt`. Omit it and the list shows a `prompt` excerpt. |
|
|
164
147
|
| `tier` | No | `lite` / `medium` / `high`. Omit to use the dispatcher's process-key default (medium for `scheduled.task`). See "Tier / Model selection" above. Mutually exclusive with `model`. |
|
|
@@ -179,11 +162,11 @@ Fields: `time` (ISO 8601), `prompt` (the agent instruction, ≤8000 chars, non-d
|
|
|
179
162
|
```bash
|
|
180
163
|
curl -s "http://localhost:8321/api/schedule?status=pending"
|
|
181
164
|
```
|
|
182
|
-
Param `status` (default `pending,running`): comma-separated `pending`, `running`, `completed`, `failed`.
|
|
165
|
+
Param `status` (default `pending,running`): comma-separated `pending`, `running`, `completed`, `failed`, `skipped`. DELETE/cancel does not remove a row — it moves it to `status='skipped'`, so re-listing a cancelled item requires `status=skipped`.
|
|
183
166
|
Param `roadmapEligible=true`: return only rows that may become
|
|
184
167
|
roadmap `Scheduled:` entries (`transient` / `low` excluded, `normal`
|
|
185
168
|
only beyond 7 days, `strategic` included).
|
|
186
|
-
Response: `{ "items":[{ "id","scheduledFor","taskType","description","prompt","status","model","backendId","tier","taskContext","createdAt" }] }`. `prompt` / `tier` / `model` / `backendId` are `null` when no override is set. `model` is a registered id verbatim and travels with `backendId` when set — the row carries either the `(model, backendId)` pin or `tier`, never both. Legacy alias inputs (`sonnet` / `opus`) are normalized to `tier` at write time. `taskContext` is the parsed JSON (
|
|
169
|
+
Response: `{ "items":[{ "id","scheduledFor","taskType","description","prompt","status","model","backendId","tier","taskContext","createdAt" }] }`. `prompt` / `tier` / `model` / `backendId` are `null` when no override is set. `model` is a registered id verbatim and travels with `backendId` when set — the row carries either the `(model, backendId)` pin or `tier`, never both. Legacy alias inputs (`sonnet` / `opus`) are normalized to `tier` at write time. `taskContext` is the parsed JSON (always an object — `{}` when unset); filter with `jq` e.g. `'.items[] | select(.taskContext.confirm_dedup_key == "create_project:la-pm-masters")'`.
|
|
187
170
|
|
|
188
171
|
### DELETE /api/schedule/:id — Cancel a pending item
|
|
189
172
|
```bash
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: reference
|
|
3
|
+
name: importance
|
|
4
|
+
description: The `importance` tier convention for `agent_schedule` rows — which tiers surface in `plans/roadmap.md` `Scheduled:` entries, defaults per endpoint, and when to use `strategic`.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# `importance` convention
|
|
8
|
+
|
|
9
|
+
This controls whether `agent_schedule` rows become `plans/roadmap.md`
|
|
10
|
+
`Scheduled:` entries:
|
|
11
|
+
|
|
12
|
+
| Tier | Roadmap behavior | Use |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `transient` | Never in roadmap; surfaces in today.md only on the day it fires | Default for `/api/schedule/dm`; short pings like "call mom next Tuesday" |
|
|
15
|
+
| `normal` | In roadmap only when scheduled more than 7 days out | Default for `/api/schedule`; ordinary user-facing follow-ups |
|
|
16
|
+
| `strategic` | In roadmap regardless of horizon | Long-prep commitments such as ESTA / travel / deadline reminders |
|
|
17
|
+
| `low` | Never in roadmap | Internal ticks already visible elsewhere, e.g. Agent Plan rows, recurring-schedule instances, morning retries |
|
|
18
|
+
|
|
19
|
+
For direct DMs, omit `importance` for ordinary one-off pings. If the
|
|
20
|
+
reminder is clearly tied to a long-prep commitment ("remind me in a
|
|
21
|
+
month about ESTA for the LA trip"), either write/promote the roadmap
|
|
22
|
+
item via the roadmap skill and let AAP schedule the reminder, or call
|
|
23
|
+
`/api/schedule/dm` with `"importance":"strategic"`.
|
|
@@ -8,10 +8,12 @@ description: recurrenceRule grammar — hourly / daily / weekly / monthly. Engin
|
|
|
8
8
|
|
|
9
9
|
The daemon's recurrence engine accepts four frequencies: `hourly`,
|
|
10
10
|
`daily`, `weekly`, `monthly`. Each frequency requires its own set of
|
|
11
|
-
fields and rejects fields that don't apply — the daemon
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
fields and rejects fields that don't apply — the daemon rejects a
|
|
12
|
+
mismatched shape with an HTTP 400 validation error naming the
|
|
13
|
+
frequency/field conflict. The recurring-schedules endpoint (the
|
|
14
|
+
`schedule` skill) surfaces it as a `schedule.frequency_field_mismatch`
|
|
15
|
+
issue with a field path; the managed-tasks endpoint surfaces it as a
|
|
16
|
+
`managed_tasks.validation_error`. Pre-validate to save a round-trip.
|
|
15
17
|
|
|
16
18
|
Times are `HH:MM` 24-hour local; `timezone` is IANA (auto-fills from
|
|
17
19
|
daemon config when omitted, but explicit is safer so a roaming laptop
|
|
@@ -215,9 +215,12 @@ If the entity file does not previously exist, PATCH returns
|
|
|
215
215
|
`404 context.path_not_found` — today's API requires a PUT with full
|
|
216
216
|
content to create it first (the `<domain>/<type-plural>/*` write path
|
|
217
217
|
is whitelisted for both PUT and PATCH; only the file-existence rule
|
|
218
|
-
forces the PUT-first ordering).
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
forces the PUT-first ordering). There is **no API-side entity
|
|
219
|
+
validation**: the creating PUT succeeds even with incomplete
|
|
220
|
+
frontmatter, but always write a complete block — `type`, `domain`,
|
|
221
|
+
`slug`, `title`, `created`, `sources` — because the entity-mirror
|
|
222
|
+
watcher parses loosely and silently skips rows it can't read, leaving
|
|
223
|
+
the §7.6 dedup lookup blind.
|
|
221
224
|
|
|
222
225
|
### Step 5b — Update the row
|
|
223
226
|
|
|
@@ -269,19 +272,16 @@ an em-dash; the user can also set the path explicitly via the
|
|
|
269
272
|
|
|
270
273
|
### Step 6 — Three-strikes notify
|
|
271
274
|
|
|
272
|
-
The
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
The daemon emits **no** 3-strikes notify: `updateManagedTaskRunResult`
|
|
276
|
+
is a bare UPDATE and the `/run-result` route only records the run and
|
|
277
|
+
re-renders — it never calls `sendNotification`. (The similarly-named
|
|
278
|
+
`failureNotifyThreshold` param is metrics-only — a dashboard
|
|
279
|
+
"failing_now" gauge — not a daemon-side notify mechanism.)
|
|
277
280
|
|
|
278
|
-
**
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
PATCH, if the post-update `consecutive_failures` you computed is ≥ 3
|
|
283
|
-
AND was < 3 before this run (i.e. the *crossing*, not every
|
|
284
|
-
subsequent failure), call:
|
|
281
|
+
**This skill is the sole notifier** — the safety net for failing
|
|
282
|
+
managed tasks. After Step 5b's failure-path PATCH, if the post-update
|
|
283
|
+
`consecutive_failures` you computed is ≥ 3 AND was < 3 before this run
|
|
284
|
+
(i.e. the *crossing*, not every subsequent failure), call:
|
|
285
285
|
|
|
286
286
|
```bash
|
|
287
287
|
curl -sS -X POST http://localhost:8321/api/notify \
|
|
@@ -309,16 +309,15 @@ is **empty final text**: bookkeeping is invisible by design. The user
|
|
|
309
309
|
sees the change reflected in `state/activity/<source>.md` (auto-built) and
|
|
310
310
|
`<domain>/_index.md`, not in a chat ping per fire.
|
|
311
311
|
|
|
312
|
-
Exceptions
|
|
312
|
+
Exceptions (final text stays empty in all cases — these only govern
|
|
313
|
+
whether a `/api/notify` fires):
|
|
313
314
|
|
|
314
315
|
- The `notify` skill's awareness gate fired *during* this run — e.g.
|
|
315
316
|
the new datum is a meeting starting in 15 min. Then call
|
|
316
|
-
`/api/notify`
|
|
317
|
-
|
|
318
|
-
-
|
|
319
|
-
|
|
320
|
-
- `last_result='failed: ...'` at the threshold crossing — Step 6 fired
|
|
321
|
-
the `/api/notify`; final text empty.
|
|
317
|
+
`/api/notify` (a follow-up "Sent" line is duplicate noise per
|
|
318
|
+
`scheduled.task.md`).
|
|
319
|
+
- A failure: notify only on the Step 6 threshold crossing; below it,
|
|
320
|
+
the activity view records the failure and the user is not paged.
|
|
322
321
|
|
|
323
322
|
NEVER write a `## Agent Plan` row for a managed-task run — managed
|
|
324
323
|
tasks are not the same as Agent Plan rows. The Agent Plan loop close
|
|
@@ -332,13 +331,15 @@ A scheduled fire that crashes mid-run leaves the row's
|
|
|
332
331
|
`last_run_at` un-updated. The next slot picks up the same `since`
|
|
333
332
|
window and re-fetches the same data — the entity-mirror's
|
|
334
333
|
`(source_key, external_id)` lookup makes this a **merge**, not a
|
|
335
|
-
duplicate
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
334
|
+
duplicate at the file level, and Step 5a's `frontmatterMerge` is deep,
|
|
335
|
+
so re-writing the same frontmatter is idempotent. **Body
|
|
336
|
+
section-appends are NOT de-duplicated** — `mode:"append"` concatenates
|
|
337
|
+
unconditionally, so re-appending the same block on a replay WILL
|
|
338
|
+
duplicate it. Guard against that: on a re-run, `GET` the section first
|
|
339
|
+
and skip any block already present (or carry the structured fields in
|
|
340
|
+
frontmatter, which merges). For sources without a stable `external_id`,
|
|
341
|
+
use Step 4.2's date+title window — at the cost of occasional dedup
|
|
342
|
+
misses, never duplicates by construction.
|
|
342
343
|
|
|
343
344
|
## Caps
|
|
344
345
|
|
|
@@ -352,20 +353,16 @@ appended `## <App> Notes` body, not as a separate DM.
|
|
|
352
353
|
|
|
353
354
|
| HTTP | `error` | What to do |
|
|
354
355
|
|---|---|---|
|
|
355
|
-
| 400 (`/api/managed-tasks/:id/run-result`) | `invalid_id` / `validation_error` |
|
|
356
|
+
| 400 (`/api/managed-tasks/:id` or `:id/run-result`) | `invalid_id` / `validation_error` | All managed-task body validation is 400 (never 422). Re-check field names exactly match `last_run_at` / `last_result` / `consecutive_failures`; for the user-facing PATCH, drop the offending field (typically `output_path`) and retry once with the rest |
|
|
356
357
|
| 404 (`/api/context/<domain>/<type-plural>/...`) | `context.path_not_found` | The entity file does not exist yet — PATCH cannot create it. Create it first with a PUT carrying full content + complete frontmatter (§Step 5a), then the merge succeeds. (Entity-domain write paths ARE whitelisted for PUT/PATCH; the prior 403 claim is obsolete.) |
|
|
357
358
|
| 404 (`/api/managed-tasks/:id`) | `not_found` | Row was stopped mid-run. End the session quietly. |
|
|
358
|
-
| 422 (`/api/context/...`) | `validation_error` | Frontmatter incomplete or malformed; populate all required fields and retry once |
|
|
359
|
-
| 422 (`/api/managed-tasks/:id`) | `validation_error` | Path / body shape rejected; drop the offending field (typically `output_path`) and retry once with the rest |
|
|
360
359
|
| 5xx | `internal_error` | Record `last_result='failed: <body.message>'` via Step 5b's failure form and end the session |
|
|
361
360
|
|
|
362
361
|
## What this skill does NOT do
|
|
363
362
|
|
|
364
|
-
- Does NOT post `/api/notify` for routine successes
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
daemon owns the threshold notify, the agent emits one DM at the
|
|
368
|
-
3rd consecutive failure, then stays silent until success or stop.
|
|
363
|
+
- Does NOT post `/api/notify` for routine successes or failures
|
|
364
|
+
(silent by design). The sole exception is the 3-strikes crossing —
|
|
365
|
+
see Step 6.
|
|
369
366
|
- Does NOT touch the §B row's `app` or `cadence` — those are
|
|
370
367
|
user-mutable only via the `managed-tasks` skill `## Modify` flow.
|
|
371
368
|
- Does NOT INSERT `agent_schedule` rows. The cron scheduler does.
|
|
@@ -8,29 +8,7 @@ allowed-tools:
|
|
|
8
8
|
|
|
9
9
|
# today.md Guide
|
|
10
10
|
|
|
11
|
-
Output language: today.md is Policy B — see `<output_language_policy>`. The skeleton
|
|
12
|
-
|
|
13
|
-
**Skeleton (do NOT translate — exact-regex-validated on PUT):**
|
|
14
|
-
|
|
15
|
-
1. **Line 1** — `# YYYY-MM-DD (day-of-week)` H1 date line. The weekday
|
|
16
|
-
inside `(...)` is free-form and may be localized; the rest is fixed.
|
|
17
|
-
2. **Line 2** — `> Day type: …` blockquote (full pattern below). Field
|
|
18
|
-
labels (`Day type`, `Work focus`, `Study focus`, `Personal focus`),
|
|
19
|
-
values (`Weekday`/`Weekend`, `on`/`off`), pipe separators (` | `),
|
|
20
|
-
and the leading `> ` are **all English ASCII, fixed casing, fixed
|
|
21
|
-
spacing**. This is parsed by every downstream event handler.
|
|
22
|
-
3. **The six H2 headers** — `## User Schedule`, `## User Tasks`,
|
|
23
|
-
`## Agent Plan`, `## Agent Notes`, `## Agent Log`, `## Handoff` —
|
|
24
|
-
in this order.
|
|
25
|
-
|
|
26
|
-
A `PUT /api/context/state/today` whose line 1 or line 2 fails the exact regex
|
|
27
|
-
is rejected with 400 and the daemon does NOT write the file. Translating
|
|
28
|
-
any keyword on line 2 (the field labels, the `Weekday`/`Weekend` value,
|
|
29
|
-
or `on`/`off`) into the user's primary language is the most common
|
|
30
|
-
failure mode — keep it English even when the rest of today.md is being
|
|
31
|
-
written in another language. The `<output_language_policy>` skeleton
|
|
32
|
-
precedence rule already covers this; this paragraph just makes the
|
|
33
|
-
consequence explicit.
|
|
11
|
+
Output language: today.md is Policy B — see `<output_language_policy>`. The skeleton (line 1, line 2, the six H2 headers) stays English verbatim — line 1 and line 2 are exact-regex-validated on PUT; bullets and narrative under each H2 are in `<settings primary_language>`. §Line 1 and §Header line carry the exact patterns and the consequence of translating a line-2 keyword.
|
|
34
12
|
|
|
35
13
|
today.md has a **day-type header line** (second line) and **six required sections**.
|
|
36
14
|
|
|
@@ -78,52 +56,27 @@ Line 2 encodes today's filter policy (field order is fixed — downstream parser
|
|
|
78
56
|
> Day type: {Weekday|Weekend} | Work focus: {on|off} | Study focus: {on|off} | Personal focus: {on|off}
|
|
79
57
|
```
|
|
80
58
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
59
|
+
The field labels (`Day type`, `Work focus`, `Study focus`, `Personal
|
|
60
|
+
focus`), the values (`Weekday`/`Weekend`, `on`/`off`), the ` | `
|
|
61
|
+
separators, and the leading `> ` are all English ASCII, fixed casing,
|
|
62
|
+
fixed spacing — exact-regex-validated. **Translating any line-2 keyword
|
|
63
|
+
into the primary language is the most common write failure: PUT is
|
|
64
|
+
rejected 400 and the file is not written.** Keep line 2 English even
|
|
65
|
+
when the rest of today.md is in another language.
|
|
85
66
|
|
|
86
|
-
|
|
67
|
+
Derivation, focus-dimension mapping, and downstream focus-filter usage —
|
|
68
|
+
needed only when the Morning Routine writes line 2 — are in the
|
|
69
|
+
**today-skeleton** reference.
|
|
87
70
|
|
|
88
|
-
|
|
89
|
-
|---|---|
|
|
90
|
-
| `[work]` | Work focus |
|
|
91
|
-
| `[study]` | Study focus |
|
|
92
|
-
| `[personal]`, `[home]` | Personal focus |
|
|
71
|
+
## Sections and entry formats
|
|
93
72
|
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- schedule.approaching suppresses notifications for off categories
|
|
73
|
+
The per-section update matrix (when/mode/who-writes) and the
|
|
74
|
+
per-section entry-format table (User Schedule / User Tasks / Agent Plan
|
|
75
|
+
/ Agent Log row shapes, category tags, trigger tags, mandatory-HH:MM
|
|
76
|
+
fallback rules) are reference-grade detail the Morning Routine needs to
|
|
77
|
+
write the full skeleton. They live in the **today-skeleton** reference.
|
|
100
78
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| Section | When to update | Mode | Who writes |
|
|
104
|
-
|---|---|---|---|
|
|
105
|
-
| `user_schedule` | Morning from calendar; refresh after sync | PUT (Morning) / PATCH replace | Morning primary |
|
|
106
|
-
| `user_tasks` | Status changes, new tasks, hourly observations | PATCH append (new) / replace (flip) | Morning + event-driven |
|
|
107
|
-
| `agent_plan` | Morning lays out actions; hourly adds new; scheduled.task flips `[x]` | PATCH append / replace (flip) | Morning + hourly + scheduled.task |
|
|
108
|
-
| `agent_notes` | Look-ahead + day-time events | PATCH append | Morning (look-ahead) + event-driven |
|
|
109
|
-
| `agent_log` | Every non-trivial agent action | PATCH append | All events |
|
|
110
|
-
| `handoff` | Evening Review finalizes carry-overs | PATCH replace | Evening Review only |
|
|
111
|
-
|
|
112
|
-
## Entry formats
|
|
113
|
-
|
|
114
|
-
| Section | Format | Example |
|
|
115
|
-
|---|---|---|
|
|
116
|
-
| `user_schedule` | `- HH:MM[–HH:MM] <title> [category]` | `- 14:00–15:00 Design review [work]` |
|
|
117
|
-
| `user_tasks` | `- [ ] HH:MM <description> [category]` | `- [ ] 11:00 Finalize Q2 draft [work]` |
|
|
118
|
-
| `agent_plan` | `- [ ] HH:MM <action> [category] →<trigger>` | `- [ ] 08:55 DM reminder: standup [work] →DM` |
|
|
119
|
-
| `agent_notes` | see flavors below | |
|
|
120
|
-
| `agent_log` | `- HH:MM <action description>` | `- 13:50 [cal] Design review — reminder sent` |
|
|
121
|
-
|
|
122
|
-
**Category tags**: `[work]`, `[study]`, `[personal]`, `[home]` — mandatory on Agent Plan rows (not decorative).
|
|
123
|
-
|
|
124
|
-
**Trigger tags** (Agent Plan only): `→DM`, `→notify`, `→check-in`, `→wake`
|
|
125
|
-
|
|
126
|
-
**HH:MM is mandatory** on User Tasks and Agent Plan rows. If no natural time: (1) deadline → 2h before, (2) calendar-adjacent → 15 min before, (3) otherwise → working-hours midpoint.
|
|
79
|
+
{{> ref:today-skeleton }}
|
|
127
80
|
|
|
128
81
|
## User Tasks vs Agent Plan
|
|
129
82
|
|
|
@@ -173,7 +126,7 @@ reference only if your event type is in its applicability list.
|
|
|
173
126
|
## schedule.approaching → Agent Notes + Agent Log
|
|
174
127
|
|
|
175
128
|
The firing flow gates timing — `schedule.approaching` only fires at
|
|
176
|
-
`minutesUntil <= 15` (`packages/daemon/src/observers/
|
|
129
|
+
`minutesUntil <= 15` (`packages/daemon/src/observers/imminent-event-scheduler.ts:281`),
|
|
177
130
|
so the LLM never sees this format-using event with a wider lookahead.
|
|
178
131
|
No additional gate is restated here.
|
|
179
132
|
|
|
@@ -191,19 +144,7 @@ PUT today.md must contain the H1 date line, day-type header quote, and all six s
|
|
|
191
144
|
|
|
192
145
|
## today.md API
|
|
193
146
|
|
|
194
|
-
The generic GET / PUT / PATCH / DELETE
|
|
195
|
-
envelopes, body-submission shape — is documented in the **context**
|
|
196
|
-
skill `references/api.md`. today.md-specific rules layered on top:
|
|
197
|
-
|
|
198
|
-
- **Lock.** `state/today.md` is locked by the Morning Routine. Include
|
|
199
|
-
`X-Lock-Id: <today_write_lock_id>` on every PUT / PATCH when the
|
|
200
|
-
tag is in your context; other sessions get `409
|
|
201
|
-
morning_routine_lock_held` while the lock is held.
|
|
202
|
-
- **Skeleton validators.** PUT is rejected (400) if line 1 fails the
|
|
203
|
-
H1 date regex or line 2 fails the day-type quote regex (see §"Line 1
|
|
204
|
-
— which date?" and §"Header line — day-type filter" above). PUT is
|
|
205
|
-
also rejected (400) if line 1's date disagrees with the daemon's current
|
|
206
|
-
agent-day — the error echoes both values.
|
|
147
|
+
The generic GET / PUT / PATCH / DELETE shape lives in the **context** skill `references/api.md`. today.md adds only the Morning Routine lock (§Morning Routine lock) and the line-1/line-2 skeleton validators (§Line 1, §Header line) detailed above.
|
|
207
148
|
|
|
208
149
|
## Knowledge map — section shape (auto-curated)
|
|
209
150
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: reference
|
|
3
|
+
name: today-skeleton
|
|
4
|
+
description: today.md full-skeleton detail for Morning Routine — day-type derivation, focus-dimension mapping, downstream focus-filter usage, per-section update matrix, and entry-format table. Only Morning Routine writes the full skeleton; DM/hourly events do not need this.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# today.md skeleton — derivation, sections, entry formats
|
|
8
|
+
|
|
9
|
+
Only the Morning Routine writes the full skeleton from scratch. DM
|
|
10
|
+
handlers, hourly checks, and scheduled.task sessions patch individual
|
|
11
|
+
sections and do not need this detail — load it only when populating
|
|
12
|
+
line 2 or laying out the section bodies.
|
|
13
|
+
|
|
14
|
+
## Day-type derivation (Morning Routine at 04:00)
|
|
15
|
+
|
|
16
|
+
Line 2 is:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
> Day type: {Weekday|Weekend} | Work focus: {on|off} | Study focus: {on|off} | Personal focus: {on|off}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
1. Day-of-week from `<current_time>`. Weekday = Mon–Fri, Weekend = Sat–Sun (unless user/profile.md overrides).
|
|
23
|
+
2. Read `identity/profile.md` → ## Notification Preferences. Apply matching policy.
|
|
24
|
+
3. No explicit policy → default: weekday = all on, weekend = work off, study on, personal on.
|
|
25
|
+
|
|
26
|
+
Category → focus-dimension mapping:
|
|
27
|
+
|
|
28
|
+
| Category tag | Controlled by |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `[work]` | Work focus |
|
|
31
|
+
| `[study]` | Study focus |
|
|
32
|
+
| `[personal]`, `[home]` | Personal focus |
|
|
33
|
+
|
|
34
|
+
How downstream events use the filter:
|
|
35
|
+
- Morning Routine suppresses items with focus `off` at generation time
|
|
36
|
+
- scheduled.task re-checks at fire time: if focus is off, skip + close as `skipped (focus off)`
|
|
37
|
+
- DM handler skips follow-ups on rows whose focus is off
|
|
38
|
+
- Hourly check drops observations whose focus is off
|
|
39
|
+
- schedule.approaching suppresses notifications for off categories
|
|
40
|
+
|
|
41
|
+
## Sections and when to update
|
|
42
|
+
|
|
43
|
+
| Section | When to update | Mode | Who writes |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `user_schedule` | Morning from calendar; refresh after sync | PUT (Morning) / PATCH replace | Morning primary |
|
|
46
|
+
| `user_tasks` | Status changes, new tasks, hourly observations | PATCH append (new) / replace (flip) | Morning + event-driven |
|
|
47
|
+
| `agent_plan` | Morning lays out actions; hourly adds new; scheduled.task flips `[x]` | PATCH append / replace (flip) | Morning + hourly + scheduled.task |
|
|
48
|
+
| `agent_notes` | Look-ahead + day-time events | PATCH append | Morning (look-ahead) + event-driven |
|
|
49
|
+
| `agent_log` | Every non-trivial agent action | PATCH append | All events |
|
|
50
|
+
| `handoff` | Evening Review finalizes carry-overs | PATCH replace | Evening Review only |
|
|
51
|
+
|
|
52
|
+
## Entry formats
|
|
53
|
+
|
|
54
|
+
| Section | Format | Example |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `user_schedule` | `- HH:MM[–HH:MM] <title> [category]` | `- 14:00–15:00 Design review [work]` |
|
|
57
|
+
| `user_tasks` | `- [ ] HH:MM <description> [category]` | `- [ ] 11:00 Finalize Q2 draft [work]` |
|
|
58
|
+
| `agent_plan` | `- [ ] HH:MM <action> [category] →<trigger>` | `- [ ] 08:55 DM reminder: standup [work] →DM` |
|
|
59
|
+
| `agent_notes` | see flavors in the `today` skill body | |
|
|
60
|
+
| `agent_log` | `- HH:MM <action description>` | `- 13:50 [cal] Design review — reminder sent` |
|
|
61
|
+
|
|
62
|
+
**Category tags**: `[work]`, `[study]`, `[personal]`, `[home]` — mandatory on Agent Plan rows (not decorative).
|
|
63
|
+
|
|
64
|
+
**Trigger tags** (Agent Plan only): `→DM`, `→notify`, `→check-in`, `→wake`
|
|
65
|
+
|
|
66
|
+
**HH:MM is mandatory** on User Tasks and Agent Plan rows. If no natural time: (1) deadline → 2h before, (2) calendar-adjacent → 15 min before, (3) otherwise → working-hours midpoint.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"topic": "Latent profile question",
|
|
14
|
-
"rule": "Latent profile questions are open questions
|
|
14
|
+
"rule": "Latent profile questions are open questions to ask the user when context allows. The parenthetical is the state: `(latent)` while waiting, `(asked HH:MM)` once woven into a reply."
|
|
15
15
|
}
|
|
16
16
|
]
|
|
17
17
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"files": [
|
|
4
4
|
{
|
|
5
5
|
"path": "state/today.md",
|
|
6
|
-
"purpose": "today's
|
|
6
|
+
"purpose": "today's schedule, tasks, agent plan, log, and handoff to tomorrow",
|
|
7
7
|
"sections": [
|
|
8
|
-
{ "heading": "##
|
|
9
|
-
{ "heading": "##
|
|
10
|
-
{ "heading": "##
|
|
8
|
+
{ "heading": "## User Schedule", "contains": "time-blocked events for today" },
|
|
9
|
+
{ "heading": "## User Tasks", "contains": "open task entries the user will do, with status checkbox" },
|
|
10
|
+
{ "heading": "## Agent Plan", "contains": "scheduled actions Claude Code will take to help, each backed by a schedule entry" },
|
|
11
11
|
{ "heading": "## Agent Notes", "contains": "look-aheads, day-time observations, latent profile questions" },
|
|
12
|
-
{ "heading": "##
|
|
13
|
-
{ "heading": "##
|
|
12
|
+
{ "heading": "## Agent Log", "contains": "running log of every non-trivial agent action" },
|
|
13
|
+
{ "heading": "## Handoff", "contains": "context carried over to tomorrow's morning routine" }
|
|
14
14
|
]
|
|
15
15
|
}
|
|
16
16
|
]
|