Skip to content

Add the HLD mock loop, the LLD drill log, and get_current_time - #5

Open
codenamesubho wants to merge 1 commit into
mainfrom
lld-clock-tool
Open

Add the HLD mock loop, the LLD drill log, and get_current_time#5
codenamesubho wants to merge 1 commit into
mainfrom
lld-clock-tool

Conversation

@codenamesubho

Copy link
Copy Markdown
Owner

Three related additions to the interview-memory MCP server. They ship together because the HLD work depends on _now(), added by the clock commit.

The HLD mock loop (the bulk of this PR)

Brings HLD up to parity with the existing LLD mock loop.

Until now an HLD session saved exactly one artifact: a practice doc blending what the candidate produced with what the correct answer was. Two problems followed. The reference the interviewer graded against was never persisted — it lived only in the model's context, where it could drift under candidate pushback, so "the reference is frozen" was advisory rather than enforceable. And because the candidate's own design was never captured separately, there was nothing to diff against; feedback was reconstructed at the end of the round, which systematically cleans up what was actually said.

Seven new tools, mirroring the LLD side:

Tool What it does
start_hld_mock_attempt Freezes reference.md before the problem is posed
save_hld_attempt What the candidate actually designed, raw turns first
save_hld_diff matched / missed invariants / diverged at choice points
save_hld_evaluation Seven-dimension scorecard; also logs the session
list_hld_mock_attempts What's been attempted, what's incomplete
read_hld_mock_file Opens one of the four known files
get_hld_feedback Rubric averages, weakest dimensions, verdicts at level

Layout, one folder per attempt under HLD_SOLUTIONS_DIR/Mock Solutions/:

2026-08-21-design-distributed-task-scheduler/
  reference.md    # frozen before the problem was posed
  attempt.md      # what the candidate designed, warts intact
  diff.md         # three-way comparison
  evaluation.md   # verdict + seven-dimension scorecard

The pre-commitment is enforced, not promised. start_hld_mock_attempt refuses to overwrite an existing reference.md and has no overwrite flag; written_at comes from the server's own clock, so it can't be backdated. A genuine re-attempt opens a -r2 folder.

Missed vs. diverged. save_hld_diff separates a missing reference invariant (a real gap) from a different option taken at a choice point (not a gap if the trade-off reasoning held), and compares end-to-end flows rather than just which components got named — two designs can list identical boxes and route a request completely differently.

Evidence stays separate from revision material. Nothing under Mock Solutions/ is surfaced by list_practice_docs, and no tool points a tracker doc_path at it. An attempt groomed toward the right answer reads clean six weeks later and tells you nothing about which parts you actually got right.

Also in this commit

  • The four rubric helpers are parameterized on prefix rather than duplicated, so LLD and HLD share the aggregation code. HLD scores live under an hld: prefix.
  • Bug fix: get_progress_summary filtered only the lld: prefix when picking out behavioral competencies, so HLD rubric scores would have rendered as behavioral ones. Both rubrics now report in their own blocks.
  • save_practice_doc and start_hld_mock_attempt warn (never block) when a design doc has no ## End-to-end flows section. A component diagram shows what exists; that section shows what happens, and its absence is what makes an HLD doc hard to revise from.
  • skills/hld-interviewer/SKILL.md — the updated interviewer skill. The only copy on the dev machine lived in a per-session upload cache, so this is the durable one; it needs re-uploading to take effect.

The LLD drill log

log_lld_drill / get_lld_drill_log — short focused reps that don't warrant a whole mock folder, appended to one running DRILL_LOG.md. Gaps feed the same weak-area tracker log_session writes to.

get_current_time

Reports this machine's wall clock (local, UTC, epoch) — for timing a rep, or checking today's date rather than assuming it.

Testing

  • test_hld_tools.py (new) — 79 hermetic checks against a synthetic HLD root in a temp dir, with one named case per acceptance criterion: reference can't be overwritten, written_at is server-clocked, a one-sided diff errors, a free-form rubric key is rejected, Mock Solutions/ never leaks into list_practice_docs, a doc without flows warns but still writes, and get_hld_feedback on an empty history returns cleanly.
  • test_lld_tools.py — unchanged, still green.
  • test_server.py — updated for the seven new tool names; 37 tools exposed.

All three suites pass. Nothing outside the temp sandboxes is read or written.

🤖 Generated with Claude Code

Brings HLD up to parity with the LLD mock loop, and fixes a weakness in
the practice docs it writes.

Until now an HLD session saved exactly one artifact: a practice doc that
blended what the candidate produced with what the correct answer was.
Two things followed. The reference the interviewer graded against was
never persisted -- it lived only in the model's context, where it could
drift under candidate pushback, so "the reference is frozen" was
advisory rather than enforceable. And because the candidate's own design
was never captured separately, there was nothing to diff against;
feedback was reconstructed at the end of the round, which systematically
cleans up what was actually said.

Seven tools, mirroring the LLD side:

  start_hld_mock_attempt   freeze reference.md BEFORE posing the problem
  save_hld_attempt         what the candidate actually designed
  save_hld_diff            matched / missed invariants / diverged
  save_hld_evaluation      seven-dimension scorecard; also logs the session
  list_hld_mock_attempts   what's been attempted, what's incomplete
  read_hld_mock_file       open one of the four files
  get_hld_feedback         rubric averages, weakest dimensions

The pre-commitment is enforced rather than promised:
start_hld_mock_attempt refuses to overwrite an existing reference.md and
has no overwrite flag, and written_at comes from the server's own clock
so it can't be backdated. A genuine re-attempt opens a -r2 folder.

save_hld_diff separates a missed *invariant* (a real gap) from a
divergence at a *choice point* (not a gap if the trade-off reasoning
held), and compares end-to-end flows rather than just which components
got named -- two designs can list identical boxes and route a request
completely differently.

The attempt folder holds the evidence, ungroomed; the practice doc holds
the correct design. Nothing under Mock Solutions/ is ever surfaced by
list_practice_docs, and no tool points a tracker doc_path at it -- an
attempt groomed toward the right answer reads clean six weeks later and
tells you nothing about which parts you actually got right.

Also here:

- The four rubric helpers are parameterized on prefix rather than
  duplicated, so LLD and HLD share the aggregation code. HLD scores are
  stored under an "hld:" prefix.
- get_progress_summary filtered only the "lld:" prefix when picking out
  behavioral competencies, so HLD rubric scores would have rendered as
  behavioral ones. Both rubrics now report in their own blocks.
- save_practice_doc and start_hld_mock_attempt warn (never block) when a
  design doc has no "## End-to-end flows" section. A component diagram
  shows what exists; that section shows what happens, and its absence is
  what makes an HLD doc hard to revise from.
- test_hld_tools.py: 79 hermetic checks, one named case per acceptance
  criterion, run against a synthetic HLD root in a temp directory.
- skills/hld-interviewer/SKILL.md, updated for the new flow. The only
  copy on this machine lived in a per-session upload cache; this is the
  durable one.

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