This folder provides:
frontend/: React page with run form, live console, and artifacts tablebackend/: FastAPI service that triggers one OpenCode master command (/ben-spec-process)
For each run, backend executes only:
opencode run --dir <ben_specs_repo> --model openai/gpt-5.4 --command ben-spec-process <excel_path> <output_dir>So UI and terminal use the same pipeline behavior.
When Allow local run is ON in UI, backend runs Stage 1-3 directly (run context, extract, standardize, summary) and skips Stratio publish/workflow trigger.
- OpenCode installed and available in PATH (
opencode --version) - OpenCode authenticated (
~/.local/share/opencode/auth.jsonexists), orOPENAI_API_KEYset in backend env - Stratio cookie and URLs set before backend start
cd /Users/bhagyashri_lohiya/Aviva/opencode-runner
source scripts/set_stratio_env.sh ~/.secrets/stratio.cookieQuick cookie save helper (macOS/Linux; falls back to manual paste):
# copy Stratio cookie value in browser first, then:
scripts/save_stratio_cookie.sh ~/.secrets/stratio.cookiePractical cookie refresh flow:
- Copy cookie in browser
- Run
scripts/save_stratio_cookie.sh ~/.secrets/stratio.cookie - Click
Refresh checksin UI (or callPOST /api/stratio/refresh) - Run pipeline
Supported env keys:
STRATIO_COOKIEorSTRATIO_COOKIE_PATHROCKET_BASE_URL(BenSpecs contract) orSTRATIO_API_BASE_URLSTRATIO_REQUIRE_API_PING(falseby default)STRATIO_JDBC_URLSTRATIO_JDBC_CHECK_COMMANDSTRATIO_REQUIRE_JDBC(falseby default)
Note: backend auto-loads STRATIO_COOKIE from STRATIO_COOKIE_PATH for subprocesses, so
ben-spec-process can authenticate Rocket even when only cookie-path is set in opencode-runner.
cd /Users/bhagyashri_lohiya/Aviva/opencode-runner/backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Health checks:
curl http://localhost:8000/health
curl http://localhost:8000/api/preflight
curl http://localhost:8000/api/stratio/healthStratio readiness endpoints:
GET /api/stratio/healthPOST /api/stratio/refresh
cd /Users/bhagyashri_lohiya/Aviva/opencode-runner/frontend
npm install
npm run devFrontend will run on http://localhost:5174.
- Source Stratio env (
source scripts/set_stratio_env.sh ...) - Start backend (
uvicorn ...) - Start frontend (
npm run dev) - Open UI and click
Refresh checks - Confirm preflight + Stratio badges are green
- Run pipeline from UI
Use these values in UI:
excel_path:/Users/bhagyashri_lohiya/Aviva/Schemes/Domnick Hunter/Domnick Hunter Data Masked (1).xlsxoutput_dir:/tmp/domnick_out_runnerben_specs_repo:/Users/bhagyashri_lohiya/Aviva/2604-AVIVA-BenSpecs- turn ON
Allow local run
Notes:
- Local mode runs Stage 1-3 only.
- Output dir is cleaned before each run.
- Stratio-side input/output cleanup is still manual.
POST /api/runs- body:
excel_path: absolute path to workbookoutput_dir: absolute output directoryben_specs_repo: path to2604-AVIVA-BenSpecs(default prefilled)
- body:
GET /api/runs/{run_id}GET /api/runs/{run_id}/logsGET /api/runs/{run_id}/artifactsGET /api/runs/{run_id}/artifact?path=...GET /api/runs/{run_id}/artifacts.zip
- Stratio preflight/health badges (cookie required; API/JDBC optional unless enforced)
- Pipeline tracker (Intake/Extract/Standardize/Summarize)
- Stage Summary table (Find/Extract/Standardize rows)
- Live console stream
- Artifact list with per-file and zip download
Stratio Not Connected: refresh cookie, re-source env, restart backend- If API ping is flaky in local dev, keep
STRATIO_REQUIRE_API_PING=false(default) - If JDBC is not ready yet, keep
STRATIO_REQUIRE_JDBC=false(default) opencode CLI/auth not ready: runopencode providers loginor setOPENAI_API_KEYinbackend/.env- Runs blocked at start: check
GET /api/preflightandGET /api/stratio/healthresponse details