From aac43d77d299e4e28442dec387ff6a8086b0b83f Mon Sep 17 00:00:00 2001 From: Tristan Michael Date: Sun, 5 Apr 2026 19:23:52 -0700 Subject: [PATCH] Docs: update frontmatter examples and Task struct for version counter Remove created/updated timestamps from Task struct docs and frontmatter examples in PLAN.md, README.md, docs/API.md. Add version field. Update CLAUDE.md on-disk format section to document version counter, default behavior for legacy files, and self-healing dedup in list_tasks. --- CLAUDE.md | 2 +- PLAN.md | 7 +++---- README.md | 3 +-- docs/API.md | 6 ++---- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e876302..61e2474 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,7 +43,7 @@ Two-crate workspace (`resolver = "2"`, edition 2021) plus a Tauri app: ### On-disk format -Workspaces are plain folders. Each task list is a subfolder containing `.listdata.json` (metadata/ordering) and one `.md` file per task. The workspace root has `.onyx-workspace.json` for list ordering and workspace detection. Sync only processes files at expected depths: `.onyx-workspace.json` at root, `.listdata.json` and `*.md` inside list directories. +Workspaces are plain folders. Each task list is a subfolder containing `.listdata.json` (metadata/ordering) and one `.md` file per task. The workspace root has `.onyx-workspace.json` for list ordering and workspace detection. Sync only processes files at expected depths: `.onyx-workspace.json` at root, `.listdata.json` and `*.md` inside list directories. Task frontmatter contains `id`, `status`, `version` (u64, increments on every write, defaults to 1 for legacy files), and optionally `due`, `has_time`, `parent` (omitted when false/null). `list_tasks` auto-deduplicates by UUID, keeping the highest-version file and deleting stale copies. ### Tauri GUI structure diff --git a/PLAN.md b/PLAN.md index 48579a8..87c96b6 100644 --- a/PLAN.md +++ b/PLAN.md @@ -61,9 +61,8 @@ Tasks are stored as individual `.md` files with YAML frontmatter: --- id: 550e8400-e29b-41d4-a716-446655440000 status: backlog +version: 3 due: 2026-11-15T14:00:00Z -created: 2026-10-26T10:00:00Z -updated: 2026-10-26T12:30:00Z parent: 550e8400-e29b-41d4-a716-446655440001 --- @@ -86,8 +85,8 @@ Task { description: String, // Markdown content status: TaskStatus, // Backlog or Completed due_date: Option, - created_at: DateTime, - updated_at: DateTime, + has_time: bool, // Whether due_date includes a specific time + version: u64, // Increments on every write; used for sync dedup parent_id: Option, // For subtasks } diff --git a/README.md b/README.md index cce9abd..b3e7b8b 100644 --- a/README.md +++ b/README.md @@ -167,9 +167,8 @@ Tasks are stored as markdown files with YAML frontmatter (Obsidian-compatible): --- id: 550e8400-e29b-41d4-a716-446655440000 status: backlog +version: 3 due: 2026-11-15T14:00:00Z -created: 2026-10-26T10:00:00Z -updated: 2026-10-26T12:30:00Z --- Task description and notes go here in **markdown** format. diff --git a/docs/API.md b/docs/API.md index d521f37..d038e20 100644 --- a/docs/API.md +++ b/docs/API.md @@ -20,8 +20,7 @@ pub struct Task { pub status: TaskStatus, pub due_date: Option>, pub has_time: bool, // Whether due_date includes a specific time - pub created_at: DateTime, - pub updated_at: DateTime, + pub version: u64, // Increments on every write; used for sync dedup pub parent_id: Option, } @@ -241,9 +240,8 @@ Tasks are stored as `.md` files with YAML frontmatter: --- id: 550e8400-e29b-41d4-a716-446655440000 status: backlog +version: 3 due: 2026-11-15T14:00:00Z -created: 2026-10-26T10:00:00Z -updated: 2026-10-26T12:30:00Z parent: 550e8400-e29b-41d4-a716-446655440001 ---