chore: 升级 Trellis 并精简规则(09-05-trellis-upgrade-rule-cleanup)

这个提交包含在:
2026-09-06 11:14:41 +08:00
父节点 ab82fe30c0
当前提交 c3cef5cfc4
共修改 48 个文件,包含 4588 行新增和 1053 行删除
+24 -1
查看文件
@@ -141,6 +141,25 @@ def _platform_matches(platform: str, block_names: list[str]) -> bool:
return False
_PLATFORM_MARKER_LABELS: dict[str, str] = {
# workflow.md marker blocks label platforms with their product names, but
# every caller passes the stable id instead (`--platform {{CLI_FLAG}}` in
# the start / continue commands). `_platform_matches` only strips
# punctuation, so an id that is not its label-minus-spaces never matches and
# `filter_platform` drops the block WITHOUT error — the section just comes
# back empty. Four platforms shipped that way before this table existed.
#
# Add an entry whenever a platform's id is not its marker label with the
# separators removed. `test/registry-invariants.test.ts` asserts every
# registry id keeps a non-empty routing section, so a missing entry fails
# there rather than silently blanking that platform's routing.
"claude": "Claude Code",
"kimi": "Kimi Code",
"omp": "Oh My Pi",
"dsh": "DeepSeek Harness",
}
def resolve_effective_platform(platform: str, config: dict) -> str:
"""Map ``codex`` to a dispatch-mode-namespaced virtual platform name.
@@ -155,8 +174,12 @@ def resolve_effective_platform(platform: str, config: dict) -> str:
explicit values fall back to ``inline`` safely; this renderer deliberately
does not warn because it can run in normal CLI output flows.
Other platforms are returned unchanged.
Platforms whose marker label differs from their id resolve through
``_PLATFORM_MARKER_LABELS``. Everything else is returned unchanged.
"""
label = _PLATFORM_MARKER_LABELS.get(platform.strip().lower())
if label:
return label
if platform == "codex":
mode = "auto"
codex_cfg = config.get("codex") if isinstance(config, dict) else None