Files
Marcos Paulo 7f432138df
ci / ci (macos-latest) (push) Has been cancelled
ci / ci (ubuntu-latest) (push) Has been cancelled
ci / ci (windows-latest) (push) Has been cancelled
docs: Obsidian plugin parity research, Bases spec and tasks, empty notescraft-bases crate
Inventory of the 29 core plugins (22 done, 2 partial, 5 missing), 80 community plugins with a verdict each, a ranked roadmap with 8 ready briefs, the Bases spec (D1-D13) and 20 tasks, ASCII wireframes of the Bases screens (PaperCraft was not running). crates/bases is registered at layer L2.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 00:30:28 -03:00

2.9 KiB

TASK periodic-notes: weekly, monthly, quarterly and yearly notes (Periodic Notes)

Runs through OpenCode (specs/agents/opencode-runbook.md is attached automatically).

OWNS

  • crates/engine/src/periodic/mod.rs, crates/engine/src/periodic/period.rs, crates/engine/src/periodic/commands.rs (new folder; vault/ and src/ are full), one mod periodic; line in crates/engine/src/lib.rs, one register_periodic(reg) call in crates/engine/src/commands.rs::register_core
  • crates/engine/src/prefs/files_config.rs is NOT touched; settings live in a new crates/engine/src/prefs/periodic_config.rs + one entry in crates/engine/src/prefs/catalog/ (copy calendar_config.rs shape)
  • crates/engine/tests/periodic.rs, crates/engine/tests/core_commands.rs (CORE_IDS), crates/engine/src/ai/assistant_gate.rs

FILES TO OPEN

  • pattern: crates/engine/src/vault/daily.rs (daily_specs, daily_note, template expansion, parse_date)
  • crates/templates/src/daily.rs, crates/templates/src/date.rs (Date, weekday math), crates/templates/src/format.rs (tokens; check whether gggg/ww week tokens exist and add them there ONLY if a test in your brief needs it: if so say so in the report)
  • crates/engine/src/prefs/calendar_config.rs + crates/engine/tests/files_config_viewers.rs (settings pattern)

GOAL / API

  • note.periodic {kind: weekly|monthly|quarterly|yearly, date?: YYYY-MM-DD} (default today): returns {path, created}; creates from the configured template when missing (same behaviour as Session::daily_note).
  • Settings per kind: folder, format (defaults gggg-[W]ww, YYYY-MM, YYYY-[Q]Q, YYYY), template (empty = none). ISO 8601 weeks (Monday start, week 1 contains Jan 4). Week-year differs from calendar year at the edges (2026-12-31 is 2026-W53; 2027-01-01 is 2026-W53: assert whatever ISO says).
  • period_bounds(kind, date) -> (Date, Date) for the UI (previous/next period).
  • Template variables: reuse expand, add {{start}} and {{end}} (period bounds) via a local pre-pass in periodic/, not in the templates crate.
  • Invalid format string -> settings error, nothing created. Writes through the existing note-creation path (craft-atomic).

TESTS

crates/engine/tests/periodic.rs: ISO week edges (2020-12-31, 2021-01-03, 2026-12-31), quarter and month names, create-once idempotence, template expansion with {{start}}, folder auto-created, invalid format refused, read-only session refused.

VERIFY

export PATH="$HOME/.cargo/bin:$PATH"
cargo test -p notescraft-engine --test periodic
cargo test -p notescraft-engine --test core_commands
cargo clippy -p notescraft-engine --all-targets -- -D warnings
rustfmt --edition 2024 crates/engine/src/periodic/*.rs crates/engine/src/prefs/periodic_config.rs crates/engine/tests/periodic.rs

DO NOT

Touch the sidebar calendar or views/calendar_view (follow-up: week-number click); edit crates/templates beyond the one case named above; add settings UI.