From the 101 lk/man/pth code-gen sources: 63 tasks (C11 36, C++17 27, 11 canonical families), 38 skipped for scope or duplication. Each task has at least one independent contract-edge defect, boundary types rotate, and public docs state trap clauses as plain contract prose. Claude reviewed 63/63 USABLE against current digests. Difficulty is unmeasured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
控制台协议
- 输入为 ASCII 文本,每行一条命令,LF 结束;最后一行可无 LF。分词只使用空格和水平 TAB。命令名大小写敏感,名称无空格。空行、未知命令、参数数量错误或非法整数返回 rc=-9,服务不变;读取继续,EOF 退出 0。每行最多 65536 字节,超出返回 -9。整数词法为可选单个 + 或 - 后接至少一个 ASCII 数字,前导零合法,值须在有符号 32 位范围内。
Z调用 reset;A slot name分配;C slot count [type code lower upper]...替换能力,count 为 0..40 且后续恰有 count 组;B slot fail注册;D slot撤销注册;X slot释放;E slot type code value报告;S slot同步;R slot type code读取。参数结构正确时,rc 为对应 API 返回值;Z 的 rc=0。N count [type code lower upper]...直接调用 normalize_capabilities,count 为 0..40。输出参数开始为一项 {1,31,0,1};rc 和 normalized 反映 helper 返回值及输出参数。H slot name type code lower upper调用 valid_slot、valid_name、capability_valid、inspect、capability;其中 capability 查询使用给定 type/code。help 为五个 0/1 值,按上述顺序表示真假或非空。- 每条输入产生一个 UTF-8 JSON 对象行。字段固定为 rc、read、normalized、help、slots、totals、ledger。read 为 R 的读数,否则 null;normalized 为 N 的能力数组,否则 null;help 为 H 的五项结果,否则 null。JSON 空白不影响语义。
- slots 是按槽号排列的四项数组,每项为 [phase,generation,name,capabilities,values,pending]。capabilities 每项 [type,code,lower,upper];pending 每项 [type,code,value]。totals 依次为 allocations、releases、configurations、registrations、unregistrations、reports、frames、committed_events。ledger 每项 [serial,slot,generation,events],events 使用与 pending 相同格式。数组顺序属于输出合同。
- 观察包含每次操作后的原始状态;stdout 只包含这些 JSON 对象行,诊断可写 stderr。控制台实现为公开调用示例,正式验收也使用独立的原始观察器调用相同 API;不会依赖候选控制台来判定正确。