Skip to content

feat(L): all 57 regimes rewritten to canonical IDENTITY template - #6

Merged
LeoLin990405 merged 2 commits into
mainfrom
feat/l-full-regime-rewrite
Apr 14, 2026
Merged

LeoLin990405 merged 2 commits into
mainfrom
feat/l-full-regime-rewrite

Conversation

@LeoLin990405

Copy link
Copy Markdown
Owner

What

Full rewrite of every regime's IDENTITY.md to a canonical structure so each civilization's Agent Team authentically mirrors its historical governance.

How

Parallel delegation across 9 AI workers (7 CN backends + Codex + Gemini). Each worker was given:

  • The canonical template (docs/IDENTITY-TEMPLATE.md)
  • Tang as gold exemplar
  • Regime metadata.json + existing IDENTITY.md for reference

Wall time: ~15 min for 56 regimes + 2 retry rounds.

Canonical structure

Every IDENTITY.md now has:

  1. 制度简介 (System Overview) — era, duration, significance
  2. 组织架构图 (Organization Chart) — ASCII hierarchy, 3–10 organs
  3. 角色映射表 (Role Mapping Table) — ≥5 rows with canonical AI roles
  4. 决策流程 / 协作流程 (Decision Flow) — step-by-step governance flow
  5. 制度特点 (Characteristics) — mechanism-level bullets
  6. Pattern 映射 — orchestration pattern from 6 canonical options
  7. 历史参考 (Historical Sources) — 3–5 references

Attribution by worker

Worker Regimes Notes
cc-mimo byzantine, persian, ottoman, mongol, russian, soviet, ming, qing, north-south, western-xia, napoleon, us-federal 1M ctx, archive-heavy civs + retries
cc-glm song, yuan, han, sui, five-dynasties, three-kingdoms Chinese reasoning
cc-qwen xia, shang, zhou, qin, jin Early Chinese dynasties
cc-doubao taiping, liao, jin-jurchen, roc, viking General coding
cc-stepfun sparta, prussia, zulu, meiji, maurya, inca Discipline/logic civs
cc-minimax carthage, venice, swiss, aztec, mali, sumeria Fast inference, smaller polities
codex roman-republic, roman-empire, british European structures
gemini athens, caliphate, egypt, shogunate, habsburg, khmer, safavid, hre, joseon, mughal, polish Cross-continental + retries

Rejection incidents

  • cc-kimi returned {"error":{"type":"invalid_request_error","message":"The request was rejected because it was considered high risk"}} for all 6 assigned regimes (ming/qing/joseon/polish/hre/mughal). Content filter triggered by political governance topics. Reassigned to cc-mimo + gemini.
  • codex timed out mid-write on napoleon/us-federal. Reassigned to cc-mimo.

Test plan

  • npm run validate:regimes — 0 errors, 40 alias warnings (expected)
  • All 57 regimes have required canonical H2 sections
  • Role mapping tables have ≥5 rows each
  • npm test — 9/9 unit tests pass
  • Deferred: historical accuracy review (sample 5-10 regimes with a human historian)
  • Deferred: end-to-end tournament run to verify agent counts match new tables

Risks

  • AI-authored historical content may have inaccuracies. The provenance is recorded in commit message; future corrections can target specific regimes.
  • All 7 CN backends' outputs vary in style/depth. Visual consistency is not guaranteed.
  • No single human reviewed all 57 files; quality varies by worker and by regime.

Parallel rewrite delegated across 9 AI workers (+ 3 retry rounds):
- cc-mimo  (1M ctx):  persian, ottoman, mongol, russian, soviet, byzantine,
                      + retries: ming, qing, north-south, western-xia,
                      + final: napoleon, us-federal
- cc-glm:             song, yuan, han, sui, five-dynasties, three-kingdoms
- cc-qwen:            xia, shang, zhou, qin, jin
- cc-doubao:          taiping, liao, jin-jurchen, roc, viking
- cc-stepfun:         sparta, prussia, zulu, meiji, maurya, inca
- cc-minimax:         carthage, venice, swiss, aztec, mali, sumeria
- codex (GPT-5.4):    roman-republic, roman-empire, british
- gemini (2.5 Pro):   caliphate, egypt, shogunate, habsburg, khmer, safavid,
                      athens, hre, joseon, mughal, polish

cc-kimi rejected all 6 (content filter on political topics) — reassigned.

