Repository navigation
Conversation
- _runtime/_observations: mirror the browser keyboardCommands.ts magnitude-axis semantics in the local runner (magnitude axes rest at zero, keys command +/- the parameter value clamped to the axis range; cruise axes keep the explicit neutral-input guard) - sdk/_robot (synced mirror): commands waypoint now combines with constant axes (tracker pins them via cmdMin/cmdMax), docs updated Co-Authored-By: Claude Code <noreply@anthropic.com>
…d mirror) pyodide file-rule handlers write config/*.yaml with json.dumps (no PyYAML there); the TS end reads those as YAML 1.2, so the local parser must accept a flow-mapping root as well. Co-Authored-By: Claude Code <noreply@anthropic.com>
- new docs/project-setup.md: step-by-step CLI-side project scaffold (skeleton, assets, presets, declarations, three-section controller) - README: config/ file-split layout, PolicyController(robot, target=) signature, setup guide links - hatch_build: require project-setup.md in wheel docs Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
代码审核
发现 3 个需要核查的问题,按影响从重到轻列出。
1. 【中风险】负轴索引被静默当作负索引,绑定到错误轴
位置:src/botlab/_runtime/_observations.py:1662–1671
- 触发:
commandBindings写出负数或浮点轴,例如-1或1.7;_magnitude_binding_index只校验index >= dim,随后用int(key)直接截断/保留符号。 - 影响:
-1通过校验后被当作 Python 负索引命中最后一维,1.7静默变成 1,幅值轴被错误绑定,配置错误没有在编译期报错。 - **建议:**对数值 key 同时校验
0 <= index < dim且要求整数(或显式拒绝 float/负数),并补一个负索引与浮点 key 的失败用例。
2. 【中风险】缺 cmdMin/cmdMax 时按幅值键会直接抛异常
位置:src/botlab/_runtime/_observations.py:1689–1707
- **触发:**项目声明了
magnitude幅值轴但 plan 未带cmdMin/cmdMax(或长度不足),_magnitude_axis_flags只校验 dim,_apply_magnitude_axes里minimum[index]取到None。 - **影响:**一旦按下 increase/decrease 键,运行期抛 TypeError/IndexError,而不是给出可读的声明错误;未按键时不复现,问题延后暴露。
- **建议:**在读取 flags 时一并校验
cmdMin/cmdMax为等长数值序列并报带节点名的错误;需人工确认 plan 是否在所有幅值轴场景都输出该 bounds 向量。
3. 【低风险】同时含幅值轴与巡航轴时,巡航按键被静默忽略
位置:src/botlab/_runtime/_observations.py:1733–1741
- **触发:**项目既有
magnitude轴又有普通巡航轴,然后按下巡航轴按键;只要any(flags)成立就跳过中性输入护栏。 - **影响:**本应因“巡航轴按键推进无本地实现”而显式失败的场景改为静默不生效,用户看到按键无效且无提示。
- **建议:**把护栏拆成只针对未实现推进的巡航轴检查,例如对非幅值且被绑定的轴按键时报错,而不是整体跳过。
仅检查代码安全和技术缺陷;业务判断由负责人负责。本次未运行测试。
审核范围与依据
- 审核提交:
eecead7b05793f729939766d1b7eee65d52751d0 - 配置版本:
v1 - 团队规则:enkeebot-dev · 2304177fb38a
- 已加载:
SKILL.md、references/projects/botlab-python.md、references/environment.md、references/architecture.md - 部分规则仅加载了摘录,未加载的部分未作核对。
- 根据提供的文本差异审核,未读取完整仓库。
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.
What's shipping (main..dev, 3 commits)
9dd9b09feat: keyboard magnitude axes and waypoint constant-axis support2a3986dfeat: restricted YAML parser accepts JSON-root documents (synced mirror with BotLab)eecead7docs: project setup guide (docs/project-setup.md), README scaffold refresh, wheel doc manifestNotes
src/botlab/sdk/) is byte-identical with BotLab truth sourcesrc/domain/python/botlab/— only_runtimediffers (native runner owned by this repo, never mirrored). No pending sync from BotLabdev.config/file-split layout,PolicyController(robot, target=)signature, and legacy root-level*.preset.yamlread-compatibility.Testing
ruff check .— All checks passed (exit 0).venv/bin/python -m pytest tests -x -q --ignore=tests/e2e— exit 0 (one pre-existing overflow RuntimeWarning in test_processors_math)tests/e2enot run locally (needs browser runtime); CI covers ithatch_build._REQUIRED_DOCS) satisfied — all five docs including project-setup.md are committed