From b79d57ec85b4c6a54757410f46dec31b31fa50a6 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Tue, 17 Nov 2026 18:25:45 +1100 Subject: [PATCH] docs: author runtime workflows with CEL and TaskNotes v5 --- SKILL.md | 84 ++++++------- references/examples.md | 143 ++++++---------------- references/query-dto.md | 2 +- references/workflow-schema.md | 224 +++++++++++++++++++++------------- 4 files changed, 213 insertions(+), 240 deletions(-) diff --git a/SKILL.md b/SKILL.md index 380ab97..89889a6 100644 --- a/SKILL.md +++ b/SKILL.md @@ -1,72 +1,58 @@ --- name: tasknotes-workflows -description: Use when creating, reviewing, repairing, or explaining TaskNotes Workflows Markdown automation files for Obsidian. Covers workflow frontmatter, triggers, typed steps, safe mutation defaults, TaskNotes runtime query DTOs, template references, dry-run guidance, and human-readable workflow note bodies. +description: Create, review, repair, or explain TaskNotes Workflows Markdown automation for Obsidian using mdbase Runtime 0.2 records, CEL, and the TaskNotes runtime API. --- # TaskNotes Workflows -Use this skill to author safe TaskNotes Workflows notes. A workflow is a Markdown note whose YAML frontmatter is executable configuration and whose body explains intent, assumptions, and dry-run checks. +Author Markdown notes under `TaskNotes/Workflows/` unless another folder is configured. Frontmatter is executable configuration; preserve the user's Markdown body. -## Core Workflow +Use `type: runtime_workflow`, `version: 1.0.0`, and `x-tasknotes.format_version: 2`. In an mdbase 0.3 collection, read `mdbase.yaml` and use its first `settings.explicit_type_keys` key instead of `type`; new TaskNotes v5 collections use `mdbase_type`. Omitted keys default to `type`; an explicitly empty list needs collection configuration. Do not install packs automatically. -1. Write workflow notes under `TaskNotes/Workflows/` unless the user specifies another folder. -2. Use `type: tasknotes-workflow` and `schemaVersion: 1`. -3. Prefer `enabled: false` for any workflow that mutates tasks or vault files. -4. Use `triggers`, `conditions`, `steps`, and `run`; do not invent JavaScript, shell, HTTP, or untyped action blocks. -5. Use typed TaskNotes steps for task changes and typed Obsidian steps for vault changes. -6. Use `task.query` only with the canonical TaskNotes runtime task query DTO. -7. Add `run.noOverlap: true`, a bounded `run.maxTasks`, and `run.onError`. -8. Include a short Markdown body describing what the workflow does, what it mutates, and what to check in dry run. +Keep mutating examples disabled by default. Give workflows, triggers and steps stable IDs. Triggers reference `event: { id, version }`; steps reference `action: { id, version }`. Use `for_each`, `run.limits.max_items`, `run.on_error`, and `run.concurrency` rather than legacy camelCase run fields. -## Query Rule +## CEL and events -For `task.query`, never emit compact field-map queries or internal TaskNotes `FilterQuery` objects. Use the runtime DTO: +Use an object with exactly one `$expr` key for CEL. Plain strings, including `{{...}}`, are literals. Do not generate Bases formulas or legacy templates for new workflows. + +Activation: `event` is a CloudEvent with payload under `event.data`; `workflow` and `trigger` are runtime records; `vars` are evaluated in dependency order; step outputs are `steps..output`; `item` is the current `for_each` item. Use brackets for hyphenated IDs, `today().addDays(3)` for date arithmetic, and `now()` for the captured instant. Variable dependencies require named/literal keys, not dynamic indexing. + +TaskNotes API events expose `event.data.taskId`, `taskPath`, `task`, `before`, `after`, and `changes: { field: { before, after } }` when present. Write transitions as trigger guards: ```yaml -query: - where: - all: - - field: task.status - op: ne - value: done - - field: task.due - op: lte - value: - fn: today - sort: - - field: task.due - direction: asc - limit: 25 - scope: - includeArchived: false +triggers: + - id: started + event: { id: task.status.changed, version: 1.0.0 } + if: + $expr: 'event.data.before.status == "open" && event.data.after.status == "active"' + x-tasknotes: + type: tasknotes.event ``` -Load [references/query-dto.md](references/query-dto.md) when writing or reviewing non-trivial `task.query` inputs. +Use `input.taskId: { $expr: event.data.taskId }` for supported TaskNotes v5 task reads/mutations, or `input.task` for a path. All task reads/writes use the TaskNotes runtime API. Semantic fields follow TaskNotes' configured mappings; arbitrary fields go under `patch.customFrontmatter` (`null` removes them). + +For cross-application events/actions, the installed mdbase plugin ID is `mdbase-sync` (API 1, interop profile 0.1). **Allow plugin integrations** must be enabled. The bridge is ephemeral and does not execute workflows; this plugin executes them. Exactly one compatible action provider is required. Explicit `provider` selectors are only needed for intentional provider coupling. + +## Run policy -## Step Catalog +Bound iteration with `run.limits.max_items`, use `run.limits.timeout` where appropriate, and choose `run.on_error: stop|continue`. Concurrency supports `skip|queue|replace|allow` with literal or CEL-valued groups (default workflow ID). Run idempotency defaults to `workflow.id:event.id:trigger.id`, with seven-day persistent reservations. Interop step keys append step ID and item index. Cron uses an IANA timezone or `local`; missed schedules coalesce once. -When an Obsidian runtime is available, inspect the live step catalog before relying on a step input shape: +Automatic runs should be enabled on one synced-vault device. The device-local **Run workflows on this device** setting defaults on for desktop and off for mobile; manual runs remain available. Do not promise exactly-once effects, distributed leases, durable queue recovery, or interrupted-run replay. + +## Query and catalog + +`task.query.input.query` must use the canonical TaskNotes runtime DTO, not compact field maps or internal `FilterQuery` objects. Load [references/query-dto.md](references/query-dto.md) for fields, operators, grouping and date values. + +When a live runtime is available, inspect the installed catalog: ```js -const tasknotes = app.plugins.getPlugin("tasknotes")?.api; -const workflows = tasknotes?.extensions.get("tasknotes-workflows"); -workflows?.listStepDefinitions(); +app.plugins.getPlugin("tasknotes")?.api.extensions.get("tasknotes-workflows")?.listStepDefinitions(); ``` -Use `inputFields` as the contract for YAML input and `outputFields` as the contract for references like `{{steps.query.tasks}}`. - -## References +Use `inputFields` and `outputFields` to verify action shapes. Read [references/workflow-schema.md](references/workflow-schema.md) for the complete format and execution limits, and [references/examples.md](references/examples.md) for runnable authoring patterns. -- Load [references/workflow-schema.md](references/workflow-schema.md) for frontmatter fields, trigger kinds, step categories, run policy, and template references. -- Load [references/query-dto.md](references/query-dto.md) for runtime task query fields, operators, grouping, dates, and result outputs. -- Load [references/examples.md](references/examples.md) when the user wants a concrete workflow pattern. +## Existing workflows -## Review Checklist +Format v1 and older `workflow`/`tasknotes-workflow` notes still use Bases until explicitly migrated. Use the plugin's review → backup → apply → rollback migration. Unsupported conversions must be reported and the migrated workflow disabled with an explanation. Do not relabel an old expression as CEL without converting it. CEL workflow editing opens the YAML note; the legacy visual formula builder remains for v1 files. -- YAML parses and has a stable lowercase `id`. -- Every trigger and step has a stable `id`. -- Mutating workflows start disabled unless the user explicitly wants them enabled. -- `forEach` expressions resolve to arrays and `run.maxTasks` is bounded. -- Task batches use `forEach: "{{steps.query.tasks}}"`. -- Template references are constrained to `workflow`, `trigger`, `vars`, `steps`, `item`, `today`, or `now`. -- The body tells a human how to verify the workflow before enabling it. +Include a short body explaining intent, mutations, assumptions, and dry-run checks. Verify CEL syntax, unique IDs, query DTOs, bounded iteration, and the exact installed action catalog before enabling a workflow. diff --git a/references/examples.md b/references/examples.md index 364ca62..3240fe9 100644 --- a/references/examples.md +++ b/references/examples.md @@ -1,136 +1,69 @@ -# Workflow Examples +# Workflow examples -## Manual Active Count +Use the collection's configured type key in place of `type` where required. All examples start disabled. + +## Manual active-task count ```markdown --- -type: tasknotes-workflow -schemaVersion: 1 +type: runtime_workflow id: show-active-count +version: 1.0.0 name: Show active task count enabled: false -description: Show a notice with the number of active tasks. triggers: - id: manual - type: manual -conditions: [] + event: { id: tasknotes-workflows.manual, version: 1.0.0 } + x-tasknotes: { type: manual } steps: - id: active - type: task.query + action: { id: task.query, version: 1.0.0 } input: query: - where: - field: task.status - op: eq - value: active + where: { field: task.status, op: eq, value: active } limit: 25 - id: notice - type: notice.show + action: { id: notice.show, version: 1.0.0 } input: - message: "Active tasks: {{steps.active.count}}" + message: + $expr: '"Active tasks: " + string(steps.active.output.count)' run: - mode: sequential - noOverlap: true - source: tasknotes-workflows - maxTasks: 25 - onError: stop + concurrency: { policy: skip } + limits: { max_items: 25, timeout: 30s } + on_error: stop +x-tasknotes: { format_version: 2 } --- # Show active task count -Run this manually from the command palette. Dry-run should show the notice text without mutating tasks. -``` - -## Morning Overdue Review - -```markdown ---- -type: tasknotes-workflow -schemaVersion: 1 -id: morning-overdue-review -name: Morning overdue review -enabled: false -description: Find overdue open tasks every morning and mark them high priority. -triggers: - - id: every-morning - type: cron - schedule: "0 9 * * *" - timezone: local -conditions: [] -steps: - - id: overdue - type: task.query - input: - query: - where: - all: - - field: task.due - op: lt - value: - fn: today - - field: task.status - op: notIn - value: - - done - - cancelled - sort: - - field: task.due - direction: asc - limit: 50 - scope: - includeArchived: false - - id: mark-high - type: task.patch - forEach: "{{steps.overdue.tasks}}" - input: - task: "{{item.path}}" - patch: - priority: high -run: - mode: sequential - noOverlap: true - source: tasknotes-workflows - maxTasks: 50 - onError: continue ---- - -# Morning overdue review - -Dry-run before enabling. Confirm the query selects only overdue incomplete tasks, then enable if the priority changes are desired. +Dry-run first and check the selected tasks and count before enabling. This workflow reads tasks and shows a notice. ``` -## Grouped Status Digest +## Start time when a task becomes active ```yaml -type: tasknotes-workflow -schemaVersion: 1 -id: grouped-status-digest -name: Grouped status digest +type: runtime_workflow +id: start-time +version: 1.0.0 +name: Start time when active enabled: false -description: Show grouped counts for non-archived tasks. triggers: - - id: manual - type: manual -conditions: [] + - id: active + event: { id: task.status.changed, version: 1.0.0 } + if: { $expr: 'event.data.after.status == "active"' } + x-tasknotes: { type: tasknotes.event } steps: - - id: tasks - type: task.query + - id: start + action: { id: time.start, version: 1.0.0 } input: - query: - where: - field: task.archived - op: isFalse - group: - - field: task.status - limit: 100 - - id: notice - type: notice.show - input: - message: "Found {{steps.tasks.count}} tasks across {{steps.tasks.groups.length}} status group(s)." + taskId: { $expr: event.data.taskId } run: - mode: sequential - noOverlap: true - source: tasknotes-workflows - maxTasks: 25 - onError: stop + concurrency: + group: { $expr: event.data.taskId } + policy: queue + limits: { max_items: 1, timeout: 30s } + on_error: stop +x-tasknotes: { format_version: 2 } ``` + +Body guidance: verify the configured active status and dry-run a sample event. This starts a real timer, so enable automatic execution on one device only. diff --git a/references/query-dto.md b/references/query-dto.md index fe5d627..76c485a 100644 --- a/references/query-dto.md +++ b/references/query-dto.md @@ -97,7 +97,7 @@ value: `task.query` outputs: -- `tasks`: returned task records, usually used for `forEach` +- `tasks`: returned task records, usually used for `for_each` - `count`: number of returned tasks - `total`: tasks in scope before filtering - `matched`: tasks matching `where` before `offset` and `limit` diff --git a/references/workflow-schema.md b/references/workflow-schema.md index af0a05d..6bae86b 100644 --- a/references/workflow-schema.md +++ b/references/workflow-schema.md @@ -1,117 +1,171 @@ -# Workflow Schema Reference +# Workflow schema -Workflow files are Markdown notes with YAML frontmatter. The default folder is `TaskNotes/Workflows/`; the default Base view is `TaskNotes/Views/workflows.base`. - -## Required Frontmatter +Workflow notes contain mdbase Runtime 0.2 `runtime_workflow` frontmatter and a user-owned Markdown body. New files use CEL and `x-tasknotes.format_version: 2`. The published `@callumalpass/mdbase-runtime@0.2.0` schema validates records. ```yaml -type: tasknotes-workflow -schemaVersion: 1 -id: short-lowercase-id -name: Human readable name +type: runtime_workflow +id: auto-start-time +version: 1.0.0 +name: Auto-start time tracking enabled: false -description: One sentence. -triggers: [] -conditions: [] -steps: [] +triggers: + - id: status-active + event: + id: task.status.changed + version: 1.0.0 + if: + $expr: 'event.data.after.status == "active"' + debounce: 500ms + minimum_interval: 5s + x-tasknotes: + type: tasknotes.event +steps: + - id: start-time + action: + id: time.start + version: 1.0.0 + input: + taskId: + $expr: event.data.taskId run: - mode: sequential - noOverlap: true - source: tasknotes-workflows - maxTasks: 25 - onError: stop + concurrency: + group: + $expr: event.data.taskId + policy: queue + limits: + max_items: 25 + timeout: 30s + on_error: stop +x-tasknotes: + format_version: 2 ``` -Use lowercase ids with letters, numbers, dots, underscores, and dashes. `enabled: false` is the safe default for workflows that write tasks or vault files. +Required fields are `type`, `id`, `version`, `name`, `enabled`, `triggers`, and `steps`. Trigger and step IDs must each be unique. Unknown fields require an `x-` prefix. In an mdbase 0.3 collection, new and migrated files use the first configured `settings.explicit_type_keys` key instead of `type` (for example `mdbase_type` in a new TaskNotes v5 collection). Omitted settings use `type`; an explicitly empty list requires collection configuration before writing workflows. A missing `runtime_workflow` type produces a hint to install the **mdbase runtime standard** pack; the plugin does not install it. -## Trigger Types - -```yaml -triggers: - - id: manual - type: manual +## Expressions - - id: status-active - type: tasknotes.event - event: task.status.changed - from: open - to: active - - - id: every-morning - type: cron - schedule: "0 9 * * *" - timezone: local - - - id: every-half-hour - type: interval - every: 30m - - - id: project-note-opened - type: obsidian.workspace - event: file-open - path: - glob: "Projects/**/*.md" -``` +An object with exactly one `$expr` key evaluates CEL using the mdbase CEL host. Every plain string is literal, including `{{...}}`. Evaluation errors fail execution. Conditions must produce a boolean; only `true` continues. -TaskNotes event workflows should leave `allowSelfTrigger` unset unless reacting to workflow-originated writes is intentional. +The activation contains: -## Conditions +| Name | Value | +| --- | --- | +| `event` | CloudEvent; payload is under `event.data` | +| `workflow` | Runtime workflow record | +| `trigger` | Selected runtime trigger record | +| `vars` | Variables evaluated once in dependency order | +| `steps..output` | Completed output; use brackets for IDs containing hyphens | +| `item` | Current `for_each` item; optional `as` adds an alias | -Conditions can appear at workflow level or step level: +Use `today()` and `now()` for the captured execution date/instant. `today().addDays(3)` returns a full-date string. Variable cycles fail before dispatch. Variable dependencies use named selections (`vars.name` or `vars["name"]`); dynamic variable keys are rejected. The clock uses the cron timezone when supplied, otherwise the device timezone. ```yaml -conditions: - - field: trigger.after.status - operator: is - value: active +vars: + greeting: + $expr: '"Review " + workflow.name' +steps: + - id: notify + action: { id: notice.show, version: 1.0.0 } + input: + message: + $expr: 'vars.greeting + ": " + string(steps["task-query"].output.count)' ``` -Condition operators: `is`, `isNot`, `in`, `notIn`, `exists`, `missing`, `contains`, `startsWith`, `before`, `after`, `onOrBefore`, `onOrAfter`. - -## Template References +## Events and triggers -References use constrained template expressions; arbitrary JavaScript is not evaluated. +`tasknotes.event` uses the TaskNotes runtime API, including v5's additive task identity. Its `event.data` is the plain-data TaskNotes API payload: ```text -{{workflow.id}} -{{workflow.name}} -{{trigger.after.path}} -{{trigger.path}} -{{steps.query.tasks}} -{{steps.parents.tasks[0].path}} -{{item.path}} -{{today}} -{{now}} +event, timestamp, taskId, taskPath, +task, before, after, deletedTask, +changes: { : { before, after } }, +data, context, source, correlationId, reason, rawEvent +``` + +Fields absent in the original event remain absent. `before`/`after` are semantic task snapshots, not raw frontmatter. Configured field mappings continue to work. Custom values are under `customProperties`. Write status guards as `event.data.after.status == "active"`, and transitions as `event.data.before.status == "open" && event.data.after.status == "active"`. The older `from`/`to` extension filters remain accepted. Self-generated task events are ignored unless `x-tasknotes.allowSelfTrigger: true`. + +`contract.event` is the default when no trigger extension type is given. It uses the exact incoming CloudEvent, preserving its ID, data, contract version and digest. Optional extension `source` selects `mdbaseapplication`; `path.glob`/`path.extension` filter the event subject/path. + +```yaml +triggers: + - id: completed + event: { id: tasknotes.task.completed, version: ^1.0.0 } + x-tasknotes: + type: contract.event + source: tasknotes ``` -If a string is exactly one reference, the underlying value is preserved. Embedded references are stringified. +Other supported extension types: -## Step Types +```yaml +triggers: + - id: daily + event: { id: tasknotes-workflows.schedule.cron, version: 1.0.0 } + x-tasknotes: + type: cron + schedule: "0 9 * * *" + timezone: Australia/Melbourne # IANA zone, or local + catchUp: true + - id: interval + event: { id: tasknotes-workflows.schedule.interval, version: 1.0.0 } + x-tasknotes: { type: interval, every: 30m } + - id: manual + event: { id: tasknotes-workflows.manual, version: 1.0.0 } + x-tasknotes: { type: manual } + - id: metadata + event: { id: mdbase.record.modified, version: 1.0.0 } + x-tasknotes: + type: obsidian.metadata + event: changed + path: { glob: "Projects/**/*.md" } +``` -Task read steps: `task.query`, `task.get`, `task.parents`, `task.subtasks`, `task.dependencies`, `task.blocking`, `task.relationships`. +Cron and interval state persists under the plugin directory. On restart, missed schedules coalesce into one firing (`fire_once`), not one execution per missed slot. Cron `catchUp: false` disables missed-slot firing. New schedules have no pre-installation backlog. Debounce is trailing-edge and keeps the latest event; pending debounce timers are in memory and disappear on reload. Minimum-interval admission timestamps persist. Schedule state records the fire decision before executing; a crash between that write and dispatch can lose that firing. -Task write steps: `task.create`, `task.patch`, `task.set`, `task.move`, `task.archive`, `task.unarchive`, `task.complete`, `task.uncomplete`, `task.reschedule`, `task.setDue`, `task.clearDue`, `task.setScheduled`, `task.clearScheduled`, `task.addTag`, `task.removeTag`, `task.addProject`, `task.removeProject`, `task.addContext`, `task.removeContext`, `task.addDependency`, `task.removeDependency`. +`obsidian.metadata` `changed` observes metadata cache snapshots and emits local `mdbase.record.modified@1.0.0` data: `path`, `before`, `after`, `changed_fields`, `previous_revision`, `revision`, `previous_types`, `types`. Revisions hash metadata snapshots, not full mdbase record revisions. Type lists read configured explicit type keys; they do not include automatic type matches. Other metadata events (`deleted`, `resolve`, `resolved`) retain their original payload. `obsidian.vault` (`create`, `modify`, `delete`, `rename`) and `obsidian.workspace` (`file-open`, `active-leaf-change`, `layout-change`) keep their existing local payloads under `event.data`. -Other steps: `time.start`, `time.stop`, `time.appendEntry`, `notice.show`, `obsidian.openFile`, `obsidian.createNote`, `obsidian.appendNote`, `obsidian.updateFrontmatter`, `obsidian.moveFile`, `workflow.stop`. +## Actions and iteration -Use `forEach` for batch steps: +Steps execute in document order. Local actions use the TaskNotes runtime API for task reads and writes; Obsidian actions use Obsidian APIs. `task.get` accepts `taskId` through v5 `tasks.getById`, or `task` as a path through `getByPath`/the v4-compatible `get`. Mutations accept `taskId`, resolve its current path immediately before calling the path-based TaskNotes mutation, and otherwise accept `task` paths. `time.appendEntry.entry` uses TaskNotes `TimeEntry` fields (`startTime`, optional `endTime` and `description`). ```yaml steps: - - id: query - type: task.query - input: - query: - where: - field: task.status - op: eq - value: active - - - id: mark-high - type: task.patch - forEach: "{{steps.query.tasks}}" + - id: patch-each + action: { id: task.patch, version: 1.0.0 } + for_each: + items: + $expr: steps.query.output.tasks + if: + $expr: 'item.status != "done"' input: - task: "{{item.path}}" + taskId: + $expr: item.id patch: - priority: high + customFrontmatter: + reviewed: true ``` + +`for_each.items` must be a list and may not exceed `run.limits.max_items` (default 25). Items execute in order and step output is an ordered list. A step `if` is evaluated for each item. Arbitrary task properties belong in `patch.customFrontmatter`; `null` removes a custom property. TaskNotes semantic fields such as `projects` and `scheduled` use TaskNotes' configured field mappings. + +Unknown local action IDs, or steps with an explicit `provider`, use the mdbase bridge. The executor resolves exactly one provider, pins its contract and declaration, and rechecks that binding before dispatch. Contract requirements accept SemVer ranges. Enabling **Allow plugin integrations** in **mdbase** (`mdbase-sync`, API v1/profile 0.1) is required. The bridge applies its own authorization and schema validation. + +## Run policy and history + +- `run.idempotency.key` is a literal or CEL expression producing a string. Default: `workflow.id + ":" + event.id + ":" + trigger.id`. Reservations persist for seven days before any actions; clearing history does not clear them. Dry runs do not reserve keys. +- `run.concurrency.group` is a literal or expression producing a string; default is the workflow ID. `skip` records a cancelled admission, `queue` waits in order, `replace` requests cooperative cancellation and waits for active work to settle, and `allow` runs concurrently. Queue positions and active execution are device-memory state. +- `run.limits.timeout` prevents new dispatch after the deadline. An in-flight local action must settle; interop receives deadline/cancellation requests. Completed effects are retained. +- `run.on_error: stop|continue` controls later dispatch. A run with any failed action remains failed even with `continue`. + +The history UI remains available. New details store `runtime_run` with `queued|running|waiting|succeeded|failed|cancelled|indeterminate` status and nested `runtime_action_attempt` records with `admitted|dispatching|succeeded|rejected|failed|cancelled|indeterminate`. UI summaries live in `x-tasknotes`; old history is read-only compatible. Intent and outcome snapshots are written before/after dispatch under the configured run-log directory. Local bindings identify this plugin's local handlers. The ephemeral bridge supplies invocation/attempt identities only with its outcome, so intent identities are provisional until then. Unknown interop outcomes become `indeterminate` and are not replayed. + +This client executor does not claim full durable Runtime 0.2 conformance: it has no distributed lease, transactional event journal, durable queue/checkpoint recovery, or exactly-once external effects. Reservations suppress repeat events across restarts, but interrupted work is not resumed. On startup, incomplete queued history becomes cancelled and in-flight history becomes indeterminate. Run this plugin on one device per vault for automatic automation. + +**Run workflows on this device** is stored through Obsidian local storage, defaults on for desktop and off for mobile, and gates all automatic trigger kinds. Manual runs remain available. The setting is excluded from synced `data.json`. + +## Migration and editing + +Format v1 and older `workflow`/`tasknotes-workflow` records continue to use the original Bases evaluator until migrated. One startup notice offers the migration command. CEL records open their YAML note for editing; the existing visual formula builder remains available for v1 workflows. + +**Migrate workflow files to the mdbase runtime format** analyzes without modifying files, displays diffs and conversion warnings, then checks source hashes, backs up originals under `.obsidian/tasknotes-workflows/workflow-migrations/`, applies only reviewed frontmatter, and rolls back earlier writes on failure. Markdown bodies are preserved. + +Migration converts clear Bases expressions, `{{reference}}` strings, scalar string interpolation, and `x-tasknotes.conditions` into CEL. Unsupported functions, ambiguous field `contains` semantics, and unsupported date arithmetic disable that workflow and add `x-tasknotes.comment` explaining required manual work. Original source remains in the backup and review diff. Migration never runs automatically. Editing v1 files retains v1 evaluation until the migration is applied.