Add planner bucket model and when metadata for Tasks #107

Closed
opened 2026-05-27 09:14:03 +00:00 by steve · 0 comments
Owner

Add the pure planner projection model and the minimal when metadata needed to classify existing markdown-backed tasks into planner buckets.

Problem

The Tasks plugin has rich task-note metadata, but it does not yet expose the calm Things-like planner buckets described in the Tasks spec. There is no when field for explicit Today, This Evening, or Someday placement, and no framework-independent planner classification logic for tests or future UI.

Goal

Introduce a tested planner domain model that can classify StoredTask entries into Inbox, Today, This Evening, Upcoming, Anytime, Someday, and Logbook without changing existing task views.

Scope

  • Add a pure packages/plugins/plugin-tasks/src/planner/planner-model.ts module.
  • Add a planner bucket/snapshot API suitable for Svelte views and tests.
  • Add when as a mapped frontmatter role with default key when.
  • Parse and normalize when: today | this-evening | someday on StoredTask.
  • Preserve due-date and scheduled-date semantics: due dates are deadlines, scheduled dates are start/planning dates.
  • Add unit tests for classification, grouping, sorting, and parsing.

Non-goals

  • No planner UI.
  • No quick capture or triage actions.
  • No areas, project sections, review workflow, or manual ordering.
  • No generated Planner Base.

Acceptance Criteria

  • buildPlannerSnapshot() returns all required planner buckets from a StoredTask[] input.
  • Completed tasks appear only in Logbook-active output, never active planner buckets.
  • scheduledDate today classifies as Today; future scheduled dates classify as Upcoming.
  • dueDate alone does not classify a task as Today unless an explicit option enables that behavior.
  • when=someday parks the task in Someday even when other active metadata exists.
  • when=this-evening classifies separately from Today and can still coexist with today's scheduled date.
  • Inbox classification is conservative: no scheduled date, no due date, no project links, and no explicit planner placement.
  • Strict validation handles unsupported when values deliberately.
  • Existing Tasks list, task-card, Bases, and TaskNotes conformance tests still pass.

Implementation Notes

  • Keep the planner model free of runtime imports from @lapis-notes/api so Vitest can run it cheaply.
  • Extend TaskFieldMapping, DEFAULT_TASKS_FIELD_MAPPING, mergeTasksSettings(), cloneTasksSettings(), and related settings tests.
  • Extend parseTaskNote() and createTaskNoteDraft() only as needed; ordinary task creation should not write when unless explicitly requested.
  • Treat this as Lapis planner metadata, not a new TaskNotes conformance-profile claim.

Suggested Files or Specs To Inspect

  • packages/plugins/plugin-tasks/src/core/model.ts
  • packages/plugins/plugin-tasks/src/core/settings.ts
  • packages/plugins/plugin-tasks/src/core/model.test.ts
  • packages/plugins/plugin-tasks/src/core/settings.test.ts
  • packages/plugins/plugin-tasks/src/tasknotes/conformance.test.ts
  • spec/src/20-packages/plugins/tasks/index.md
  • packages/plugins/plugin-tasks/spec.md

Validation Commands

  • pnpm --filter @lapis-notes/tasks test
  • pnpm --filter @lapis-notes/tasks check
  • make spec-lint
  • pnpm test:smoke

Follow-up Tasks

  • TASK-PLUGIN-055
  • TASK-PLUGIN-056

Implementation Summary

Implemented the planner bucket model, mapped when metadata, and task parsing for Inbox, Today, Upcoming, Anytime, Someday, and Logbook classification.

Add the pure planner projection model and the minimal `when` metadata needed to classify existing markdown-backed tasks into planner buckets. ## Problem The Tasks plugin has rich task-note metadata, but it does not yet expose the calm Things-like planner buckets described in the Tasks spec. There is no `when` field for explicit Today, This Evening, or Someday placement, and no framework-independent planner classification logic for tests or future UI. ## Goal Introduce a tested planner domain model that can classify `StoredTask` entries into Inbox, Today, This Evening, Upcoming, Anytime, Someday, and Logbook without changing existing task views. ## Scope - Add a pure `packages/plugins/plugin-tasks/src/planner/planner-model.ts` module. - Add a planner bucket/snapshot API suitable for Svelte views and tests. - Add `when` as a mapped frontmatter role with default key `when`. - Parse and normalize `when: today | this-evening | someday` on `StoredTask`. - Preserve due-date and scheduled-date semantics: due dates are deadlines, scheduled dates are start/planning dates. - Add unit tests for classification, grouping, sorting, and parsing. ## Non-goals - No planner UI. - No quick capture or triage actions. - No areas, project sections, review workflow, or manual ordering. - No generated Planner Base. ## Acceptance Criteria - `buildPlannerSnapshot()` returns all required planner buckets from a `StoredTask[]` input. - Completed tasks appear only in Logbook-active output, never active planner buckets. - `scheduledDate` today classifies as Today; future scheduled dates classify as Upcoming. - `dueDate` alone does not classify a task as Today unless an explicit option enables that behavior. - `when=someday` parks the task in Someday even when other active metadata exists. - `when=this-evening` classifies separately from Today and can still coexist with today's scheduled date. - Inbox classification is conservative: no scheduled date, no due date, no project links, and no explicit planner placement. - Strict validation handles unsupported `when` values deliberately. - Existing Tasks list, task-card, Bases, and TaskNotes conformance tests still pass. ## Implementation Notes - Keep the planner model free of runtime imports from `@lapis-notes/api` so Vitest can run it cheaply. - Extend `TaskFieldMapping`, `DEFAULT_TASKS_FIELD_MAPPING`, `mergeTasksSettings()`, `cloneTasksSettings()`, and related settings tests. - Extend `parseTaskNote()` and `createTaskNoteDraft()` only as needed; ordinary task creation should not write `when` unless explicitly requested. - Treat this as Lapis planner metadata, not a new TaskNotes conformance-profile claim. ## Suggested Files or Specs To Inspect - `packages/plugins/plugin-tasks/src/core/model.ts` - `packages/plugins/plugin-tasks/src/core/settings.ts` - `packages/plugins/plugin-tasks/src/core/model.test.ts` - `packages/plugins/plugin-tasks/src/core/settings.test.ts` - `packages/plugins/plugin-tasks/src/tasknotes/conformance.test.ts` - `spec/src/20-packages/plugins/tasks/index.md` - `packages/plugins/plugin-tasks/spec.md` ## Validation Commands - `pnpm --filter @lapis-notes/tasks test` - `pnpm --filter @lapis-notes/tasks check` - `make spec-lint` - `pnpm test:smoke` ## Follow-up Tasks - TASK-PLUGIN-055 - TASK-PLUGIN-056 ## Implementation Summary Implemented the planner bucket model, mapped when metadata, and task parsing for Inbox, Today, Upcoming, Anytime, Someday, and Logbook classification. <!-- backlog:task_id=TASK-PLUGIN-054 source_spec=spec/src/20-packages/plugins/tasks/index.md#things-like-planner-workflow -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#107
No description provided.