Skip to content

feat(frontend): R1 Tournament Dashboard — Vite+React live match observer - #11

Merged
LeoLin990405 merged 1 commit into
feat/r1-backend-robustnessfrom
feat/r1-frontend-dashboard
May 28, 2026
Merged

LeoLin990405 merged 1 commit into
feat/r1-backend-robustnessfrom
feat/r1-frontend-dashboard

Conversation

@LeoLin990405

Copy link
Copy Markdown
Owner

Summary

R1 frontend layer (antigravity). Stacks on PR #10 (backend robustness).

  • Live Tournament tab — 4 parallel TerminalPanel components stream match events. Mock simulation plays 4-civ scenario (Tang/Rome/Soviet/Prussia) with timestamped role turns. JudgeLeaderboard appears on completion with legality/feasibility/resilience scores and per-civ AI verdict.
  • Match Archive tab — lists ~/.civagent/matches/ (B4 structured) and ~/.civagent/transcripts/ (legacy fallback), sorted by mtime. Click a match to load its events.jsonl and display turn-by-turn playback + actual sedimented skill events in the timeline (not hardcoded).
  • Regimes Codex tab — grid of all 57 regimes with pattern filter (centralized / checks-and-balances / democratic / dual-track / federation / theocratic), search by id/tag, IDENTITY.md + SOUL.md preview, sedimented skills count.

Architecture

Vite dev server (port 5173)
  └── civagentApiPlugin (vite.config.ts middleware)
        ├── GET /api/regimes       → reads regimes/*/metadata.json + IDENTITY/SOUL/skills
        ├── GET /api/matches       → ~/.civagent/matches/<id>/meta.json (B4)
        │                            + ~/.civagent/transcripts/*.jsonl (legacy)
        ├── GET /api/matches/:id   → events.jsonl lines parsed as MatchEvent[]
        └── GET /api/tournaments   → ~/.civagent/tournaments/*/manifest.json

No separate backend process. Frontend reads files directly via Vite middleware during development; production build would need a thin static server with the same routes.

Data contract alignment

Test plan

  • cd frontend && npm run dev — starts on :5173 with no errors
  • /api/regimes returns 58 entries (including _template)
  • Live Tournament → "Run Simulation" → 4 panels animate in parallel, leaderboard appears after ~14s
  • Match Archive → empty until a real civagent run --v5 match completes
  • Regimes Codex → filter by "checks-and-balances" narrows list; click regime shows IDENTITY preview
  • TypeScript: npx tsc --noEmit → 0 errors

Vite + React 19 frontend for the CivAgent v5 match observation layer.
Serves data directly from ~/.civagent/ via a Vite middleware — no
separate backend process required.

Three tabs:
- Live Tournament: parallel TerminalPanel × 4 civs with real-time
  event streaming (mock simulation on click, real events.jsonl when
  available). JudgeLeaderboard renders after match completes with
  legality/feasibility/resilience scores and per-civ verdict.
- Match Archive: browse ~/.civagent/matches/ (structured B4 events)
  and legacy ~/.civagent/transcripts/ with searchable list + event
  playback. Skill Sedimentation Timeline reads actual `skill` events
  from each match (not hardcoded).
- Regimes Codex: full-text browse of all 57 regimes with
  orchestrationPattern filter, IDENTITY.md + SOUL.md preview, and
  sedimented skills count per regime.

API endpoints (Vite middleware, dev only):
  GET /api/regimes         → reads regimes/*/metadata.json + IDENTITY/SOUL/skills
  GET /api/matches         → structured meta.json + legacy transcripts
  GET /api/matches/:id     → events.jsonl parse or legacy chunk format
  GET /api/tournaments     → manifest.json list
  GET /api/tournaments/:id → single manifest

Frontend data contract: schemas/match-event.schema.json (B4, engine/v5/events.mjs).
TournamentManifest type aligned to actual tournament.mjs output schema.
@LeoLin990405
LeoLin990405 merged commit 955a63d into feat/r1-backend-robustness May 28, 2026
1 check passed
LeoLin990405 pushed a commit that referenced this pull request Aug 6, 2026
🔴 结构性问题(4个):
- #1 新增 CONTRIBUTING.md 贡献指南(项目结构、GUI 开发、PR 检查清单)
- #2 GUI README 已有完整说明(确认无需额外修改)
- #3 Docker CI/CD 待后续处理(标记为 TODO)
- #4 install.sh 末尾自动运行 doctor.sh 健康检查

🟡 文档一致性(4个):
- #5 README GUI 章节已完善(确认无需额外修改)
- #6 README 基础篇/进阶篇加说明(标注为小红书配套文字稿)
- #7 README_EN 同步预装 Skill 章节 + 60+ Skill 措辞 + badge
- #8 进阶篇待后续全面更新(标记为 TODO)

🟢 建议优化(5个):
- #9 新增 skills/README.md 总索引(7个 Skill 说明 + 安装更多 + 自定义指南)
- #10 docker-compose.yml 移除废弃的 version: '3.8'
- #11 openclaw.example.json + install.sh 补翰林院 account + binding
- #12 Dockerfile COPY skills/ 改用 ${WORKSPACE} 变量
- #13 新增 CHANGELOG.md(v2.0 → v3.5 变更记录)
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.

1 participant