amos 73a5240295 Batches 21 and 18: add 74 calibrated tasks (40 Bos redo, 34 HWE code-gen)
Batch 21 (20261027-A-bos-redo-21) rebuilt 40 of the 53 rejected Bos-qiao
environments: hidden assertions that ran inside the candidate's process
now run in a trusted parent that reads observations from a low-UID
worker; gold bytes are unchanged. 9 were excluded for scope (ROS2,
oversize, security core), 3 are blocked because the source requires an
exec bit the platform does not freeze, 1 lacks requests/bs4 in trace6.

Batch 18 (20261026-C-hwe-codegen-18) adds its last 34 of 134 tasks; the
first 100 landed in 2f32624d.

Claude reviewed 74/74 USABLE against current digests, canonical
families, no ID or source overlap with main, plain public docs. Only the
new task directories are taken; the stale pre-batch-20 copies of
concur-release-capsule and resource-temp-link on the batch 21 branch and
both branches' progress notes stay as main has them. Difficulty is
unmeasured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:23:12 +08:00

4.3 KiB
Raw Permalink Blame History

调用帧软件合同

  1. Machine是彼此独立的对象。构造时活动栈为空、8个上下文槽为vacant,下次帧token为1。只进行逻辑转换,不调用真实setjmp/longjmp或操作真实栈。
  2. Code的数值为OK0、RANGE1、EXISTS2、FULL3、EMPTY4、MISSING5、VACANT6、STALE7。所有失败操作不改任何状态,Reply失败时value为-1。除列出的变化外,每个操作保持其他字段。
  3. frame id范围0..31,local范围-1000..1000,slot及帧index范围0..7,jump value范围-128..128。每个数参都是int,域外值返回RANGE。多个数参均先检查范围,再执行下述条件。
  4. enter(id,local)先检查活动栈是否已有id并返回EXISTS,再在深度8时返回FULL。成功在栈尾增加帧,id/local取输入、returned为0,token取下次token再递增,Reply.value为新深度。弹出后可以复用id,但token不复用。
  5. leave()在空栈返回EMPTY。成功弹出栈尾帧,所有仍live且owner token与弹出帧相同的槽变stale,槽的其余字段保持,Reply.value为弹出id。
  6. store(id,local)在活动栈无此id时返回MISSING,否则只更新该帧local,Reply.value为更新前local。可以更新非栈顶帧。
  7. save(slot)在空栈返回EMPTY。成功覆盖此槽为live,owner为栈顶id、token为栈顶token、resumes为0,并把栈顶returned设为0,Reply.value为0。此前槽为vacant、live或stale均可覆盖。
  8. jump(slot,value)先在vacant槽返回VACANT,再在stale槽返回STALE。成功保留owner帧与所有祖先,弹出其后帧,所弹帧拥有的live槽变stale,槽的其他字段保持。owner的local及token保持,returned取value,value为0时returned取1;被使用槽resumes加1,其他槽resumes不变。Reply.value为owner新的returned。跳到栈顶也执行这些转换。
  9. clear(slot)把槽恢复构造时的vacant字段,并返回该槽先前state作为Reply.value;不改变帧。state为vacant0、live1、stale2;vacant槽owner为-1、token为0、resumes为0。
  10. frame(index)按根帧到栈顶的0起算位置返回FrameView,活动帧code为OK并逐字段给出id/local/returned/token。合法位置未占用时code为EMPTY。top()独立返回栈顶视图,空时code为EMPTY。所有失败FrameView除code外均为id=-1/local=0/returned=0/token=0。depth()返回活动帧数。
  11. context(slot)返回ContextView,合法slot的code为OK并给出state/owner/token/resumes。域外slot的code为RANGE,其余字段为构造时vacant值。查询不改变任何状态。
  12. run_cli(Machine&,istream&,ostream&)在传入对象上执行,可在同进程重复调用,每次独立计lines/errors/limited。CliReply不影响对象寿命,接口不要求Machine可复制、移动或赋值。
  13. 每条physical line是一条指令,LF分行,最后无LF的非空行也处理。只用ASCII空格及TAB分词,大小写敏感。整数token由可选负号和至少1个十进制数字组成,允许前导零与-0,不接受正号、CR、其他字符或int域外数字。
  14. 指令及参数数为ENTER id local、STORE id local、JUMP slot value、SAVE slot、CLEAR slot、FRAME index、CONTEXT slot、LEAVE、TOP、DEPTH。空行、未知词、参数数不符、坏数字均输出SYNTAX加LF,不调用API,不改对象。语法有效后调用相应API。
  15. Reply输出R code value;FrameView输出F code id local returned token;ContextView输出C code state owner token resumes;DEPTH输出D depth。字段用一个ASCII空格隔开,每条末尾一个LF;所有整数为普通十进制,不带正号、前导零或分组,不受输出流当前flags、width、fill、locale影响。查询按返回原始字段输出,不合并失败类型。
  16. 每次最多处理64条physical lines,处理时lines增加,包括语法与API错误;第65条出现时输出LIMIT加LF并设置limited=true,不执行它或之后的指令。只有64条时limited=false。errors是这64条以内SYNTAX行与API code非OK行的合计,LIMIT不计errors;DEPTH无错误。初始三个字段为0、0、false。
  17. 公开jump-demo从stdin调用一次run_cli,空stdin无stdout,始终exit0。所有程序输出应严格匹配上述bytes,所有场景stderr为空。模型与CLI应允许多次查询、失效槽重复操作、相同ID的新生命期与多个Machine同时交错使用。