Skip to content

Latest commit

 

History

History

README.md

Local E2E Harness

just e2e is the single local E2E entrypoint. The case catalog lives in e2e/cases.ts, and the dispatcher lives in e2e/cli.ts.

Run from the repo root:

just e2e --help
just e2e contract
just e2e public-api
just e2e contract harness
just e2e deterministic session-log
just e2e ui files-page
just e2e ui sidebar
just e2e ui design-contract
just e2e ui typography-proof
just e2e ui preview
just e2e public-api runtime
just e2e public-api latency

The harness is grouped by layer. just e2e <layer> runs every case in that layer; just e2e <layer> <case> runs one case.

  • cases/contract: local harness and signal contracts.
  • cases/deterministic: no-provider acceptance paths with fixture-backed data.
  • cases/ui: browser journeys.
  • cases/public-api: Public API-triggered live runtime checks.
  • lib: shared E2E clients, auth helpers, setup helpers, env preflight, and runtime progress.

deterministic session-log runs the real Web route with explicit GraphQL projection fixtures, so it is safe for local PR evidence and does not require provider keys or Worker runtime bindings. It starts only @mosoo/web by default; set MOSOO_E2E_WEB_SERVER_COMMAND to override the server command.

ui sidebar is the console sidebar acceptance case for the shell hierarchy (work zone, persistent zone, resource icons, collapsed rail, keyboard focus, CJK labels, mobile drawer, Org layer). It is fixture-backed like ui files-page, starts only @mosoo/web, and writes review screenshots to .tmp/e2e/sidebar/. Point it at a running console with MOSOO_E2E_BASE_URL to capture a branch that is already served on another port.

ui design-contract is the acceptance case for the Console design contract (docs/design/console-design-contract.md): it measures the shipped button, badge, switch, field, and row recipes, checks focus, disabled, invalid, and success states, and writes review screenshots to .tmp/e2e/design-contract/<label>/. MOSOO_E2E_DESIGN_LABEL=before captures the same views from a pre-change checkout for side-by-side evidence. ui typography-proof renders the same fixture-backed surfaces with only the type-role families swapped (geist, the shipped set, and instrument-sans, the previous Instrument Sans / IBM Plex Mono set) into .tmp/e2e/typography-proof/<variant>/, and writes the font files each variant made the page fetch to font-requests.json next to the PNGs. The previous set's SIL OFL files are fetched from the jsDelivr mirror of the Fontsource packages into .tmp/e2e/typography-proof/fonts/ for the run and are never committed (if Node cannot reach the CDN through your network, download instrument-sans-latin-wght-normal.woff2, ibm-plex-mono-latin-400-normal.woff2, and ibm-plex-mono-latin-500-normal.woff2 from the @fontsource-variable/instrument-sans and @fontsource/ibm-plex-mono packages into that folder first). Both cases share e2e/lib/console-fixtures.ts. bun e2e/tools/theme-color-probe.ts regenerates the reference-site evidence behind docs/design/theme-color-usage.md.

Each live case requires a key matching MOSOO_E2E_PROVIDER (or the generic MOSOO_E2E_PROVIDER_API_KEY):

MOSOO_E2E_PROVIDER_API_KEY=...
MOSOO_E2E_OPENAI_API_KEY=...
MOSOO_E2E_ANTHROPIC_API_KEY=...
MOSOO_E2E_OPENCODE_API_KEY=...
MOSOO_E2E_DEEPSEEK_API_KEY=...

ui preview and public-api latency support openai|anthropic. public-api runtime supports openai|anthropic|opencode|deepseek. Omitting MOSOO_E2E_PROVIDER selects openai, so an unrelated DeepSeek/OpenCode key does not satisfy preflight. Optional environment can live in .env, MOSOO_ENV_FILE, or MOSOO_E2E_ENV_FILE.

MOSOO_E2E_PROVIDER=deepseek is supported by the public-api runtime case. It creates an official DeepSeek credential and runs the DeepSeek preset through the OpenCode ACP fallback runtime:

MOSOO_E2E_RUNTIME_ID=acp-fallback
MOSOO_E2E_DEEPSEEK_API_KEY=...
MOSOO_E2E_DEEPSEEK_BASE_URL=https://api.deepseek.com
MOSOO_E2E_DEEPSEEK_MODEL=deepseek-v4-pro

Use MOSOO_E2E_OPENCODE_API_KEY only for the OpenCode Zen provider. DeepSeek official keys must use MOSOO_E2E_DEEPSEEK_API_KEY or the generic MOSOO_E2E_PROVIDER_API_KEY with MOSOO_E2E_PROVIDER=deepseek.

Common optional values:

MOSOO_E2E_EMAIL=preview-smoke@mosoo.ai
MOSOO_E2E_BASE_URL=http://127.0.0.1:5173
WEB_DEV_PORT=5173
MOSOO_E2E_RUNTIME_ID=openai-runtime
MOSOO_E2E_LATENCY_LABEL=current
MOSOO_E2E_LATENCY_OUTPUT=.tmp/e2e/preview-latency-current.json

Runtime signal artifacts are collected by lib/runtime-progress.ts.

Runtime performance overlay

The Runtime E2E Scoreboard and frozen performance harness are intentionally maintained outside main, so their probes cannot affect the production runtime. Treat these remote refs as one staging-only overlay:

Repository Remote ref
langgenius/mosoo origin/perf/runtime-e2e-scoreboard-infra
langgenius/mosoo-agent-driver origin/feat/runtime-performance-evidence

The mosoo ref pins the paired Driver revision through apps/driver. Follow the canonical overlay instructions for disposable worktrees, provenance, validation, and staging cleanup.

The minimum checkout and identity check is:

git fetch origin perf/runtime-e2e-scoreboard-infra
PERF_OVERLAY_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/mosoo-perf-overlay.XXXXXX")"
git worktree add --detach \
  "$PERF_OVERLAY_ROOT/before" origin/perf/runtime-e2e-scoreboard-infra
git -C "$PERF_OVERLAY_ROOT/before" \
  submodule update --init .skills/mosoo-skills apps/driver
git -C "$PERF_OVERLAY_ROOT/before/apps/driver" \
  fetch origin feat/runtime-performance-evidence
test "$(git -C "$PERF_OVERLAY_ROOT/before/apps/driver" rev-parse HEAD)" = \
  "$(git -C "$PERF_OVERLAY_ROOT/before/apps/driver" \
    rev-parse origin/feat/runtime-performance-evidence)"

For instrumentation acceptance, compare target mosoo/Driver SHAs with those same SHAs plus the overlay. For product experiments, both sides must use the same overlay and only the candidate may add the mosoo and/or Driver optimization. An API-only candidate must keep the Driver submodule identical on both sides.

Use dedicated performance staging only; never deploy the overlay to production. Missing provenance or stage evidence fails closed. The balanced 4-pair 1/2/17/18 run is staging acceptance, not statistical certification, and does not modify or replace the frozen 32-pair protocol.