Skip to content

Add Next.js demo with live usage and parallel CLI arena - #21

Merged
BunsDev merged 4 commits into
mainfrom
feat/live-routing-host
Sep 22, 2026
Merged

BunsDev merged 4 commits into
mainfrom
feat/live-routing-host

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What changed

The static routing demo could not save a TypeSafe key, report live usage, or compare an actual CLI host. Replace it with a Next.js App Router application while preserving the pure harness in src/ unchanged.

  • Compact dashboard header with active-page underline tabs. Full-width dark React UI with routing, schema/context examples, and an Agent arena. Progressive disclosure keeps the main path focused on tools exposed → observed calls → answer.
  • Playground-style masked personal-key override and reported Jev usage, with unknown usage kept distinct from zero. The loopback host rebuilds bounded, pinned-model requests and excludes credentials from receipts and logs.
  • Two isolated Codex CLI lanes run concurrently after routing, with independent live activity, elapsed timers, cancellation, and results. Only fixed synthetic MCP handlers are permitted; proposed patches are never applied.
  • A responsive, keyboard-navigable run inspector presents usage bars, tool timelines, Jev evidence, and the comparison setup. Raw receipts remain a deeper disclosure.

This is an explicitly requested example-host expansion. Dependencies were landed separately in #19/#8; this PR adds no dependency versions. Auth-only temporary CLI homes, read-only sandboxing, disabled external features, bounded inputs/output/time, and process-group cancellation stay in the host, outside the exported package.

Verdict impact

None. No src/ changes, verdict changes, decision-table changes, proposal-review question changes, or model-pin changes. The fixture host may read invented files and record proposals; it never executes model-proposed source.

Verification

  • pnpm typecheck
  • pnpm test — 72 offline tests, including parallel-start/settlement, CLI activity transitions, MCP bounds, origin normalization, and usage accounting.
  • pnpm build — production build in an isolated copy of the final source so the requested dev preview remains available.
  • pnpm check:secrets and signed commits; existing hooks remain enabled.
  • 143 browser checks: responsive layouts, keys/usage, progressive disclosure, inspector keyboard controls, parallel progress, partial results, cancellation, and unknown usage. Provider requests were intercepted.
  • Manual live parallel arena run through the UI: both lanes returned a real synthetic read_file call. Separate from automated tests; not a quality, cost, or latency benchmark.
  • Fresh code review; findings addressed and regression-checked.

The template's no-provider/no-credential/no-execution-path checkbox does not apply to this requested optional local host: those additions are explicitly described above. No provider, React, or CLI I/O enters src/.

Review fixes: fixture contents now stay behind MCP rather than in the common prompt; pending proposals retain their bounded diff and rationale in the inspector/export; Windows CLI execution is explicitly refused before any process or auth workspace starts.

Limitations: the CLI host requires macOS or Linux; file-based Codex sign-in is required; keychain-only auth is unsupported. Browser key storage is origin-local and unencrypted, as disclosed in settings. Independent trajectories, cache effects, and shared host resources affect comparisons. Answer quality is not automatically scored. Human keyboard-only/VoiceOver acceptance and repeated live benchmarking remain outstanding.

Copilot AI lite review requested due to automatic review settings September 22, 2026 11:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The credential-bearing provider path and concurrent Codex/MCP process sandbox have correctness and lifecycle findings requiring fixes and final human security review.

Review effort: Lite
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Replaces the static routing demo with a Next.js App Router host while preserving the pure harness in src/.

Changes:

  • Adds live Jev routing, key storage, usage reporting, and responsive React UI.
  • Adds a synthetic Codex CLI arena with parallel MCP lanes and inspectors.
  • Updates tests, documentation, CI, and removes the old static demo host.
File Description
tsconfig.json Enables Next.js and React compilation.
tsconfig.demo.json Removes obsolete demo configuration.
tests/​usage.test.ts Tests usage parsing and accounting.
tests/​routing-demo.test.ts Removes obsolete static-server tests.
tests/​routing-bench.test.ts Adapts benchmark assertions.
tests/​live-host.test.ts Tests live host validation and failures.
tests/​arena.test.ts Tests MCP and CLI arena behavior.
scripts/​verify-live-browser.mjs Adds live UI verification.
scripts/​verify-arena-browser.mjs Adds arena UI verification.
scripts/​demo-routing.ts Removes obsolete launcher.
scripts/​arena-mcp.mjs Adds bounded synthetic MCP server.
README.md Documents the new demo host.
public/​favicon.svg Adds application favicon.
package.json Adds Next.js development and build scripts.
next.config.ts Configures Next.js aliases and security headers.
examples/​routing/​usage.ts Implements session usage tracking.
examples/​routing/​server.ts Removes obsolete static server.
examples/​routing/​live-client.ts Adds browser live-routing client.
examples/​routing/​index.html Removes obsolete static page.
examples/​routing/​demo-state.ts Supports injected live routers.
examples/​routing/​compare.ts Adds live measurements to comparisons.
examples/​routing/​browser.ts Removes obsolete browser implementation.
examples/​routing/​api-key.ts Implements local key storage.
examples/​host/​runtime.ts Creates server-side live handler.
examples/​host/​live.ts Adds bounded provider adapter.
examples/​host/​codex.ts Runs isolated Codex CLI processes.
examples/​host/​arena-lanes.ts Coordinates parallel arena lanes.
examples/​arena/​cases.ts Defines synthetic arena fixtures.
docs/​verification/​next-browser-2026-09-22.json Records browser verification.
docs/​verification/​live-routing-2026-09-22.json Records live routing smoke test.
docs/​verification/​live-browser-2026-09-22.json Records live UI checks.
docs/​verification/​live-arena-parallel-2026-09-22.json Records parallel arena run.
docs/​verification/​live-arena-2026-09-22.json Records arena smoke test.
docs/​routing-demo.md Documents the new host and arena.
docs/​roadmap.md Updates project milestones.
docs/​plans/​routing-demo.md Tracks requested demo work.
docs/​architecture.md Documents host boundaries.
components/​routing-room.tsx Implements routing UI.
components/​header.tsx Adds navigation, key, and usage controls.
components/​example-lab.tsx Adds schema/context experiments.
components/​comparison.tsx Displays routing accounting.
components/​arena.tsx Implements arena orchestration UI.
components/​arena-results.tsx Displays lane results and accounting.
components/​arena-inspector.tsx Adds run inspection tabs.
app/​page.tsx Defines routing page.
app/​layout.tsx Defines shared application layout.
app/​globals.css Styles the application UI.
app/​examples/​page.tsx Defines examples page.
app/​arena/​page.tsx Defines arena page.
app/​api/​route/​route.ts Exposes live routing endpoint.
app/​api/​config/​route.ts Exposes host configuration status.
app/​api/​arena/​route.ts Streams arena execution events.
AGENTS.md Adds host-specific safety guidance.
.gitignore Ignores Next.js generated files.
.github/​workflows/​checks.yml Adds production build verification.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread examples/host/codex.ts Resolved
Comment thread examples/host/codex.ts Resolved
Comment thread scripts/arena-mcp.mjs Resolved
Comment thread docs/routing-demo.md Resolved
@BunsDev
BunsDev merged commit 3b1704f into main Sep 22, 2026
2 checks passed
@BunsDev
BunsDev deleted the feat/live-routing-host branch September 22, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants