From 62d1128ab2a06b04cca22433a357d9dd25dd4f22 Mon Sep 17 00:00:00 2001 From: Zhongyue Lin <101193087+LeoLin990405@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:09:16 +0800 Subject: [PATCH] fix(engine): IDENTITY.md canonical role table now primary source for agents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v4 engine preferred openclaw.json.template over IDENTITY.md, making the L-stage canonical rewrite of 57 IDENTITY.md files have no effect on actual agent generation. Flipped the precedence. Before this fix: node engine/regime-to-cc.mjs regimes/global/byzantine → silijian, bingbu, hubu... (generic Tang-derived defaults) After: node engine/regime-to-cc.mjs regimes/global/byzantine → basileus, patriarch, logothete-dromos/genikon, domestikos, eparch, protoasecretis (historically accurate Byzantine offices) All 57 regimes verified to generate ≥5 agents from their canonical role mapping table. openclaw.json.template remains as fallback for potential future regimes that haven't been canonicalized. Tang anachronism fix also now takes effect: silijian (Ming-Qing) is replaced by zhongshu-sheren (actual Tang drafter). --- engine/regime-to-cc.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/regime-to-cc.mjs b/engine/regime-to-cc.mjs index 3fc58dd..85e14dc 100644 --- a/engine/regime-to-cc.mjs +++ b/engine/regime-to-cc.mjs @@ -118,8 +118,10 @@ export function convertRegime(regimeDir) { } catch { /* ignore parse errors in templates */ } } - // Build CC agents from whichever source has data - const sourceAgents = oclawAgents.length > 0 ? oclawAgents : tableAgents; + // v5.1: IDENTITY.md canonical role mapping is the source of truth. + // openclaw.json.template remains only as a legacy fallback for regimes that + // haven't been rewritten yet (should be zero after the L-stage PR). + const sourceAgents = tableAgents.length > 0 ? tableAgents : oclawAgents; const ccAgents = {}; for (const agent of sourceAgents) {