Files
Marcos Paulo b32650767c
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: specs and briefs for smart folders, version diff, media timestamps, clean paste, link cards, spaced repetition
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 12:18:00 -03:00

5.2 KiB

Tasks: spaced repetition (roadmap 31)

One task = one agent (specs/agents/opencode-runbook.md). Spec: spec.md. Rules: AGENTS.md, docs/CODE-MAP.md. First tool call rule: after at most three reads, write the first OWNS file in your SECOND tool call (compiling stub + ONE failing test), then make it pass. Standing VERIFY: export PATH="$HOME/.cargo/bin:$PATH"; cargo test -p <pkg>; cargo clippy -p <pkg> --all-targets -- -D warnings; rustfmt --edition 2024 <owned files>; UI tasks add cargo xtask i18n; last task of a phase adds cargo xtask layers and cargo xtask tree. Standing DO NOT: edit files outside OWNS, git state, cargo fmt --all; add allow; unwrap/expect/panic/[i]/[a..b] on input-derived data; add a dependency.

Owner/lead step 0

Answer Q1 to Q4 (defaults in the spec hold if unanswered).

Phase 1 - pure crate

  • 1. Crate notescraft-srs with the SM-2 scheduler (brief briefs/18-srs-scheduler.md; includes crate registration). OWNS: crates/srs/Cargo.toml, crates/srs/src/lib.rs, crates/srs/src/sm2.rs, crates/srs/tests/sm2.rs; registration: root Cargo.toml (one [workspace.dependencies] line), xtask/src/layers.rs (("srs", Class::Layer(0))).
  • 2. Card extraction. OWNS: crates/srs/src/extract.rs, crates/srs/src/key.rs, crates/srs/src/lib.rs (exports), crates/srs/tests/extract.rs. FILES TO OPEN: spec.md syntax and D1, crates/srs/src/lib.rs, crates/markdown/src/scanning/ (how fences/front matter are skipped here: copy the idea, do not depend on the crate: same layer), crates/templater/src/segment.rs (hand scanner style). GOAL: extract_cards, FNV-1a key, tag detection (front matter tags: [flashcards], tags: flashcards, list form, inline #flashcards/deck). TESTS: acceptance 1 and 2, key stability when the card moves lines, key differs after edit, 2 001 cards in a note capped, 5 000 random-line fuzz without panic, CRLF, emoji. VERIFY: standing -p notescraft-srs. DO NOT: IO.
  • 3. Store model. OWNS: crates/srs/src/store.rs, crates/srs/src/lib.rs (export), crates/srs/tests/store.rs. FILES TO OPEN: spec.md D1/D4, crates/engine/src/activity/outbox.rs (versioned JSON), crates/srs/src/sm2.rs. GOAL: Store::parse, to_json (sorted keys: stable bytes), get/put/remove, cap 100 000, unknown version -> Err, corrupt -> Err. TESTS: round trip byte-stable; cap; corrupt; unknown version; negative or huge numbers rejected. VERIFY: standing. DO NOT: IO.

Phase 2 - engine

  • 4. srs.* commands, settings, store IO. OWNS: crates/engine/Cargo.toml (one dep line), crates/engine/src/srs/{mod,scan,store,commands}.rs, one mod srs; in crates/engine/src/lib.rs, one register_srs(reg) call in commands.rs::register_core, crates/engine/src/prefs/srs_config.rs, crates/engine/src/prefs/catalog/ entry, crates/engine/src/ai/assistant_gate.rs, crates/engine/tests/core_commands.rs, crates/engine/tests/srs.rs. FILES TO OPEN: spec.md D2, crates/engine/src/bases/commands.rs (group to copy), crates/engine/src/bases/source.rs (iterating index notes), crates/engine/src/prefs/files_config.rs + tests/files_config_viewers.rs, crates/engine/src/activity/outbox.rs (write_private). GOAL: D2 table; injected clock for tests (pub(crate) fn today(session) reads a test override); scan cached per index generation; store written atomically; corrupt store never overwritten. TESTS: TempVault with a tagged note: scan counts, due ordering, answer persists across Session reopen, notes byte-identical, new_per_day cap, prune, corrupt store refuses answer, disabled setting, assistant gate lists. VERIFY: standing + --test srs --test core_commands. DO NOT: touch UI; read note text per call (use one scan pass).

Phase 3 - UI

  • 5. Review tab. OWNS: crates/ui-egui/src/views/srs_view/{mod,card,summary}.rs, crates/ui-egui/src/text/views/srs.rs, [ui.srs] at END of en.toml, crates/ui-egui/tests/srs_view.rs, crates/ui-egui/src/widgets/tabs/kind.rs (one TabKind::Srs arm + prefix const), crates/ui-egui/src/shell/app/window/views.rs (one dispatch arm). FILES TO OPEN: spec.md D3, crates/ui-egui/src/views/versions_view/mod.rs (tab with prefix and actions), crates/ui-egui/src/widgets/tabs/kind.rs, crates/ui-egui/src/views/note_view/inlines.rs (render rich text), crates/ui-egui/src/shell/hotkeys/defaults.rs and commands.rs, .claude/skills/notescraft-egui-screen/. GOAL: front/back, reveal, 1-4 grading, Again re-queued, summary, deck picker; palette "Flashcards: Review". Dispatch and palette wiring lines listed for the lead. TESTS: kittest: reveal on Space, keys 1-4 send one srs.answer each, Again cards return, empty queue shows summary, no cards shows the how-to text. VERIFY: standing + cargo xtask i18n tree; snapshot PNG read. DO NOT: engine calls on the UI thread (worker, copy share_dialog/mod.rs); hardcode strings; raw widgets.
  • 6. Status chip, docs. OWNS: crates/ui-egui/src/shell/ status-bar chip file (find with git grep -n "sync_pill" crates/ui-egui/src | head), ROADMAP.md, docs/ARCHITECTURE.md (new crate), docs/CODE-MAP.md, specs/plugins-parity/roadmap.md (mark 31), specs/plugins-parity/inventory.md (row for Spaced Repetition). VERIFY: cargo xtask ci.