Open-Legal-Products is shoring up Mike's chat and project workflows

A small maintenance pass improves what Mike remembers, how reliably it can be checked, and how smoothly its project directory opens.

workflowinfrastructure

Open-Legal-Products has tightened three unglamorous but consequential parts of Mike:

  • Chat records now retain the workflow context associated with a conversation, reducing the risk that stored messages lose information the product expects to use.
  • A basic automated testing foundation now spans both the service behind the product and its user-facing interface, giving the team a starting point for catching regressions.
  • Opening the project directory now loads projects together rather than making a separate request for each one, avoiding a request surge as the directory grows.

None of this changes the legal analysis on screen today, but it makes the product more dependable as teams add matters, workflows, and changes over time.

So what Legal teams evaluating Mike should care because reliable conversation context and a responsive project view are the quiet prerequisites for operational trust.

View this fork on GitHub →

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

Commits in this thread

6 commits from open-legal-products/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
cfdcda6d fix(db): add missing chat_messages.workflow column JJ 2026-07-16 ↗ GitHub
commit body
User messages are persisted with a `workflow` field
(backend/src/routes/chat.ts, projectChat.ts) and it is read back when
rendering chat history (ChatView -> UserMessage) to show which workflow a
message was sent under. But the column is never created by schema.sql or any
migration, so every user-message insert fails with PostgREST PGRST204
("Could not find the 'workflow' column of 'chat_messages'") and is dropped
silently (the insert result is not checked). The assistant insert has no
workflow column, so it succeeds - the net effect on a self-hosted install is
that reloading a thread shows the assistant reply but not the user's prompt.

Add the `workflow jsonb` column to schema.sql (fresh installs) and a
migration (existing installs), mirroring the adjacent content/files jsonb
columns.
4039b949 test: minimal vitest harness for backend and frontend QA Runner 2026-07-20 ↗ GitHub
commit body
Ported from amal66/mike#24 onto current main; lockfiles regenerated against
this tree. Adds vitest as a dev dependency with a `test` script in both
packages, excludes test files from the backend tsc build, and seeds one
suite per package (backend: downloadTokens, 12 tests; frontend: cn() utils,
8 tests). Verified locally: backend 12/12, frontend 8/8 passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
36cddb25 fix: batch directory-modal project fetch instead of N+1 getProject burst QA Runner 2026-07-20 ↗ GitHub
commit body
Every directory picker (AddDocumentsModal, UseWorkflowModal, the assistant
project selector) loads its "Projects" tab through useDirectoryData, which
fired one GET /projects/:id for EVERY existing project the moment the modal
opened. Each of those requests costs an auth verification against GoTrue
plus ~6 PostgREST queries, so an account with N projects produced an
~8xN-request burst on the Supabase gateway per modal open.

Under that burst the gateway genuinely falls over: measured locally against
the Supabase CLI stack, overlapping modal-open storms drove GoTrue into
Postgres connection exhaustion ("failed to connect ... context deadline
exceeded") and produced 467x 500 + 641x 504 on /auth/v1/user in a single
run - surfacing to users as failed project creates/loads, and to the e2e
suite as the intermittent Kong 502s its specs currently retry around.

Fix: GET /projects now accepts ?include=documents and returns each
project's documents from one batched query (same attach helpers as
GET /projects/:id, run once across all documents), and useDirectoryData
uses it. A modal open is now 1 API request and a fixed number of DB
queries regardless of project count. After the change the same storm
harness produced zero 5xx and zero auth failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0843e290 Merge pull request #212 from jmooves/upstream-pr/chat-messages-workflow-column cosimoastrada 2026-07-21 ↗ GitHub
fix(db): add missing chat_messages.workflow column (user prompts dropped on reload)
8a34a645 Merge pull request #228 from amal66/olp-pr/test-harness cosimoastrada 2026-07-21 ↗ GitHub
[Testing 05] test: minimal vitest harness for backend and frontend
eda088e1 Merge pull request #238 from amal66/olp-pr/directory-fetch-storm Will Chen 2026-07-21 ↗ GitHub
[Fix 01] Batch the directory modal's project fetch (N+1 getProject storm)

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-1345.md from inside the repo you want the changes in.

⬇ Download capture-thread-1345.md