Skip to content

Add VLA & Decision models (as expert models) support - #61

Merged
wangxingjun778 merged 10 commits into
mainfrom
feat/vla_adapt
Nov 29, 2026
Merged

wangxingjun778 merged 10 commits into
mainfrom
feat/vla_adapt

Conversation

@wangxingjun778

@wangxingjun778 wangxingjun778 commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Features

Read-only model specialists as a first-class capability

  • New llm/services/ package: fail-closed declaration admission (config.py), immutable protocol values (protocol.py), strict JSON result codec (codec.py), bounded single-origin HTTP client (http_client.py), generation-pinned stateless runtime (runtime.py), and per-caller inference telemetry (telemetry.py).
  • model_service transport + backend: provider: an already-served model becomes an HCP device with one declaration; no per-model Python integration.
  • New tools: config_model_service (show/set/enable/disable/unset/check, per-ID upsert, cross-process serialized writes), model_describe, model_query, model_query_batch; exposed through an optional plugin so an empty catalog stays byte-identical.
  • leap config llm services … and /config llm services share one implementation, including permissions, revoke, and a bounded local-only --case fixture check.

Consent, permissions and revocation

  • Approval grants carry a binding (declaration + resolved destination) and are revalidated against a revision before write (put_if_current), preventing stale consent from resurrecting after revocation.
  • Scoped permission listing and revoke for model services; disable keeps discovery but refuses calls and revokes prior handles.
  • Sensitive-payload disclosure (method, processing_location, service_id) now participates in the action digest; session-scoped approval bypass replaces a daemon-wide bypass.

Passive evidence, without new capture authority

  • perceive.clip builtin skill + hardware/skills/clips.py: bounded temporal evidence encoded from existing camera/episode seams, owner-port split (builtin_clip entry point).
  • snapshot_evidence.py: opt-in, caller-owned retention of an already-shared snapshot — checksum-bound, per-session quota, no eviction, opaque session artifact IDs only.
  • calib.grasp_evidence skill (HardwareTaskContract diagnostics) plus grasp.install reuse_from and identical-evidence no-op.

Calibration and execution recipes

  • calib.ball: carried-ball hand-eye calibration with radius-seeded sphere fitting, dual-radius sanity check, and full ring/scale planning in camera_calibration (v1.3.0).
  • relocation_recipe.py + recipe_plugin.py + hardware_relocation example SKILL: pure-recipe, three-mode (service/native/supplied) task family built on existing governed skills; default-off and reversible.

ToolInvoker port for composite tools

  • New domain/tool_invoker.py + engine/tools/tool_invoker.py: a tool runs its declared x_leapflow["child_tools"] only through ordinary dispatch, keeping validation, ledger, approval, permits and freshness checks — no parallel mutation path.

Demand-driven tool admission (PCD)

  • agent.admission_policy: demand_driven|legacy with capability manifests, manifest-declared bootstrap tools, and CORE/EXPANDED/FULL disclosure where execution schemas default to on-demand.

Child session engines

  • session_factory.build_child_session_engine: subagents and concurrent children get fresh working memory, compressor config, guardrails and ledger while sharing stateless services; only inference cost merges back.

Enhancements

  • Tool result budgeting: tools may declare an atomic _context_fields view that is selected before any lossy shaping; failure/effect metadata always survives.
  • Usage telemetry: streaming and non-streaming provider paths report through ProviderAttempt; OpenAI/Anthropic usage extraction is contained so telemetry never fails a turn; cached-token shapes preserved.
  • Provider lifecycle: AsyncCloseableProvider, idempotent shielded aclose(), isolated instance construction with per-provider revisions.
  • Memory scoping: workspace/session isolation enforced on retrieval; mandatory_context() admits only preference/safety sections; sync_turn stores the answer as conversation, never as a verified fact.
  • Context focus: earlier task resources are labelled historical candidates, explicitly not resolved references.
  • Hardware runtime: reach-envelope timeout memo, node verification feedback bounded to 8 records, replay_report() counts expanded samples with scope/epoch-aware loss accounting, grasp verdict depth/size guards.
  • Piper: execution budget derived from the approved plan's max_duration_s; one-shot firmware drive-latch clear inside an approved enable; release/re-enable fault gating reworked.
  • Resource bounds: per-instance DuckDB memory_limit/threads, monitor finding retention (max_age_s, max_per_watch) with durable notification checkpoints, lossless compact raw segments with workspace quota, off-loop focus polling with backoff.
  • Config plane: cross-process config_transaction, new settings (db.*, hardware.raw_quota_mb, hardware.snapshot_evidence, monitor.findings_*, observer.focus_*), llm.services restricted to the profile layer, startup and runtime reload share one decoder.
  • TUI: input sizing/IME safety rework, content-sized draft viewport, render-guard invalidation.

Refactors

  • Engine loop: turn finalization moved to SessionPersistence, child-frame install/cleanup, single OutputSink path with fewer AgentEngine inline responsibilities.
  • hardware/transports/model_service.py rebuilt on llm/services (−134 lines) with the SDK wire shape isolated in _model_http/_model_provider.
  • Tool dispatch decomposed (tool_invoker, tool_attachments, invocation-scoped admission overlay).
  • reference_resolver reduced to a historical-candidate lookup (−37 lines); daemon/session and session registry delegate to the shared factory.

Fixes

  • TUI crash on input/render-guard path.
  • Decision-model behaviour on real tasks.
  • Over-strict grasp/reach policy that blocked valid real-machine actions.
  • Local defects are classified by exception type as internal_defect before the provider taxonomy (unified classifier).
  • DuckDB "different configuration" lock is treated as in-use, never routed to repair.
  • Dashboard renders the newest complete finding instead of a partial sibling payload.
  • Hardware CLI now reports why a declaration was rejected (rule, detail, remedy) instead of "missing".

Docs

  • README.md: model specialists, consent/revocation, snapshot evidence, relocation workflow.
  • docs/plugins/: plugin lifecycle (specialist service lifecycle, demand-driven admission and cache integrity), hardware init calibration (+98), third-party plugin development (+207).
  • AGENTS.md: new mandatory TUI draft-overflow and IME-safety contract.
  • New src/leapcalib/README.md; new hardware_relocation example skill doc.

Tests

  • 14 new modules: model services/tools/consent/onboarding/batch/provider backend, tool invoker, perceive clip, snapshot evidence, relocation recipe, carried ball, calibration board, resource optimizations.
  • New tests/_harness/media_replay.py; 464 refreshed journey cassettes.

Bind reusable consent to declarations and destinations, unify owned-evidence approval, expose scoped permissions and revocation, and prevent stale consent writes after revocation.
…e contracts

- llm/services: typed task admission (contracts), immutable per-caller
  telemetry records, and provider/runtime/codec wiring for them
- hardware: passive bounded clip skill behind an owner port (new builtin
  entry point), conservative grasp installation preparation, hardware-owned
  query contracts, and frames/readiness/snapshot evidence updates
- engine: streaming usage telemetry, result budget, session factory and
  learning bridge updates
- tools: model service/tools telemetry and fixture alignment
- tests: media replay harness, refreshed journey cassettes and expanded
  coverage for contracts, telemetry, clips and dispatch
- docs: plugin lifecycle and third-party plugin development refresh
…s compact raw readings, off-loop focus polling
@wangxingjun778 wangxingjun778 changed the title Feat/vla adapt Add VLA & Decision models (as expert models) support Nov 29, 2026
@wangxingjun778
wangxingjun778 merged commit d93e0ef into main Nov 29, 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