Skip to content

docs: align set_goal docs with append semantics (W-405) - #4

Merged
AndPuQing merged 1 commit into
mainfrom
agent/leo3/aaba28d0b0de
Aug 25, 2026
Merged

AndPuQing merged 1 commit into
mainfrom
agent/leo3/aaba28d0b0de

Conversation

@AndPuQing

Copy link
Copy Markdown
Contributor

目标

W-405:set_goal 文档与实际语义对齐(append 语义,修误导性文档),不改运行时行为。

改动

  1. src/lib.rs set_goal rustdoc:「Returns state 0」→「创建新的 root goal state(不影响已有 state),返回该 state 的 id(新会话首次调用为 0)」。
  2. python/leotower/__init__.py set_goal docstring:同步修改。
  3. README API 表 Repl.set_goal 行:同步修改。
  4. tests/test_repl.py:新增回归测试 test_set_goal_appends_independent_root_states — 同一会话连续两次 set_goal 分别返回 0 与 1,两个 root state 的 goal 相互独立(证明其中一个不影响另一个),第三次 set_goal(中间夹了一次 run_tac)正确返回 3。

测试

  • cargo fmt -- --check ✓
  • cargo clippy -- -D warnings ✓
  • uv run pytest ✓(64 passed, 1 skipped — Mathlib 环境缺失的既有 skip)

评审已通过(Leo3 Reviewer,见 W-405 评论)。

set_goal appends a new root state per call and returns its id (0 on the
first call in a fresh session) — it does not reset to state 0. Unify the
misleading 'returns state 0' wording across the Rust docstring, the
Python docstring, and the README API table, and add a regression test
covering two consecutive set_goal calls and the independence of the
resulting root states. No runtime behavior change.
@AndPuQing
AndPuQing merged commit c65c348 into main Aug 25, 2026
@AndPuQing
AndPuQing deleted the agent/leo3/aaba28d0b0de branch August 25, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant