diff --git a/CHANGELOG.md b/CHANGELOG.md index babaf1d..dc051bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,16 @@ # Changelog -## Unreleased +## 0.3.0-rc.22 + +### Added + +- `LEGACY_APP_SETTINGS_FOLDER`, `legacyAppSettingsPath(app)` and `resolveAppSettingsPath(app, { currentExists, legacyExists })`, exported from the root and `@tasknotes/model/settings`. The resolver chooses the new path when it exists, otherwise the legacy path when it exists, otherwise the new path for creation. Clients read and save the selected record without moving it. ### Changed +- **New-collection layout:** `APP_SETTINGS_FOLDER` and `appSettingsPath` / `TASKNOTES_SETTINGS_PATH` now use `_mdbase/settings`. New collection resources explicitly default to `_mdbase/types` and `_mdbase/contracts`; schema files follow the parent of the contracts folder. Existing collections keep their configured folders (or the unchanged mdbase spec defaults `_types` / `_contracts`); clients must use the path resolver rather than creating a second settings record. +- Settings resources implement `mdbase.app-settings` 2.0.0 and `tasknotes.settings` 1.1.0 with settings type version 2. The record's `settings_version` remains 1. `resolveAppSettings` accepts the path read as its third argument, and `resolveTaskNotesAppSettings` accepts `options.path`, so read-only messages identify the actual record. +- Vendor the `tasknotes.task` 0.3.0-rc.21 pack from mdbase-contracts PR #23 (`c50a6d08d975b02891fdb8f9c9f08011179efd51`). Generated packs now include the published settings resources, retained contracts/schemas and seed upgrade history, with configured folder targets and byte-identical support documents. `provides` includes the settings contracts as well as `tasknotes.task`. Refresh the vendored artifact with `MDBASE_CONTRACTS_ROOT= npm run sync:mdbase-pack` after building that checkout's `dist/`. - Documented `taskSchemaDocument`, `bindingSchemaDocument`, `paths.taskSchema` and `paths.bindingSchema` as tasknotes.task type-pack resources. A host must not write them as plain files: mdbase setup refuses a plain file at a path the pack manages unless it holds the exact resource bytes (tasknotes-app #436). The contract already carries both schemas inline. ## 0.3.0-rc.21 diff --git a/README.md b/README.md index 5463bbf..8e72feb 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,31 @@ The package exports both the root module and focused subpath modules: | `@tasknotes/model/frontmatter` | Markdown task document parse/serialize helpers | | `@tasknotes/model/mdbase` | Canonical mdbase v0.3 config, contract, schema, and implementing-type generation; reading a type or implementation into a configuration; `patchTaskNotesMdbaseTypeSettings`, the one editor for a task type's settings, statuses, priorities and custom fields | | `@tasknotes/model/starter` | The published TaskNotes starter type (`tasknotes.task` pack seed), pinned to mdbase-contracts by the test suite. Use it, not the plugin defaults in `defaults`, to build starter types | +| `@tasknotes/model/settings` | Shared app-settings paths, resolution, patches, conflicts and published TaskNotes settings resources | | `@tasknotes/model/conformance` | tasknotes-spec conformance operation dispatcher | +## Collection metadata and settings + +New collection resources explicitly use `_mdbase/types`, `_mdbase/contracts` and +`_mdbase/settings/.md`. Schema resources are placed under the parent of the +contracts folder. Existing collections keep their configured layout; when reading +an existing config, the mdbase spec defaults remain `_types` and `_contracts`. +Pass those existing folders to the resource builders instead of adopting the +new-collection defaults. + +Check `appSettingsPath(app)` and `legacyAppSettingsPath(app)`, then call +`resolveAppSettingsPath(app, { currentExists, legacyExists })`. Read and save the +returned path: new wins when both exist, legacy wins when only it exists, and +creation uses the new path. Never move a record or fall back merely because its +contents are invalid. Pass the selected path to `resolveAppSettings` as its third +argument, or to `resolveTaskNotesAppSettings` as `options.path`, so messages name +the record actually read. + +`buildTaskNotesMdbaseTypePack` carries the published rc.21 settings resources, +retained contracts and schemas, and seed upgrade history. Its `provides` includes +`tasknotes.settings` 1.1.0 and `mdbase.app-settings` 2.0.0 alongside `tasknotes.task`. +The settings type is version 2; the record's `settings_version` remains 1. + ## Calendar contract ```ts diff --git a/package-lock.json b/package-lock.json index 579820b..33e5a72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tasknotes/model", - "version": "0.3.0-rc.21", + "version": "0.3.0-rc.22", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tasknotes/model", - "version": "0.3.0-rc.21", + "version": "0.3.0-rc.22", "license": "MIT", "dependencies": { "rrule": "^2.8.1", diff --git a/package.json b/package.json index f96438a..0a8b72c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tasknotes/model", - "version": "0.3.0-rc.21", + "version": "0.3.0-rc.22", "description": "TaskNotes model, mapping, validation, recurrence, and operation-planning reference implementation.", "license": "MIT", "type": "module", @@ -138,6 +138,7 @@ "scripts": { "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"", "sync:mdbase-contract": "node scripts/sync-tasknotes-contract.mjs", + "sync:mdbase-pack": "node scripts/sync-tasknotes-pack.mjs", "build": "npm run clean && node scripts/build.mjs && tsc -p tsconfig.types.json", "prepack": "npm run build", "typecheck": "tsc -p tsconfig.types.json --emitDeclarationOnly false --noEmit", diff --git a/scripts/smoke-package.mjs b/scripts/smoke-package.mjs index 0063788..8ec4f08 100644 --- a/scripts/smoke-package.mjs +++ b/scripts/smoke-package.mjs @@ -46,6 +46,9 @@ try { ); for (const [filename, content] of [ + ["settings.mjs", 'import { resolveAppSettingsPath as rootResolve } from "@tasknotes/model";\nimport { resolveAppSettingsPath, legacyAppSettingsPath, LEGACY_APP_SETTINGS_FOLDER } from "@tasknotes/model/settings";\nif (rootResolve("dev.tasknotes", { currentExists: false, legacyExists: true }) !== legacyAppSettingsPath("dev.tasknotes")) throw new Error("Root settings export failed");\nif (LEGACY_APP_SETTINGS_FOLDER !== "_settings" || resolveAppSettingsPath("dev.tasknotes", { currentExists: false, legacyExists: false }) !== "_mdbase/settings/dev.tasknotes.md") throw new Error("ESM settings exports failed");\n'], + ["settings.cjs", 'const { resolveAppSettingsPath } = require("@tasknotes/model/settings");\nconst { legacyAppSettingsPath } = require("@tasknotes/model");\nif (resolveAppSettingsPath("dev.tasknotes", { currentExists: false, legacyExists: true }) !== legacyAppSettingsPath("dev.tasknotes")) throw new Error("CJS settings exports failed");\n'], + ["settings.ts", 'import { resolveAppSettingsPath } from "@tasknotes/model";\nimport { appSettingsPath, legacyAppSettingsPath, resolveTaskNotesAppSettings } from "@tasknotes/model/settings";\nconst path: string = resolveAppSettingsPath("dev.tasknotes", { currentExists: true, legacyExists: true });\nresolveTaskNotesAppSettings(undefined, { path });\nvoid appSettingsPath;\nvoid legacyAppSettingsPath;\n'], ["calendar.mjs", 'import { buildCalendarEntries, createCalendarEntryIndex, planCalendarEdit } from "@tasknotes/model/calendar";\nimport { calendarFixtures } from "@tasknotes/model/calendar/fixtures";\nif (!planCalendarEdit || !createCalendarEntryIndex || buildCalendarEntries(calendarFixtures[0].input).length !== calendarFixtures[0].expectedEntries.length) throw new Error("ESM calendar exports failed");\n'], ["calendar.cjs", 'const { buildCalendarEntries } = require("@tasknotes/model/calendar");\nconst { calendarFixtures } = require("@tasknotes/model/calendar/fixtures");\nconst raw = [...require("@tasknotes/model/fixtures/calendar/scenarios.json"), ...require("@tasknotes/model/fixtures/calendar/moved-occurrences.json")];\nif (raw.length !== calendarFixtures.length || buildCalendarEntries(raw[0].input).length !== raw[0].expectedEntries.length) throw new Error("CJS calendar exports failed");\n'], ["calendar.ts", 'import { buildCalendarEntries, type CalendarEntry } from "@tasknotes/model/calendar";\nimport { calendarFixtures, type CalendarFixture } from "@tasknotes/model/calendar/fixtures";\nconst fixture: CalendarFixture = calendarFixtures[0];\nconst entries: CalendarEntry[] = buildCalendarEntries(fixture.input);\nvoid entries;\n'], @@ -61,11 +64,16 @@ try { execFileSync(process.execPath, ["attachments.cjs"], { cwd: tempRoot, stdio: "inherit" }); execFileSync(process.execPath, ["calendar.mjs"], { cwd: tempRoot, stdio: "inherit" }); execFileSync(process.execPath, ["calendar.cjs"], { cwd: tempRoot, stdio: "inherit" }); + execFileSync(process.execPath, ["settings.mjs"], { cwd: tempRoot, stdio: "inherit" }); + execFileSync(process.execPath, ["settings.cjs"], { cwd: tempRoot, stdio: "inherit" }); for (const resolution of ["nodenext", "node"]) { execFileSync(process.execPath, [resolve(packageRoot, "node_modules/typescript/bin/tsc"), "--noEmit", "--strict", "--target", "es2020", "--module", resolution === "nodenext" ? "nodenext" : "esnext", "--moduleResolution", resolution, "calendar.ts"], { cwd: tempRoot, stdio: "inherit" }); } + execFileSync(process.execPath, [resolve(packageRoot, "node_modules/typescript/bin/tsc"), + "--noEmit", "--strict", "--target", "es2020", "--module", "esnext", + "--moduleResolution", "node", "settings.ts"], { cwd: tempRoot, stdio: "inherit" }); } finally { if (tarball) rmSync(tarball, { force: true }); rmSync(tempRoot, { recursive: true, force: true }); diff --git a/scripts/sync-tasknotes-pack.mjs b/scripts/sync-tasknotes-pack.mjs new file mode 100644 index 0000000..52d918b --- /dev/null +++ b/scripts/sync-tasknotes-pack.mjs @@ -0,0 +1,18 @@ +import { mkdir, readFile, writeFile } from "node:fs/promises"; +import path from "node:path"; + +const contractsRoot = + process.env.MDBASE_CONTRACTS_ROOT ?? + path.resolve(import.meta.dirname, "../../mdbase-contracts"); +const generatedPath = path.resolve( + import.meta.dirname, + "../src/generated/tasknotes-type-pack.json" +); +const source = await readFile( + path.join(contractsRoot, "dist/packs/tasknotes.task/0.3.0-rc.21.json"), + "utf8" +); + +await mkdir(path.dirname(generatedPath), { recursive: true }); +await writeFile(generatedPath, source); +console.log(`Synced TaskNotes type pack from ${contractsRoot}`); diff --git a/src/generated/tasknotes-type-pack.json b/src/generated/tasknotes-type-pack.json new file mode 100644 index 0000000..726d8f1 --- /dev/null +++ b/src/generated/tasknotes-type-pack.json @@ -0,0 +1,218 @@ +{ + "manifest": { + "kind": "mdbase.type-pack", + "id": "tasknotes.task", + "version": "0.3.0-rc.21", + "name": "TaskNotes task type pack", + "description": "Portable tasks whose app behaviour (templates, archive moves, status cycling, time tracking and link format) lives in a TaskNotes settings record, with a reviewed, atomic upgrade from every TaskNotes starter published before.", + "resources": [ + { + "kind": "contract", + "mode": "managed", + "source": "contracts/tasknotes.task/0.3.0-rc.5.md", + "target": "_contracts/tasknotes.task.md", + "digest": "sha256:ecadd00700e249940f4244aaa5b5985a96557d13340463ec491dfa5e89b032a4" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/tasknotes.task/0.3.0-rc.4.md", + "target": "_contracts/tasknotes.task/0.3.0-rc.4.md", + "digest": "sha256:91165b7664f936bba9289aca984e2638901db7fedf68642ab755e8d0b424e734" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/tasknotes.task/0.3.0-rc.3.md", + "target": "_contracts/tasknotes.task/0.3.0-rc.3.md", + "digest": "sha256:4761ee78615882170cae6e52590f98917f549bd89d852a0c40568583394d7264" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/tasknotes.task/0.3.0-rc.6.md", + "target": "_contracts/tasknotes.task/0.3.0-rc.6.md", + "digest": "sha256:3f4eb90782948ed68112ffcc99575911036020544cf501de3d2265b588b38456" + }, + { + "kind": "type", + "mode": "seed", + "source": "types/tasknotes-task/6.md", + "target": "_types/task.md", + "digest": "sha256:87e52c25b474a06283b29e2983ae4fc6e618fd1a4cbcc5856ff9a67328df605b", + "upgrade_from": [ + { + "digest": "sha256:b3cf8dbe8885b331c494d2eeb36abfb052890e06b757877d655c269e666487dc", + "version": 4, + "document": "---\nkind: mdbase.type\nname: task\nversion: 4\ndescription: A task managed by TaskNotes.\nmatch:\n where:\n tags:\n contains: task\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n type: object\n additionalProperties: true\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n enum: &a2\n - none\n - open\n - in-progress\n - done\n - cancelled\n default: open\n priority:\n enum: &a4\n - none\n - low\n - normal\n - high\n default: normal\n due: &a1\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled: *a1\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n items:\n type: string\n minLength: 1\n pattern: \\S\n uniqueItems: true\n attachments:\n type: array\n items:\n type: string\n minLength: 1\n uniqueItems: true\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrence_anchor:\n enum:\n - scheduled\n - completion\n default: scheduled\n occurrence_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default: manual\n occurrence_next_trigger:\n enum:\n - completion\n - completion_or_skip\n default: completion\n occurrence_template:\n type: string\n occurrence_past_horizon:\n type: string\n occurrence_future_horizon:\n type: string\n recurrence_parent:\n type: string\n occurrence_date:\n type: string\n format: date\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n startTime:\n type: string\n format: date-time\n endTime:\n type: string\n format: date-time\n description:\n type: string\n duration:\n type: integer\n reminders:\n type: array\n items:\n oneOf:\n - type: object\n required:\n - id\n - type\n - absoluteTime\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: absolute\n description:\n type: string\n absoluteTime:\n type: string\n format: date-time\n - type: object\n required:\n - id\n - type\n - relatedTo\n - offset\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: relative\n description:\n type: string\n relatedTo:\n enum:\n - due\n - scheduled\n offset:\n type: string\n blockedBy:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n uid:\n type: string\n reltype:\n type: string\n gap:\n type: string\n required:\n - uid\n complete_instances:\n type: array\n items:\n type: string\n format: date\n skipped_instances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n tasknotes_manual_order:\n type: string\n allOf:\n - if:\n required:\n - status\n properties:\n status:\n enum: &a3\n - done\n not:\n required:\n - recurrence\n then:\n required:\n - completedDate\n required:\n - title\n - status\n - dateCreated\ncollection:\n read_defaults:\n status: open\n priority: normal\n recurrence_anchor: scheduled\n occurrence_materialization: manual\n occurrence_next_trigger: completion\n links:\n projects[]:\n target_type: any\n validate_exists: false\n assignees[]:\n validate_exists: false\n attachments[]:\n validate_exists: false\n occurrence_template:\n target_type: any\n validate_exists: false\n recurrence_parent:\n target_type: task\n validate_exists: false\n blockedBy[].uid:\n target_type: task\n validate_exists: false\n path:\n runtime: tasknotes\n template: \"{{zettel}}\"\n folder: tasks\n generated_by: tasknotes.filename.create\n display:\n name_field: title\n unique:\n - field: id\n scope: type\nlifecycle:\n on_create:\n set:\n id:\n uuid: true\n dateCreated:\n now: true\n dateModified:\n now: true\n on_update:\n set:\n dateModified:\n now: true\nimplements:\n - contract: tasknotes.task\n version: 0.3.0-rc.5\n fields:\n id: id\n title: title\n status: status\n priority: priority\n due: due\n scheduled: scheduled\n contexts: contexts\n projects: projects\n assignees: assignees\n attachments: attachments\n timeEstimate: timeEstimate\n completedDate: completedDate\n dateCreated: dateCreated\n dateModified: dateModified\n recurrence: recurrence\n recurrenceAnchor: recurrence_anchor\n occurrenceMaterialization: occurrence_materialization\n occurrenceNextTrigger: occurrence_next_trigger\n occurrenceTemplate: occurrence_template\n occurrencePastHorizon: occurrence_past_horizon\n occurrenceFutureHorizon: occurrence_future_horizon\n recurrenceParent: recurrence_parent\n occurrenceDate: occurrence_date\n tags: tags\n timeEntries: timeEntries\n reminders: reminders\n blockedBy: blockedBy\n completeInstances: complete_instances\n skippedInstances: skipped_instances\n icsEventId: icsEventId\n googleCalendarEventId: googleCalendarEventId\n googleCalendarExceptionEventId: googleCalendarExceptionEventId\n googleCalendarExceptionOriginalScheduled: googleCalendarExceptionOriginalScheduled\n googleCalendarMovedOriginalDates: googleCalendarMovedOriginalDates\n sortOrder: tasknotes_manual_order\n binding:\n profiles:\n - core-lite\n - recurrence\n - materialized-occurrences\n capabilities:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - archive\n - templating\n title:\n storage: frontmatter\n filename_format: zettel\n status:\n values: *a2\n default: open\n completed_values: *a3\n skipped_values:\n - cancelled\n default_skipped: cancelled\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 0\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: open\n label: Open\n color: \"#64748b\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 1\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: in-progress\n label: In progress\n color: \"#3b82f6\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 2\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: done\n label: Done\n color: \"#22c55e\"\n is_completed: true\n is_skipped: false\n exclude_from_cycle: false\n order: 3\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: cancelled\n label: Cancelled\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: true\n exclude_from_cycle: true\n order: 4\n auto_archive: false\n auto_archive_delay_minutes: 5\n priority:\n values: *a4\n default: normal\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n weight: 0\n - value: low\n label: Low\n color: \"#3b82f6\"\n weight: 1\n - value: normal\n label: Normal\n color: \"#f59e0b\"\n weight: 2\n - value: high\n label: High\n color: \"#ef4444\"\n weight: 3\n recurrence:\n syntax: tasknotes\n maintain_due_date_offset: true\n reset_body_checkboxes: false\n occurrences:\n identity_roles:\n - recurrenceParent\n - occurrenceDate\n default_materialization: manual\n default_next_trigger: completion\n past_horizon: P0D\n future_horizon: P14D\n links:\n accepted_formats:\n - wikilink\n - markdown\n write_format: wikilink\n archive:\n archived_tag: archived\n move_on_archive: false\n time_tracking:\n auto_stop_on_complete: false\n templating:\n enabled: false\n occurrence_enabled: false\nx-tasknotes-generator:\n managed_fields:\n - attachments\n - blockedBy\n - complete_instances\n - completedDate\n - contexts\n - dateCreated\n - dateModified\n - due\n - googleCalendarEventId\n - googleCalendarExceptionEventId\n - googleCalendarExceptionOriginalScheduled\n - googleCalendarMovedOriginalDates\n - icsEventId\n - id\n - occurrence_date\n - occurrence_future_horizon\n - occurrence_materialization\n - occurrence_next_trigger\n - occurrence_past_horizon\n - occurrence_template\n - priority\n - projects\n - recurrence\n - recurrence_anchor\n - recurrence_parent\n - reminders\n - scheduled\n - skipped_instances\n - status\n - tags\n - tasknotes_manual_order\n - timeEntries\n - timeEstimate\n - title\n---\n# Task\n\nTask records live under `tasks/`.\n" + }, + { + "digest": "sha256:2b6016c3543c0dfff491cc6262aed3afd4d672360484174042a261acd1d8ff5f", + "version": 4, + "document": "---\nkind: mdbase.type\nname: task\nversion: 4\ndescription: A task managed by TaskNotes.\nmatch:\n where:\n tags:\n contains: task\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n type: object\n additionalProperties: true\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n enum: &a2\n - none\n - open\n - in-progress\n - done\n - cancelled\n default: open\n priority:\n enum: &a4\n - none\n - low\n - normal\n - high\n default: normal\n due: &a1\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled: *a1\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n items:\n type: string\n minLength: 1\n pattern: \\S\n uniqueItems: true\n attachments:\n type: array\n items:\n type: string\n minLength: 1\n uniqueItems: true\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrence_anchor:\n enum:\n - scheduled\n - completion\n default: scheduled\n occurrence_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default: manual\n occurrence_next_trigger:\n enum:\n - completion\n - completion_or_skip\n default: completion\n occurrence_template:\n type: string\n occurrence_past_horizon:\n type: string\n occurrence_future_horizon:\n type: string\n recurrence_parent:\n type: string\n occurrence_date:\n type: string\n format: date\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n startTime:\n type: string\n format: date-time\n endTime:\n type: string\n format: date-time\n description:\n type: string\n duration:\n type: integer\n reminders:\n type: array\n items:\n oneOf:\n - type: object\n required:\n - id\n - type\n - absoluteTime\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: absolute\n description:\n type: string\n absoluteTime:\n type: string\n format: date-time\n - type: object\n required:\n - id\n - type\n - relatedTo\n - offset\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: relative\n description:\n type: string\n relatedTo:\n enum:\n - due\n - scheduled\n offset:\n type: string\n blockedBy:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n uid:\n type: string\n reltype:\n type: string\n gap:\n type: string\n required:\n - uid\n complete_instances:\n type: array\n items:\n type: string\n format: date\n skipped_instances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n tasknotes_manual_order:\n type: string\n allOf:\n - if:\n required:\n - status\n properties:\n status:\n enum: &a3\n - done\n not:\n required:\n - recurrence\n then:\n required:\n - completedDate\n required:\n - title\n - status\n - dateCreated\ncollection:\n read_defaults:\n status: open\n priority: normal\n recurrence_anchor: scheduled\n occurrence_materialization: manual\n occurrence_next_trigger: completion\n links:\n projects[]:\n target_type: any\n validate_exists: false\n assignees[]:\n validate_exists: false\n attachments[]:\n validate_exists: false\n occurrence_template:\n target_type: any\n validate_exists: false\n recurrence_parent:\n target_type: task\n validate_exists: false\n blockedBy[].uid:\n target_type: task\n validate_exists: false\n path:\n runtime: tasknotes\n template: \"{{zettel}}\"\n folder: tasks\n generated_by: tasknotes.filename.create\n display:\n name_field: title\n unique:\n - field: id\n scope: type\nlifecycle:\n on_create:\n set:\n id:\n uuid: true\n dateCreated:\n now: true\n dateModified:\n now: true\n on_update:\n set:\n dateModified:\n now: true\nimplements:\n - contract: tasknotes.task\n version: 0.3.0-rc.5\n fields:\n id: id\n title: title\n status: status\n priority: priority\n due: due\n scheduled: scheduled\n contexts: contexts\n projects: projects\n assignees: assignees\n attachments: attachments\n timeEstimate: timeEstimate\n completedDate: completedDate\n dateCreated: dateCreated\n dateModified: dateModified\n recurrence: recurrence\n recurrenceAnchor: recurrence_anchor\n occurrenceMaterialization: occurrence_materialization\n occurrenceNextTrigger: occurrence_next_trigger\n occurrenceTemplate: occurrence_template\n occurrencePastHorizon: occurrence_past_horizon\n occurrenceFutureHorizon: occurrence_future_horizon\n recurrenceParent: recurrence_parent\n occurrenceDate: occurrence_date\n tags: tags\n timeEntries: timeEntries\n reminders: reminders\n blockedBy: blockedBy\n completeInstances: complete_instances\n skippedInstances: skipped_instances\n icsEventId: icsEventId\n googleCalendarEventId: googleCalendarEventId\n googleCalendarExceptionEventId: googleCalendarExceptionEventId\n googleCalendarExceptionOriginalScheduled: googleCalendarExceptionOriginalScheduled\n googleCalendarMovedOriginalDates: googleCalendarMovedOriginalDates\n sortOrder: tasknotes_manual_order\n binding:\n profiles:\n - core-lite\n - recurrence\n - materialized-occurrences\n capabilities:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - archive\n - templating\n title:\n storage: frontmatter\n filename_format: zettel\n status:\n values: *a2\n default: open\n completed_values: *a3\n skipped_values:\n - cancelled\n default_skipped: cancelled\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 0\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: open\n label: Open\n color: \"#64748b\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 1\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: in-progress\n label: In progress\n color: \"#3b82f6\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 2\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: done\n label: Done\n color: \"#22c55e\"\n is_completed: true\n is_skipped: false\n exclude_from_cycle: false\n order: 3\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: cancelled\n label: Cancelled\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: true\n exclude_from_cycle: true\n order: 4\n auto_archive: false\n auto_archive_delay_minutes: 5\n priority:\n values: *a4\n default: normal\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n weight: 0\n - value: low\n label: Low\n color: \"#3b82f6\"\n weight: 1\n - value: normal\n label: Normal\n color: \"#f59e0b\"\n weight: 2\n - value: high\n label: High\n color: \"#ef4444\"\n weight: 3\n recurrence:\n syntax: tasknotes\n maintain_due_date_offset: true\n reset_body_checkboxes: false\n occurrences:\n identity_roles:\n - recurrenceParent\n - occurrenceDate\n default_materialization: manual\n default_next_trigger: completion\n past_horizon: P0D\n future_horizon: P14D\n links:\n accepted_formats:\n - wikilink\n - markdown\n write_format: wikilink\n archive:\n archived_tag: archived\n move_on_archive: false\n time_tracking:\n auto_stop_on_complete: false\n templating:\n enabled: false\n occurrence_enabled: false\nx-tasknotes-generator:\n managed_fields:\n - assignees\n - attachments\n - blockedBy\n - complete_instances\n - completedDate\n - contexts\n - dateCreated\n - dateModified\n - due\n - googleCalendarEventId\n - googleCalendarExceptionEventId\n - googleCalendarExceptionOriginalScheduled\n - googleCalendarMovedOriginalDates\n - icsEventId\n - id\n - occurrence_date\n - occurrence_future_horizon\n - occurrence_materialization\n - occurrence_next_trigger\n - occurrence_past_horizon\n - occurrence_template\n - priority\n - projects\n - recurrence\n - recurrence_anchor\n - recurrence_parent\n - reminders\n - scheduled\n - skipped_instances\n - status\n - tags\n - tasknotes_manual_order\n - timeEntries\n - timeEstimate\n - title\n---\n# Task\n\nTask records live under `tasks/`.\n" + }, + { + "digest": "sha256:02d1a2a04f26937dd7eec3cde3070dd770c73625e06f386d6214044d176788dd", + "version": 3, + "document": "---\nkind: mdbase.type\nname: task\nversion: 3\ndescription: A task managed by TaskNotes.\nmatch:\n where:\n tags:\n contains: task\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n type: object\n additionalProperties: true\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n enum: &a1\n - none\n - open\n - in-progress\n - done\n default: open\n priority:\n enum: &a3\n - none\n - low\n - normal\n - high\n default: normal\n due:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n items:\n type: string\n minLength: 1\n pattern: \\S\n uniqueItems: true\n attachments:\n type: array\n items:\n type: string\n minLength: 1\n uniqueItems: true\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrence_anchor:\n enum:\n - scheduled\n - completion\n default: scheduled\n occurrence_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default: manual\n occurrence_next_trigger:\n enum:\n - completion\n - completion_or_skip\n default: completion\n occurrence_template:\n type: string\n occurrence_past_horizon:\n type: string\n occurrence_future_horizon:\n type: string\n recurrence_parent:\n type: string\n occurrence_date:\n type: string\n format: date\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n startTime:\n type: string\n format: date-time\n endTime:\n type: string\n format: date-time\n description:\n type: string\n duration:\n type: integer\n reminders:\n type: array\n items:\n oneOf:\n - type: object\n required:\n - id\n - type\n - absoluteTime\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: absolute\n description:\n type: string\n absoluteTime:\n type: string\n format: date-time\n - type: object\n required:\n - id\n - type\n - relatedTo\n - offset\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: relative\n description:\n type: string\n relatedTo:\n enum:\n - due\n - scheduled\n offset:\n type: string\n blockedBy:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n uid:\n type: string\n reltype:\n type: string\n gap:\n type: string\n required:\n - uid\n complete_instances:\n type: array\n items:\n type: string\n format: date\n skipped_instances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n tasknotes_manual_order:\n type: string\n allOf:\n - if:\n required:\n - status\n properties:\n status:\n enum: &a2\n - done\n not:\n required:\n - recurrence\n then:\n required:\n - completedDate\n required:\n - title\n - status\n - dateCreated\ncollection:\n read_defaults:\n status: open\n priority: normal\n recurrence_anchor: scheduled\n occurrence_materialization: manual\n occurrence_next_trigger: completion\n links:\n projects[]:\n target_type: any\n validate_exists: false\n assignees[]:\n validate_exists: false\n attachments[]:\n validate_exists: false\n occurrence_template:\n target_type: any\n validate_exists: false\n recurrence_parent:\n target_type: task\n validate_exists: false\n blockedBy[].uid:\n target_type: task\n validate_exists: false\n path:\n runtime: tasknotes\n template: \"{{zettel}}\"\n folder: tasks\n generated_by: tasknotes.filename.create\n display:\n name_field: title\n unique:\n - field: id\n scope: type\nlifecycle:\n on_create:\n set:\n id:\n uuid: true\n dateCreated:\n now: true\n dateModified:\n now: true\n on_update:\n set:\n dateModified:\n now: true\nimplements:\n - contract: tasknotes.task\n version: 0.3.0-rc.5\n fields:\n id: id\n title: title\n status: status\n priority: priority\n due: due\n scheduled: scheduled\n contexts: contexts\n projects: projects\n assignees: assignees\n attachments: attachments\n timeEstimate: timeEstimate\n completedDate: completedDate\n dateCreated: dateCreated\n dateModified: dateModified\n recurrence: recurrence\n recurrenceAnchor: recurrence_anchor\n occurrenceMaterialization: occurrence_materialization\n occurrenceNextTrigger: occurrence_next_trigger\n occurrenceTemplate: occurrence_template\n occurrencePastHorizon: occurrence_past_horizon\n occurrenceFutureHorizon: occurrence_future_horizon\n recurrenceParent: recurrence_parent\n occurrenceDate: occurrence_date\n tags: tags\n timeEntries: timeEntries\n reminders: reminders\n blockedBy: blockedBy\n completeInstances: complete_instances\n skippedInstances: skipped_instances\n icsEventId: icsEventId\n googleCalendarEventId: googleCalendarEventId\n googleCalendarExceptionEventId: googleCalendarExceptionEventId\n googleCalendarExceptionOriginalScheduled: googleCalendarExceptionOriginalScheduled\n googleCalendarMovedOriginalDates: googleCalendarMovedOriginalDates\n sortOrder: tasknotes_manual_order\n binding:\n profiles:\n - core-lite\n - recurrence\n - templating\n - materialized-occurrences\n - extended\n capabilities:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - archive\n - templating\n title:\n storage: frontmatter\n filename_format: zettel\n status:\n values: *a1\n default: open\n completed_values: *a2\n skipped_values: []\n definitions:\n - value: none\n label: None\n color: \"#cccccc\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 0\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: open\n label: Open\n color: \"#808080\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 1\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: in-progress\n label: In progress\n color: \"#0066cc\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 2\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: done\n label: Done\n color: \"#00aa00\"\n is_completed: true\n is_skipped: false\n exclude_from_cycle: false\n order: 3\n auto_archive: false\n auto_archive_delay_minutes: 5\n priority:\n values: *a3\n default: normal\n definitions:\n - value: none\n label: None\n color: \"#cccccc\"\n weight: 0\n - value: low\n label: Low\n color: \"#00aa00\"\n weight: 1\n - value: normal\n label: Normal\n color: \"#ffaa00\"\n weight: 2\n - value: high\n label: High\n color: \"#ff0000\"\n weight: 3\n recurrence:\n syntax: tasknotes\n maintain_due_date_offset: true\n reset_body_checkboxes: false\n occurrences:\n identity_roles:\n - recurrenceParent\n - occurrenceDate\n default_materialization: manual\n default_next_trigger: completion\n past_horizon: P0D\n future_horizon: P14D\n links:\n accepted_formats:\n - wikilink\n - markdown\n write_format: wikilink\n archive:\n archived_tag: archived\n move_on_archive: false\n time_tracking:\n auto_stop_on_complete: false\n templating:\n enabled: false\n occurrence_enabled: false\nx-tasknotes-generator:\n managed_fields:\n - assignees\n - attachments\n - blockedBy\n - complete_instances\n - completedDate\n - contexts\n - dateCreated\n - dateModified\n - due\n - googleCalendarEventId\n - googleCalendarExceptionEventId\n - googleCalendarExceptionOriginalScheduled\n - googleCalendarMovedOriginalDates\n - icsEventId\n - id\n - occurrence_date\n - occurrence_future_horizon\n - occurrence_materialization\n - occurrence_next_trigger\n - occurrence_past_horizon\n - occurrence_template\n - priority\n - projects\n - recurrence\n - recurrence_anchor\n - recurrence_parent\n - reminders\n - scheduled\n - skipped_instances\n - status\n - tags\n - tasknotes_manual_order\n - timeEntries\n - timeEstimate\n - title\n---\n\n# Task\n\nThis type definition implements the TaskNotes contract for this mdbase collection.\nIts JSON Schema describes persisted task frontmatter; collection and lifecycle\nmetadata describe generic mdbase behavior; `implements` maps the portable\nTaskNotes task view and supplies TaskNotes behavior.\n\nChanges made here are loaded by TaskNotes. Portable changes made in TaskNotes\nsettings are written back while unknown extensions are preserved.\n" + }, + { + "digest": "sha256:ade71117bd31e571f403511c48d432bab7a05dfd25e730ca2931f3afda7f7cd5", + "version": 2, + "document": "---\nkind: mdbase.type\nname: task\nversion: 2\ndescription: A task managed by TaskNotes.\nmatch:\n where:\n tags:\n contains: task\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n type: object\n additionalProperties: true\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n enum: &a1\n - none\n - open\n - in-progress\n - done\n default: open\n priority:\n enum: &a3\n - none\n - low\n - normal\n - high\n default: normal\n due:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n items:\n type: string\n minLength: 1\n pattern: \\S\n uniqueItems: true\n attachments:\n type: array\n items:\n type: string\n minLength: 1\n uniqueItems: true\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrence_anchor:\n enum:\n - scheduled\n - completion\n default: scheduled\n occurrence_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default: manual\n occurrence_next_trigger:\n enum:\n - completion\n - completion_or_skip\n default: completion\n occurrence_template:\n type: string\n occurrence_past_horizon:\n type: string\n occurrence_future_horizon:\n type: string\n recurrence_parent:\n type: string\n occurrence_date:\n type: string\n format: date\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n startTime:\n type: string\n format: date-time\n endTime:\n type: string\n format: date-time\n description:\n type: string\n duration:\n type: integer\n reminders:\n type: array\n items:\n oneOf:\n - type: object\n required:\n - id\n - type\n - absoluteTime\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: absolute\n description:\n type: string\n absoluteTime:\n type: string\n format: date-time\n - type: object\n required:\n - id\n - type\n - relatedTo\n - offset\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: relative\n description:\n type: string\n relatedTo:\n enum:\n - due\n - scheduled\n offset:\n type: string\n blockedBy:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n uid:\n type: string\n reltype:\n type: string\n gap:\n type: string\n required:\n - uid\n complete_instances:\n type: array\n items:\n type: string\n format: date\n skipped_instances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n tasknotes_manual_order:\n type: string\n allOf:\n - if:\n required:\n - status\n properties:\n status:\n enum: &a2\n - done\n not:\n required:\n - recurrence\n then:\n required:\n - completedDate\n required:\n - title\n - status\n - dateCreated\ncollection:\n read_defaults:\n status: open\n priority: normal\n recurrence_anchor: scheduled\n occurrence_materialization: manual\n occurrence_next_trigger: completion\n links:\n projects[]:\n target_type: any\n validate_exists: false\n attachments[]:\n validate_exists: false\n occurrence_template:\n target_type: any\n validate_exists: false\n recurrence_parent:\n target_type: task\n validate_exists: false\n blockedBy[].uid:\n target_type: task\n validate_exists: false\n path:\n runtime: tasknotes\n template: \"{{zettel}}\"\n folder: tasks\n generated_by: tasknotes.filename.create\n display:\n name_field: title\n unique:\n - field: id\n scope: type\nlifecycle:\n on_create:\n set:\n id:\n uuid: true\n dateCreated:\n now: true\n dateModified:\n now: true\n on_update:\n set:\n dateModified:\n now: true\nimplements:\n - contract: tasknotes.task\n version: 0.3.0-rc.4\n fields:\n id: id\n title: title\n status: status\n priority: priority\n due: due\n scheduled: scheduled\n contexts: contexts\n projects: projects\n assignees: assignees\n attachments: attachments\n timeEstimate: timeEstimate\n completedDate: completedDate\n dateCreated: dateCreated\n dateModified: dateModified\n recurrence: recurrence\n recurrenceAnchor: recurrence_anchor\n occurrenceMaterialization: occurrence_materialization\n occurrenceNextTrigger: occurrence_next_trigger\n occurrenceTemplate: occurrence_template\n occurrencePastHorizon: occurrence_past_horizon\n occurrenceFutureHorizon: occurrence_future_horizon\n recurrenceParent: recurrence_parent\n occurrenceDate: occurrence_date\n tags: tags\n timeEntries: timeEntries\n reminders: reminders\n blockedBy: blockedBy\n completeInstances: complete_instances\n skippedInstances: skipped_instances\n icsEventId: icsEventId\n googleCalendarEventId: googleCalendarEventId\n googleCalendarExceptionEventId: googleCalendarExceptionEventId\n googleCalendarExceptionOriginalScheduled: googleCalendarExceptionOriginalScheduled\n googleCalendarMovedOriginalDates: googleCalendarMovedOriginalDates\n sortOrder: tasknotes_manual_order\n binding:\n profiles:\n - core-lite\n - recurrence\n - templating\n - materialized-occurrences\n - extended\n capabilities:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - archive\n - templating\n title:\n storage: frontmatter\n filename_format: zettel\n status:\n values: *a1\n default: open\n completed_values: *a2\n skipped_values: []\n definitions:\n - value: none\n label: None\n color: \"#cccccc\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 0\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: open\n label: Open\n color: \"#808080\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 1\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: in-progress\n label: In progress\n color: \"#0066cc\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 2\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: done\n label: Done\n color: \"#00aa00\"\n is_completed: true\n is_skipped: false\n exclude_from_cycle: false\n order: 3\n auto_archive: false\n auto_archive_delay_minutes: 5\n priority:\n values: *a3\n default: normal\n definitions:\n - value: none\n label: None\n color: \"#cccccc\"\n weight: 0\n - value: low\n label: Low\n color: \"#00aa00\"\n weight: 1\n - value: normal\n label: Normal\n color: \"#ffaa00\"\n weight: 2\n - value: high\n label: High\n color: \"#ff0000\"\n weight: 3\n recurrence:\n syntax: tasknotes\n maintain_due_date_offset: true\n reset_body_checkboxes: false\n occurrences:\n identity_roles:\n - recurrenceParent\n - occurrenceDate\n default_materialization: manual\n default_next_trigger: completion\n past_horizon: P0D\n future_horizon: P14D\n links:\n accepted_formats:\n - wikilink\n - markdown\n write_format: wikilink\n archive:\n archived_tag: archived\n move_on_archive: false\n time_tracking:\n auto_stop_on_complete: false\n templating:\n enabled: false\n occurrence_enabled: false\nx-tasknotes-generator:\n managed_fields:\n - assignees\n - attachments\n - blockedBy\n - complete_instances\n - completedDate\n - contexts\n - dateCreated\n - dateModified\n - due\n - googleCalendarEventId\n - googleCalendarExceptionEventId\n - googleCalendarExceptionOriginalScheduled\n - googleCalendarMovedOriginalDates\n - icsEventId\n - id\n - occurrence_date\n - occurrence_future_horizon\n - occurrence_materialization\n - occurrence_next_trigger\n - occurrence_past_horizon\n - occurrence_template\n - priority\n - projects\n - recurrence\n - recurrence_anchor\n - recurrence_parent\n - reminders\n - scheduled\n - skipped_instances\n - status\n - tags\n - tasknotes_manual_order\n - timeEntries\n - timeEstimate\n - title\n---\n\n# Task\n\nThis type definition implements the TaskNotes contract for this mdbase collection.\nIts JSON Schema describes persisted task frontmatter; collection and lifecycle\nmetadata describe generic mdbase behavior; `implements` maps the portable\nTaskNotes task view and supplies TaskNotes behavior.\n\nChanges made here are loaded by TaskNotes. Portable changes made in TaskNotes\nsettings are written back while unknown extensions are preserved.\n" + }, + { + "digest": "sha256:b7f8af7b18d77859dab1f1532c1b55c08c7c39879f55e4ef2a94cb7d2d2284eb", + "version": 1, + "document": "---\nkind: mdbase.type\nname: task\nversion: 1\ndescription: A task managed by TaskNotes.\nmatch:\n where:\n tags:\n contains: task\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n type: object\n additionalProperties: true\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n enum: &a2\n - none\n - open\n - in-progress\n - done\n - cancelled\n default: open\n priority:\n enum: &a4\n - none\n - low\n - normal\n - high\n default: normal\n due: &a1\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled: *a1\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n attachments:\n type: array\n items:\n type: string\n minLength: 1\n uniqueItems: true\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrence_anchor:\n enum:\n - scheduled\n - completion\n default: scheduled\n occurrence_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default: manual\n occurrence_next_trigger:\n enum:\n - completion\n - completion_or_skip\n default: completion\n occurrence_template:\n type: string\n occurrence_past_horizon:\n type: string\n occurrence_future_horizon:\n type: string\n recurrence_parent:\n type: string\n occurrence_date:\n type: string\n format: date\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n startTime:\n type: string\n format: date-time\n endTime:\n type: string\n format: date-time\n description:\n type: string\n duration:\n type: integer\n reminders:\n type: array\n items:\n oneOf:\n - type: object\n required:\n - id\n - type\n - absoluteTime\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: absolute\n description:\n type: string\n absoluteTime:\n type: string\n format: date-time\n - type: object\n required:\n - id\n - type\n - relatedTo\n - offset\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: relative\n description:\n type: string\n relatedTo:\n enum:\n - due\n - scheduled\n offset:\n type: string\n blockedBy:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n uid:\n type: string\n reltype:\n type: string\n gap:\n type: string\n required:\n - uid\n complete_instances:\n type: array\n items:\n type: string\n format: date\n skipped_instances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n tasknotes_manual_order:\n type: string\n allOf:\n - if:\n required:\n - status\n properties:\n status:\n enum: &a3\n - done\n not:\n required:\n - recurrence\n then:\n required:\n - completedDate\n required:\n - title\n - status\n - dateCreated\ncollection:\n read_defaults:\n status: open\n priority: normal\n recurrence_anchor: scheduled\n occurrence_materialization: manual\n occurrence_next_trigger: completion\n links:\n projects[]:\n target_type: any\n validate_exists: false\n attachments[]:\n validate_exists: false\n occurrence_template:\n target_type: any\n validate_exists: false\n recurrence_parent:\n target_type: task\n validate_exists: false\n blockedBy[].uid:\n target_type: task\n validate_exists: false\n path:\n runtime: tasknotes\n template: \"{{zettel}}\"\n folder: tasks\n generated_by: tasknotes.filename.create\n display:\n name_field: title\n unique:\n - field: id\n scope: type\nlifecycle:\n on_create:\n set:\n id:\n uuid: true\n dateCreated:\n now: true\n dateModified:\n now: true\n on_update:\n set:\n dateModified:\n now: true\nimplements:\n - contract: tasknotes.task\n version: 0.3.0-rc.3\n fields:\n id: id\n title: title\n status: status\n priority: priority\n due: due\n scheduled: scheduled\n contexts: contexts\n projects: projects\n attachments: attachments\n timeEstimate: timeEstimate\n completedDate: completedDate\n dateCreated: dateCreated\n dateModified: dateModified\n recurrence: recurrence\n recurrenceAnchor: recurrence_anchor\n occurrenceMaterialization: occurrence_materialization\n occurrenceNextTrigger: occurrence_next_trigger\n occurrenceTemplate: occurrence_template\n occurrencePastHorizon: occurrence_past_horizon\n occurrenceFutureHorizon: occurrence_future_horizon\n recurrenceParent: recurrence_parent\n occurrenceDate: occurrence_date\n tags: tags\n timeEntries: timeEntries\n reminders: reminders\n blockedBy: blockedBy\n completeInstances: complete_instances\n skippedInstances: skipped_instances\n icsEventId: icsEventId\n googleCalendarEventId: googleCalendarEventId\n googleCalendarExceptionEventId: googleCalendarExceptionEventId\n googleCalendarExceptionOriginalScheduled: googleCalendarExceptionOriginalScheduled\n googleCalendarMovedOriginalDates: googleCalendarMovedOriginalDates\n sortOrder: tasknotes_manual_order\n binding:\n profiles:\n - core-lite\n - recurrence\n - materialized-occurrences\n capabilities:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - archive\n - templating\n title:\n storage: frontmatter\n filename_format: zettel\n status:\n values: *a2\n default: open\n completed_values: *a3\n skipped_values:\n - cancelled\n default_skipped: cancelled\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 0\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: open\n label: Open\n color: \"#64748b\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 1\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: in-progress\n label: In progress\n color: \"#3b82f6\"\n is_completed: false\n is_skipped: false\n exclude_from_cycle: false\n order: 2\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: done\n label: Done\n color: \"#22c55e\"\n is_completed: true\n is_skipped: false\n exclude_from_cycle: false\n order: 3\n auto_archive: false\n auto_archive_delay_minutes: 5\n - value: cancelled\n label: Cancelled\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: true\n exclude_from_cycle: true\n order: 4\n auto_archive: false\n auto_archive_delay_minutes: 5\n priority:\n values: *a4\n default: normal\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n weight: 0\n - value: low\n label: Low\n color: \"#3b82f6\"\n weight: 1\n - value: normal\n label: Normal\n color: \"#f59e0b\"\n weight: 2\n - value: high\n label: High\n color: \"#ef4444\"\n weight: 3\n recurrence:\n syntax: tasknotes\n maintain_due_date_offset: true\n reset_body_checkboxes: false\n occurrences:\n identity_roles:\n - recurrenceParent\n - occurrenceDate\n default_materialization: manual\n default_next_trigger: completion\n past_horizon: P0D\n future_horizon: P14D\n links:\n accepted_formats:\n - wikilink\n - markdown\n write_format: wikilink\n archive:\n archived_tag: archived\n move_on_archive: false\n time_tracking:\n auto_stop_on_complete: false\n templating:\n enabled: false\n occurrence_enabled: false\nx-tasknotes-generator:\n managed_fields:\n - attachments\n - blockedBy\n - complete_instances\n - completedDate\n - contexts\n - dateCreated\n - dateModified\n - due\n - googleCalendarEventId\n - googleCalendarExceptionEventId\n - googleCalendarExceptionOriginalScheduled\n - googleCalendarMovedOriginalDates\n - icsEventId\n - id\n - occurrence_date\n - occurrence_future_horizon\n - occurrence_materialization\n - occurrence_next_trigger\n - occurrence_past_horizon\n - occurrence_template\n - priority\n - projects\n - recurrence\n - recurrence_anchor\n - recurrence_parent\n - reminders\n - scheduled\n - skipped_instances\n - status\n - tags\n - tasknotes_manual_order\n - timeEntries\n - timeEstimate\n - title\n---\n# Task\n\nTask records live under `tasks/`.\n" + } + ] + }, + { + "kind": "schema", + "mode": "managed", + "source": "schemas/tasknotes.task/0.3.0-rc.6.schema.json", + "target": "_schemas/tasknotes/tasknotes-task.schema.json", + "digest": "sha256:ac78a55f46669d6e8bd08d608b7c25338fec8ba7606dbf54ebd6b8d4e66b7035" + }, + { + "kind": "schema", + "mode": "managed", + "source": "schemas/tasknotes.task.binding/0.3.0-rc.6.schema.json", + "target": "_schemas/tasknotes/tasknotes-task-binding.schema.json", + "digest": "sha256:4f8f3288f593ce06a04525697308173147ff957e7066f83d9a922468d06be659" + }, + { + "kind": "schema", + "mode": "managed", + "source": "schemas/mdbase.app-settings/1.0.0.schema.json", + "target": "schemas/mdbase.app-settings/1.0.0.schema.json", + "digest": "sha256:f37ed43b57fe86465b5bb67216da71d6e351bc1b85bf55a20f95edf886f0749e" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/mdbase.app-settings/1.0.0.md", + "target": "_contracts/mdbase.app-settings/1.0.0.md", + "digest": "sha256:9028d8ccd99cfbb4034399777376315486eb8e699aea7757a6b193743f1084c8" + }, + { + "kind": "schema", + "mode": "managed", + "source": "schemas/tasknotes.settings/1.0.0.schema.json", + "target": "schemas/tasknotes.settings/1.0.0.schema.json", + "digest": "sha256:3a4fc207e14ab1579ca478ce84b25cb8dd85b804b3aa79d01eda08e4554dfbb1" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/tasknotes.settings/1.0.0.md", + "target": "_contracts/tasknotes.settings/1.0.0.md", + "digest": "sha256:e8c25653ef37c032fb4cb1f1c3f7c618092a09c4911a41aba42c0476796fe0d1" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/mdbase.app-settings/2.0.0.md", + "target": "_contracts/mdbase.app-settings/2.0.0.md", + "digest": "sha256:a6587ce4cac92b064b2a07f032045e1f114ae358f1749adf4d8d8f38970952e8" + }, + { + "kind": "contract", + "mode": "managed", + "source": "contracts/tasknotes.settings/1.1.0.md", + "target": "_contracts/tasknotes.settings/1.1.0.md", + "digest": "sha256:7d4e6f55b6ba599faff00d837152ef7811ac5193ac20802f1ecdbc3ef7db5647" + }, + { + "kind": "type", + "mode": "seed", + "source": "types/tasknotes-settings/2.md", + "target": "_types/tasknotes-settings.md", + "digest": "sha256:044d3d07b75ab07e458e824bf2b31116a683778d46db33cccf6a00111f652739", + "upgrade_from": [ + { + "digest": "sha256:22ec312c75df356b0b26ba3c46961212efe2803a5d57071fa5753bab7638c2cc", + "version": 1, + "document": "---\nkind: mdbase.type\nname: tasknotes-settings\nversion: 1\ndescription: TaskNotes' collection-wide settings, one record at _settings/dev.tasknotes.md.\nmatch:\n where:\n app:\n eq: dev.tasknotes\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n title: tasknotes.settings 1.0.0\n description: Collection-wide behaviour that every TaskNotes client honours. Every field is optional and has a default, so a record with none of them behaves like no record at all.\n type: object\n required:\n - app\n - scope\n - settings_version\n properties:\n app:\n const: dev.tasknotes\n description: Marks this record as TaskNotes' settings.\n scope:\n const: collection\n description: These settings apply to everyone using TaskNotes in this collection.\n settings_version:\n type: integer\n minimum: 1\n description: The version of these settings that last wrote the record. TaskNotes writes 1.\n nlp_triggers:\n type: array\n items:\n type: object\n required:\n - property_id\n - trigger\n - enabled\n properties:\n property_id:\n type: string\n minLength: 1\n trigger:\n type: string\n minLength: 1\n enabled:\n type: boolean\n additionalProperties: false\n description: Natural-language capture triggers, such as @ for contexts. Without the field each client uses its own defaults.\n template_enabled:\n type: boolean\n default: false\n description: Apply template_path to the body of new tasks.\n template_path:\n type: string\n description: The template for new task bodies. Empty or absent means none.\n occurrence_template_enabled:\n type: boolean\n default: false\n description: Apply occurrence_template_path to new materialized occurrences.\n occurrence_template_path:\n type: string\n description: The template for new occurrence bodies. Empty or absent means none.\n template_failure_mode:\n enum:\n - error\n - warning_fallback\n description: What a client does when a template cannot be applied.\n template_unknown_variable_policy:\n enum:\n - preserve\n - empty\n description: What a client writes for a template variable it does not know.\n move_on_archive:\n type: boolean\n default: false\n description: Move a task's file to archive_folder when it is archived.\n archive_folder:\n type: string\n description: Where archived tasks move to. Empty or absent means the client's default.\n auto_stop_time_tracking_on_complete:\n type: boolean\n default: false\n description: Stop a running timer when its task is completed.\n reset_body_checkboxes_on_recurrence:\n type: boolean\n default: false\n description: Uncheck body checkboxes when a recurring task moves to its next occurrence.\n link_write_format:\n enum:\n - wikilink\n - markdown\n default: wikilink\n description: How clients write links into task frontmatter. Both formats are always read.\n status_behavior:\n type: object\n description: Behaviour per status value. A status without an entry has no next status and no auto-archive, and is out of the status cycle exactly when it is a skipped status.\n additionalProperties:\n type: object\n properties:\n next_status:\n type: string\n minLength: 1\n description: The status the cycle moves to next.\n exclude_from_cycle:\n type: boolean\n description: Leave this status out of the status cycle.\n auto_archive:\n type: boolean\n description: Archive a task some time after it takes this status.\n auto_archive_delay_minutes:\n type: number\n minimum: 0\n description: How long after taking this status a task is archived.\n additionalProperties: false\n default: {}\n additionalProperties: true\ncollection:\n unique:\n - field: app\n scope: type\nimplements:\n - contract: mdbase.app-settings\n version: 1.0.0\n fields:\n app: app\n scope: scope\n settings_version: settings_version\n - contract: tasknotes.settings\n version: 1.0.0\n fields:\n app: app\n scope: scope\n settings_version: settings_version\n nlp_triggers: nlp_triggers\n template_enabled: template_enabled\n template_path: template_path\n occurrence_template_enabled: occurrence_template_enabled\n occurrence_template_path: occurrence_template_path\n template_failure_mode: template_failure_mode\n template_unknown_variable_policy: template_unknown_variable_policy\n move_on_archive: move_on_archive\n archive_folder: archive_folder\n auto_stop_time_tracking_on_complete: auto_stop_time_tracking_on_complete\n reset_body_checkboxes_on_recurrence: reset_body_checkboxes_on_recurrence\n link_write_format: link_write_format\n status_behavior: status_behavior\n---\n\n# TaskNotes settings\n\nSettings that every TaskNotes client honours in this collection, such as body\ntemplates, archive moves and status cycling. TaskNotes reads them from\n`_settings/dev.tasknotes.md` and writes only the fields a save changes.\n" + } + ] + } + ] + }, + "resources": [ + { + "source": "contracts/tasknotes.task/0.3.0-rc.5.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: tasknotes.task\nversion: 0.3.0-rc.5\nname: TaskNotes task\ndescription: Portable task data and behavior defined by tasknotes-spec 0.3.0-rc.5.\nrecord_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task.schema.json\n title: TaskNotes portable task view\n description: The storage-neutral record view exposed by the tasknotes.task 0.3.0-rc.5 record contract.\n type: object\n required:\n - status\n - dateCreated\n additionalProperties: false\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n type: string\n minLength: 1\n priority:\n type: string\n minLength: 1\n due:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n pattern: \\S\n description: Links to records implementing mdbase.person, such as [[Alex Rivera]]. Implementing types declare this field in collection.links. These references never grant collection access.\n attachments:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrenceAnchor:\n enum:\n - scheduled\n - completion\n recurrenceParent:\n type: string\n occurrenceDate:\n type: string\n format: date\n occurrenceMaterialization:\n enum:\n - manual\n - on_completion\n - rolling\n occurrenceNextTrigger:\n enum:\n - completion\n - completion_or_skip\n occurrenceTemplate:\n type: string\n occurrencePastHorizon:\n type: string\n occurrenceFutureHorizon:\n type: string\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n reminders:\n type: array\n items:\n type: object\n blockedBy:\n type: array\n items:\n type: object\n completeInstances:\n type: array\n items:\n type: string\n format: date\n skippedInstances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n sortOrder:\n type: string\nbinding_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task-binding.schema.json\n title: TaskNotes task data-contract binding\n description: Semantic configuration supplied by an mdbase type that implements tasknotes.task 0.3.0-rc.3.\n type: object\n required:\n - profiles\n - capabilities\n - title\n - status\n - priority\n - recurrence\n - occurrences\n - links\n - archive\n - time_tracking\n - templating\n properties:\n profiles:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - core-lite\n - recurrence\n - templating\n - materialized-occurrences\n - extended\n capabilities:\n type: array\n uniqueItems: true\n items:\n enum:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - rename\n - archive\n - batch\n - concurrency\n - dry-run\n - migration\n - templating\n title:\n $ref: \"#/$defs/titlePolicy\"\n status:\n $ref: \"#/$defs/statusPolicy\"\n priority:\n $ref: \"#/$defs/priorityPolicy\"\n recurrence:\n $ref: \"#/$defs/recurrencePolicy\"\n occurrences:\n $ref: \"#/$defs/occurrencePolicy\"\n links:\n $ref: \"#/$defs/linkPolicy\"\n archive:\n $ref: \"#/$defs/archivePolicy\"\n time_tracking:\n $ref: \"#/$defs/timeTrackingPolicy\"\n templating:\n $ref: \"#/$defs/templatingPolicy\"\n nlp:\n $ref: \"#/$defs/nlpPolicy\"\n additionalProperties: false\n $defs:\n nonEmptyString:\n type: string\n minLength: 1\n stringSet:\n type: array\n uniqueItems: true\n items:\n $ref: \"#/$defs/nonEmptyString\"\n titlePolicy:\n type: object\n required:\n - storage\n properties:\n storage:\n enum:\n - filename\n - frontmatter\n filename_format:\n enum:\n - title\n - zettel\n - timestamp\n - uuid\n - custom\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n allOf:\n - if:\n properties:\n filename_format:\n const: custom\n required:\n - filename_format\n then:\n properties:\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n required:\n - custom_filename_template\n additionalProperties: true\n statusDefinition:\n type: object\n required:\n - value\n - label\n - color\n - is_completed\n - is_skipped\n - exclude_from_cycle\n - order\n - auto_archive\n - auto_archive_delay_minutes\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n is_completed:\n type: boolean\n is_skipped:\n type: boolean\n exclude_from_cycle:\n type: boolean\n next_status:\n $ref: \"#/$defs/nonEmptyString\"\n order:\n type: number\n auto_archive:\n type: boolean\n auto_archive_delay_minutes:\n type: number\n minimum: 0\n additionalProperties: true\n statusPolicy:\n type: object\n required:\n - values\n - default\n - completed_values\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n completed_values:\n $ref: \"#/$defs/stringSet\"\n skipped_values:\n $ref: \"#/$defs/stringSet\"\n default_skipped:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/statusDefinition\"\n additionalProperties: false\n priorityDefinition:\n type: object\n required:\n - value\n - label\n - color\n - weight\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n weight:\n type: number\n additionalProperties: true\n priorityPolicy:\n type: object\n required:\n - values\n - default\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/priorityDefinition\"\n additionalProperties: false\n recurrencePolicy:\n type: object\n required:\n - syntax\n - maintain_due_date_offset\n - reset_body_checkboxes\n properties:\n syntax:\n const: tasknotes\n maintain_due_date_offset:\n type: boolean\n reset_body_checkboxes:\n type: boolean\n additionalProperties: false\n occurrencePolicy:\n type: object\n required:\n - identity_roles\n - default_materialization\n - default_next_trigger\n properties:\n identity_roles:\n const:\n - recurrenceParent\n - occurrenceDate\n default_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default_next_trigger:\n enum:\n - completion\n - completion_or_skip\n past_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n future_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n linkPolicy:\n type: object\n required:\n - accepted_formats\n - write_format\n properties:\n accepted_formats:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - wikilink\n - markdown\n write_format:\n enum:\n - wikilink\n - markdown\n additionalProperties: false\n archivePolicy:\n type: object\n required:\n - archived_tag\n - move_on_archive\n properties:\n archived_tag:\n $ref: \"#/$defs/nonEmptyString\"\n move_on_archive:\n type: boolean\n folder:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n timeTrackingPolicy:\n type: object\n required:\n - auto_stop_on_complete\n properties:\n auto_stop_on_complete:\n type: boolean\n additionalProperties: false\n templatingPolicy:\n type: object\n required:\n - enabled\n - occurrence_enabled\n properties:\n enabled:\n type: boolean\n template_path:\n $ref: \"#/$defs/nonEmptyString\"\n occurrence_enabled:\n type: boolean\n occurrence_template_path:\n $ref: \"#/$defs/nonEmptyString\"\n failure_mode:\n enum:\n - error\n - warning_fallback\n unknown_variable_policy:\n enum:\n - preserve\n - empty\n additionalProperties: false\n nlpTrigger:\n type: object\n required:\n - property_id\n - trigger\n - enabled\n properties:\n property_id:\n $ref: \"#/$defs/nonEmptyString\"\n trigger:\n $ref: \"#/$defs/nonEmptyString\"\n enabled:\n type: boolean\n additionalProperties: false\n nlpPolicy:\n type: object\n required:\n - triggers\n properties:\n triggers:\n type: array\n items:\n $ref: \"#/$defs/nlpTrigger\"\n additionalProperties: false\n---\n\n# TaskNotes task contract\n\nTypes implement this contract through `implements`; applications consume\nthe normalized contract view rather than assuming frontmatter names.\n" + }, + { + "source": "contracts/tasknotes.task/0.3.0-rc.4.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: tasknotes.task\nversion: 0.3.0-rc.4\nname: TaskNotes task\ndescription: Portable task data and behavior defined by tasknotes-spec 0.3.0-rc.4.\nrecord_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task.schema.json\n title: TaskNotes portable task view\n description: The storage-neutral record view exposed by the tasknotes.task 0.3.0-rc.4 record contract.\n type: object\n required:\n - status\n - dateCreated\n additionalProperties: false\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n type: string\n minLength: 1\n priority:\n type: string\n minLength: 1\n due:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n pattern: \\S\n description: Stable mdbase.person IDs. These references never grant collection access.\n attachments:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrenceAnchor:\n enum:\n - scheduled\n - completion\n recurrenceParent:\n type: string\n occurrenceDate:\n type: string\n format: date\n occurrenceMaterialization:\n enum:\n - manual\n - on_completion\n - rolling\n occurrenceNextTrigger:\n enum:\n - completion\n - completion_or_skip\n occurrenceTemplate:\n type: string\n occurrencePastHorizon:\n type: string\n occurrenceFutureHorizon:\n type: string\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n reminders:\n type: array\n items:\n type: object\n blockedBy:\n type: array\n items:\n type: object\n completeInstances:\n type: array\n items:\n type: string\n format: date\n skippedInstances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n sortOrder:\n type: string\nbinding_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task-binding.schema.json\n title: TaskNotes task data-contract binding\n description: Semantic configuration supplied by an mdbase type that implements tasknotes.task 0.3.0-rc.3.\n type: object\n required:\n - profiles\n - capabilities\n - title\n - status\n - priority\n - recurrence\n - occurrences\n - links\n - archive\n - time_tracking\n - templating\n properties:\n profiles:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - core-lite\n - recurrence\n - templating\n - materialized-occurrences\n - extended\n capabilities:\n type: array\n uniqueItems: true\n items:\n enum:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - rename\n - archive\n - batch\n - concurrency\n - dry-run\n - migration\n - templating\n title:\n $ref: \"#/$defs/titlePolicy\"\n status:\n $ref: \"#/$defs/statusPolicy\"\n priority:\n $ref: \"#/$defs/priorityPolicy\"\n recurrence:\n $ref: \"#/$defs/recurrencePolicy\"\n occurrences:\n $ref: \"#/$defs/occurrencePolicy\"\n links:\n $ref: \"#/$defs/linkPolicy\"\n archive:\n $ref: \"#/$defs/archivePolicy\"\n time_tracking:\n $ref: \"#/$defs/timeTrackingPolicy\"\n templating:\n $ref: \"#/$defs/templatingPolicy\"\n nlp:\n $ref: \"#/$defs/nlpPolicy\"\n additionalProperties: false\n $defs:\n nonEmptyString:\n type: string\n minLength: 1\n stringSet:\n type: array\n uniqueItems: true\n items:\n $ref: \"#/$defs/nonEmptyString\"\n titlePolicy:\n type: object\n required:\n - storage\n properties:\n storage:\n enum:\n - filename\n - frontmatter\n filename_format:\n enum:\n - title\n - zettel\n - timestamp\n - uuid\n - custom\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n allOf:\n - if:\n properties:\n filename_format:\n const: custom\n required:\n - filename_format\n then:\n properties:\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n required:\n - custom_filename_template\n additionalProperties: true\n statusDefinition:\n type: object\n required:\n - value\n - label\n - color\n - is_completed\n - is_skipped\n - exclude_from_cycle\n - order\n - auto_archive\n - auto_archive_delay_minutes\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n is_completed:\n type: boolean\n is_skipped:\n type: boolean\n exclude_from_cycle:\n type: boolean\n next_status:\n $ref: \"#/$defs/nonEmptyString\"\n order:\n type: number\n auto_archive:\n type: boolean\n auto_archive_delay_minutes:\n type: number\n minimum: 0\n additionalProperties: true\n statusPolicy:\n type: object\n required:\n - values\n - default\n - completed_values\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n completed_values:\n $ref: \"#/$defs/stringSet\"\n skipped_values:\n $ref: \"#/$defs/stringSet\"\n default_skipped:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/statusDefinition\"\n additionalProperties: false\n priorityDefinition:\n type: object\n required:\n - value\n - label\n - color\n - weight\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n weight:\n type: number\n additionalProperties: true\n priorityPolicy:\n type: object\n required:\n - values\n - default\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/priorityDefinition\"\n additionalProperties: false\n recurrencePolicy:\n type: object\n required:\n - syntax\n - maintain_due_date_offset\n - reset_body_checkboxes\n properties:\n syntax:\n const: tasknotes\n maintain_due_date_offset:\n type: boolean\n reset_body_checkboxes:\n type: boolean\n additionalProperties: false\n occurrencePolicy:\n type: object\n required:\n - identity_roles\n - default_materialization\n - default_next_trigger\n properties:\n identity_roles:\n const:\n - recurrenceParent\n - occurrenceDate\n default_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default_next_trigger:\n enum:\n - completion\n - completion_or_skip\n past_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n future_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n linkPolicy:\n type: object\n required:\n - accepted_formats\n - write_format\n properties:\n accepted_formats:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - wikilink\n - markdown\n write_format:\n enum:\n - wikilink\n - markdown\n additionalProperties: false\n archivePolicy:\n type: object\n required:\n - archived_tag\n - move_on_archive\n properties:\n archived_tag:\n $ref: \"#/$defs/nonEmptyString\"\n move_on_archive:\n type: boolean\n folder:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n timeTrackingPolicy:\n type: object\n required:\n - auto_stop_on_complete\n properties:\n auto_stop_on_complete:\n type: boolean\n additionalProperties: false\n templatingPolicy:\n type: object\n required:\n - enabled\n - occurrence_enabled\n properties:\n enabled:\n type: boolean\n template_path:\n $ref: \"#/$defs/nonEmptyString\"\n occurrence_enabled:\n type: boolean\n occurrence_template_path:\n $ref: \"#/$defs/nonEmptyString\"\n failure_mode:\n enum:\n - error\n - warning_fallback\n unknown_variable_policy:\n enum:\n - preserve\n - empty\n additionalProperties: false\n nlpTrigger:\n type: object\n required:\n - property_id\n - trigger\n - enabled\n properties:\n property_id:\n $ref: \"#/$defs/nonEmptyString\"\n trigger:\n $ref: \"#/$defs/nonEmptyString\"\n enabled:\n type: boolean\n additionalProperties: false\n nlpPolicy:\n type: object\n required:\n - triggers\n properties:\n triggers:\n type: array\n items:\n $ref: \"#/$defs/nlpTrigger\"\n additionalProperties: false\n---\n\n# TaskNotes task contract\n\nTypes implement this contract through `implements`; applications consume\nthe normalized contract view rather than assuming frontmatter names.\n" + }, + { + "source": "contracts/tasknotes.task/0.3.0-rc.3.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: tasknotes.task\nversion: 0.3.0-rc.3\nname: TaskNotes task\ndescription: Portable task data and behavior defined by tasknotes-spec 0.3.0-rc.3.\nrecord_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task.schema.json\n title: TaskNotes portable task view\n description: The storage-neutral record view exposed by the tasknotes.task 0.3.0-rc.3 record contract.\n type: object\n required:\n - status\n - dateCreated\n additionalProperties: false\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n type: string\n minLength: 1\n priority:\n type: string\n minLength: 1\n due:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n attachments:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrenceAnchor:\n enum:\n - scheduled\n - completion\n recurrenceParent:\n type: string\n occurrenceDate:\n type: string\n format: date\n occurrenceMaterialization:\n enum:\n - manual\n - on_completion\n - rolling\n occurrenceNextTrigger:\n enum:\n - completion\n - completion_or_skip\n occurrenceTemplate:\n type: string\n occurrencePastHorizon:\n type: string\n occurrenceFutureHorizon:\n type: string\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n reminders:\n type: array\n items:\n type: object\n blockedBy:\n type: array\n items:\n type: object\n completeInstances:\n type: array\n items:\n type: string\n format: date\n skippedInstances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n sortOrder:\n type: string\nbinding_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task-binding.schema.json\n title: TaskNotes task data-contract binding\n description: Semantic configuration supplied by an mdbase type that implements tasknotes.task 0.3.0-rc.3.\n type: object\n required:\n - profiles\n - capabilities\n - title\n - status\n - priority\n - recurrence\n - occurrences\n - links\n - archive\n - time_tracking\n - templating\n properties:\n profiles:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - core-lite\n - recurrence\n - templating\n - materialized-occurrences\n - extended\n capabilities:\n type: array\n uniqueItems: true\n items:\n enum:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - rename\n - archive\n - batch\n - concurrency\n - dry-run\n - migration\n - templating\n title:\n $ref: \"#/$defs/titlePolicy\"\n status:\n $ref: \"#/$defs/statusPolicy\"\n priority:\n $ref: \"#/$defs/priorityPolicy\"\n recurrence:\n $ref: \"#/$defs/recurrencePolicy\"\n occurrences:\n $ref: \"#/$defs/occurrencePolicy\"\n links:\n $ref: \"#/$defs/linkPolicy\"\n archive:\n $ref: \"#/$defs/archivePolicy\"\n time_tracking:\n $ref: \"#/$defs/timeTrackingPolicy\"\n templating:\n $ref: \"#/$defs/templatingPolicy\"\n nlp:\n $ref: \"#/$defs/nlpPolicy\"\n additionalProperties: false\n $defs:\n nonEmptyString:\n type: string\n minLength: 1\n stringSet:\n type: array\n uniqueItems: true\n items:\n $ref: \"#/$defs/nonEmptyString\"\n titlePolicy:\n type: object\n required:\n - storage\n properties:\n storage:\n enum:\n - filename\n - frontmatter\n filename_format:\n enum:\n - title\n - zettel\n - timestamp\n - uuid\n - custom\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n allOf:\n - if:\n properties:\n filename_format:\n const: custom\n required:\n - filename_format\n then:\n properties:\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n required:\n - custom_filename_template\n additionalProperties: true\n statusDefinition:\n type: object\n required:\n - value\n - label\n - color\n - is_completed\n - is_skipped\n - exclude_from_cycle\n - order\n - auto_archive\n - auto_archive_delay_minutes\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n is_completed:\n type: boolean\n is_skipped:\n type: boolean\n exclude_from_cycle:\n type: boolean\n next_status:\n $ref: \"#/$defs/nonEmptyString\"\n order:\n type: number\n auto_archive:\n type: boolean\n auto_archive_delay_minutes:\n type: number\n minimum: 0\n additionalProperties: true\n statusPolicy:\n type: object\n required:\n - values\n - default\n - completed_values\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n completed_values:\n $ref: \"#/$defs/stringSet\"\n skipped_values:\n $ref: \"#/$defs/stringSet\"\n default_skipped:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/statusDefinition\"\n additionalProperties: false\n priorityDefinition:\n type: object\n required:\n - value\n - label\n - color\n - weight\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n weight:\n type: number\n additionalProperties: true\n priorityPolicy:\n type: object\n required:\n - values\n - default\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/priorityDefinition\"\n additionalProperties: false\n recurrencePolicy:\n type: object\n required:\n - syntax\n - maintain_due_date_offset\n - reset_body_checkboxes\n properties:\n syntax:\n const: tasknotes\n maintain_due_date_offset:\n type: boolean\n reset_body_checkboxes:\n type: boolean\n additionalProperties: false\n occurrencePolicy:\n type: object\n required:\n - identity_roles\n - default_materialization\n - default_next_trigger\n properties:\n identity_roles:\n const:\n - recurrenceParent\n - occurrenceDate\n default_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default_next_trigger:\n enum:\n - completion\n - completion_or_skip\n past_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n future_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n linkPolicy:\n type: object\n required:\n - accepted_formats\n - write_format\n properties:\n accepted_formats:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - wikilink\n - markdown\n write_format:\n enum:\n - wikilink\n - markdown\n additionalProperties: false\n archivePolicy:\n type: object\n required:\n - archived_tag\n - move_on_archive\n properties:\n archived_tag:\n $ref: \"#/$defs/nonEmptyString\"\n move_on_archive:\n type: boolean\n folder:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n timeTrackingPolicy:\n type: object\n required:\n - auto_stop_on_complete\n properties:\n auto_stop_on_complete:\n type: boolean\n additionalProperties: false\n templatingPolicy:\n type: object\n required:\n - enabled\n - occurrence_enabled\n properties:\n enabled:\n type: boolean\n template_path:\n $ref: \"#/$defs/nonEmptyString\"\n occurrence_enabled:\n type: boolean\n occurrence_template_path:\n $ref: \"#/$defs/nonEmptyString\"\n failure_mode:\n enum:\n - error\n - warning_fallback\n unknown_variable_policy:\n enum:\n - preserve\n - empty\n additionalProperties: false\n nlpTrigger:\n type: object\n required:\n - property_id\n - trigger\n - enabled\n properties:\n property_id:\n $ref: \"#/$defs/nonEmptyString\"\n trigger:\n $ref: \"#/$defs/nonEmptyString\"\n enabled:\n type: boolean\n additionalProperties: false\n nlpPolicy:\n type: object\n required:\n - triggers\n properties:\n triggers:\n type: array\n items:\n $ref: \"#/$defs/nlpTrigger\"\n additionalProperties: false\n---\n\n# TaskNotes task contract\n\nTypes implement this contract through `implements`; applications consume\nthe normalized contract view rather than assuming frontmatter names.\n" + }, + { + "source": "contracts/tasknotes.task/0.3.0-rc.6.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: tasknotes.task\nversion: 0.3.0-rc.6\nname: TaskNotes task\ndescription: Portable task data and behavior defined by tasknotes-spec 0.3.0-rc.6.\nrecord_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task.schema.json\n title: TaskNotes portable task view\n description: The storage-neutral record view exposed by the tasknotes.task 0.3.0-rc.6 record contract.\n type: object\n required:\n - status\n - dateCreated\n additionalProperties: false\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n type: string\n minLength: 1\n priority:\n type: string\n minLength: 1\n due:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled:\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n pattern: \\S\n description: Links to records implementing mdbase.person, such as [[Alex Rivera]]. Implementing types declare this field in collection.links. These references never grant collection access.\n attachments:\n type: array\n uniqueItems: true\n items:\n type: string\n minLength: 1\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrenceAnchor:\n enum:\n - scheduled\n - completion\n recurrenceParent:\n type: string\n occurrenceDate:\n type: string\n format: date\n occurrenceMaterialization:\n enum:\n - manual\n - on_completion\n - rolling\n occurrenceNextTrigger:\n enum:\n - completion\n - completion_or_skip\n occurrenceTemplate:\n type: string\n occurrencePastHorizon:\n type: string\n occurrenceFutureHorizon:\n type: string\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n reminders:\n type: array\n items:\n type: object\n blockedBy:\n type: array\n items:\n type: object\n completeInstances:\n type: array\n items:\n type: string\n format: date\n skippedInstances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n sortOrder:\n type: string\nbinding_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n $id: https://tasknotes.dev/schemas/tasknotes-task-binding.schema.json\n title: TaskNotes task data-contract binding\n description: Semantic configuration supplied by an mdbase type that implements tasknotes.task 0.3.0-rc.6. App behaviour, such as templates, archive moves, status cycling and natural-language triggers, lives in the app's tasknotes.settings record instead.\n type: object\n required:\n - profiles\n - capabilities\n - title\n - status\n - priority\n - recurrence\n - occurrences\n - links\n - archive\n properties:\n profiles:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - core-lite\n - recurrence\n - templating\n - materialized-occurrences\n - extended\n capabilities:\n type: array\n uniqueItems: true\n items:\n enum:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - rename\n - archive\n - batch\n - concurrency\n - dry-run\n - migration\n - templating\n title:\n $ref: \"#/$defs/titlePolicy\"\n status:\n $ref: \"#/$defs/statusPolicy\"\n priority:\n $ref: \"#/$defs/priorityPolicy\"\n recurrence:\n $ref: \"#/$defs/recurrencePolicy\"\n occurrences:\n $ref: \"#/$defs/occurrencePolicy\"\n links:\n $ref: \"#/$defs/linkPolicy\"\n archive:\n $ref: \"#/$defs/archivePolicy\"\n additionalProperties: false\n $defs:\n nonEmptyString:\n type: string\n minLength: 1\n stringSet:\n type: array\n uniqueItems: true\n items:\n $ref: \"#/$defs/nonEmptyString\"\n titlePolicy:\n type: object\n required:\n - storage\n properties:\n storage:\n enum:\n - filename\n - frontmatter\n filename_format:\n enum:\n - title\n - zettel\n - timestamp\n - uuid\n - custom\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n allOf:\n - if:\n properties:\n filename_format:\n const: custom\n required:\n - filename_format\n then:\n properties:\n custom_filename_template:\n $ref: \"#/$defs/nonEmptyString\"\n required:\n - custom_filename_template\n additionalProperties: true\n statusDefinition:\n type: object\n required:\n - value\n - label\n - color\n - is_completed\n - is_skipped\n - order\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n is_completed:\n type: boolean\n is_skipped:\n type: boolean\n order:\n type: number\n additionalProperties: true\n statusPolicy:\n type: object\n required:\n - values\n - default\n - completed_values\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n completed_values:\n $ref: \"#/$defs/stringSet\"\n skipped_values:\n $ref: \"#/$defs/stringSet\"\n default_skipped:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/statusDefinition\"\n additionalProperties: false\n priorityDefinition:\n type: object\n required:\n - value\n - label\n - color\n - weight\n properties:\n value:\n $ref: \"#/$defs/nonEmptyString\"\n label:\n type: string\n color:\n type: string\n icon:\n $ref: \"#/$defs/nonEmptyString\"\n weight:\n type: number\n additionalProperties: true\n priorityPolicy:\n type: object\n required:\n - values\n - default\n - definitions\n properties:\n values:\n $ref: \"#/$defs/stringSet\"\n default:\n $ref: \"#/$defs/nonEmptyString\"\n definitions:\n type: array\n items:\n $ref: \"#/$defs/priorityDefinition\"\n additionalProperties: false\n recurrencePolicy:\n type: object\n required:\n - syntax\n - maintain_due_date_offset\n properties:\n syntax:\n const: tasknotes\n maintain_due_date_offset:\n type: boolean\n additionalProperties: false\n occurrencePolicy:\n type: object\n required:\n - identity_roles\n - default_materialization\n - default_next_trigger\n properties:\n identity_roles:\n const:\n - recurrenceParent\n - occurrenceDate\n default_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default_next_trigger:\n enum:\n - completion\n - completion_or_skip\n past_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n future_horizon:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n linkPolicy:\n type: object\n required:\n - accepted_formats\n properties:\n accepted_formats:\n type: array\n minItems: 1\n uniqueItems: true\n items:\n enum:\n - wikilink\n - markdown\n additionalProperties: false\n archivePolicy:\n type: object\n required:\n - archived_tag\n properties:\n archived_tag:\n $ref: \"#/$defs/nonEmptyString\"\n additionalProperties: false\n---\n\n# TaskNotes task contract\n\nTypes implement this contract through `implements`; applications consume\nthe normalized contract view rather than assuming frontmatter names.\n" + }, + { + "source": "types/tasknotes-task/6.md", + "document": "---\nkind: mdbase.type\nname: task\nversion: 5\ndescription: A task managed by TaskNotes.\nmatch:\n where:\n tags:\n contains: task\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n type: object\n additionalProperties: true\n properties:\n id:\n type: string\n minLength: 1\n title:\n type: string\n minLength: 1\n status:\n enum: &a2\n - none\n - open\n - in-progress\n - done\n - cancelled\n default: open\n priority:\n enum: &a4\n - none\n - low\n - normal\n - high\n default: normal\n due: &a1\n anyOf:\n - type: string\n format: date\n - type: string\n format: date-time\n scheduled: *a1\n contexts:\n type: array\n items:\n type: string\n projects:\n type: array\n items:\n type: string\n assignees:\n type: array\n items:\n type: string\n minLength: 1\n pattern: \\S\n uniqueItems: true\n attachments:\n type: array\n items:\n type: string\n minLength: 1\n uniqueItems: true\n timeEstimate:\n type: integer\n minimum: 0\n completedDate:\n type: string\n format: date\n dateCreated:\n type: string\n format: date-time\n dateModified:\n type: string\n format: date-time\n recurrence:\n type: string\n recurrence_anchor:\n enum:\n - scheduled\n - completion\n default: scheduled\n occurrence_materialization:\n enum:\n - manual\n - on_completion\n - rolling\n default: manual\n occurrence_next_trigger:\n enum:\n - completion\n - completion_or_skip\n default: completion\n occurrence_template:\n type: string\n occurrence_past_horizon:\n type: string\n occurrence_future_horizon:\n type: string\n recurrence_parent:\n type: string\n occurrence_date:\n type: string\n format: date\n tags:\n type: array\n items:\n type: string\n timeEntries:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n startTime:\n type: string\n format: date-time\n endTime:\n type: string\n format: date-time\n description:\n type: string\n duration:\n type: integer\n reminders:\n type: array\n items:\n oneOf:\n - type: object\n required:\n - id\n - type\n - absoluteTime\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: absolute\n description:\n type: string\n absoluteTime:\n type: string\n format: date-time\n - type: object\n required:\n - id\n - type\n - relatedTo\n - offset\n additionalProperties: false\n properties:\n id:\n type: string\n type:\n const: relative\n description:\n type: string\n relatedTo:\n enum:\n - due\n - scheduled\n offset:\n type: string\n blockedBy:\n type: array\n items:\n type: object\n additionalProperties: false\n properties:\n uid:\n type: string\n reltype:\n type: string\n gap:\n type: string\n required:\n - uid\n complete_instances:\n type: array\n items:\n type: string\n format: date\n skipped_instances:\n type: array\n items:\n type: string\n format: date\n icsEventId:\n type: array\n items:\n type: string\n googleCalendarEventId:\n type: string\n googleCalendarExceptionEventId:\n type: string\n googleCalendarExceptionOriginalScheduled:\n type: string\n format: date\n googleCalendarMovedOriginalDates:\n type: array\n items:\n type: string\n format: date\n tasknotes_manual_order:\n type: string\n allOf:\n - if:\n required:\n - status\n properties:\n status:\n enum: &a3\n - done\n not:\n required:\n - recurrence\n then:\n required:\n - completedDate\n required:\n - title\n - status\n - dateCreated\ncollection:\n read_defaults:\n status: open\n priority: normal\n recurrence_anchor: scheduled\n occurrence_materialization: manual\n occurrence_next_trigger: completion\n links:\n projects[]:\n target_type: any\n validate_exists: false\n assignees[]:\n validate_exists: false\n attachments[]:\n validate_exists: false\n occurrence_template:\n target_type: any\n validate_exists: false\n recurrence_parent:\n target_type: task\n validate_exists: false\n blockedBy[].uid:\n target_type: task\n validate_exists: false\n path:\n runtime: tasknotes\n template: \"{{zettel}}\"\n folder: tasks\n generated_by: tasknotes.filename.create\n display:\n name_field: title\n unique:\n - field: id\n scope: type\nlifecycle:\n on_create:\n set:\n id:\n uuid: true\n dateCreated:\n now: true\n dateModified:\n now: true\n on_update:\n set:\n dateModified:\n now: true\nimplements:\n - contract: tasknotes.task\n version: 0.3.0-rc.6\n fields:\n id: id\n title: title\n status: status\n priority: priority\n due: due\n scheduled: scheduled\n contexts: contexts\n projects: projects\n assignees: assignees\n attachments: attachments\n timeEstimate: timeEstimate\n completedDate: completedDate\n dateCreated: dateCreated\n dateModified: dateModified\n recurrence: recurrence\n recurrenceAnchor: recurrence_anchor\n occurrenceMaterialization: occurrence_materialization\n occurrenceNextTrigger: occurrence_next_trigger\n occurrenceTemplate: occurrence_template\n occurrencePastHorizon: occurrence_past_horizon\n occurrenceFutureHorizon: occurrence_future_horizon\n recurrenceParent: recurrence_parent\n occurrenceDate: occurrence_date\n tags: tags\n timeEntries: timeEntries\n reminders: reminders\n blockedBy: blockedBy\n completeInstances: complete_instances\n skippedInstances: skipped_instances\n icsEventId: icsEventId\n googleCalendarEventId: googleCalendarEventId\n googleCalendarExceptionEventId: googleCalendarExceptionEventId\n googleCalendarExceptionOriginalScheduled: googleCalendarExceptionOriginalScheduled\n googleCalendarMovedOriginalDates: googleCalendarMovedOriginalDates\n sortOrder: tasknotes_manual_order\n binding:\n profiles:\n - core-lite\n - recurrence\n - materialized-occurrences\n capabilities:\n - dependencies\n - reminders\n - attachments\n - links\n - time-tracking\n - materialized-occurrences\n - archive\n - templating\n title:\n storage: frontmatter\n filename_format: zettel\n status:\n values: *a2\n default: open\n completed_values: *a3\n skipped_values:\n - cancelled\n default_skipped: cancelled\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: false\n order: 0\n - value: open\n label: Open\n color: \"#64748b\"\n is_completed: false\n is_skipped: false\n order: 1\n - value: in-progress\n label: In progress\n color: \"#3b82f6\"\n is_completed: false\n is_skipped: false\n order: 2\n - value: done\n label: Done\n color: \"#22c55e\"\n is_completed: true\n is_skipped: false\n order: 3\n - value: cancelled\n label: Cancelled\n color: \"#94a3b8\"\n is_completed: false\n is_skipped: true\n order: 4\n priority:\n values: *a4\n default: normal\n definitions:\n - value: none\n label: None\n color: \"#94a3b8\"\n weight: 0\n - value: low\n label: Low\n color: \"#3b82f6\"\n weight: 1\n - value: normal\n label: Normal\n color: \"#f59e0b\"\n weight: 2\n - value: high\n label: High\n color: \"#ef4444\"\n weight: 3\n recurrence:\n syntax: tasknotes\n maintain_due_date_offset: true\n occurrences:\n identity_roles:\n - recurrenceParent\n - occurrenceDate\n default_materialization: manual\n default_next_trigger: completion\n past_horizon: P0D\n future_horizon: P14D\n links:\n accepted_formats:\n - wikilink\n - markdown\n archive:\n archived_tag: archived\nx-tasknotes-generator:\n managed_fields:\n - attachments\n - blockedBy\n - complete_instances\n - completedDate\n - contexts\n - dateCreated\n - dateModified\n - due\n - googleCalendarEventId\n - googleCalendarExceptionEventId\n - googleCalendarExceptionOriginalScheduled\n - googleCalendarMovedOriginalDates\n - icsEventId\n - id\n - occurrence_date\n - occurrence_future_horizon\n - occurrence_materialization\n - occurrence_next_trigger\n - occurrence_past_horizon\n - occurrence_template\n - priority\n - projects\n - recurrence\n - recurrence_anchor\n - recurrence_parent\n - reminders\n - scheduled\n - skipped_instances\n - status\n - tags\n - tasknotes_manual_order\n - timeEntries\n - timeEstimate\n - title\n---\n# Task\n\nTask records live under `tasks/`.\n" + }, + { + "source": "schemas/tasknotes.task/0.3.0-rc.6.schema.json", + "document": "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://tasknotes.dev/schemas/tasknotes-task.schema.json\",\n \"title\": \"TaskNotes portable task view\",\n \"description\": \"The storage-neutral record view exposed by the tasknotes.task 0.3.0-rc.6 record contract.\",\n \"type\": \"object\",\n \"required\": [\n \"status\",\n \"dateCreated\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"status\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"priority\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"due\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n ]\n },\n \"scheduled\": {\n \"anyOf\": [\n {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n {\n \"type\": \"string\",\n \"format\": \"date-time\"\n }\n ]\n },\n \"contexts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"projects\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"assignees\": {\n \"type\": \"array\",\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"pattern\": \"\\\\S\"\n },\n \"description\": \"Links to records implementing mdbase.person, such as [[Alex Rivera]]. Implementing types declare this field in collection.links. These references never grant collection access.\"\n },\n \"attachments\": {\n \"type\": \"array\",\n \"uniqueItems\": true,\n \"items\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n },\n \"timeEstimate\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"completedDate\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"dateCreated\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"dateModified\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"recurrence\": {\n \"type\": \"string\"\n },\n \"recurrenceAnchor\": {\n \"enum\": [\n \"scheduled\",\n \"completion\"\n ]\n },\n \"recurrenceParent\": {\n \"type\": \"string\"\n },\n \"occurrenceDate\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"occurrenceMaterialization\": {\n \"enum\": [\n \"manual\",\n \"on_completion\",\n \"rolling\"\n ]\n },\n \"occurrenceNextTrigger\": {\n \"enum\": [\n \"completion\",\n \"completion_or_skip\"\n ]\n },\n \"occurrenceTemplate\": {\n \"type\": \"string\"\n },\n \"occurrencePastHorizon\": {\n \"type\": \"string\"\n },\n \"occurrenceFutureHorizon\": {\n \"type\": \"string\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"timeEntries\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\"\n }\n },\n \"reminders\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\"\n }\n },\n \"blockedBy\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\"\n }\n },\n \"completeInstances\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"date\"\n }\n },\n \"skippedInstances\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"date\"\n }\n },\n \"icsEventId\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"googleCalendarEventId\": {\n \"type\": \"string\"\n },\n \"googleCalendarExceptionEventId\": {\n \"type\": \"string\"\n },\n \"googleCalendarExceptionOriginalScheduled\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"googleCalendarMovedOriginalDates\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"date\"\n }\n },\n \"sortOrder\": {\n \"type\": \"string\"\n }\n }\n}\n" + }, + { + "source": "schemas/tasknotes.task.binding/0.3.0-rc.6.schema.json", + "document": "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://tasknotes.dev/schemas/tasknotes-task-binding.schema.json\",\n \"title\": \"TaskNotes task data-contract binding\",\n \"description\": \"Semantic configuration supplied by an mdbase type that implements tasknotes.task 0.3.0-rc.6. App behaviour, such as templates, archive moves, status cycling and natural-language triggers, lives in the app's tasknotes.settings record instead.\",\n \"type\": \"object\",\n \"required\": [\n \"profiles\",\n \"capabilities\",\n \"title\",\n \"status\",\n \"priority\",\n \"recurrence\",\n \"occurrences\",\n \"links\",\n \"archive\"\n ],\n \"properties\": {\n \"profiles\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"uniqueItems\": true,\n \"items\": {\n \"enum\": [\n \"core-lite\",\n \"recurrence\",\n \"templating\",\n \"materialized-occurrences\",\n \"extended\"\n ]\n }\n },\n \"capabilities\": {\n \"type\": \"array\",\n \"uniqueItems\": true,\n \"items\": {\n \"enum\": [\n \"dependencies\",\n \"reminders\",\n \"attachments\",\n \"links\",\n \"time-tracking\",\n \"materialized-occurrences\",\n \"rename\",\n \"archive\",\n \"batch\",\n \"concurrency\",\n \"dry-run\",\n \"migration\",\n \"templating\"\n ]\n }\n },\n \"title\": {\n \"$ref\": \"#/$defs/titlePolicy\"\n },\n \"status\": {\n \"$ref\": \"#/$defs/statusPolicy\"\n },\n \"priority\": {\n \"$ref\": \"#/$defs/priorityPolicy\"\n },\n \"recurrence\": {\n \"$ref\": \"#/$defs/recurrencePolicy\"\n },\n \"occurrences\": {\n \"$ref\": \"#/$defs/occurrencePolicy\"\n },\n \"links\": {\n \"$ref\": \"#/$defs/linkPolicy\"\n },\n \"archive\": {\n \"$ref\": \"#/$defs/archivePolicy\"\n }\n },\n \"additionalProperties\": false,\n \"$defs\": {\n \"nonEmptyString\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"stringSet\": {\n \"type\": \"array\",\n \"uniqueItems\": true,\n \"items\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n }\n },\n \"titlePolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"storage\"\n ],\n \"properties\": {\n \"storage\": {\n \"enum\": [\n \"filename\",\n \"frontmatter\"\n ]\n },\n \"filename_format\": {\n \"enum\": [\n \"title\",\n \"zettel\",\n \"timestamp\",\n \"uuid\",\n \"custom\"\n ]\n },\n \"custom_filename_template\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n }\n },\n \"allOf\": [\n {\n \"if\": {\n \"properties\": {\n \"filename_format\": {\n \"const\": \"custom\"\n }\n },\n \"required\": [\n \"filename_format\"\n ]\n },\n \"then\": {\n \"properties\": {\n \"custom_filename_template\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n }\n },\n \"required\": [\n \"custom_filename_template\"\n ]\n }\n }\n ],\n \"additionalProperties\": true\n },\n \"statusDefinition\": {\n \"type\": \"object\",\n \"required\": [\n \"value\",\n \"label\",\n \"color\",\n \"is_completed\",\n \"is_skipped\",\n \"order\"\n ],\n \"properties\": {\n \"value\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"icon\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"is_completed\": {\n \"type\": \"boolean\"\n },\n \"is_skipped\": {\n \"type\": \"boolean\"\n },\n \"order\": {\n \"type\": \"number\"\n }\n },\n \"additionalProperties\": true\n },\n \"statusPolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"values\",\n \"default\",\n \"completed_values\",\n \"definitions\"\n ],\n \"properties\": {\n \"values\": {\n \"$ref\": \"#/$defs/stringSet\"\n },\n \"default\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"completed_values\": {\n \"$ref\": \"#/$defs/stringSet\"\n },\n \"skipped_values\": {\n \"$ref\": \"#/$defs/stringSet\"\n },\n \"default_skipped\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"definitions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/statusDefinition\"\n }\n }\n },\n \"additionalProperties\": false\n },\n \"priorityDefinition\": {\n \"type\": \"object\",\n \"required\": [\n \"value\",\n \"label\",\n \"color\",\n \"weight\"\n ],\n \"properties\": {\n \"value\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"icon\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"weight\": {\n \"type\": \"number\"\n }\n },\n \"additionalProperties\": true\n },\n \"priorityPolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"values\",\n \"default\",\n \"definitions\"\n ],\n \"properties\": {\n \"values\": {\n \"$ref\": \"#/$defs/stringSet\"\n },\n \"default\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"definitions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/priorityDefinition\"\n }\n }\n },\n \"additionalProperties\": false\n },\n \"recurrencePolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"syntax\",\n \"maintain_due_date_offset\"\n ],\n \"properties\": {\n \"syntax\": {\n \"const\": \"tasknotes\"\n },\n \"maintain_due_date_offset\": {\n \"type\": \"boolean\"\n }\n },\n \"additionalProperties\": false\n },\n \"occurrencePolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"identity_roles\",\n \"default_materialization\",\n \"default_next_trigger\"\n ],\n \"properties\": {\n \"identity_roles\": {\n \"const\": [\n \"recurrenceParent\",\n \"occurrenceDate\"\n ]\n },\n \"default_materialization\": {\n \"enum\": [\n \"manual\",\n \"on_completion\",\n \"rolling\"\n ]\n },\n \"default_next_trigger\": {\n \"enum\": [\n \"completion\",\n \"completion_or_skip\"\n ]\n },\n \"past_horizon\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n },\n \"future_horizon\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n }\n },\n \"additionalProperties\": false\n },\n \"linkPolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"accepted_formats\"\n ],\n \"properties\": {\n \"accepted_formats\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"uniqueItems\": true,\n \"items\": {\n \"enum\": [\n \"wikilink\",\n \"markdown\"\n ]\n }\n }\n },\n \"additionalProperties\": false\n },\n \"archivePolicy\": {\n \"type\": \"object\",\n \"required\": [\n \"archived_tag\"\n ],\n \"properties\": {\n \"archived_tag\": {\n \"$ref\": \"#/$defs/nonEmptyString\"\n }\n },\n \"additionalProperties\": false\n }\n }\n}\n" + }, + { + "source": "schemas/mdbase.app-settings/1.0.0.schema.json", + "document": "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"title\": \"mdbase.app-settings 1.0.0 record contract view\",\n \"description\": \"The reserved fields every app settings record shares. Everything else in the record belongs to the app and is described by the app's own settings contract.\",\n \"type\": \"object\",\n \"required\": [\"app\", \"scope\", \"settings_version\"],\n \"properties\": {\n \"app\": {\n \"type\": \"string\",\n \"pattern\": \"^[a-z0-9]+([.-][a-z0-9]+)*$\",\n \"description\": \"The app whose clients honour these settings, such as tasknotes or dev.mdbase.reader.\"\n },\n \"scope\": {\n \"enum\": [\"collection\", \"user\"],\n \"description\": \"Who the values apply to: everyone using the app in this collection, or one person.\"\n },\n \"user\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"A link to the mdbase.person record the values apply to. Present only when scope is user.\"\n },\n \"settings_version\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"description\": \"The version of the app's settings schema that last wrote the record. A client that does not understand it treats the settings as read-only.\"\n }\n },\n \"allOf\": [\n {\n \"if\": { \"properties\": { \"scope\": { \"const\": \"user\" } }, \"required\": [\"scope\"] },\n \"then\": { \"required\": [\"user\"] },\n \"else\": { \"not\": { \"required\": [\"user\"] } }\n }\n ],\n \"additionalProperties\": true\n}\n" + }, + { + "source": "contracts/mdbase.app-settings/1.0.0.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: mdbase.app-settings\nversion: 1.0.0\nname: App settings\ndescription: One record per app holding the policy that app's clients honour in this collection.\nrecord_schema:\n dialect: json-schema-2020-12\n ref: ../../schemas/mdbase.app-settings/1.0.0.schema.json\n---\n\n# App settings\n\nAn app settings record holds values that every client of one app honours in this\ncollection, such as how new files are named. The values change client behaviour,\nnever what another record means.\n\n## Location and identity\n\nA collection-scope record lives at `_settings/.md`, where `` is the\nrecord's `app` field. Clients read it by that path, without a query. Each\nimplementing type declares `collection.unique` on `app` with `scope: type`, so a\ncollection holds at most one collection-scope record per app.\n\nThe record's `type` field names the app's own settings type, not a shared value.\nGeneric tools find every settings record through this contract.\n\n## Reserved fields\n\n- `app`: the app id.\n- `scope`: `collection`, or `user` for one person's overrides.\n- `user`: a link to an `mdbase.person` record, present only when `scope` is\n `user`.\n- `settings_version`: the version of the app's settings schema that last wrote\n the record.\n\nEvery other frontmatter field belongs to the app and is described by the app's\nown settings contract. The body is free Markdown for people; apps never parse it.\n\n## Client behaviour\n\n- A missing record means every setting has its default. Clients never create the\n record on read.\n- A missing or invalid field takes its default; valid fields are used as\n written. The record is not rewritten until someone saves.\n- A save creates the record at its fixed path the first time, and otherwise\n patches only the fields it changes, guarded by the record's revision.\n- A client that finds a `settings_version` newer than it understands treats the\n settings as read-only and uses them as written.\n\n## Authority\n\nThis artifact is passive. A settings record grants nothing and must never hold\nsecrets: anyone who can read or write records can read or edit it.\n" + }, + { + "source": "schemas/tasknotes.settings/1.0.0.schema.json", + "document": "{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"title\": \"tasknotes.settings 1.0.0\",\n \"description\": \"Collection-wide behaviour that every TaskNotes client honours. Every field is optional and has a default, so a record with none of them behaves like no record at all.\",\n \"type\": \"object\",\n \"required\": [\n \"app\",\n \"scope\",\n \"settings_version\"\n ],\n \"properties\": {\n \"app\": {\n \"const\": \"dev.tasknotes\",\n \"description\": \"Marks this record as TaskNotes' settings.\"\n },\n \"scope\": {\n \"const\": \"collection\",\n \"description\": \"These settings apply to everyone using TaskNotes in this collection.\"\n },\n \"settings_version\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"description\": \"The version of these settings that last wrote the record. TaskNotes writes 1.\"\n },\n \"nlp_triggers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"property_id\",\n \"trigger\",\n \"enabled\"\n ],\n \"properties\": {\n \"property_id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"trigger\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"enabled\": {\n \"type\": \"boolean\"\n }\n },\n \"additionalProperties\": false\n },\n \"description\": \"Natural-language capture triggers, such as @ for contexts. Without the field each client uses its own defaults.\"\n },\n \"template_enabled\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Apply template_path to the body of new tasks.\"\n },\n \"template_path\": {\n \"type\": \"string\",\n \"description\": \"The template for new task bodies. Empty or absent means none.\"\n },\n \"occurrence_template_enabled\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Apply occurrence_template_path to new materialized occurrences.\"\n },\n \"occurrence_template_path\": {\n \"type\": \"string\",\n \"description\": \"The template for new occurrence bodies. Empty or absent means none.\"\n },\n \"template_failure_mode\": {\n \"enum\": [\n \"error\",\n \"warning_fallback\"\n ],\n \"description\": \"What a client does when a template cannot be applied.\"\n },\n \"template_unknown_variable_policy\": {\n \"enum\": [\n \"preserve\",\n \"empty\"\n ],\n \"description\": \"What a client writes for a template variable it does not know.\"\n },\n \"move_on_archive\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Move a task's file to archive_folder when it is archived.\"\n },\n \"archive_folder\": {\n \"type\": \"string\",\n \"description\": \"Where archived tasks move to. Empty or absent means the client's default.\"\n },\n \"auto_stop_time_tracking_on_complete\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Stop a running timer when its task is completed.\"\n },\n \"reset_body_checkboxes_on_recurrence\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Uncheck body checkboxes when a recurring task moves to its next occurrence.\"\n },\n \"link_write_format\": {\n \"enum\": [\n \"wikilink\",\n \"markdown\"\n ],\n \"default\": \"wikilink\",\n \"description\": \"How clients write links into task frontmatter. Both formats are always read.\"\n },\n \"status_behavior\": {\n \"type\": \"object\",\n \"description\": \"Behaviour per status value. A status without an entry has no next status and no auto-archive, and is out of the status cycle exactly when it is a skipped status.\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"properties\": {\n \"next_status\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The status the cycle moves to next.\"\n },\n \"exclude_from_cycle\": {\n \"type\": \"boolean\",\n \"description\": \"Leave this status out of the status cycle.\"\n },\n \"auto_archive\": {\n \"type\": \"boolean\",\n \"description\": \"Archive a task some time after it takes this status.\"\n },\n \"auto_archive_delay_minutes\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"How long after taking this status a task is archived.\"\n }\n },\n \"additionalProperties\": false\n },\n \"default\": {}\n }\n },\n \"additionalProperties\": true\n}\n" + }, + { + "source": "contracts/tasknotes.settings/1.0.0.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: tasknotes.settings\nversion: 1.0.0\nname: TaskNotes settings\ndescription: Collection-wide TaskNotes behaviour, such as templates, archive moves and status cycling.\nrecord_schema:\n dialect: json-schema-2020-12\n ref: ../../schemas/tasknotes.settings/1.0.0.schema.json\n---\n\n# TaskNotes settings\n\nThe collection's settings record for TaskNotes, at `_settings/dev.tasknotes.md`.\nIt also implements `mdbase.app-settings`, whose reserved fields (`app`, `scope`,\n`settings_version`) it shares.\n\nThese settings change what TaskNotes clients do, never what a task record\nmeans: that stays in the `tasknotes.task` binding of each task type.\n`tasknotes.task` 0.3.0-rc.6 moved them here from the binding. A client reads\neach setting from this record, then from an earlier binding that still holds\nit, then uses its default, so a collection whose task type is still on rc.5\nkeeps its behaviour until it is upgraded.\n\n## Fields\n\n- `nlp_triggers`: natural-language capture triggers. Without it, each client\n uses its own defaults.\n- `template_enabled`, `template_path`, `occurrence_template_enabled`,\n `occurrence_template_path`, `template_failure_mode`,\n `template_unknown_variable_policy`: body templates for new tasks and\n materialized occurrences.\n- `move_on_archive`, `archive_folder`: whether archiving moves the file, and\n where to.\n- `auto_stop_time_tracking_on_complete`: stop a running timer on completion.\n- `reset_body_checkboxes_on_recurrence`: uncheck body checkboxes when a\n recurring task advances.\n- `link_write_format`: `wikilink` or `markdown` for links written to task\n frontmatter.\n- `status_behavior`: per status value, `next_status`, `exclude_from_cycle`,\n `auto_archive` and `auto_archive_delay_minutes`. A status without an entry\n has no next status and no auto-archive (5 minute delay), and is out of the\n cycle exactly when it is a skipped status.\n\n## Authority\n\nThis artifact is passive and grants nothing.\n" + }, + { + "source": "contracts/mdbase.app-settings/2.0.0.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: mdbase.app-settings\nversion: 2.0.0\nname: App settings\ndescription: One record per app holding the policy that app's clients honour in this collection.\nrecord_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n title: mdbase.app-settings 2.0.0 record contract view\n description: The reserved fields every app settings record shares. Everything else in the record belongs to the app and is described by the app's own settings contract.\n type: object\n required:\n - app\n - scope\n - settings_version\n properties:\n app:\n type: string\n pattern: ^[a-z0-9]+([.-][a-z0-9]+)*$\n description: The app whose clients honour these settings, such as tasknotes or dev.mdbase.reader.\n scope:\n enum:\n - collection\n - user\n description: \"Who the values apply to: everyone using the app in this collection, or one person.\"\n user:\n type: string\n minLength: 1\n description: A link to the mdbase.person record the values apply to. Present only when scope is user.\n settings_version:\n type: integer\n minimum: 1\n description: The version of the app's settings schema that last wrote the record. A client that does not understand it treats the settings as read-only.\n allOf:\n - if:\n properties:\n scope:\n const: user\n required:\n - scope\n then:\n required:\n - user\n else:\n not:\n required:\n - user\n additionalProperties: true\n---\n\n# App settings\n\nAn app settings record holds values that every client of one app honours in this\ncollection, such as how new files are named. The values change client behaviour,\nnever what another record means.\n\n## Location and identity\n\nA collection-scope record lives at `_mdbase/settings/.md`, where `` is\nthe record's `app` field. Clients read it by that path, without a query.\n\nA collection set up before 2.0.0 may hold the record at `_settings/.md`, the\n1.0.0 location. A client that finds no record at `_mdbase/settings/.md` reads\n`_settings/.md`, and saves back to the record it read. Clients never move a\nrecord between the two paths. When both exist, the `_mdbase/settings` record is\nused.\n\nEach implementing type declares `collection.unique` on `app` with `scope: type`,\nso a collection holds at most one collection-scope record per app.\n\nThe record's `type` field names the app's own settings type, not a shared value.\nGeneric tools find every settings record through this contract.\n\n## Reserved fields\n\n- `app`: the app id.\n- `scope`: `collection`, or `user` for one person's overrides.\n- `user`: a link to an `mdbase.person` record, present only when `scope` is\n `user`.\n- `settings_version`: the version of the app's settings schema that last wrote\n the record.\n\nEvery other frontmatter field belongs to the app and is described by the app's\nown settings contract. The body is free Markdown for people; apps never parse it.\n\n## Client behaviour\n\n- A missing record means every setting has its default. Clients never create the\n record on read.\n- A missing or invalid field takes its default; valid fields are used as\n written. The record is not rewritten until someone saves.\n- A save patches the record it read, only the fields it changes, guarded by the\n record's revision. When there is no record, the save creates it at\n `_mdbase/settings/.md`.\n- A client that finds a `settings_version` newer than it understands treats the\n settings as read-only and uses them as written.\n\n## Authority\n\nThis artifact is passive. A settings record grants nothing and must never hold\nsecrets: anyone who can read or write records can read or edit it.\n" + }, + { + "source": "contracts/tasknotes.settings/1.1.0.md", + "document": "---\nkind: mdbase.contract\ncontract_type: record\nid: tasknotes.settings\nversion: 1.1.0\nname: TaskNotes settings\ndescription: Collection-wide TaskNotes behaviour, such as templates, archive moves and status cycling.\nrecord_schema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n title: tasknotes.settings 1.1.0\n description: Collection-wide behaviour that every TaskNotes client honours. Every field is optional and has a default, so a record with none of them behaves like no record at all.\n type: object\n required:\n - app\n - scope\n - settings_version\n properties:\n app:\n const: dev.tasknotes\n description: Marks this record as TaskNotes' settings.\n scope:\n const: collection\n description: These settings apply to everyone using TaskNotes in this collection.\n settings_version:\n type: integer\n minimum: 1\n description: The version of these settings that last wrote the record. TaskNotes writes 1.\n nlp_triggers:\n type: array\n items:\n type: object\n required:\n - property_id\n - trigger\n - enabled\n properties:\n property_id:\n type: string\n minLength: 1\n trigger:\n type: string\n minLength: 1\n enabled:\n type: boolean\n additionalProperties: false\n description: Natural-language capture triggers, such as @ for contexts. Without the field each client uses its own defaults.\n template_enabled:\n type: boolean\n default: false\n description: Apply template_path to the body of new tasks.\n template_path:\n type: string\n description: The template for new task bodies. Empty or absent means none.\n occurrence_template_enabled:\n type: boolean\n default: false\n description: Apply occurrence_template_path to new materialized occurrences.\n occurrence_template_path:\n type: string\n description: The template for new occurrence bodies. Empty or absent means none.\n template_failure_mode:\n enum:\n - error\n - warning_fallback\n description: What a client does when a template cannot be applied.\n template_unknown_variable_policy:\n enum:\n - preserve\n - empty\n description: What a client writes for a template variable it does not know.\n move_on_archive:\n type: boolean\n default: false\n description: Move a task's file to archive_folder when it is archived.\n archive_folder:\n type: string\n description: Where archived tasks move to. Empty or absent means the client's default.\n auto_stop_time_tracking_on_complete:\n type: boolean\n default: false\n description: Stop a running timer when its task is completed.\n reset_body_checkboxes_on_recurrence:\n type: boolean\n default: false\n description: Uncheck body checkboxes when a recurring task moves to its next occurrence.\n link_write_format:\n enum:\n - wikilink\n - markdown\n default: wikilink\n description: How clients write links into task frontmatter. Both formats are always read.\n status_behavior:\n type: object\n description: Behaviour per status value. A status without an entry has no next status and no auto-archive, and is out of the status cycle exactly when it is a skipped status.\n additionalProperties:\n type: object\n properties:\n next_status:\n type: string\n minLength: 1\n description: The status the cycle moves to next.\n exclude_from_cycle:\n type: boolean\n description: Leave this status out of the status cycle.\n auto_archive:\n type: boolean\n description: Archive a task some time after it takes this status.\n auto_archive_delay_minutes:\n type: number\n minimum: 0\n description: How long after taking this status a task is archived.\n additionalProperties: false\n default: {}\n additionalProperties: true\n---\n\n# TaskNotes settings\n\nThe collection's settings record for TaskNotes (`app: dev.tasknotes`) implements\n`mdbase.app-settings` 2.0.0, so it lives at `_mdbase/settings/dev.tasknotes.md`, or\nat `_settings/dev.tasknotes.md` in a collection set up before then. It shares\nthat contract's reserved fields (`app`, `scope`, `settings_version`).\n\nThese settings change what TaskNotes clients do, never what a task record\nmeans: that stays in the `tasknotes.task` binding of each task type.\n`tasknotes.task` 0.3.0-rc.6 moved them here from the binding. A client reads\neach setting from this record, then from an earlier binding that still holds\nit, then uses its default, so a collection whose task type is still on rc.5\nkeeps its behaviour until it is upgraded.\n\n## Fields\n\n- `nlp_triggers`: natural-language capture triggers. Without it, each client\n uses its own defaults.\n- `template_enabled`, `template_path`, `occurrence_template_enabled`,\n `occurrence_template_path`, `template_failure_mode`,\n `template_unknown_variable_policy`: body templates for new tasks and\n materialized occurrences.\n- `move_on_archive`, `archive_folder`: whether archiving moves the file, and\n where to.\n- `auto_stop_time_tracking_on_complete`: stop a running timer on completion.\n- `reset_body_checkboxes_on_recurrence`: uncheck body checkboxes when a\n recurring task advances.\n- `link_write_format`: `wikilink` or `markdown` for links written to task\n frontmatter.\n- `status_behavior`: per status value, `next_status`, `exclude_from_cycle`,\n `auto_archive` and `auto_archive_delay_minutes`. A status without an entry\n has no next status and no auto-archive (5 minute delay), and is out of the\n cycle exactly when it is a skipped status.\n\n## Authority\n\nThis artifact is passive and grants nothing.\n" + }, + { + "source": "types/tasknotes-settings/2.md", + "document": "---\nkind: mdbase.type\nname: tasknotes-settings\nversion: 2\ndescription: TaskNotes' collection-wide settings, one record at _mdbase/settings/dev.tasknotes.md (or _settings/dev.tasknotes.md in an older collection).\nmatch:\n where:\n app:\n eq: dev.tasknotes\nschema:\n dialect: json-schema-2020-12\n value:\n $schema: https://json-schema.org/draft/2020-12/schema\n title: tasknotes.settings 1.0.0\n description: Collection-wide behaviour that every TaskNotes client honours. Every field is optional and has a default, so a record with none of them behaves like no record at all.\n type: object\n required:\n - app\n - scope\n - settings_version\n properties:\n app:\n const: dev.tasknotes\n description: Marks this record as TaskNotes' settings.\n scope:\n const: collection\n description: These settings apply to everyone using TaskNotes in this collection.\n settings_version:\n type: integer\n minimum: 1\n description: The version of these settings that last wrote the record. TaskNotes writes 1.\n nlp_triggers:\n type: array\n items:\n type: object\n required:\n - property_id\n - trigger\n - enabled\n properties:\n property_id:\n type: string\n minLength: 1\n trigger:\n type: string\n minLength: 1\n enabled:\n type: boolean\n additionalProperties: false\n description: Natural-language capture triggers, such as @ for contexts. Without the field each client uses its own defaults.\n template_enabled:\n type: boolean\n default: false\n description: Apply template_path to the body of new tasks.\n template_path:\n type: string\n description: The template for new task bodies. Empty or absent means none.\n occurrence_template_enabled:\n type: boolean\n default: false\n description: Apply occurrence_template_path to new materialized occurrences.\n occurrence_template_path:\n type: string\n description: The template for new occurrence bodies. Empty or absent means none.\n template_failure_mode:\n enum:\n - error\n - warning_fallback\n description: What a client does when a template cannot be applied.\n template_unknown_variable_policy:\n enum:\n - preserve\n - empty\n description: What a client writes for a template variable it does not know.\n move_on_archive:\n type: boolean\n default: false\n description: Move a task's file to archive_folder when it is archived.\n archive_folder:\n type: string\n description: Where archived tasks move to. Empty or absent means the client's default.\n auto_stop_time_tracking_on_complete:\n type: boolean\n default: false\n description: Stop a running timer when its task is completed.\n reset_body_checkboxes_on_recurrence:\n type: boolean\n default: false\n description: Uncheck body checkboxes when a recurring task moves to its next occurrence.\n link_write_format:\n enum:\n - wikilink\n - markdown\n default: wikilink\n description: How clients write links into task frontmatter. Both formats are always read.\n status_behavior:\n type: object\n description: Behaviour per status value. A status without an entry has no next status and no auto-archive, and is out of the status cycle exactly when it is a skipped status.\n additionalProperties:\n type: object\n properties:\n next_status:\n type: string\n minLength: 1\n description: The status the cycle moves to next.\n exclude_from_cycle:\n type: boolean\n description: Leave this status out of the status cycle.\n auto_archive:\n type: boolean\n description: Archive a task some time after it takes this status.\n auto_archive_delay_minutes:\n type: number\n minimum: 0\n description: How long after taking this status a task is archived.\n additionalProperties: false\n default: {}\n additionalProperties: true\ncollection:\n unique:\n - field: app\n scope: type\nimplements:\n - contract: mdbase.app-settings\n version: 2.0.0\n fields:\n app: app\n scope: scope\n settings_version: settings_version\n - contract: tasknotes.settings\n version: 1.1.0\n fields:\n app: app\n scope: scope\n settings_version: settings_version\n nlp_triggers: nlp_triggers\n template_enabled: template_enabled\n template_path: template_path\n occurrence_template_enabled: occurrence_template_enabled\n occurrence_template_path: occurrence_template_path\n template_failure_mode: template_failure_mode\n template_unknown_variable_policy: template_unknown_variable_policy\n move_on_archive: move_on_archive\n archive_folder: archive_folder\n auto_stop_time_tracking_on_complete: auto_stop_time_tracking_on_complete\n reset_body_checkboxes_on_recurrence: reset_body_checkboxes_on_recurrence\n link_write_format: link_write_format\n status_behavior: status_behavior\n---\n\n# TaskNotes settings\n\nSettings that every TaskNotes client honours in this collection, such as body\ntemplates, archive moves and status cycling. TaskNotes reads them from\n`_mdbase/settings/dev.tasknotes.md`, or `_settings/dev.tasknotes.md` in an older\ncollection, and writes only the fields a save changes back to the record it read.\n" + } + ], + "provides": [ + { + "id": "tasknotes.task", + "version": "0.3.0-rc.6", + "digest": "sha256:c400ead6e218b715d86ad31125bb3d4b2e276817da6ba8065449fd0947b24d67" + }, + { + "id": "tasknotes.settings", + "version": "1.1.0", + "digest": "sha256:7772184281e22e173d4c08c54b586730e20cc534fd31f716a2c88fcd3d4fd6dc" + }, + { + "id": "mdbase.app-settings", + "version": "2.0.0", + "digest": "sha256:278a7b51ce7b9f19718a55f22706d1ea82d324f77d02a58a656d4af35748124f" + } + ] +} diff --git a/src/mdbase.ts b/src/mdbase.ts index 56963df..d122133 100644 --- a/src/mdbase.ts +++ b/src/mdbase.ts @@ -1,4 +1,5 @@ import YAML from "yaml"; +import tasknotesTypePack from "./generated/tasknotes-type-pack.json"; import { resolveModelConfig } from "./config"; import { TASKNOTES_TASK_BINDING_SCHEMA, @@ -164,10 +165,15 @@ export interface TaskNotesMdbaseTypePack { source: string; target: string; digest: string; + upgrade_from?: Array<{ digest: string; version: number; document: string }>; }>; }; resources: Array<{ source: string; document: string }>; - provides: Array<{ id: "tasknotes.task"; version: string; digest: string }>; + provides: Array<{ + id: "tasknotes.task" | "tasknotes.settings" | "mdbase.app-settings"; + version: string; + digest: string; + }>; } /** @@ -178,7 +184,7 @@ export interface TaskNotesMdbaseTypePack { export const TASKNOTES_MDBASE_TYPE_VERSION = 5; /** Version of the generated definition bundle, independent of contract version. */ -export const TASKNOTES_MDBASE_PACK_VERSION = "0.3.0-rc.19"; +export const TASKNOTES_MDBASE_PACK_VERSION = "0.3.0-rc.21"; export const TASKNOTES_CONTRACT_DIGEST = "sha256:c400ead6e218b715d86ad31125bb3d4b2e276817da6ba8065449fd0947b24d67"; @@ -525,13 +531,14 @@ export function buildTaskNotesMdbaseResources( ): TaskNotesMdbaseResources { const typeName = cleanSegment(options.typeName ?? "task", "typeName"); const tasksFolder = cleanOptionalPath(options.tasksFolder ?? "tasks", "tasksFolder"); - const typesFolder = cleanPath(options.typesFolder ?? "_types", "typesFolder"); + const typesFolder = cleanPath(options.typesFolder ?? "_mdbase/types", "typesFolder"); const contractsFolder = cleanPath( - options.contractsFolder ?? "_contracts", + options.contractsFolder ?? "_mdbase/contracts", "contractsFolder" ); const schemasFolder = cleanPath( - options.schemasFolder ?? "_schemas/tasknotes", + options.schemasFolder ?? + [...contractsFolder.split("/").slice(0, -1), "_schemas/tasknotes"].join("/"), "schemasFolder" ); if (contractsFolder === typesFolder) { @@ -1009,37 +1016,6 @@ export function buildTaskNotesMdbaseResources( export async function buildTaskNotesMdbaseTypePack( resources: TaskNotesMdbaseResources ): Promise { - const typeSource = `types/${resources.paths.type.split("/").slice(-1)[0]}`; - const definitions = [ - { - kind: "contract" as const, - mode: "managed" as const, - source: `contracts/tasknotes.task/${TASKNOTES_SPEC_VERSION}.md`, - target: resources.paths.contract, - document: resources.contractDocument, - }, - { - kind: "type" as const, - mode: "seed" as const, - source: typeSource, - target: resources.paths.type, - document: resources.typeDocument, - }, - { - kind: "schema" as const, - mode: "managed" as const, - source: "schemas/tasknotes-task.schema.json", - target: resources.paths.taskSchema, - document: resources.taskSchemaDocument, - }, - { - kind: "schema" as const, - mode: "managed" as const, - source: "schemas/tasknotes-task-binding.schema.json", - target: resources.paths.bindingSchema, - document: resources.bindingSchemaDocument, - }, - ]; const contractDigest = await sha256(canonicalJson({ kind: "mdbase.contract", contract_type: "record", @@ -1053,34 +1029,41 @@ export async function buildTaskNotesMdbaseTypePack( "The TaskNotes contract changed without updating TASKNOTES_CONTRACT_DIGEST." ); } - return { - manifest: { - kind: "mdbase.type-pack", - id: "tasknotes.task", - version: TASKNOTES_MDBASE_PACK_VERSION, - name: "TaskNotes task", - description: - "TaskNotes task contract, implementation, and referenced JSON Schemas.", - resources: await Promise.all( - definitions.map(async ({ kind, mode, source, target, document }) => ({ - kind, - mode, - source, - target, - digest: await sha256(document), - })) - ), - }, - resources: definitions.map(({ source, document }) => ({ - source, - document, - })), - provides: [{ - id: "tasknotes.task", - version: TASKNOTES_SPEC_VERSION, - digest: contractDigest, + const pack = structuredClone(tasknotesTypePack) as TaskNotesMdbaseTypePack; + const typesFolder = resources.paths.type.split("/").slice(0, -1).join("/"); + const contractsFolder = resources.paths.contract.split("/").slice(0, -2).join("/"); + const schemaParent = contractsFolder.split("/").slice(0, -1); + const overrides = new Map([ + [`contracts/tasknotes.task/${TASKNOTES_SPEC_VERSION}.md`, { + target: resources.paths.contract, document: resources.contractDocument, }], - }; + ["types/tasknotes-task/6.md", { + target: resources.paths.type, document: resources.typeDocument, + }], + [`schemas/tasknotes.task/${TASKNOTES_SPEC_VERSION}.schema.json`, { + target: resources.paths.taskSchema, document: resources.taskSchemaDocument, + }], + [`schemas/tasknotes.task.binding/${TASKNOTES_SPEC_VERSION}.schema.json`, { + target: resources.paths.bindingSchema, document: resources.bindingSchemaDocument, + }], + ]); + for (const declaration of pack.manifest.resources) { + const resource = pack.resources.find((entry) => entry.source === declaration.source); + if (!resource) throw new Error(`Missing published pack resource: ${declaration.source}`); + const override = overrides.get(declaration.source); + if (override) { + declaration.target = override.target; + resource.document = override.document; + } else if (declaration.target.startsWith("_types/")) { + declaration.target = `${typesFolder}/${declaration.target.slice("_types/".length)}`; + } else if (declaration.target.startsWith("_contracts/")) { + declaration.target = `${contractsFolder}/${declaration.target.slice("_contracts/".length)}`; + } else if (declaration.kind === "schema") { + declaration.target = [...schemaParent, declaration.target].join("/"); + } + declaration.digest = await sha256(resource.document); + } + return pack; } /** diff --git a/src/settings.ts b/src/settings.ts index 20f43ba..0dae2c6 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,12 +1,14 @@ import YAML from "yaml"; +import tasknotesTypePack from "./generated/tasknotes-type-pack.json"; import type { StatusConfig, TaskNotesModelConfig } from "./types"; /* - * App settings records (mdbase.app-settings 1.0.0): one record per app at - * `_settings/.md` whose flat frontmatter holds behaviour every client of + * App settings records (mdbase.app-settings 2.0.0): one record per app at + * `_mdbase/settings/.md` (or `_settings/.md` in older collections) + * whose flat frontmatter holds behaviour every client of * that app honours in the collection. The generic part below follows mdbase * Reader's implementation; the TaskNotes part defines the tasknotes.settings - * 1.0.0 fields, which tasknotes.task 0.3.0-rc.6 moved out of the type binding. + * 1.1.0 fields, which tasknotes.task 0.3.0-rc.6 moved out of the type binding. * * - A missing record means defaults. Nothing here creates or repairs a record * on read: an unusable field takes its default with a warning. @@ -16,7 +18,8 @@ import type { StatusConfig, TaskNotesModelConfig } from "./types"; */ /** The folder collection-scope settings records live in. */ -export const APP_SETTINGS_FOLDER = "_settings"; +export const APP_SETTINGS_FOLDER = "_mdbase/settings"; +export const LEGACY_APP_SETTINGS_FOLDER = "_settings"; export interface AppSettingField { readonly default: Value; @@ -60,6 +63,19 @@ export function appSettingsPath(app: string): string { return `${APP_SETTINGS_FOLDER}/${app}.md`; } +export function legacyAppSettingsPath(app: string): string { + return `${LEGACY_APP_SETTINGS_FOLDER}/${app}.md`; +} + +export function resolveAppSettingsPath( + app: string, + exists: { currentExists: boolean; legacyExists: boolean } +): string { + return !exists.currentExists && exists.legacyExists + ? legacyAppSettingsPath(app) + : appSettingsPath(app); +} + export function defaultAppSettings( definition: AppSettingsDefinition ): ResolvedAppSettings { @@ -74,7 +90,8 @@ export function defaultAppSettings( */ export function resolveAppSettings( definition: AppSettingsDefinition, - frontmatter: Readonly> | undefined + frontmatter: Readonly> | undefined, + path = appSettingsPath(definition.app) ): ResolvedAppSettings { const values: Record = {}; const stored: Record = {}; @@ -92,7 +109,7 @@ export function resolveAppSettings( stored[key] = read; } } - const readOnly = frontmatter ? readOnlyReason(definition, frontmatter) : undefined; + const readOnly = frontmatter ? readOnlyReason(definition, frontmatter, path) : undefined; return { values: values as Values, stored: stored as Partial, @@ -208,9 +225,9 @@ export function readAppSettingsFrontmatter(markdown: string): Record( definition: AppSettingsDefinition, - frontmatter: Readonly> + frontmatter: Readonly>, + path: string ): string | undefined { - const path = appSettingsPath(definition.app); if (frontmatter.app !== undefined && frontmatter.app !== definition.app) { return `${path} names another app, so it is left as it is.`; } @@ -225,17 +242,17 @@ function readOnlyReason( } // --------------------------------------------------------------------------- -// TaskNotes settings (tasknotes.settings 1.0.0) +// TaskNotes settings (tasknotes.settings 1.1.0) export const TASKNOTES_SETTINGS_APP = "dev.tasknotes"; export const TASKNOTES_SETTINGS_TYPE = "tasknotes-settings"; export const TASKNOTES_SETTINGS_CONTRACT_ID = "tasknotes.settings"; -export const TASKNOTES_SETTINGS_CONTRACT_VERSION = "1.0.0"; +export const TASKNOTES_SETTINGS_CONTRACT_VERSION = "1.1.0"; export const APP_SETTINGS_CONTRACT_ID = "mdbase.app-settings"; -export const APP_SETTINGS_CONTRACT_VERSION = "1.0.0"; +export const APP_SETTINGS_CONTRACT_VERSION = "2.0.0"; export const TASKNOTES_SETTINGS_VERSION = 1; /** Version of the generated tasknotes-settings type. */ -export const TASKNOTES_SETTINGS_TYPE_VERSION = 1; +export const TASKNOTES_SETTINGS_TYPE_VERSION = 2; export const TASKNOTES_SETTINGS_PATH = appSettingsPath(TASKNOTES_SETTINGS_APP); /** Default auto-archive delay, in minutes, for a status without one. */ export const TASKNOTES_DEFAULT_AUTO_ARCHIVE_DELAY = 5; @@ -474,9 +491,13 @@ export interface ResolvedTaskNotesAppSettings extends ResolvedAppSettings> | undefined, - options: { legacyBinding?: unknown; fallback?: Partial } = {} + options: { + legacyBinding?: unknown; + fallback?: Partial; + path?: string; + } = {} ): ResolvedTaskNotesAppSettings { - const resolved = resolveAppSettings(tasknotesSettingsDefinition, frontmatter); + const resolved = resolveAppSettings(tasknotesSettingsDefinition, frontmatter, options.path); const legacy = taskNotesAppSettingsFromLegacyBinding(options.legacyBinding); const fallback = options.fallback ?? {}; const values = { ...resolved.values } as Record; @@ -742,7 +763,7 @@ export interface TaskNotesSettingsResources { type: Record; typeDocument: string; paths: { - /** Pack source and target of the contract, schema and type. */ + /** Resolved resource paths; the inline schema needs no standalone file. */ contract: string; schema: string; type: string; @@ -758,106 +779,33 @@ export interface TaskNotesSettingsResources { export function buildTaskNotesSettingsResources( options: { typesFolder?: string; contractsFolder?: string } = {} ): TaskNotesSettingsResources { - const typesFolder = options.typesFolder ?? "_types"; - const contractsFolder = options.contractsFolder ?? "_contracts"; + const typesFolder = options.typesFolder ?? "_mdbase/types"; + const contractsFolder = options.contractsFolder ?? "_mdbase/contracts"; + const schemasFolder = [...contractsFolder.split("/").slice(0, -1), "schemas"].join("/"); const version = TASKNOTES_SETTINGS_CONTRACT_VERSION; - const contract = { - kind: "mdbase.contract", - contract_type: "record", - id: TASKNOTES_SETTINGS_CONTRACT_ID, - version, - name: "TaskNotes settings", - description: "Collection-wide TaskNotes behaviour, such as templates, archive moves and status cycling.", - record_schema: { - dialect: "json-schema-2020-12", - ref: `../../schemas/${TASKNOTES_SETTINGS_CONTRACT_ID}/${version}.schema.json`, - }, - }; - const contractDocument = [ - "---", - YAML.stringify(contract, { lineWidth: 0 }).trimEnd(), - "---", - "", - "# TaskNotes settings", - "", - `The collection's settings record for TaskNotes, at \`${TASKNOTES_SETTINGS_PATH}\`.`, - "It also implements `mdbase.app-settings`, whose reserved fields (`app`, `scope`,", - "`settings_version`) it shares.", - "", - "These settings change what TaskNotes clients do, never what a task record", - "means: that stays in the `tasknotes.task` binding of each task type.", - "`tasknotes.task` 0.3.0-rc.6 moved them here from the binding. A client reads", - "each setting from this record, then from an earlier binding that still holds", - "it, then uses its default, so a collection whose task type is still on rc.5", - "keeps its behaviour until it is upgraded.", - "", - "## Fields", - "", - "- `nlp_triggers`: natural-language capture triggers. Without it, each client", - " uses its own defaults.", - "- `template_enabled`, `template_path`, `occurrence_template_enabled`,", - " `occurrence_template_path`, `template_failure_mode`,", - " `template_unknown_variable_policy`: body templates for new tasks and", - " materialized occurrences.", - "- `move_on_archive`, `archive_folder`: whether archiving moves the file, and", - " where to.", - "- `auto_stop_time_tracking_on_complete`: stop a running timer on completion.", - "- `reset_body_checkboxes_on_recurrence`: uncheck body checkboxes when a", - " recurring task advances.", - "- `link_write_format`: `wikilink` or `markdown` for links written to task", - " frontmatter.", - "- `status_behavior`: per status value, `next_status`, `exclude_from_cycle`,", - " `auto_archive` and `auto_archive_delay_minutes`. A status without an entry", - " has no next status and no auto-archive (5 minute delay), and is out of the", - " cycle exactly when it is a skipped status.", - "", - "## Authority", - "", - "This artifact is passive and grants nothing.", - "", - ].join("\n"); - const reserved = { app: "app", scope: "scope", settings_version: "settings_version" }; - const type = { - kind: "mdbase.type", - name: TASKNOTES_SETTINGS_TYPE, - version: TASKNOTES_SETTINGS_TYPE_VERSION, - description: `TaskNotes' collection-wide settings, one record at ${TASKNOTES_SETTINGS_PATH}.`, - match: { where: { app: { eq: TASKNOTES_SETTINGS_APP } } }, - schema: { dialect: "json-schema-2020-12", value: cloneValue(TASKNOTES_SETTINGS_SCHEMA) }, - collection: { unique: [{ field: "app", scope: "type" }] }, - implements: [ - { contract: APP_SETTINGS_CONTRACT_ID, version: APP_SETTINGS_CONTRACT_VERSION, fields: { ...reserved } }, - { - contract: TASKNOTES_SETTINGS_CONTRACT_ID, - version, - fields: { - ...reserved, - ...Object.fromEntries(TASKNOTES_APP_SETTING_KEYS.map((key) => [key, key])), - }, - }, - ], - }; - const typeDocument = [ - "---", - YAML.stringify(type, { lineWidth: 0 }).trimEnd(), - "---", - "", - "# TaskNotes settings", - "", - "Settings that every TaskNotes client honours in this collection, such as body", - "templates, archive moves and status cycling. TaskNotes reads them from", - `\`${TASKNOTES_SETTINGS_PATH}\` and writes only the fields a save changes.`, - "", - ].join("\n"); + const contractDocument = tasknotesTypePack.resources.find( + (resource) => resource.source === `contracts/${TASKNOTES_SETTINGS_CONTRACT_ID}/${version}.md` + )?.document; + const typeDocument = tasknotesTypePack.resources.find( + (resource) => resource.source === `types/${TASKNOTES_SETTINGS_TYPE}/${TASKNOTES_SETTINGS_TYPE_VERSION}.md` + )?.document; + if (!contractDocument || !typeDocument) { + throw new Error("The published TaskNotes pack is missing its settings resources."); + } + const contract = readAppSettingsFrontmatter(contractDocument); + const type = readAppSettingsFrontmatter(typeDocument); + if (!contract || !type || !isRecord(contract.record_schema)) { + throw new Error("The published TaskNotes settings resources have no frontmatter."); + } return { contract, contractDocument, - schemaDocument: `${JSON.stringify(TASKNOTES_SETTINGS_SCHEMA, null, 2)}\n`, + schemaDocument: `${JSON.stringify(contract.record_schema.value, null, 2)}\n`, type, typeDocument, paths: { contract: `${contractsFolder}/${TASKNOTES_SETTINGS_CONTRACT_ID}/${version}.md`, - schema: `schemas/${TASKNOTES_SETTINGS_CONTRACT_ID}/${version}.schema.json`, + schema: `${schemasFolder}/${TASKNOTES_SETTINGS_CONTRACT_ID}/${version}.schema.json`, type: `${typesFolder}/${TASKNOTES_SETTINGS_TYPE}.md`, record: TASKNOTES_SETTINGS_PATH, }, diff --git a/test/mdbase.test.mjs b/test/mdbase.test.mjs index 7e2dc08..954dba4 100644 --- a/test/mdbase.test.mjs +++ b/test/mdbase.test.mjs @@ -1,4 +1,5 @@ import assert from "node:assert/strict"; +import { createHash } from "node:crypto"; import test from "node:test"; import YAML from "yaml"; import { @@ -6,6 +7,7 @@ import { buildTaskNotesMdbaseTypePack, patchTaskNotesMdbaseTypeSettings, resolveTaskNotesModelConfigFromMdbaseType, + TASKNOTES_MDBASE_PACK_VERSION, } from "../dist/esm/mdbase.js"; function implementation(type) { @@ -27,7 +29,11 @@ test("builds one canonical TaskNotes and mdbase collection contract", () => { const schema = type.schema.value; assert.equal(resources.config.spec_version, "0.3.0"); - assert.equal(resources.config.settings.contracts_folder, "_contracts"); + assert.equal(resources.config.settings.types_folder, "_mdbase/types"); + assert.equal(resources.config.settings.contracts_folder, "_mdbase/contracts"); + assert.equal(resources.paths.contract, "_mdbase/contracts/tasknotes.task/0.3.0-rc.6.md"); + assert.equal(resources.paths.type, "_mdbase/types/task.md"); + assert.equal(resources.paths.taskSchema, "_mdbase/_schemas/tasknotes/tasknotes-task.schema.json"); assert.equal(resources.contract.id, "tasknotes.task"); assert.equal(resources.contract.contract_type, "record"); assert.equal(resources.contract.version, "0.3.0-rc.6"); @@ -121,36 +127,60 @@ test("packages the contract, implementation, and schemas as one digest-pinned ty const resources = buildTaskNotesMdbaseResources({ typeName: "action" }); const pack = await buildTaskNotesMdbaseTypePack(resources); - assert.deepEqual(pack.provides, [ - { - id: "tasknotes.task", - version: "0.3.0-rc.6", - digest: pack.provides[0].digest, - }, + assert.deepEqual(pack.provides.map(({ id, version }) => [id, version]), [ + ["tasknotes.task", "0.3.0-rc.6"], + ["tasknotes.settings", "1.1.0"], + ["mdbase.app-settings", "2.0.0"], ]); assert.match(pack.provides[0].digest, /^sha256:[0-9a-f]{64}$/); assert.equal(pack.manifest.kind, "mdbase.type-pack"); assert.equal(pack.manifest.id, "tasknotes.task"); - assert.equal(pack.manifest.resources.length, 4); + assert.equal(pack.manifest.version, TASKNOTES_MDBASE_PACK_VERSION); + assert.equal(TASKNOTES_MDBASE_PACK_VERSION, "0.3.0-rc.21"); + assert.equal(pack.manifest.resources.length, 14); assert.deepEqual( - pack.manifest.resources.map(({ kind, mode, target }) => [kind, mode, target]), + pack.manifest.resources.filter(({ source }) => [ + "contracts/tasknotes.task/0.3.0-rc.6.md", "types/tasknotes-task/6.md", + "schemas/tasknotes.task/0.3.0-rc.6.schema.json", "schemas/tasknotes.task.binding/0.3.0-rc.6.schema.json", + ].includes(source)).map(({ kind, mode, target }) => [kind, mode, target]), [ - ["contract", "managed", "_contracts/tasknotes.task/0.3.0-rc.6.md"], - ["type", "seed", "_types/action.md"], - ["schema", "managed", "_schemas/tasknotes/tasknotes-task.schema.json"], + ["contract", "managed", "_mdbase/contracts/tasknotes.task/0.3.0-rc.6.md"], + ["type", "seed", "_mdbase/types/action.md"], + ["schema", "managed", "_mdbase/_schemas/tasknotes/tasknotes-task.schema.json"], [ "schema", "managed", - "_schemas/tasknotes/tasknotes-task-binding.schema.json", + "_mdbase/_schemas/tasknotes/tasknotes-task-binding.schema.json", ], ] ); for (const declared of pack.manifest.resources) { assert.match(declared.digest, /^sha256:[0-9a-f]{64}$/); - assert.ok( - pack.resources.some((resource) => resource.source === declared.source) - ); + const resource = pack.resources.find((resource) => resource.source === declared.source); + assert.ok(resource); + assert.equal(declared.digest, `sha256:${createHash("sha256").update(resource.document).digest("hex")}`); + } +}); + +test("pack support resources follow explicit legacy or nested collection folders", async () => { + for (const [typesFolder, contractsFolder, schemaParent] of [ + ["_types", "_contracts", ""], + ["System/types", "System/metadata/contracts", "System/metadata/"], + ]) { + const resources = buildTaskNotesMdbaseResources({ typesFolder, contractsFolder }); + assert.equal(resources.config.settings.types_folder, typesFolder); + assert.equal(resources.config.settings.contracts_folder, contractsFolder); + assert.equal(resources.paths.taskSchema, `${schemaParent}_schemas/tasknotes/tasknotes-task.schema.json`); + const pack = await buildTaskNotesMdbaseTypePack(resources); + assert.equal(pack.manifest.resources.find(({ source }) => source === "contracts/mdbase.app-settings/1.0.0.md").target, `${contractsFolder}/mdbase.app-settings/1.0.0.md`); + assert.equal(pack.manifest.resources.find(({ source }) => source === "schemas/mdbase.app-settings/1.0.0.schema.json").target, `${schemaParent}schemas/mdbase.app-settings/1.0.0.schema.json`); + const settingsType = pack.manifest.resources.find(({ source }) => source === "types/tasknotes-settings/2.md"); + assert.equal(settingsType.target, `${typesFolder}/tasknotes-settings.md`); + assert.deepEqual(settingsType.upgrade_from.map(({ version }) => version), [1]); } + const custom = buildTaskNotesMdbaseResources({ schemasFolder: "Custom/task-schemas" }); + const pack = await buildTaskNotesMdbaseTypePack(custom); + assert.ok(pack.manifest.resources.some(({ target }) => target === "Custom/task-schemas/tasknotes-task.schema.json")); }); test("round-trips optional NLP trigger settings through the TaskNotes contract", () => { diff --git a/test/settings.test.mjs b/test/settings.test.mjs index 1ffb66c..886cc93 100644 --- a/test/settings.test.mjs +++ b/test/settings.test.mjs @@ -3,16 +3,48 @@ import test from "node:test"; import { buildTaskNotesMdbaseResources, resolveTaskNotesModelConfigFromMdbaseType, upgradeTaskNotesMdbaseTypeContract } from "../dist/esm/mdbase.js"; import { absentTaskNotesSettingsPatch, + APP_SETTINGS_FOLDER, + appSettingsPath, buildTaskNotesSettingsPatch, buildTaskNotesSettingsResources, conflictingTaskNotesSettings, newTaskNotesSettingsFrontmatter, + LEGACY_APP_SETTINGS_FOLDER, + legacyAppSettingsPath, readAppSettingsFrontmatter, resolveTaskNotesAppSettings, + resolveAppSettingsPath, + TASKNOTES_SETTINGS_SCHEMA, TASKNOTES_SETTINGS_PATH, writeAppSettingsDocument, } from "../dist/esm/settings.js"; +test("resolves one settings path for both reads and saves without moving records", () => { + assert.equal(APP_SETTINGS_FOLDER, "_mdbase/settings"); + assert.equal(LEGACY_APP_SETTINGS_FOLDER, "_settings"); + for (const app of ["dev.tasknotes", "dev.mdbase.reader"]) { + assert.equal(appSettingsPath(app), `_mdbase/settings/${app}.md`); + assert.equal(legacyAppSettingsPath(app), `_settings/${app}.md`); + for (const [currentExists, legacyExists, expected] of [ + [true, true, appSettingsPath(app)], + [true, false, appSettingsPath(app)], + [false, true, legacyAppSettingsPath(app)], + [false, false, appSettingsPath(app)], + ]) { + assert.equal(resolveAppSettingsPath(app, { currentExists, legacyExists }), expected); + } + } +}); + +test("read-only messages name the settings path actually read", () => { + for (const path of [appSettingsPath("dev.tasknotes"), legacyAppSettingsPath("dev.tasknotes")]) { + for (const invalid of [{ app: "dev.other" }, { scope: "user" }]) { + assert.ok(resolveTaskNotesAppSettings(record(invalid), { path }).readOnly.startsWith(path)); + } + } + assert.ok(resolveTaskNotesAppSettings(record({ app: "dev.other" })).readOnly.startsWith(TASKNOTES_SETTINGS_PATH)); +}); + // An rc.5 binding still carries the settings rc.6 moved to the record. function legacyBinding() { return { @@ -140,11 +172,35 @@ test("a migration adds only the fields an existing record lacks", () => { test("publishes the settings contract, schema and type", () => { const resources = buildTaskNotesSettingsResources(); assert.equal(resources.paths.record, TASKNOTES_SETTINGS_PATH); - assert.equal(TASKNOTES_SETTINGS_PATH, "_settings/dev.tasknotes.md"); + assert.equal(TASKNOTES_SETTINGS_PATH, "_mdbase/settings/dev.tasknotes.md"); + assert.equal(resources.paths.type, "_mdbase/types/tasknotes-settings.md"); + assert.equal(resources.paths.contract, "_mdbase/contracts/tasknotes.settings/1.1.0.md"); + assert.equal(resources.paths.schema, "_mdbase/schemas/tasknotes.settings/1.1.0.schema.json"); assert.deepEqual(resources.type.collection, { unique: [{ field: "app", scope: "type" }] }); assert.deepEqual(resources.type.implements.map(({ contract, version }) => `${contract}@${version}`), [ - "mdbase.app-settings@1.0.0", - "tasknotes.settings@1.0.0", + "mdbase.app-settings@2.0.0", + "tasknotes.settings@1.1.0", ]); + assert.equal(resources.type.version, 2); assert.equal(resources.type.schema.value.title, "tasknotes.settings 1.0.0"); + assert.deepEqual(resources.type.schema.value, TASKNOTES_SETTINGS_SCHEMA); + assert.equal(resources.contract.record_schema.ref, undefined); + assert.equal(resources.contract.record_schema.value.title, "tasknotes.settings 1.1.0"); + assert.deepEqual(JSON.parse(resources.schemaDocument), resources.contract.record_schema.value); + assert.deepEqual(readAppSettingsFrontmatter(resources.contractDocument), resources.contract); + assert.deepEqual(readAppSettingsFrontmatter(resources.typeDocument), resources.type); + assert.match(resources.contractDocument, /_settings\/dev.tasknotes.md/); + assert.match(resources.typeDocument, /_settings\/dev.tasknotes.md/); +}); + +test("settings support schemas follow the parent of the configured contracts folder", () => { + for (const [contractsFolder, schemaParent] of [ + ["_contracts", ""], + ["System/mdbase/contracts", "System/mdbase/"], + ]) { + const resources = buildTaskNotesSettingsResources({ typesFolder: "Definitions", contractsFolder }); + assert.equal(resources.paths.type, "Definitions/tasknotes-settings.md"); + assert.equal(resources.paths.contract, `${contractsFolder}/tasknotes.settings/1.1.0.md`); + assert.equal(resources.paths.schema, `${schemaParent}schemas/tasknotes.settings/1.1.0.schema.json`); + } }); diff --git a/test/starter.test.mjs b/test/starter.test.mjs index 501e8ed..b3eee92 100644 --- a/test/starter.test.mjs +++ b/test/starter.test.mjs @@ -1,4 +1,5 @@ import assert from "node:assert/strict"; +import { readFile } from "node:fs/promises"; import test from "node:test"; import { buildTaskNotesMdbaseResources, buildTaskNotesMdbaseTypePack } from "../dist/esm/mdbase.js"; import { @@ -6,31 +7,45 @@ import { TASKNOTES_STARTER_TYPE_VERSION, } from "../dist/esm/starter.js"; -// The tasknotes.task 0.3.0-rc.19 pack in mdbase-contracts -// (packs/tasknotes.task/0.3.0-rc.19.pack.yaml, published at -// https://mdbase.dev/contracts/packs/tasknotes.task/0.3.0-rc.19.json). If the +// The tasknotes.task 0.3.0-rc.21 pack in mdbase-contracts PR #23 (c50a6d0), +// vendored from dist/ in src/generated/tasknotes-type-pack.json. If the // starter changes, publish a new starter revision in mdbase-contracts and // update these digests together; collections upgrade by merging against the // previous starter, so an unintended change here reaches every collection. -const PUBLISHED_RC19_RESOURCES = { - "_contracts/tasknotes.task/0.3.0-rc.6.md": - "sha256:3f4eb90782948ed68112ffcc99575911036020544cf501de3d2265b588b38456", - "_types/task.md": - "sha256:87e52c25b474a06283b29e2983ae4fc6e618fd1a4cbcc5856ff9a67328df605b", - "_schemas/tasknotes/tasknotes-task.schema.json": - "sha256:ac78a55f46669d6e8bd08d608b7c25338fec8ba7606dbf54ebd6b8d4e66b7035", - "_schemas/tasknotes/tasknotes-task-binding.schema.json": - "sha256:4f8f3288f593ce06a04525697308173147ff957e7066f83d9a922468d06be659", +const PUBLISHED_RC21_RESOURCES = { + "_mdbase/contracts/tasknotes.task.md": "sha256:ecadd00700e249940f4244aaa5b5985a96557d13340463ec491dfa5e89b032a4", + "_mdbase/contracts/tasknotes.task/0.3.0-rc.4.md": "sha256:91165b7664f936bba9289aca984e2638901db7fedf68642ab755e8d0b424e734", + "_mdbase/contracts/tasknotes.task/0.3.0-rc.3.md": "sha256:4761ee78615882170cae6e52590f98917f549bd89d852a0c40568583394d7264", + "_mdbase/contracts/tasknotes.task/0.3.0-rc.6.md": "sha256:3f4eb90782948ed68112ffcc99575911036020544cf501de3d2265b588b38456", + "_mdbase/types/task.md": "sha256:87e52c25b474a06283b29e2983ae4fc6e618fd1a4cbcc5856ff9a67328df605b", + "_mdbase/_schemas/tasknotes/tasknotes-task.schema.json": "sha256:ac78a55f46669d6e8bd08d608b7c25338fec8ba7606dbf54ebd6b8d4e66b7035", + "_mdbase/_schemas/tasknotes/tasknotes-task-binding.schema.json": "sha256:4f8f3288f593ce06a04525697308173147ff957e7066f83d9a922468d06be659", + "_mdbase/schemas/mdbase.app-settings/1.0.0.schema.json": "sha256:f37ed43b57fe86465b5bb67216da71d6e351bc1b85bf55a20f95edf886f0749e", + "_mdbase/contracts/mdbase.app-settings/1.0.0.md": "sha256:9028d8ccd99cfbb4034399777376315486eb8e699aea7757a6b193743f1084c8", + "_mdbase/schemas/tasknotes.settings/1.0.0.schema.json": "sha256:3a4fc207e14ab1579ca478ce84b25cb8dd85b804b3aa79d01eda08e4554dfbb1", + "_mdbase/contracts/tasknotes.settings/1.0.0.md": "sha256:e8c25653ef37c032fb4cb1f1c3f7c618092a09c4911a41aba42c0476796fe0d1", + "_mdbase/contracts/mdbase.app-settings/2.0.0.md": "sha256:a6587ce4cac92b064b2a07f032045e1f114ae358f1749adf4d8d8f38970952e8", + "_mdbase/contracts/tasknotes.settings/1.1.0.md": "sha256:7d4e6f55b6ba599faff00d837152ef7811ac5193ac20802f1ecdbc3ef7db5647", + "_mdbase/types/tasknotes-settings.md": "sha256:044d3d07b75ab07e458e824bf2b31116a683778d46db33cccf6a00111f652739" }; -test("the starter reproduces the published TaskNotes pack byte for byte", async () => { +test("the starter reproduces the published TaskNotes pack resource bytes", async () => { const pack = await buildTaskNotesMdbaseTypePack(buildTaskNotesStarterResources()); + assert.equal(pack.manifest.version, "0.3.0-rc.21"); assert.deepEqual( Object.fromEntries(pack.manifest.resources.map((resource) => [resource.target, resource.digest])), - PUBLISHED_RC19_RESOURCES, + PUBLISHED_RC21_RESOURCES, ); }); +test("the legacy layout reproduces the complete published pack including upgrade history", async () => { + const published = JSON.parse(await readFile(new URL("../src/generated/tasknotes-type-pack.json", import.meta.url), "utf8")); + const pack = await buildTaskNotesMdbaseTypePack(buildTaskNotesStarterResources({ + typesFolder: "_types", contractsFolder: "_contracts", + })); + assert.deepEqual(pack, published); +}); + test("the starter keeps cancelled as a skipped status and declares only implemented profiles", () => { const { type } = buildTaskNotesStarterResources(); const binding = type.implements.find((entry) => entry.contract === "tasknotes.task").binding;