align: ChatGPT Codex 对齐第一批:技能包 + 对照表

对照用户提供的 ChatGPT Codex 工具目录,区分可对齐与
不照搬:核心编程工作流已对齐,ChatGPT 托管专属
(CUA、宠物、Docs/Sites 连接器、图片生成模型)不在
开源宿主编排层范围,不凭空宣称对齐。

第一批只补技能层,不改 worker、不改生产行为:
- cloud/skills/live-info:天气/时区/股票/体育,查一级
  来源、带来源和快照时间,绝不编数字。
- cloud/skills/document-tools:LaTeX/Word/PDF/表格/
  演示文稿,先核查工具、缺了明说、产出后重读验证。
- cloud/skills/image-workflow:已有图片处理 + 生成工具
  已配置时才生成,未配置时明说、绝不顶替。
- docs/chatgpt-codex-alignment.md:逐项对照表与不照搬
  的诚实边界,方向为自动化编程任务平台。
- cloud/tests/test_chatgpt_codex_skills.py:校验技能
  frontmatter、名字与目录一致、正文非空、无密钥占位。

验证:新测试 2 项全过。播种进租户 codex-home、 worker
改动、CUA/连接器/图片模型均不在本批,另行评审。
This commit is contained in:
host committed 2026-10-30 01:16:49 +08:00
1 parent 6d4f87e286
commit 8a26d1973c
5 files changed
+272

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
"""ChatGPT Codex 对齐第一批:技能包校验。
只校验技能文件本身,不启动 worker、不跑模型、不改生产行为:
每个 cloud/skills/<名>/SKILL.md 必须有 name + description
frontmatter、名字与目录一致、正文非空、不含密钥占位。
"""
import os
import re
import unittest
from pathlib import Path
SKILLS_DIR = Path(__file__).resolve().parents[1] / "skills"
EXPECTED = {"live-info", "document-tools", "image-workflow"}
def _frontmatter(text):
m = re.match(r"^---\n(.*?)\n---\n", text, re.DOTALL)
if not m:
return None
out = {}
for line in m.group(1).splitlines():
if ":" in line:
k, v = line.split(":", 1)
out[k.strip()] = v.strip()
return out
class ChatGptCodexSkillsTestCase(unittest.TestCase):
def test_expected_skills_exist(self):
names = {p.name for p in SKILLS_DIR.iterdir() if p.is_dir()}
self.assertEqual(names, EXPECTED)
def test_skill_frontmatter_and_body(self):
for name in sorted(EXPECTED):
path = SKILLS_DIR / name / "SKILL.md"
self.assertTrue(path.is_file(), str(path))
text = path.read_text(encoding="utf-8")
fm = _frontmatter(text)
self.assertIsNotNone(fm, name)
self.assertEqual(fm.get("name"), name)
desc = fm.get("description", "")
self.assertTrue(desc, name)
self.assertLessEqual(len(desc), 200, name)
body = text.split("---", 2)[-1].strip()
self.assertTrue(len(body) > 200, name)
for bad in ("API_KEY", "sk-", "password"):
self.assertNotIn(bad, text, name)
if __name__ == "__main__":
unittest.main()