Why this surface still exists
services/api/main.py predates the tenant-scoped product API in services/api/product_app.py. It hosts the local research workbench, file-backed client onboarding, and the process-global /mvp1 routes that the current product does not need. The product boundary (services/api/product_app.py) explicitly does not import it — the module’s own docstring calls out that importing the legacy app “creates stores and exposes operations the customer/staff product does not need.” Treat everything on this page as a research and pipeline-development environment, not a place to prototype product features.
Choosing a mode
Pick the smallest mode that covers the work at hand:
All three assume Python 3.12+,
uv, and Node.js 20+/npm 10+ are installed. From the repository root, install locked dependencies once:
check_local_setup.py is local and non-mutating — it never calls OpenAI, never contacts a remote service, and never prints a secret value. Run it for the mode you’re about to use before claiming that mode is ready.
Mode 1: basic UI and API
No Docker, no API key. Start both processes together:- Web UI:
http://127.0.0.1:5173 - API docs:
http://127.0.0.1:8000/docs - API schema:
http://127.0.0.1:8000/openapi.json
docs/issue-set-2-records.json, 250 records) is available in this mode. A fresh clone has no generated strict latest report, so report endpoints correctly return 404 until an analysis is run — that is not a setup failure (see Troubleshooting).
scripts/run_local.py builds its child environment by loading .env then .env.local, but the real process environment takes precedence over both — a variable already set in your shell overrides whatever either dotenv file has. It then launches uvicorn on services.api.main:app and npm --prefix apps/web run dev as child processes. It requires npm to be on PATH.Mode 2: strict MVP1 analysis
1
Create the local env file
2
Run the doctor for mvp1
3
Start the stack
4
Approve and run the strict analysis in the UI
In the web UI, choose the Operator or Developer role, enable the two separate OpenAI transfer approvals, and start the strict run.
AGENTS.md.
The strict pipeline persists its reusable analysis state locally; PostgreSQL is not required for mvp1 mode. The UI/API shape for this mode is specified in docs/MVP1_API_CONTRACT.md.
Mode 3: relational DB-to-Excel
This path clusters the same trackeddocs/issue-set-2-records.json dataset through PostgreSQL and a reviewed Excel workbook. It does not depend on a workbook in ~/Downloads or any machine-specific path.
1
Prepare local configuration and start Postgres
.env.local and infra/causeloop.local.env are git-ignored. Never read, print, log, or commit either file — that rule is explicit in AGENTS.md.2
Point Node at the bundled @oai/artifact-tool package
The reviewed workbook builder (
workers/artifacts/build_mvp1_clustering_workbook.mjs) imports @oai/artifact-tool. If you are a Codex agent, call the workspace-dependency discovery tool and export its bundled Node executable:scripts/check_local_setup.py resolves this as either the configured path or whatever node is on PATH, then looks for @oai/artifact-tool next to workers/artifacts/node_modules or next to that Node binary’s own node_modules. Do not point it at an arbitrary Node install that doesn’t carry the package — the check will fail with “Node runtime does not expose @oai/artifact-tool.”3
Verify prerequisites without making an API call
4
Run the pipeline (only after explicit user approval of cost)
outputs/mvp1/ directory and must never be committed. Validated severity, embedding, and cluster-label results are content-addressed in PostgreSQL: an unchanged rerun reuses them and should make zero new OpenAI calls. The full database and workbook contract is in docs/MVP1_RELATIONAL_PIPELINE.md.
To bring up every optional local infrastructure service instead of Postgres alone: