Sloth-ninja brings Companies House into JessicaOSS research

Company records can now sit alongside legal research in the same chat workflow.

searchintegration

With a Companies House key configured, users can search UK companies, pull a company profile, and inspect filing history without leaving the conversation. The interface shows what was retrieved and can open a side panel with the underlying corporate record.

  • Company search to identify businesses by name.
  • Company profiles with officers, people with significant control, and key filing deadlines.
  • Filing-history lookup for a quick view of submitted records.

The integration is built to handle real-world API constraints: it limits request volume, avoids duplicate lookups, temporarily caches recent results, and gives clear responses when a record is unavailable or access is limited. Credentials can be stored per user and are kept out of error messages.

This matters for lawyers and legal-ops teams doing entity checks or matter research who want corporate context close to their legal questions, with a link back to the official source for verification.

So what Worth a closer look if company structure, officers, or filings regularly shape your research and intake decisions.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

7 commits from Sloth-ninja/JessicaOSS, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
60169a4d Add companies_house API-key provider (schema, migration, plumbing) sloth-ninja 2026-07-08 ↗ GitHub
commit body
Extends the ApiKeyProvider union (backend + frontend), envApiKey
fallback, DB CHECK constraint (via the pre-authorised migration
20260706_add_companies_house_user_api_key_provider.sql), and the
account API-keys page with a new Companies House row, so a Companies
House key can be stored per-user or supplied via COMPANIES_HOUSE_API_KEY.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9bbc94db Add Companies House API client with rate limiting, caching, and vitest sloth-ninja 2026-07-08 ↗ GitHub
commit body
New backend/src/lib/companiesHouse.ts: typed client for
api.company-information.service.gov.uk (HTTP Basic auth, company-number
normalisation, in-process token bucket + single-flight de-dupe from the
new generic backend/src/lib/rateLimit.ts, TTL cache, 401/404/429/5xx
error mapping). Errors never include the raw key.

Also stands up the vitest harness upstream never shipped
("vitest": "^3.2.4", vitest.config.ts, `npm test`), with 21 TDD unit
tests covering auth headers, normalisation, rate limiting (fake
timers), caching, single-flight, and error mapping.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
37dd7ad7 Add Companies House chat tools and wire into the research-tools seam sloth-ninja 2026-07-08 ↗ GitHub
commit body
New backend/src/lib/legalSourcesTools/companiesHouseTools.ts:
COMPANIES_HOUSE_TOOLS (search/get_company/get_filing_history in OpenAI
function shape), COMPANIES_HOUSE_SYSTEM_PROMPT, and
executeCompaniesHouseToolCall (get_company batches profile+officers+PSCs
into one payload; officer/PSC failures degrade gracefully).

chatTools.ts: buildSystemPrompt/buildMessages/runLLMStream gain the
ResearchSources-gated seam (companiesHouse flag splices the system
prompt and tool set); runToolCalls gains a companies_house_* branch
mirroring the MCP tool-call pattern (generic tool_start/tool_result SSE
pair) with its own companiesHouseEvents accumulator, pushed into
AssistantEvents so results persist to chat history. chat.ts/
projectChat.ts now derive researchSources/includeResearchTools from
whether a Companies House key is configured (server env or per-user) -
no feature toggle, per docs/MIGRATION_SPEC.md decision 6.3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
64a9659b Add Companies House tool-call chips and CompanyPanel side panel sloth-ninja 2026-07-08 ↗ GitHub
commit body
- shared/types.ts: companies_house_tool_call AssistantEvent variant
  (mirrors the backend shape, carrying the full get_company payload).
- useAssistantChat.ts: companies_house_tool_start/_result SSE handlers,
  same start/result pairing pattern as the MCP handlers.
- AssistantMessage.tsx: extracted the mcp_tool_call chip markup into a
  shared ToolCallChip component, reused by a new companies_house_tool_call
  branch with human-friendly labels ("Searching Companies House...",
  "Fetching company record...", "Fetching filing history..." plus done-state
  company name/number). Completed get_company chips are clickable.
- CompanyPanel.tsx (new): profile/officers/PSCs from the persisted
  get_company payload, UK date formatting throughout (e.g. "21 February
  2022", never MM/DD/YYYY), link-out to the public Companies House
  register.
- AssistantSidePanel.tsx/ChatView.tsx: new CompanyTab kind (not
  document-backed, deduped by companyNumber rather than documentId) and
  an openCompany helper alongside openCitation/openEditor/openDocument.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cf5c237c Add Companies House golden eval cases sloth-ninja 2026-07-08 ↗ GitHub
commit body
Four new deterministic cases (not smoke-flagged - smoke stays at 4/5):
officers, PSCs, search, and filing-history lookups against known
companies (ARIA GRACE LAW CIC 13927967, MARKS AND SPENCER P.L.C.
00214436), values verified live 8 July 2026. Skip cleanly when
COMPANIES_HOUSE_API_KEY is unset, per the existing runner behaviour.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fc8c2086 Update CLAUDE.md and BUILD_LOG for WS1 Companies House integration sloth-ninja 2026-07-08 ↗ GitHub
commit body
CLAUDE.md: COMPANIES_HOUSE_API_KEY row moved from "planned" to actual
in the env var registry. BUILD_LOG.md: new entry at the top covering
scope, key changes, verification evidence, and decisions for WS1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1eb6112d WS1 design polish: align CompanyPanel with DocPanel conventions sloth-ninja 2026-07-08 ↗ GitHub
commit body
- SectionLabel now matches DocPanel's (no uppercase/tracking-wide) so
  section headings read identically across doc-backed and
  company-backed side-panel tabs.
- Pin the title row / "View on Companies House" link and make only the
  section list scroll, matching DocPanel's fixed-header/scrollable-body
  pattern - keeps the register link reachable with long officer/PSC
  lists.
- Add a "No profile data available." empty state so a get_company
  result with no profile fields doesn't render a blank grid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-1221.md from inside the repo you want the changes in.

⬇ Download capture-thread-1221.md