Skip to content

Add the LLD drill log: log_lld_drill / get_lld_drill_log - #3

Open
codenamesubho wants to merge 1 commit into
mainfrom
lld-drill-log
Open

Add the LLD drill log: log_lld_drill / get_lld_drill_log#3
codenamesubho wants to merge 1 commit into
mainfrom
lld-drill-log

Conversation

@codenamesubho

Copy link
Copy Markdown
Owner

Adds the persistence step for the new LLD-drill skill: two tools that maintain one running, append-only LLD_SOLUTIONS_DIR/DRILL_LOG.md.

A drill is a short focused rep — one pattern, one class hierarchy, one "how would you extend this" — not a full mock interview. Giving each one a Mock Solutions/ folder, a problem.md and a rubric score would be noise, so they all append to a single file shaped like revision.md: newest at the bottom, entries split by a --- rule.

The contract the skill wires to

log_lld_drill(topic, content_markdown, problem_id="", duration_minutes=0, gaps="")
get_lld_drill_log(limit=5)        # limit=0 returns the whole file

content_markdown is the entire entry body, authored by the skill; the tool only stamps the dated header (## <date> · <topic> · <n> min) and appends. Bodies start their headings at ### and contain no bare --- rule, since ## and --- are the entry separators.

Feeding the existing trackers

  • gaps (semicolon-separated, same vocabulary as log_session) go into index["weak_areas"] through a new _bump_weak_areas helper, now shared with log_session rather than duplicated.
  • problem_id counts the drill as an attempt via _record_practice, whose doc_path is now Path | None. None means "this practice produced no per-problem file", so logging a drill preserves any doc save_practice_doc linked — covered by a test that calls get_practice_doc after a drill.
  • Deliberately not written: an index["sessions"] record. That would appear in get_progress_summary's session table and in get_session_detail as an id with no revision.md entry behind it.

One consequence worth flagging: a drill also refreshes last_practiced, so it pushes that problem's STALE_DAYS revision clock out. Documented in the README; easy to change if drills shouldn't count for staleness.

Also

  • _lld_kind returns drill-log for DRILL_LOG.md, so scans report it as server-generated (like feedback.md) instead of as a corpus-wide index. Import tools are unaffected — they still require kind=solution.
  • Module docstring and README updated: storage layout, tool table, a new "LLD drills" section, tool count 26→29.

Testing

  • test_lld_tools.py — 19 new hermetic checks covering create-then-append, the header/duration stamp, gap aggregation, doc_path preservation, limit clipping, the empty-drill guard, and drill-log classification. 114 checks pass, zero failures.
  • test_server.py — new names added to EXPECTED_TOOLS; handshake and tool listing pass, 29 tools exposed.

🤖 Generated with Claude Code

A drill is a short focused rep -- one pattern, one class hierarchy, one
"how would you extend this" -- not a full mock interview. Giving each one
a Mock Solutions/ folder, a problem.md and a rubric score would be noise,
so they all append to a single running LLD_SOLUTIONS_DIR/DRILL_LOG.md,
shaped like revision.md: newest at the bottom, entries split by a --- rule.

This is the persistence step for the LLD-drill skill, which owns the entry
body; the tool only stamps the dated header and appends.

Drills feed the same trackers everything else does:
  - gaps go into index["weak_areas"] via a new _bump_weak_areas helper,
    now shared with log_session rather than duplicated;
  - problem_id counts the drill as an attempt via _record_practice, whose
    doc_path is now Optional -- None means "produced no per-problem file",
    so logging a drill can't unlink a doc save_practice_doc wrote.

Deliberately NOT written: an index["sessions"] record. That would show up
in get_progress_summary's session table and in get_session_detail as an id
with no revision.md entry behind it.

_lld_kind classifies DRILL_LOG.md as drill-log, so scans report it as
server-generated (like feedback.md) rather than as a corpus-wide index.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant