Skip to content

Commit 39aa022

Browse files
authored
Add TaskNotes rc.19: tasknotes.task rc.6 and the TaskNotes settings record (#18)
- Add mdbase.app-settings 1.0.0 (byte-identical to mdbase Reader's), tasknotes.settings 1.0.0 and the tasknotes-settings seed type. - Add tasknotes.task 0.3.0-rc.6 at a versioned contract target, keep rc.5 managed at _contracts/tasknotes.task.md for types that still implement it, and seed starter revision 6 with baselines 5 to 1. - Hide rc.18; extend the upgrade and plugin-collection tests.
1 parent 5c06f15 commit 39aa022

30 files changed

Lines changed: 4772 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,29 @@ hidden. A customised task type whose lock records no origin is preserved, and
196196
because it still implements the replaced contract the upgrade is blocked for
197197
review rather than merged against a guessed starter.
198198

199+
## TaskNotes settings record
200+
201+
rc.19 provides `tasknotes.task` 0.3.0-rc.6, `tasknotes.settings` 1.0.0 and the
202+
generic `mdbase.app-settings` 1.0.0 (copied byte for byte from mdbase Reader, so
203+
both apps install the same contract). rc.6 moves app behaviour out of the task
204+
binding: NLP triggers, templating, archive moves, time tracking, checkbox
205+
resets on recurrence, the link write format, and per-status `next_status`,
206+
`exclude_from_cycle`, `auto_archive` and `auto_archive_delay_minutes`. TaskNotes
207+
keeps them in one record, `_settings/dev.tasknotes.md`, of the seeded
208+
`tasknotes-settings` type (unique on `app`). The pack seeds the type only; the
209+
record is written by TaskNotes, which reads each setting from the record, then
210+
from an rc.5 binding that still holds it, then its default.
211+
212+
The rc.6 contract is installed at `_contracts/tasknotes.task/0.3.0-rc.6.md`.
213+
The rc.5 contract stays managed at `_contracts/tasknotes.task.md`, not
214+
provided, so task types that still implement it (edited types the pack
215+
preserves, and types the TaskNotes plugin wrote) stay valid until TaskNotes
216+
upgrades them. Starter revision 6 (type v5) is revision 5 with the moved
217+
settings removed and the contract version raised; it lists revisions 5 to 1 as
218+
baselines, and rc.18 is hidden. A collection that edited its status
219+
definitions (for example their colours) conflicts on that list and the
220+
upgrade is blocked for review; TaskNotes upgrades such a type itself.
221+
199222
Starter files are named by revision (`types/tasknotes-task/<revision>.md`); a
200223
revision that does not change the task data keeps the type `version`, so
201224
collections already at that version upgrade without a version conflict.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
kind: mdbase.contract
3+
contract_type: record
4+
id: mdbase.app-settings
5+
version: 1.0.0
6+
name: App settings
7+
description: One record per app holding the policy that app's clients honour in this collection.
8+
record_schema:
9+
dialect: json-schema-2020-12
10+
ref: ../../schemas/mdbase.app-settings/1.0.0.schema.json
11+
---
12+
13+
# App settings
14+
15+
An app settings record holds values that every client of one app honours in this
16+
collection, such as how new files are named. The values change client behaviour,
17+
never what another record means.
18+
19+
## Location and identity
20+
21+
A collection-scope record lives at `_settings/<app>.md`, where `<app>` is the
22+
record's `app` field. Clients read it by that path, without a query. Each
23+
implementing type declares `collection.unique` on `app` with `scope: type`, so a
24+
collection holds at most one collection-scope record per app.
25+
26+
The record's `type` field names the app's own settings type, not a shared value.
27+
Generic tools find every settings record through this contract.
28+
29+
## Reserved fields
30+
31+
- `app`: the app id.
32+
- `scope`: `collection`, or `user` for one person's overrides.
33+
- `user`: a link to an `mdbase.person` record, present only when `scope` is
34+
`user`.
35+
- `settings_version`: the version of the app's settings schema that last wrote
36+
the record.
37+
38+
Every other frontmatter field belongs to the app and is described by the app's
39+
own settings contract. The body is free Markdown for people; apps never parse it.
40+
41+
## Client behaviour
42+
43+
- A missing record means every setting has its default. Clients never create the
44+
record on read.
45+
- A missing or invalid field takes its default; valid fields are used as
46+
written. The record is not rewritten until someone saves.
47+
- A save creates the record at its fixed path the first time, and otherwise
48+
patches only the fields it changes, guarded by the record's revision.
49+
- A client that finds a `settings_version` newer than it understands treats the
50+
settings as read-only and uses them as written.
51+
52+
## Authority
53+
54+
This artifact is passive. A settings record grants nothing and must never hold
55+
secrets: anyone who can read or write records can read or edit it.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
kind: mdbase.contract
3+
contract_type: record
4+
id: tasknotes.settings
5+
version: 1.0.0
6+
name: TaskNotes settings
7+
description: Collection-wide TaskNotes behaviour, such as templates, archive moves and status cycling.
8+
record_schema:
9+
dialect: json-schema-2020-12
10+
ref: ../../schemas/tasknotes.settings/1.0.0.schema.json
11+
---
12+
13+
# TaskNotes settings
14+
15+
The collection's settings record for TaskNotes, at `_settings/dev.tasknotes.md`.
16+
It also implements `mdbase.app-settings`, whose reserved fields (`app`, `scope`,
17+
`settings_version`) it shares.
18+
19+
These settings change what TaskNotes clients do, never what a task record
20+
means: that stays in the `tasknotes.task` binding of each task type.
21+
`tasknotes.task` 0.3.0-rc.6 moved them here from the binding. A client reads
22+
each setting from this record, then from an earlier binding that still holds
23+
it, then uses its default, so a collection whose task type is still on rc.5
24+
keeps its behaviour until it is upgraded.
25+
26+
## Fields
27+
28+
- `nlp_triggers`: natural-language capture triggers. Without it, each client
29+
uses its own defaults.
30+
- `template_enabled`, `template_path`, `occurrence_template_enabled`,
31+
`occurrence_template_path`, `template_failure_mode`,
32+
`template_unknown_variable_policy`: body templates for new tasks and
33+
materialized occurrences.
34+
- `move_on_archive`, `archive_folder`: whether archiving moves the file, and
35+
where to.
36+
- `auto_stop_time_tracking_on_complete`: stop a running timer on completion.
37+
- `reset_body_checkboxes_on_recurrence`: uncheck body checkboxes when a
38+
recurring task advances.
39+
- `link_write_format`: `wikilink` or `markdown` for links written to task
40+
frontmatter.
41+
- `status_behavior`: per status value, `next_status`, `exclude_from_cycle`,
42+
`auto_archive` and `auto_archive_delay_minutes`. A status without an entry
43+
has no next status and no auto-archive (5 minute delay), and is out of the
44+
cycle exactly when it is a skipped status.
45+
46+
## Authority
47+
48+
This artifact is passive and grants nothing.

0 commit comments

Comments
 (0)