Each IDENTITY.md now has required sections:
- 制度简介 (System Overview)
- 组织架构图 (Organization Chart) — ASCII hierarchy, 3-10 organs
- 角色映射表 (Role Mapping Table) — ≥5 rows with canonical AI roles
- 决策流程 (Decision Flow) or 协作流程 (Workflow — accepted alias)
- 制度特点 (Characteristics)
- Pattern 映射
- 历史参考 (Historical Sources)

Validator (test/regime-validator.mjs) enforces structure.
Canonical template: docs/IDENTITY-TEMPLATE.md

All 57 regimes pass npm run validate:regimes (0 errors, only alias warnings).
- README.md: comprehensive v5 rewrite (345 lines) — 30s quickstart,
  learning-loop diagram, 10-model matrix, 57 regime index, 6 modes table,
  architecture diagram, full CLI reference, v5 workflow walkthrough,
  tournament mode, CI/testing, extension guide, design limits, credits
- regimes/china/tang/IDENTITY.md: remove 司礼监/批红 (Ming-Qing anachronisms
  misplaced in Tang); replace with 中书舍人 (Zhongshu Sheren — actual Tang
  drafter office). Clarify '1300 years' claim — only 三省六部 framework
  persisted, not Tang's specific configuration.
- regimes/REVIEW-FINDINGS-v5.md: Codex audit findings, documenting what
  was fixed and what deferred to v5.1 (byzantine/roman-republic/prussia/
  ottoman have accuracy gaps identified but not yet patched).
@LeoLin990405
LeoLin990405 merged commit 4a8a6b2 into main Apr 14, 2026
1 check passed
LeoLin990405 added a commit that referenced this pull request Jul 29, 2026
…dening

The frontend could read everything but launch nothing — this adds the write
path (AGENTS.md invariant #6): validate hard (civs 1-8 whitelisted ids, task
<=2000 chars, backend id whitelisted), pre-generate the tournament id, spawn
tournament.mjs detached with --id, answer 202 {tournamentId} immediately.
Spawn-time stderr lands in ~/.civagent/server-logs/<id>.launch.log.

- tournament.mjs: export newTournamentId + TOURNAMENT_ID_RE, accept --id /
  runTournament({id}) so callers can name the run before it finishes
- tournaments route becomes a factory (createTournamentsRouter) with
  injectable spawn + state dir; tests never launch a real process
- test/tournaments-write-api.test.mjs: 9 tests incl. injection attempts,
  detachment, shared-backend application, spawn-failure path
- test/regime-to-cc.test.mjs: 10 tests pinning parseIdentityTable's contract,
  incl. the prose-IDENTITY→0-agents hazard and an all-57-regimes sweep
- integration fake-bin list now derived from BACKEND_COMMANDS+JUDGE_PROVIDERS
  so no engine-reachable CLI can escape to a real binary in tests

ci: 232 tests green
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 变更记录)
LeoLin990405 added a commit that referenced this pull request Aug 6, 2026
See PR #6 for the 3-round review findings and per-regime breakdown. tang anachronism fixed in-branch; byzantine/roman-republic/prussia/ottoman accuracy gaps documented for v5.1.
LeoLin990405 added a commit that referenced this pull request Aug 6, 2026
…dening

The frontend could read everything but launch nothing — this adds the write
path (AGENTS.md invariant #6): validate hard (civs 1-8 whitelisted ids, task
<=2000 chars, backend id whitelisted), pre-generate the tournament id, spawn
tournament.mjs detached with --id, answer 202 {tournamentId} immediately.
Spawn-time stderr lands in ~/.civagent/server-logs/<id>.launch.log.

- tournament.mjs: export newTournamentId + TOURNAMENT_ID_RE, accept --id /
  runTournament({id}) so callers can name the run before it finishes
- tournaments route becomes a factory (createTournamentsRouter) with
  injectable spawn + state dir; tests never launch a real process
- test/tournaments-write-api.test.mjs: 9 tests incl. injection attempts,
  detachment, shared-backend application, spawn-failure path
- test/regime-to-cc.test.mjs: 10 tests pinning parseIdentityTable's contract,
  incl. the prose-IDENTITY→0-agents hazard and an all-57-regimes sweep
- integration fake-bin list now derived from BACKEND_COMMANDS+JUDGE_PROVIDERS
  so no engine-reachable CLI can escape to a real binary in tests

ci: 232 tests green
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