Tasks: Interactive LSAT solving aids — progressive hints + incremental diagrams¶
Each task must reference one or more
FR-*/NFR-*/AC-*IDs fromspec.md. CI'sspec_validator.pyenforces that every requirement inspec.mdis referenced by at least one task.
Conventions¶
- Status:
[ ]todo /[~]in-progress /[x]done. - Owner: GitHub handle or
@copilot/@agent:<role>. - Each task lists exact files to touch and how to verify.
T-001 — Guide domain models + loader¶
- Refs: FR-1, FR-2, NFR-PERF-1, AC-1
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/services/guides.py(new)backend/tests/lsat/test_guides.py(new)- Steps:
- Define
SolveStep{kind, title, text, representation?, spoiler}withkind ∈ {orient, inventory, symbolize, diagram, infer, eliminate, answer}; validator forcesspoiler=Trueonanswer-kind steps. - Define the
rep_type-discriminated union:SequenceRep,GridRep,NotationRep,ArgumentMapRep,PassageMapRep; unknownrep_typerejected by Pydantic. - Define
SolveGuide{question_id, method, steps (min 1), version, source}andload_guides()(@lru_cache, readsdata/guides.json, validates everyquestion_idagainstload_bank(), fails loudly otherwise),public_guide_view(guide, include_spoilers)returning locked stubs for withheld steps,reset_guide_cache()(also wired intobank.reset_caches()pattern via its own function tests call). - Verify:
docker compose run --rm backend pytest tests/lsat/test_guides.py -qpasses (unknown-id, empty-steps, unknown-rep_type rejections + spoiler stripping covered).make typecheckclean on touched files.
T-002 — Seed guide content (hand-authored)¶
- Refs: FR-3, NFR-HITL-1, AC-1
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/services/data/guides.json(new)- Steps:
- Author ≥ 9 guides against existing bank questions: ≥ 3 LG (using
sequence,grid,notationreps), ≥ 3 LR (argument_map,notation), ≥ 3 RC (passage_map); every guide ≥ 4 steps ending in a spoileranswerstep;source: "original (CC0)". - Horizontal orientation semantics for
sequenceslots (resolved OQ-3). - Verify:
docker compose run --rm backend pytest tests/lsat/test_guides.py -q— seed-file load test passes (all ids resolve, coverage counts asserted).
T-003 — Guide endpoint + hint-aware grading & stats¶
- Refs: FR-4, FR-5, NFR-SEC-1, NFR-AUDIT-1, NFR-TEST-1, AC-2, AC-3
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/urls.pybackend/tests/api/test_lsat_guides.py(new)- Steps:
GuideView(GETquestions/<question_id>/guide): default spoiler-stripped viapublic_guide_view;?spoilers=1returns full steps; 404{detail, has_tutor: true}for unknown question or guide-less question; emitslsat_guideaudit event (try/except-log likeGradeView).GradeRequestgainshints_used: int | None = Field(default=None, ge=0, le=20); recorded in thelsat_gradeevent.StatsViewaddsassisted/unassistedcounts (attempt withhints_used > 0is assisted) overall and per section bucket.- Verify:
docker compose run --rm backend pytest tests/api/test_lsat_guides.py tests/api/test_lsat.py -qpasses.make typecheckclean.
T-004 — Proposals store: guide kind + promotion¶
- Refs: FR-9, NFR-HITL-1, AC-6
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/services/proposals.pybackend/tests/lsat/test_proposals.py- Steps:
record_proposal(..., proposal_kind: str = "question")stored on the create event;_replaybackfills"question"for legacy rows.promote_to_bankraisesValueErrorforproposal_kind == "guide"; newpromote_guide_to_bank(proposal_id, reviewer, note)validates the draft asSolveGuide, appends toguides.json, clears the guide cache, sets status approved, mirrorslsat_proposal.approvedaudit event.- Verify:
docker compose run --rm backend pytest tests/lsat/test_proposals.py -qpasses (guide promotion, kind guard, legacy replay).
T-005 — LSATSolveGuideAuthor crew + prompt + generate endpoint¶
- Refs: FR-9, NFR-AUDIT-1, NFR-HITL-1, NFR-SEC-1, AC-6
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/agents_runtime/crews/lsat_solve_guide_author.py(new)backend/law_ai/agents_runtime/prompts/lsat_solve_guide_author.v1.md(new)backend/law_ai/agents_runtime/registry.pybackend/law_ai/lsat/urls.py(GuideGenerateView, throttle scopellm)backend/tests/agents/test_lsat_solve_guide_author.py(new)docs/agent-roles.md- Steps:
- Crew mirrors
lsat_content_author.py:GenerateGuideInput{question_id}, versioned prompt,llm.agenerate(..., agent="lsat_guide_author")with a structured-output schema, parse →SolveGuidevalidation, deterministic offline fallback (confidence=0.0, degraded), oneprovenance.log_agent_callparent event,human_approval_required = True. POST /api/lsat/guides/generate {question_id}runs the crew and persists the draft viarecord_proposal(..., proposal_kind="guide"); single-question only (resolved OQ-2).- Register in
registry.py; add the role todocs/agent-roles.md(NFR-DOCS-1). - Verify:
docker compose run --rm backend pytest tests/agents/test_lsat_solve_guide_author.py tests/api/test_lsat_guides.py -qpasses (draft never visible on GET guide until approved).make typecheckclean.
T-006 — Frontend API client + shared MSW handlers¶
- Refs: FR-10, NFR-TEST-1, AC-2
- Owner: @agent:claude
- Status:
[x] - Files:
frontend/lib/api.tsfrontend/mocks/server.tsfrontend/__tests__/lib/api.lsatGuide.test.ts(new)- Steps:
- Mirror FR-2 types (
LsatSolveGuide,LsatSolveStep,LsatRepresentationunion);fetchLsatGuide(questionId, opts?: {spoilers?: boolean})returning{guide}or throwing a typedLsatGuideNotFoundcarryinghas_tutor;gradeLsatgains optionalhintsUsedmapped tohints_used. - Add shared LSAT guide MSW handlers + fixtures to
mocks/server.ts. - Verify:
make test-frontendgreen including the new client test.
T-007 — Diagram renderers (parallel)¶
- Refs: FR-7, NFR-A11Y-1, NFR-PERF-1, AC-5
- Owner: @agent:claude
- Status:
[x] - Files:
frontend/components/lsat/diagrams/{Representation,SequenceBoard,GroupGrid,RuleNotation,ArgumentMap,PassageMap}.tsx(new)frontend/__tests__/components/lsat/diagrams.test.tsx(new)- Steps:
Representationdispatcher — exhaustive switch onrep_type(compile-timenevercheck).SequenceBoard: horizontal SVG slots + entity chips, fixed/excluded marks (symbol + colour, never colour alone);role="img"+ generatedaria-label.GroupGrid: semantic<table>with caption;RuleNotation: monospace symbol strings + text legend (→,¬,—);ArgumentMap: SVG premise/conclusion boxes + arrows;PassageMap: ordered list of paragraph roles.- All render inside
overflow-x-autocontainers, legible at 320 px, dark-theme tokens, no new deps. - Verify:
make test-frontendgreen — one render + one a11y assertion per renderer.
T-008 — SolveAssist progressive reveal + Lab wiring¶
- Refs: FR-6, FR-8, NFR-A11Y-1, NFR-TEST-1, AC-4, AC-7
- Owner: @agent:claude
- Status:
[x] - Files:
frontend/components/lsat/SolveAssist.tsx(new)frontend/components/LsatLab.tsx(mount points only)frontend/__tests__/components/lsat/SolveAssist.test.tsx(new)- Steps:
SolveAssist({questionId, graded, onHintsUsedChange}): lazy-fetch guide on first "Hint" click; reveal one step per click into anaria-live="polite"region; spoiler steps render locked stubs untilgraded, then "Show final step" refetches withspoilers=1; 404 branch renders the tutor CTA (FR-8 canned walkthrough question wired to the existingTutorPaneentry point).LsatLab.tsx:QuestionCardmountsSolveAssistand threadshintsUsedintogradeLsat; header session score shows· N assisted(resolved OQ-1).- Full gates:
make lint,make typecheck,make test(AC-7). - Verify:
make test-frontendgreen — reveal-one-per-click, locked-until-graded, unlock-after-grade, tutor-fallback cases.make lint && make typecheck && make testgreen;python3 scripts/spec_validator.py specs/045-lsat-solving-aidsexits 0.
T-009 — Guide quality validator wired into all three choke points¶
- Refs: FR-11, NFR-HITL-1, NFR-TEST-1, AC-8
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/services/guides.py(validate_guide_quality)backend/law_ai/lsat/services/proposals.py(promote_guide_to_bankgate)backend/law_ai/agents_runtime/crews/lsat_solve_guide_author.py(_parse_guidegate)backend/law_ai/lsat/services/data/guides.json(complete-elimination steps re-flagged spoiler)backend/tests/lsat/test_guides.py,backend/tests/agents/test_lsat_solve_guide_author.py- Steps:
validate_guide_quality(guide, question)— answer-leak patterns, complete-elimination detection, answer-step grounding, sequence/grid internal consistency; returns problem strings.- Wire into
load_guides()(seed gate, fails CI not user requests),_parse_guide(LLM draft → degraded fallback on failure), andpromote_guide_to_bank(raises before write). - Re-flag the seed guides' full-elimination steps as spoilers so shipped content passes its own gate.
- Verify:
docker compose run --rm backend pytest tests/lsat/test_guides.py tests/agents/test_lsat_solve_guide_author.py -qpasses (leak, elimination, board-consistency, answer-grounding rejections + clean seed pass).
T-010 — Remove author rationale + external links from the answer component¶
- Refs: FR-12, NFR-TEST-1, AC-9
- Owner: @agent:claude
- Status:
[x] - Files:
frontend/components/LsatLab.tsx(rationale block removed fromQuestionCard)frontend/components/lsat/ConceptRefs.tsx(new)frontend/mocks/server.ts(shared/api/lsat/conceptshandler + fixture)frontend/__tests__/components/lsat/ConceptRefs.test.tsx(new)frontend/__tests__/components/LsatLab.test.tsx(grade-test assertions)- Steps:
- Delete the post-grade "Author rationale" block (explanation text +
question.referencesexternal<a href>links) fromQuestionCard. - Replace with
ConceptRefs: resolves the union of grade-response and question concept ids against the in-app catalog, rendering name, summary, and schema examples — never any anchor; unresolvable ids fall back to plain chips. - Update the Lab grade test to assert the rationale and external links are gone and the concept references render.
- Verify:
make test-frontendgreen — ConceptRefs renders concepts without links; Lab grade flow shows "Derived from" and noAuthor rationale/ external anchors.
T-011 — Full LG seed coverage + batch guide backfill command¶
- Refs: FR-3, FR-9, NFR-HITL-1, NFR-TEST-1
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/services/data/guides.json(40 guides: all 19 LG, 16 LR, 5 RC)backend/law_ai/lsat/management/commands/lsat_guide_backfill.py(new)backend/tests/lsat/test_guide_backfill.py(new)- Steps:
- Hand-author guides for every remaining LG question (all four games: sequencing locals/globals, parity deduction, grouping contrapositive chains) plus the LR conditional/flaw/assumption core and passage-001 RC set — all clearing the FR-11 quality gate.
lsat_guide_backfillcommand (resolves BL-20260830-11): iterates guide-less questions minus pending guide proposals, runsLSATSolveGuideAuthorper question, recordsproposal_kind="guide"pending rows;--section,--limitbudget cap (default 5),--dry-run,--include-degraded(degraded drafts skipped by default).- Command tests: dry-run listing, queueing, pending-dedup across runs, degraded skip/include, bad-section rejection.
- Verify:
docker compose run --rm backend pytest tests/lsat/test_guides.py tests/lsat/test_guide_backfill.py -qpasses (all 40 guides clear the quality validator).
T-012 — SolveAssist carousel presentation¶
- Refs: FR-6, NFR-A11Y-1, AC-4
- Owner: @agent:claude
- Status:
[x] - Files:
frontend/components/lsat/SolveAssist.tsxfrontend/__tests__/components/lsat/SolveAssist.test.tsx- Steps:
- Replace the stacked step list with a carousel: one slide at a time (
role="region"+aria-roledescription="carousel", slides asrole="group"/aria-roledescription="slide",aria-liveswap region), ‹ Back / Next › navigation, clickable step dots (aria-current="step"; unrevealed steps as dimmed placeholders showing total length). - Reveal semantics unchanged: the Next button reads "💡 Next hint ›" only at the frontier when it will reveal a new step (one per click, AC-4); within revealed steps it navigates; spoiler locking, "Show final step", session depth persistence, and
hints_usedcounting are untouched. - Tests rewritten for carousel behavior: single-slide invariant, back/forward/dot navigation, frontier reveal labelling, locked-stub + unlock flow, hints-used counting, tutor fallback.
- Verify:
make test-frontendgreen (6 SolveAssist carousel cases; full suite passes).
T-013 — Walkthrough cache + answer cross-check + question-set review¶
- Refs: FR-13, FR-14, FR-15, NFR-AUDIT-1, NFR-SEC-1, NFR-TEST-1, AC-10, AC-11, AC-12
- Owner: @agent:claude
- Status:
[x] - Files:
backend/law_ai/lsat/services/llm_cache.py(new — keyed JSONL response store)backend/law_ai/lsat/services/tutor.py(cache lookup/write,refresh,cached)backend/law_ai/lsat/services/crosscheck.py(new — blind solve vs. answer key)backend/law_ai/lsat/services/validation.py(new — deterministic set review)backend/law_ai/lsat/urls.py(CrossCheckView,ValidationView)backend/tests/api/test_lsat_crosscheck.py(new),backend/tests/api/test_lsat.py(cache isolation)frontend/lib/api.ts,frontend/mocks/server.tsfrontend/components/lsat/{CrossCheckPanel,ValidationReport}.tsx(new)frontend/components/LsatLab.tsx(mounts + tutor cached badge/regenerate)frontend/__tests__/components/lsat/{CrossCheckPanel,ValidationReport}.test.tsx(new)- Steps:
- FR-13: cache LLM tutor walkthroughs keyed on (question, choice, follow-up, prompt version); identical repeats serve the stored copy (
cached: true, no model call); offline fallbacks never cached;refreshbypasses; audit events carrycached. - FR-14:
POST /api/lsat/questions/<id>/cross-check(throttlellm) solves the question blind — the prompt never contains the answer key — and compares the pick to the key; disagreement setsrequires_human_review; verdicts cached; UI panel reports agreement as corroboration by a named model, never as proof (§13). - FR-15:
GET /api/lsat/validationdeterministic report — per-question integrity issues, answer-key distribution (counts, not judgments), stored cross-check roll-up with disagreements listed — rendered on the Authoring tab. - Verify:
docker compose run --rm backend pytest tests/api/test_lsat_crosscheck.py tests/api/test_lsat.py -qpasses (cache hit/miss/refresh, offline honesty, agree/disagree/audit, report shape).make test-frontendgreen (CrossCheckPanel + ValidationReport cases).
Done-When (Definition of Done)¶
- All tasks
[x]. - All
AC-*fromspec.mdcovered by passing tests. make lint && make typecheck && make testgreen.- LegalBench delta: n/a (spec §11 — no reasoning-logic change).
- Provenance logging verified for the new agent path (
llm_call+log_agent_callevents observed in the audit log during T-005 verification).
Follow-ups Discovered¶
Append-only. Mirror each item into BACKLOG.md with a
BL-YYYYMMDD-NNid. CI (scripts/spec_validator.py) checks this section exists. CI (scripts/backlog_lint.py) checks the BACKLOG mirror.
- BL-20260830-11 — feature, med — Guide coverage is 9/126 bank questions. Add budget-capped batch drafting (the OQ-2 deferral) so
LSATSolveGuideAuthorcan fill guide-less questions section by section through the existing HITL queue. - BL-20260830-12 — feature, low — Port
SolveAssist+ the diagram renderers intolsat-staticso the serverless drill gets the same hint system (natural companion to the BL-20260830-04 timer unification). - BL-20260830-13 — feature, low — Per-reveal hint audit events (
lsat_hint): today only grade-timehints_usedis recorded, so analytics cannot distinguish a 1-hint from a 5-hint assist or hints on questions never submitted. - BL-20260830-14 — test-gap, low — The guide-proposal review card in
AuthoringPanel(added because question-shapedProposalCardcrashed on guide drafts) has no dedicated Vitest coverage; the approve→serve path is tested only at the API layer. - BL-20260831-21 — feature, med — Batch cross-check sweep: a budget-capped management command (mirroring
lsat_guide_backfill) that runs the FR-14 blind solve across guide-less/unchecked questions section by section, so the validation report's cross-check coverage can grow without manual per-question clicks; disagreements should additionally land as reviewable rows in the HITL queue, not just in the report. - BL-20260830-15 — feature, med — LLM judge tier for guide drafts:
validate_guide_quality(FR-11) is deterministic lint; aLSATGuideRevieweragent should additionally judge pedagogical soundness (does each step follow? is the symbolization faithful?) before a human sees the draft — companion to the question-side judge tier (BL-20260702-02) and reviewer crew (BL-20260527-04).