WS7: Legislation panel (legislation.gov.uk)
Research › Legislation page + /legislation backend routes, per the approved
WS7 mock-up. One prominent input with two modes (look up a natural UK
citation, or search by Act/SI title), example chips teaching the citation
grammar, master-detail split for title search, and a provision view reusing
assistant/LegislationPanel with the amber outstanding-amendments band and a
per-effect list beneath it.
Backend: new src/routes/legislation.ts (both requireAuth, per-handler
try/catch), thin wrappers over the tested lib/legislation.ts - GET
/legislation/search?title= → {matches}; GET /legislation/lookup?citation= →
lookupCitation. No key gating (open OGL API). A failed lookup is a domain
result: HTTP 200 {resolved:false, citation, reason}; only unexpected throws
yield a fixed generic 502 (raw errors logged server-side only). Success
payload uses the same snake_case field names the chat tool emits so
LegislationPanel props align. Mounted behind the existing researchLimiter.
Frontend: new (pages)/legislation/page.tsx (submit-on-enter only - no
search-as-you-type, title search can take 3-6s). mikeApi searchLegislation /
lookupLegislation. Sidebar "Legislation" (Landmark) added to the Research
group between Company Search and Citation Checker.
Tests: 7 route-mapping tests (vi.mock("../lib/legislation")). Backend tsc +
vitest 140/140 green; frontend tsc clean; lint at the main baseline (34/78);
evals:smoke 4/4 from the main checkout. CLAUDE.md module map + BUILD_LOG
entry updated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Repository | Sloth-ninja/JessicaOSS |
|---|---|
| Author | sloth-ninja <ezanahaddis@gmail.com> |
| Authored | |
| Parents | a7b5ede3 |
| Stats | 8 files changed , +829 , -3 |
| Part of | WS2 / WS7: legislation.gov.uk research integration |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-0892e306.md
from inside the repo you want the change in.