# Prompt Engine Lab (isolated live lab)

A fully live, writable clone of the Prompt Engine that can be tested end-to-end
**without touching the archived/production engine or its data**.

## Public URLs
- Dashboard: https://prompt-engine-lab.hiz.rediredge.com/dashboard.html
- Submit:    https://prompt-engine-lab.hiz.rediredge.com/submit.html
- Save API:  https://prompt-engine-save.hiz.rediredge.com  (POST submissions, GET `/health`)

## Storage (isolated — all lab writes land here, never the archive)
- Web root:        `/data/workspace/helix/shareable/prompt-engine-lab/`
- Lab store:       `/data/workspace/helix/shareable/prompt-engine-lab/store/`
  - `store/data/`               — source files + new manual submissions
  - `store/unified/records/*.jsonl` — normalized per-day records (what the dashboard reads)
  - `store/unified/index.json`  — manifest
  - `store/prompts-v2.json`     — registry snapshot
- Seeded (2026-07-22) from a snapshot copy of the current unified store so the
  dashboard is useful immediately. From then on the two stores diverge — nothing
  in the lab writes back to `redirhub-ai-visibility/`.

## Services / code
- Save handler: `/home/ubuntu/agents/prompt-engine-lab/save-handler/server.py`
  - systemd unit `prompt-engine-save-lab.service`, listens on `127.0.0.1:8644`
- Normalizer:   `/home/ubuntu/agents/prompt-engine-lab/normalize.py`
  - `BASE_DIR` points at the lab store; identical logic to production normalize.
- Hermetic + live smoke test: `save-handler/smoke_test.py`
  - `python3 smoke_test.py`        (hermetic, no store writes)
  - `python3 smoke_test.py --live` (read-only GET/OPTIONS against the lab host)

## Relationship to production (untouched)
The production engine — `prompt-engine/dashboard.html`, `prompt-engine/submit.html`,
`redirhub-ai-visibility/` data, and `save-handler/` on `save.hiz.rediredge.com`
(port 8643) — is not modified in any way. The lab is a parallel copy on its own
hosts, ports, and store.
