feat: add mock investigation mode for UI development

- lib/mocks/confidence-engine/mock-client.js: self-contained ESM interceptor with 6 inline turn fixtures, no external deps or require() calls
- components/scenario-form.jsx: MOCK_ENABLED compile-time boolean, useMockGlobals() hook injects window.__MOCK_* globals at runtime, ternary dispatch to mockFetch
- .env.example: NEXT_PUBLIC_CONFIDENCE_ENGINE_MOCKS, MOCK_DELAY, MOCK_SCENARIO env vars
- docs/v0.7-ui-mock-mode.md: setup, scenarios (default/complete/error), architecture, safety rules, fixture schema
This commit is contained in:
2026-08-04 13:56:15 +01:00
parent dced344680
commit 97a4847770
5 changed files with 364 additions and 4 deletions
+10
View File
@@ -3,3 +3,13 @@ OLLAMA_BASE_URL=http://192.168.x.x:11434
# Model name (e.g., llama3, mistral, codellama, etc.)
OLLAMA_MODEL=replace-with-model-name
# ── Mock / Demo Mode (UI development only) ──────────────────
# Set to "true" to use pre-recorded scenario fixtures instead of Ollama.
NEXT_PUBLIC_CONFIDENCE_ENGINE_MOCKS=true
# Mock delay mode: "instant" | "normal" (default, 700ms) | "slow" (2500ms)
NEXT_PUBLIC_CONFIDENCE_MOCK_DELAY=normal
# Scenario to replay: "complete" (jump to end after start) | "error" | "" (default sequential turns)
NEXT_PUBLIC_CONFIDENCE_ENGINE_MOCK_SCENARIO=complete