Skip to content

Feature & Refactor: Batch planning and views planner - #57

Merged
wangxingjun778 merged 36 commits into
mainfrom
feat/mhs
Nov 17, 2026
Merged

wangxingjun778 merged 36 commits into
mainfrom
feat/mhs

Conversation

@wangxingjun778

Copy link
Copy Markdown
Member

Features

  • Batch node planning: new pure planning layer (hardware/skills/planning.py, runtime_planning.py) with bounded, supervised spawn workers (planning_worker.py) — one hw_skill_run call can submit complete, task-equivalent candidates; the node ranks them lexicographically and only the selected plan passes the existing approval, permit, freshness and lease gates. New settings: hardware.skills_planning_{workers,max_candidates,max_jobs,timeout_s,max_bytes,cancel_grace_s,auto_variants}.
  • Planning extension points: PreparedPlanningSkill, PlanningAlternativesSkill, PlanConfirmationSkill keep alternatives and final live confirmation inside the plugin.
  • perceive.survey skill: bounded, governed finite observation (skills/survey*.py, scene_observation.py, observability.py) with declared swept-volume clearance, support thresholds and ObservationReport evidence; never commands the gripper.
  • Observation learning (rank-only): view priors (view_priors.py, view_prior_learning.py, storage/view_prior_store.py) learned only from filtered survey signals through the shared noise pipeline, stored as bounded DuckDB trials, scoped to node/workcell, re-validated live by the node — hints reorder proposals and never grant motion or trust.
  • View planner plugin namespace: new entry point group leapflow.hardware.view_planners (ring → RingViewPlanner); proposals are pure geometry.
  • Posture-specific reach guidance: reach_envelope.py publishes per-azimuth/yaw height bands into arm.state/hw_skill_list, and motion.sequence now pre-checks reach at plan time; unreachable/out-of-workspace failures report the binding limit, reachable reach and limiting joint.
  • Hold-in-place stop contract: TransportStatus.stop_effect (hold/output_off/device_latched/none) plus stop_verified; _piper_halt.py holds reported joints under power and releases torque only through a governed TorqueReleasePolicy; robot_arm halt returns a fresh observation instead of a zero vector and refuses when a target is unknown; ROS2 topics must declare halt_commands. hw_estop audits both fields and warns to use the physical stop when unverified.
  • Node log file: leap hw serve --log-file PATH [--verbose]; append-only, size-rotated by the node itself (hardware.node_log_{file,level,max_mb,backups}, init_node_logging).

Enhancements

  • Tool result tiers succeeded / repaired / refused / failed / skipped (engine/tools/tool_execution.result_tier), propagated to tool-result metadata, TurnUsageTracker counters and plugin trust (plugin_stats.trust_verdict) — a correct refusal or self-repair no longer demotes a tool.
  • hw_skill_run argument repair (skill_arguments.py): envelope fields are lifted out of args only when the skill's args_schema does not declare them; new failure_class: invalid_request with parameter-specific next steps.
  • TUI audit line now distinguishes ↺ self-repair and ⊘ no effect from real failures; only failures stay red.
  • Grasp diagnostics: grasp:infeasible reports measured width, gripper opening, margin and cause instead of a bare refusal.
  • Perception advisories: TTL values shorter than the S2 reasoning floor are surfaced as declarative advisories with remedies.
  • Read-only refusals explain themselves: hw_actuate/hw_batch_actuate carry admission demotions and the rules behind them.
  • LeapBoard: mounted live previews are carried across board re-renders (findings, watch transitions, resync), stopped only when the new spec drops them, and disposed on view error.
  • Config surface: descriptions for every new setting; config_list/config_get return typed config_unknown_category failures with a next step; guardrail_argument_scoped_tools (default hw_skill_run) makes DominationGuard count distinct operations rather than raw repetition.
  • Packaging: opencv-python<5 pinned in [vision]/[robot]; LeapSpace task YAMLs shipped via a leapspace.app_space package-data glob.

Refactors

  • motion.sequence decomposed into _sequence_schema.py, _sequence_planner.py, _sequence_guards.py, _observation_gate.py, _grasp_planning.py; orchestration resolves one owner-captured snapshot.
  • Shared detached motion math in motion_geometry.py (governed commands and pure workers use the same geometry); body capsules/segment distance moved to body_visibility.py.
  • Piper driver split into _piper_link / _piper_motion / _piper_feedback / _piper_halt / _piper_envelope.
  • skill_tools / skill_results rebuilt around typed failure classes and per-skill cards (batch_planning, reach, advisories).
  • LHP: connection-scoped planning cancellation (lhp/planning_requests.py, client/server/skill methods) — pure planning is cancellable, effectful runs never are.
  • TUI: display_clock.py + install_render_guard replace the 0.5 s refresh timer (refresh_interval=None).

Fixes

  • Terminal crash / IME marked-text abort: no timer-driven repaint, redundant invalidations emit nothing; startup fails loudly if the render guard cannot be installed.
  • Long drafts no longer scroll out of their own box while a task streams (bounded cap with hidden-row hint, not a fixed single row).
  • Piper-X halt no longer releases torque or drives toward a zero posture.
  • Worker leakage: planning workers are spawn-only, deadline-bounded and disposable.
  • LeapBoard previews no longer end the user's stream on every notification.
  • hw_skill_run nested-envelope and missing-parameter refusals; config health misclassification of unknown categories.

Docs

  • AGENTS.md: mandatory halt-in-place / torque-release rule; robot_arm halt description corrected.
  • README: hw_estop reports stop_effect/stop_verified; leap hw serve --log-file usage.
  • docs/plugins/third_party_plugin_development.md: planning extension points, PlanningSettings.auto_variants, ScenePort.grasps, relocate(commit=False).
  • Version bumped to 0.8.0.

wangxingjun778 and others added 30 commits October 13, 2026 16:50
Add grouped freshness, typed health signals, optional ROS previews and native-depth encoders. Drain daemon clients during graceful shutdown and cover ownership, release, and restart paths with regression tests.
Signed-off-by: 班扬 <xingjun.wxj@alibaba-inc.com>
- Stop tracking .qoder/ (Qoder agent scratch space: build artifacts, repo snapshots and vendored wheels, ~70MB) and ignore it going forward. Local files are retained.
- Map the tooling-mislabeled "Cheney Zhang <chen.zhang@zilliz.com>" author, written by a commit skill that hardcoded --author, to the committer's real identity via .mailmap. Published history on main and the release branches is deliberately not rewritten.

Signed-off-by: wangxingjun778 <wangxingjun778@163.com>
The 18 commits whose author field was overridden by the commit skill are now rewritten in history, so the display-layer alias is dead weight.

Signed-off-by: wangxingjun778 <wangxingjun778@163.com>
@wangxingjun778
wangxingjun778 merged commit 5d4bafa into main Nov 17, 2026
1 of 2 checks passed
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