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.
This commit is contained in:
parent
5e33416b22
commit
aac43d77d2
|
|
@ -43,7 +43,7 @@ Two-crate workspace (`resolver = "2"`, edition 2021) plus a Tauri app:
|
||||||
|
|
||||||
### On-disk format
|
### 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
|
### Tauri GUI structure
|
||||||
|
|
||||||
|
|
|
||||||
7
PLAN.md
7
PLAN.md
|
|
@ -61,9 +61,8 @@ Tasks are stored as individual `.md` files with YAML frontmatter:
|
||||||
---
|
---
|
||||||
id: 550e8400-e29b-41d4-a716-446655440000
|
id: 550e8400-e29b-41d4-a716-446655440000
|
||||||
status: backlog
|
status: backlog
|
||||||
|
version: 3
|
||||||
due: 2026-11-15T14:00:00Z
|
due: 2026-11-15T14:00:00Z
|
||||||
created: 2026-10-26T10:00:00Z
|
|
||||||
updated: 2026-10-26T12:30:00Z
|
|
||||||
parent: 550e8400-e29b-41d4-a716-446655440001
|
parent: 550e8400-e29b-41d4-a716-446655440001
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -86,8 +85,8 @@ Task {
|
||||||
description: String, // Markdown content
|
description: String, // Markdown content
|
||||||
status: TaskStatus, // Backlog or Completed
|
status: TaskStatus, // Backlog or Completed
|
||||||
due_date: Option<DateTime>,
|
due_date: Option<DateTime>,
|
||||||
created_at: DateTime,
|
has_time: bool, // Whether due_date includes a specific time
|
||||||
updated_at: DateTime,
|
version: u64, // Increments on every write; used for sync dedup
|
||||||
parent_id: Option<Uuid>, // For subtasks
|
parent_id: Option<Uuid>, // For subtasks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,9 +167,8 @@ Tasks are stored as markdown files with YAML frontmatter (Obsidian-compatible):
|
||||||
---
|
---
|
||||||
id: 550e8400-e29b-41d4-a716-446655440000
|
id: 550e8400-e29b-41d4-a716-446655440000
|
||||||
status: backlog
|
status: backlog
|
||||||
|
version: 3
|
||||||
due: 2026-11-15T14:00:00Z
|
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.
|
Task description and notes go here in **markdown** format.
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,7 @@ pub struct Task {
|
||||||
pub status: TaskStatus,
|
pub status: TaskStatus,
|
||||||
pub due_date: Option<DateTime<Utc>>,
|
pub due_date: Option<DateTime<Utc>>,
|
||||||
pub has_time: bool, // Whether due_date includes a specific time
|
pub has_time: bool, // Whether due_date includes a specific time
|
||||||
pub created_at: DateTime<Utc>,
|
pub version: u64, // Increments on every write; used for sync dedup
|
||||||
pub updated_at: DateTime<Utc>,
|
|
||||||
pub parent_id: Option<Uuid>,
|
pub parent_id: Option<Uuid>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -241,9 +240,8 @@ Tasks are stored as `.md` files with YAML frontmatter:
|
||||||
---
|
---
|
||||||
id: 550e8400-e29b-41d4-a716-446655440000
|
id: 550e8400-e29b-41d4-a716-446655440000
|
||||||
status: backlog
|
status: backlog
|
||||||
|
version: 3
|
||||||
due: 2026-11-15T14:00:00Z
|
due: 2026-11-15T14:00:00Z
|
||||||
created: 2026-10-26T10:00:00Z
|
|
||||||
updated: 2026-10-26T12:30:00Z
|
|
||||||
parent: 550e8400-e29b-41d4-a716-446655440001
|
parent: 550e8400-e29b-41d4-a716-446655440001
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue