停点规划:ask·pause 起停点,solve 按停点决策续跑 - #75
Merged
Merged
Conversation
生成程序在需要「先看结果再决定下一步」时调用 byteseek/ask·pause(reason):本 vthread 就地置 paused,控制权交回 harness。solve 见 kind=paused 就用 kvlang·printstack 取 活动栈问 LLM,把 LLM 生成的一段程序写进 /byteseek/next/fn,再把该 vthread 置回 running——ask·pause 恢复后就地 vthread·call 那段程序,跑完回到原函数继续。 停点是显式的、栈是交给 LLM 的事实:这比让模型内联调 LLM 更可复盘——决策与当时 的栈都留在轨迹里。 - main·run 改开子 vthread,返回 (kind, detail, vid);终态判定抽成 classify (error→runtime / paused→paused / 其余看 /byteseek/last/result) - 新增 main·resume(vid, fn);重试上限 3 → 4 轮,paused 不吃重试 - llm 生成函数名唯一化:同名会覆盖已入库的函数树,而暂停中的帧还指着它 - prompt 增「停点由你自己规划」硬规则 + 示例3/4(该停 vs 程序自己能判断就别停) - 工具清单登记 byteseek.ask.pause;doc/substrate.md 同步(dump → printlib) - selftest 增停点/取栈/恢复/标记断言;tests/stopplan.sh:真实 LLM 停点回归 (确定性任务期望 0 停点,需语义判断的期望 ≥1) Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #69(函数执行脑的最小落点)
做什么
生成程序在需要「先看结果再决定下一步」时调用
byteseek/ask·pause(reason):本vthread 就地置
paused,控制权交回 harness。solve见kind=paused就用kvlang·printstack取活动栈问 LLM,把 LLM 生成的一段程序写进/byteseek/next/fn,再把该 vthread 置回
running——ask·pause恢复后就地vthread·call那段程序,跑完回到原函数继续。
停点是显式的,栈是交给 LLM 的事实:这比让模型内联调 LLM 更可复盘——决策与
当时的栈都留在轨迹里。
改动
main·run改开子 vthread,返回(kind, detail, vid);终态判定抽成classify(
error→runtime /paused→paused / 其余看/byteseek/last/result)main·resume(vid, fn);重试上限 3 → 4 轮,paused不吃重试llm生成函数名唯一化:同名会覆盖已入库的函数树,而暂停中的帧还指着它prompt增「停点由你自己规划」硬规则 + 示例 3/4(该停 vs 程序自己就能判断就别停)byteseek.ask.pause;doc/substrate.md同步(dump→printlib)tests/selftest.kv增停点/取栈/恢复/标记断言tests/stopplan.sh:真实 LLM 的停点回归——确定性任务期望 0 次停点,需要语义判断的期望 ≥1 次
依赖
需要 kvlang 的
kvlang·printstack(array2d/kvlang#348,已合入 master)。验证
make test KVSPACE=fs:///tmp/bs_test:✅ selftest 通过+✅ repl 冒烟通过,含新增的
PAUSED: paused/STACK: true/RESUMED: ok/MARKERS: 1 1tests/stopplan.sh需真实 LLM,未在本 pod 跑(用例已就位)🤖 Generated with Claude Code