Sourcing workspace / 2026 / In progress · Anonymized work
Research Workflow Engine.
A research tool that saves each observation as a new version, and can carry on exactly where a paused session stopped
- The hard part
- Letting research carry on after a pause or a lost browser tab, without the search quietly changing along the way.
- Works today
- Each observation is saved as a version that cannot be changed, and written tests cover recovery after a pause and new sessions.
- Role
- Software engineering
- Built with
- TypeScript · Node.js · MCP · Zod · SQLite · Drizzle · decimal.js · MCP SDK · esbuild · Vitest
01What I built
The problem.
Research in a web browser rarely fits in one sitting. A site may ask you to prove you are a person. A tab may disappear, or a source may need another look later. Without a saved place, you either start again or carry on from a slightly different search without noticing.
What I built.
Research Workflow Engine keeps one piece of research, called a run, going across many browser sessions. Observations arrive through its A technical wordMCPModel Context Protocol. A standard way for AI apps to find and use tools that other programs offer. tool service, Research MCP Service, in a fixed shape. At each step the engine saves a checkpoint, a record of where the research has got to. One part decides whether a new checkpoint may follow on from the last one. If it may, the engine adds it as a new version, with a record of the change for later checking. Other parts work out assessments without changing what was collected. The core never sends anything over a network.
The core
TypeScript, Node.js, Zod, SQLite, Drizzle, decimal.js
- Checkpoint rules
- Decide whether a checkpoint is a proper new session, or a true recovery of a paused one.The storyLetting a research run outlast its browser sessions
- Version store
- Adds each accepted version, and its record of the change, under the one checkpoint ID for that source.
- Calculations
- Work out assessments, and costs with no rounding errors, from saved observations. They never rewrite those observations.
- Versioned exports
- Give the dashboard a copy it can read but not change, without opening the research database.
The server
TypeScript, Node.js, MCP SDK, Zod, esbuild, Vitest
Research MCP Service- Tool registry
- Holds each tool’s version, its strict input rules and output rules, and short notes that describe it.
- Error mapping
- Sorts known failures into types, each with retry advice. Any unknown failure becomes one fixed internal error.The storyReturning useful errors without recording a failed save twice
- Output streams
- Sends protocol messages on the standard output channel, and start and stop logs on the error channel. The logs leave out file paths and the computer’s settings.
- Packaged process
- Ships as one bundle, with the piece that lets it use SQLite and the steps that set up the database. It keeps saved data away from the installed code.
Confidential work. Names and identifying business details have been changed.
02The journey
What broke, and what changed.
Broke, then fixedA decisionA milestone
- 01 of 08BrokeResearch Workflow Engine
The tab was gone, so the run looked lost for good
What went wrongResearch paused for a human check, where a site asks a person to prove they are not a program. Carrying on depended on finding the original browser tab. The person passed the check, but the next session couldn’t find that tab. So the run was treated as lost, even though its exact place was saved.
What changedRecoveryResearch Workflow Engine · The coreCheckpoint rulesDecide whether a checkpoint is a proper new session, or a true recovery of a paused one.See it in the map above now starts from the saved checkpoint, not the tab. After a person confirms, a matching tab or a fresh one can carry on. But the search, the place in it and the counts must not change. The limits and the expiry time must not change either. If the site blocks access again, the run stops.
ProofThe tests accept a proper replacement tab. They refuse a changed checkpoint, and a recovery after its time ran out.
- 02 of 08BrokeResearch Workflow Engine
A finished session locked its source for good
What went wrongFinishing a browser session marked the checkpointResearch Workflow Engine · The coreCheckpoint rulesDecide whether a checkpoint is a proper new session, or a true recovery of a paused one.See it in the map above for that source as completed. Nothing was allowed to come after that. But the run was still going, and could need that source again.
What changedFinishing now closes the session, not the source. A run that is still going can add the next session under the same checkpoint. Each session is numbered in orderResearch Workflow Engine · The coreVersion storeAdds each accepted version, and its record of the change, under the one checkpoint ID for that source.See it in the map above, so the new one must have a higher number than the last. It also needs new fingerprints, short codes that change when the content changes. Earlier finished sessions can’t count twice.
ProofThe tests accept a proper next session. They refuse a reused session number and any new session on a closed run.
Read the full story - 03 of 08DecidedResearch Workflow Engine
A good score can’t fill in for missing information
The questionA calculatorResearch Workflow Engine · The coreCalculationsWork out assessments, and costs with no rounding errors, from saved observations. They never rewrite those observations.See it in the map above can explain the records it has. It can’t know about an observation nobody collected.
What I choseSo assessments are kept apart from what was collected, and gaps stay visible as gaps. A good score can’t turn a missing observation into support for a decision.
- 04 of 08DecidedResearch Workflow Engine
The core never uses the network
The questionI could let the engine fetch web pages itself. Or it could only judge the observations it is given.
What I choseIt only checks the records it is given, and each move from one record to the next. Checking what a website really shows is left to the browser steps and the person running them. Browser sessions and sign-in details stay outside the core too.
- 05 of 08DecidedResearch MCP Service
One service behind both the protocol and the tests
The questionThe tools can be reached through A technical wordMCPModel Context Protocol. A standard way for AI apps to find and use tools that other programs offer., the Model Context Protocol, or called directly in tests. Two separate routes through the code would mean two sets of checks.
What I choseSo one shared serviceResearch Workflow Engine · Research MCP Service · The serverShared serviceReads the input and limits how deeply data can sit inside other data. Then it hands the work to the engine and checks the result.See it in the map above sits behind both routes. Every caller gets the same checks and the same code doing the work. Separate protocol tests still check how tools are listed and how messages travel. A direct call can’t reach those parts.
- 06 of 08DecidedResearch MCP Service
Check what goes out, not just what comes in
The questionGood input doesn’t stop a tool’s code from sending back an answer in a new shape the caller isn’t expecting.
What I choseSo every successful answer is checked against its tool’s output rulesResearch Workflow Engine · Research MCP Service · The serverTool registryHolds each tool’s version, its strict input rules and output rules, and short notes that describe it.See it in the map above before it reaches the caller. Each tool’s rules have their own version, separate from the version of the whole package.
- 07 of 08DecidedResearch MCP Service
Useful errors, and no second record of one failed save
The questionAn error message has to tell the caller how to retry. It must not show the raw error from inside the code. A save can carry a retry key. A retry that reuses that key with changed input shouldn’t look like another first attempt.
What I choseBadly formed calls stop before any tool code runs. Known failuresResearch Workflow Engine · Research MCP Service · The serverError mappingSorts known failures into types, each with retry advice. Any unknown failure becomes one fixed internal error.See it in the map above keep their type and their retry advice. Unknown ones get one fixed internal error. A retry that reuses an old key with changed input adds no extra record of the failure.
- 08 of 08DecidedResearch MCP Service
Ship one bundle, and treat it as a real running program
The questionA single bundleResearch Workflow Engine · Research MCP Service · The serverPackaged processShips as one bundle, with the piece that lets it use SQLite and the steps that set up the database. It keeps saved data away from the installed code.See it in the map above, one package to install, is easy to hand out. But the piece that lets it use SQLite still has to load and run.
What I choseThe bundle carries that SQLite piece and the steps that set up the database. It keeps saved data out of the installed code. When it shuts down, it closes the server and the database. Tests of the tool code can’t cover any of this. So the packaging, and how the program starts and stops, need tests of their own.
03Today
Where it stands.
The rules mean the research history can be got back. But they can’t tell whether an observation from the browser is true. Some of this code is not saved in the project history yet. I also haven’t checked the installed plugin against it.