feat: 工具链与 vocab 模块(任务书 01)

- npm 包、TypeScript、node --test、dependency-cruiser;结构.md 第六部分的检查规则一次写全,临时违规实测均报错。
- vocab:基础类型与编号格式、规范序列化与哈希、角色/阶段/提交名单、指标与运行定义及结果、模型用量、16 种提交的 TypeBox 字段定义。
- 测试:规范序列化预期串手写,哈希预期值用 sha256sum 算出;每种提交一份合法样例。
- 结构.md 第八部分补 vocab 对外内容;WORK_LOG 记下用户决定。

用户决定(2026-10-01):"同意 A,vocab 上限改为 1100 行";"同意 A:解释的 cells 去掉 minItems,改为可选";"3、4、5、6:同意保留你的写法";答案路径与保障动手次数"tasks 只记读到的原始内容",对表由以后有位置表的模块现算。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 23:37:58 -04:00
parent 30e4d98ed2
commit 97a43591a3
13 changed files with 2082 additions and 3 deletions
+50
View File
@@ -0,0 +1,50 @@
/** 三个角色(方法.md 第三部分):研究者、实验员、核验员。 */
export const ROLES = ["researcher", "experimenter", "verifier"] as const;
export type Role = (typeof ROLES)[number];
/**
* 有人交提交的阶段,按方法.md 4.2、4.3 的先后排。
* 程序自己做的步骤(分配、判重、选批、采纳、选格、结算等)不在这里,步骤清单归 config。
*/
export const STAGES = [
"entryDraft", // 0.1 闭门写入口
"discussion", // 0.2 讨论,可配置为 1 或 2 次,每次都是这个阶段
"claim", // 0.3 认领
"proposal", // ② 提案
"firstPrediction", // ④ 第一次预测
"critique", // ⑤ 挑刺
"response", // ⑥ 回应与统一
"secondPrediction", // ⑦ 第二次预测
"implementation", // ⑨ 实现,以及核验不通过后的修复
"verification", // ⑨ 核验
"explanation", // ⑭ 解释
"ablationImplementation", // ⑯ 消融实现
"ablationVerification", // ⑯ 消融核验
"wrapUp", // ⑱ 收尾
] as const;
export type Stage = (typeof STAGES)[number];
/**
* 每种提交属于哪个阶段、由哪个角色交(方法.md 第五部分)。
* ledger、materials、submissions、flow、agents 都从这张表取,不在别处另写。
* 每种提交的字段定义在 submissions.ts 的 SUBMISSION_SCHEMAS,键与这张表相同。
*/
export const SUBMISSION_KINDS = {
entry: { stage: "entryDraft", role: "researcher" },
discussion: { stage: "discussion", role: "researcher" },
claim: { stage: "claim", role: "researcher" },
proposal: { stage: "proposal", role: "researcher" },
firstPrediction: { stage: "firstPrediction", role: "researcher" },
critique: { stage: "critique", role: "researcher" },
response: { stage: "response", role: "researcher" },
unification: { stage: "response", role: "researcher" },
secondPrediction: { stage: "secondPrediction", role: "researcher" },
implementation: { stage: "implementation", role: "experimenter" },
repair: { stage: "implementation", role: "experimenter" },
verification: { stage: "verification", role: "verifier" },
explanation: { stage: "explanation", role: "researcher" },
ablationImplementation: { stage: "ablationImplementation", role: "experimenter" },
ablationVerification: { stage: "ablationVerification", role: "verifier" },
wrapUp: { stage: "wrapUp", role: "researcher" },
} as const satisfies Record<string, { stage: Stage; role: Role }>;
export type SubmissionKind = keyof typeof SUBMISSION_KINDS;