WS2: wire legislation research tools into the chat loop

↗ view on GitHub · sloth-ninja · 2026-07-08 · 342687b5

- ParsedCitation widens to ParsedDocumentCitation | ParsedLegislationCitation;
  normalizeCitation/createCitationAnnotation branch on legislation_uri; the
  CITATIONS prompt block documents the legislation JSON shape.
- buildSystemPrompt/buildMessages gain a ResearchSources param and splice
  LEGISLATION_SYSTEM_PROMPT in when sources.legislation is set.
- runLLMStream populates the previously-empty researchTools seam from
  researchSources.legislation; runToolCalls gains a legislation_* branch
  mirroring the mcp_ branch (legislation_tool_start/result SSE pair,
  legislationEvents accumulator pushed into AssistantEvent[] alongside
  mcpEvents).
- chat.ts / projectChat.ts: replace the hardcoded includeResearchTools:
  false with { legislation: true } - no key needed, so always on (mirrors
  the Companies House "available whenever configured" decision for WS1).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository Sloth-ninja/JessicaOSS
Author sloth-ninja <ezanahaddis@gmail.com>
Authored
Committed
Parents 469e76a2
Stats 3 files changed , +99 , -9
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-342687b5.md from inside the repo you want the change in.

⬇ Download capture-commit-342687b5.md