7f432138df
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>
2.9 KiB
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/andsrc/are full), onemod periodic;line incrates/engine/src/lib.rs, oneregister_periodic(reg)call incrates/engine/src/commands.rs::register_corecrates/engine/src/prefs/files_config.rsis NOT touched; settings live in a newcrates/engine/src/prefs/periodic_config.rs+ one entry incrates/engine/src/prefs/catalog/(copycalendar_config.rsshape)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 whethergggg/wwweek 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 asSession::daily_note).- Settings per kind:
folder,format(defaultsgggg-[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 is2026-W53; 2027-01-01 is2026-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 inperiodic/, 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.