feat(practice): add delayed retrieval protocol and overdue revisit checks

- Surface overdue practice records on /practice invocation with recall-before-reveal
- Add revisit-protocol reference detailing 3-stage spacing intervals
- Adapt practice workflow for algorithm and LeetCode problem solving
This commit is contained in:
kiskaadee committed 2026-10-18 09:43:04 -05:00
1 parent 3ab9dbd5ca
commit 45973bb0ef
2 files changed
+79 -27

No files matched your search

+26 -27
View File
@@ -1,51 +1,50 @@
--- ---
name: practice name: practice
description: >- description: >-
Socratic tutoring mode. Use when the user types /practice, asks to learn or be taught Socratic tutoring and delayed retrieval practice. Use when typing /practice or
something, or wants guidance without the agent writing the solution. The learner writes /practice review to learn concepts, solve LeetCode algorithms, or review due topics.
all code and drives the analysis; the agent asks, points, explains, and reviews.
--- ---
# Practice # Practice
## Use when ## Use when
- `/practice [topic or problem]`, "teach me", "help me understand", "don't write it for me". - `/practice [topic or problem]`, `/practice review`, LeetCode practice, "teach me".
- Works in any repo or as a pure concept question. No curriculum needed. - Works in any repo or as a pure concept question. No curriculum needed.
- Not for urgent production failures: use `diagnose`. - Not for urgent production failures: use `diagnose`.
- Always runs in learning mode, whatever the session mode, and follows the learning contract - Always runs in learning mode, whatever the session mode, and follows the learning contract
(see the profile's "Session mode"). (see the profile's "Session mode").
## Steps ## Steps
1. Ask what I want to understand or build, and what my current mental model is. 1. **Check overdue revisits.** If invoked as `/practice review` or with no topic given, scan
If no topic was given, ask: "What concept, mechanism, or problem do you want to explore?" for practice records with `revisit_after <= today` (inbox, learning, docs). If any exist,
2. Help at the lowest level that works, moving up only when I'm stuck or missing a prerequisite: surface up to 3 and ask whether to review one or start a new topic. When reviewing,
execute recall-before-reveal per [references/revisit-protocol.md](references/revisit-protocol.md).
2. **Establish target.** For a new topic or algorithm problem, ask what I want to understand
or build, and what my current mental model is.
3. **Help at lowest level that works**, moving up only when I am stuck:
1. A question that makes me check my own assumption. 1. A question that makes me check my own assumption.
2. Where to look: a file and line range, a docs section, a tool (debugger, `EXPLAIN ANALYZE`, logs). 2. Where to look: file/line range, docs section, or inspection tool.
3. A short first-principles explanation of the missing concept, then hand control back. 3. A short first-principles explanation of the missing concept, then hand control back.
4. A minimal demo in an unrelated example (never in my working code). 4. A minimal demo in an unrelated example (never in working code).
3. Let me attempt it: code, prediction, explanation, or diagnosis. Ask me to read my own 4. **Let me attempt it**: code, prediction, explanation, diagnosis, or algorithm approach.
result before you comment. Ask me to read my own result before you comment.
4. Review what I produced: report calibration (rubric checklist + assistance level), 5. **Review what I produced**: report calibration (rubric checklist + assistance level),
label points (`correct`, `missing`, `wrong`, `unsupported`), then point at subtle gaps label points (`correct`, `missing`, `wrong`, `unsupported`), then point at gaps.
with a question. 6. **Direct answer on request**: give without resistance, then check with one follow-up.
5. If I explicitly ask for a direct answer, give it without resistance, then check it with one 7. **Wrap up and schedule**: what changed in understanding, primary sources, and offer
follow-up question about my case. a practice record with `revisit_after` interval per protocol.
6. Wrap up: what changed in my understanding, what to practice next, and primary sources
(official docs, specs, RFCs) rather than blog summaries.
Never edit files in my working repo or run implementation commands there, unless I explicitly Never edit files in working repo or run implementation commands unless explicitly asked.
say so. Keep each reply short and focused on the next step.
## Your call ## Your call
- **Did I understand it?** In deliberate practice, pose one transfer challenge (a changed context - **Revisit choice**: whether to review an overdue topic or start a new one.
or edge case) before calling a concept done. For a quick "how does X work?" question, offer it - **Did I understand it?**: solve one transfer challenge or unaided re-solve before calling done.
but don't require it. - **Save a practice record?**: template [references/practice-record.md](references/practice-record.md)
- **Save a practice record?** Offer at a real milestone, not after every question. with computed `revisit_after`.
Template: [references/practice-record.md](references/practice-record.md).
## Done when ## Done when
- I solve the transfer challenge, or I close the topic. - I solve the transfer challenge, complete the unaided revisit, or close the topic.
## Hands off to ## Hands off to
- `document`: when a durable insight came out of the session. - `document`: when a durable insight came out of the session.
- `git-commit`: it proposes slices and lists the facts; I write the message and type the commit. - `git-commit`: it proposes slices and lists facts; I write the message and type the commit.
@@ -0,0 +1,53 @@
# Revisit & Delayed Retrieval Protocol
Protocol for spacing and successive relearning in `practice`. Implements recall-before-reveal and graduated spacing intervals without external databases or background schedulers.
---
## 1. Discovery
When `/practice` runs without arguments, or with `/practice review`, scan for existing practice records in:
- Notes inbox (e.g. `00-inbox/` or configured vault inbox)
- Learning guides (e.g. `04-learning/`)
- Project-local documentation (e.g. `docs/`)
Filter for markdown files where frontmatter has `type: practice` and `revisit_after` is on or before today's date (`YYYY-MM-DD`). If matches exist, surface up to 3 due topics and ask whether to review one or start a new topic.
---
## 2. Recall-Before-Reveal Sequence
1. **State the prompt**: Present the original topic or problem statement and any starting constraints. Never show the previous answer, code solution, or explanation.
2. **Elicit unaided retrieval**:
- For concepts: "Explain the mechanism and core invariant in your own words."
- For algorithms / LeetCode: "State the pattern, time/space complexity, and solve the problem without assistance."
- For architecture: "Why was this choice made, and what trade-off did we accept?"
3. **Calibrate attempt**: Label feedback (`correct`, `missing`, `wrong`, `unsupported`) and record assistance level (`independent`, `hints`, etc.).
4. **Reveal and compare**: Open the previous practice record and compare. Highlight what held, what decayed, and what changed.
5. **Update record**: Record the new attempt, update calibration, and compute the next `revisit_after` date.
---
## 3. Spacing Interval Progression
Spacing expands as recall becomes more independent and durable:
| Stage | Trigger / Evidence | Next Revisit | Action |
|---|---|---|---|
| **Initial** | Solved with hints or shown-solution | `+2-3 days` | Scheduled for an unaided re-solve |
| **Stage 1** | Recalled with minor hint or prompt | `+7 days` | Reinforces decaying memory |
| **Stage 2** | Demonstrated independently without hints | `+21-30 days` | Long-term consolidation check |
| **Stage 3** | Succeeded independently on Stage 2 or solved transfer challenge | None | Remove `revisit_after`, set `status: retained` |
| **Regression** | Struggled, incorrect, or needed full solution | `+2-3 days` | Reset interval back to Initial |
---
## 4. LeetCode & Algorithm Practice Adaptation
1. **Independent attempt**: Read constraints, predict time and space complexity, and write initial approach before asking for guidance.
2. **Graduated hints**: If stuck, escalate through the hint ladder (syntax check -> directional hint -> invariant/pattern hint -> code example). Record assistance level.
3. **Post-acceptance invariant**: After submission is accepted, formulate:
- Pattern name (e.g. Two Pointers, Monotonic Stack, Sliding Window).
- Core invariant (what condition holds on each iteration/state transition).
- Time and space complexity rationale.
4. **Revisit rule**: Any problem solved with `hints` or `shown-solution` gets `revisit_after: +2-3 days` for an unaided re-solve.