amos 8b7616bfd8 Batch 22 (20261027-C-hwe-hard-22): add 63 calibrated HWE hard-design tasks
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>
2026-10-27 16:14:57 +08:00

2.2 KiB
Raw Permalink Blame History

控制台协议

  1. 输入为 ASCII 文本,每行一条命令,LF 结束;最后一行可无 LF。分词只使用空格和水平 TAB。命令名大小写敏感,名称无空格。空行、未知命令、参数数量错误或非法整数返回 rc=-9,服务不变;读取继续,EOF 退出 0。每行最多 65536 字节,超出返回 -9。整数词法为可选单个 + 或 - 后接至少一个 ASCII 数字,前导零合法,值须在有符号 32 位范围内。
  2. 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。
  3. 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 值,按上述顺序表示真假或非空。
  4. 每条输入产生一个 UTF-8 JSON 对象行。字段固定为 rc、read、normalized、help、slots、totals、ledger。read 为 R 的读数,否则 null;normalized 为 N 的能力数组,否则 null;help 为 H 的五项结果,否则 null。JSON 空白不影响语义。
  5. 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 相同格式。数组顺序属于输出合同。
  6. 观察包含每次操作后的原始状态;stdout 只包含这些 JSON 对象行,诊断可写 stderr。控制台实现为公开调用示例,正式验收也使用独立的原始观察器调用相同 API;不会依赖候选控制台来判定正确。