@lmmslab/harness 0.85.0 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/python/harness/__init__.py +2 -2
  4. package/python/harness/bench.py +2 -2
  5. package/python/harness/builtin/benches/README.md +1 -2
  6. package/python/harness/builtin/configs/default.toml +4 -19
  7. package/python/harness/builtin/configs/deploy/example-api.toml +1 -1
  8. package/python/harness/builtin/configs/models/deepseek-flash.toml +1 -1
  9. package/python/harness/builtin/configs/models/grok-low.toml +1 -1
  10. package/python/harness/builtin/configs/models/grok-medium.toml +3 -6
  11. package/python/harness/builtin/environment/README.md +8 -25
  12. package/python/harness/builtin/prompts/conversation/core.md +6 -5
  13. package/python/harness/builtin/prompts/core/core.md +147 -203
  14. package/python/harness/builtin/prompts/core/pack.toml +0 -1
  15. package/python/harness/builtin/prompts/reflect/core.md +8 -32
  16. package/python/harness/builtin/prompts/reflect/pack.toml +2 -4
  17. package/python/harness/builtin/prompts/shared/agent-skills.md +5 -3
  18. package/python/harness/builtin/prompts/shared/agents.md +20 -10
  19. package/python/harness/builtin/prompts/shared/checklist.md +13 -17
  20. package/python/harness/builtin/prompts/shared/environments.md +20 -15
  21. package/python/harness/builtin/prompts/shared/learning-goal.md +2 -3
  22. package/python/harness/builtin/prompts/shared/learning.md +73 -23
  23. package/python/harness/builtin/prompts/shared/mcp.md +11 -6
  24. package/python/harness/builtin/prompts/shared/reflex-method.md +243 -0
  25. package/python/harness/builtin/prompts/shared/units.md +138 -0
  26. package/python/harness/builtin/prompts/shared/web.md +5 -6
  27. package/python/harness/builtin/skills/agents/__init__.py +18 -3
  28. package/python/harness/builtin/skills/agents/skill.toml +3 -3
  29. package/python/harness/builtin/skills/checklist/__init__.py +34 -32
  30. package/python/harness/builtin/skills/checklist/skill.toml +9 -9
  31. package/python/harness/builtin/skills/environments/__init__.py +9 -5
  32. package/python/harness/builtin/skills/environments/skill.toml +1 -1
  33. package/python/harness/builtin/skills/experience/skill.toml +1 -1
  34. package/python/harness/builtin/skills/learning/__init__.py +19 -5
  35. package/python/harness/builtin/skills/mcp/skill.toml +1 -1
  36. package/python/harness/builtin/skills/memory/__init__.py +4 -1
  37. package/python/harness/builtin/skills/memory/skill.toml +0 -5
  38. package/python/harness/builtin/skills/verify/skill.toml +1 -0
  39. package/python/harness/builtin/skills/web/__init__.py +4 -1
  40. package/python/harness/builtin/third_party/sources.toml +2 -40
  41. package/python/harness/cli.py +16 -25
  42. package/python/harness/config/__init__.py +2 -2
  43. package/python/harness/config/agent.py +59 -47
  44. package/python/harness/core/__init__.py +1 -1
  45. package/python/harness/core/codec.py +4 -4
  46. package/python/harness/core/contracts.py +1 -1
  47. package/python/harness/core/media.py +1 -1
  48. package/python/harness/core/ports.py +2 -2
  49. package/python/harness/core/procs.py +1 -1
  50. package/python/harness/core/remote.py +1 -1
  51. package/python/harness/core/worker.py +19 -13
  52. package/python/harness/embodiments.py +53 -44
  53. package/python/harness/extensions.py +22 -0
  54. package/python/harness/host/__init__.py +1 -1
  55. package/python/harness/host/http.py +6 -12
  56. package/python/harness/host/sessions.py +1 -1
  57. package/python/harness/host/tasks.py +15 -11
  58. package/python/harness/host/workspaces.py +36 -8
  59. package/python/harness/packages/__init__.py +5 -5
  60. package/python/harness/packages/environments.py +30 -18
  61. package/python/harness/packages/manager.py +1 -1
  62. package/python/harness/packages/manifest.py +6 -6
  63. package/python/harness/packages/provision.py +1 -1
  64. package/python/harness/packages/sources.py +1 -1
  65. package/python/harness/paths.py +1 -1
  66. package/python/harness/runtime/decision/loop.py +95 -5
  67. package/python/harness/runtime/decision/messages.py +128 -2
  68. package/python/harness/runtime/decision/model.py +4 -5
  69. package/python/harness/runtime/decision/prompts.py +20 -32
  70. package/python/harness/runtime/events.py +7 -5
  71. package/python/harness/runtime/execution/attached.py +3 -3
  72. package/python/harness/runtime/execution/entries.py +189 -8
  73. package/python/harness/runtime/execution/kernel.py +26 -1
  74. package/python/harness/runtime/execution/results.py +2 -3
  75. package/python/harness/runtime/execution/session.py +417 -32
  76. package/python/harness/runtime/execution/skills.py +63 -16
  77. package/python/harness/runtime/learning/active.py +7 -7
  78. package/python/harness/runtime/learning/learner.py +3 -2
  79. package/python/harness/runtime/learning/library.py +9 -4
  80. package/python/harness/runtime/learning/reflect.py +10 -9
  81. package/python/harness/runtime/reactive/rules.py +4 -4
  82. package/python/harness/runtime/reactive/tree.py +506 -25
  83. package/python/harness/runtime/safety/input.py +1 -1
  84. package/python/harness/runtime/safety/isolation.py +3 -3
  85. package/python/harness/runtime/safety/shield.py +4 -50
  86. package/python/harness/runtime/task/delegation.py +5 -5
  87. package/python/harness/runtime/task/environments.py +10 -0
  88. package/python/harness/runtime/task/run.py +222 -27
  89. package/python/harness/runtime/tick.py +24 -1
  90. package/python/harness/sdk/__init__.py +2 -5
  91. package/python/harness/services/registry.py +23 -19
  92. package/python/harness/settings.py +9 -9
  93. package/python/harness/builtin/environment/constraints.txt +0 -31
  94. package/python/harness/builtin/prompts/shared/world.md +0 -1
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  <p align="center">
16
16
  <a href="https://www.npmjs.com/package/@lmmslab/harness"><img alt="npm version" src="https://img.shields.io/npm/v/@lmmslab/harness?cacheSeconds=3600&amp;style=flat-square&amp;labelColor=112332&amp;color=087f9c" /></a>
17
17
  <a href="https://pypi.org/project/the-harness/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/the-harness?cacheSeconds=3600&amp;style=flat-square&amp;labelColor=112332&amp;color=087f9c" /></a>
18
- <a href="https://discord.gg/zhkzEznBs"><img alt="Discord community" src="https://img.shields.io/badge/discord-community-bc276e?style=flat-square&amp;logo=discord&amp;logoColor=white&amp;labelColor=112332" /></a>
18
+ <a href="https://discord.gg/JbxU88aZyZ"><img alt="Discord community" src="https://img.shields.io/badge/discord-community-bc276e?style=flat-square&amp;logo=discord&amp;logoColor=white&amp;labelColor=112332" /></a>
19
19
  </p>
20
20
 
21
21
  Tell an agent what to do in your own words. A language model plans and writes short programs; The Harness runs them in an environment the agent can see and act in. Watch, send a message, or take over at any time.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lmmslab/harness",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "description": "Automatic Control for intelligence in action",
5
5
  "license": "MIT",
6
6
  "homepage": "https://harness.lmms-lab.com",
@@ -1,8 +1,8 @@
1
- """The Harness: a coding agent as a generalist robot policy. No simulator imports here."""
1
+ """The Harness: an agent that acts by writing programs, in any environment. It imports no environment's code."""
2
2
 
3
3
  # The one version: the core's. A lock records it with the versions of the packages that
4
4
  # ran and the hash of the whole lock (the agent's identity, config/agent.py).
5
- __version__ = "0.85.0"
5
+ __version__ = "0.86.0"
6
6
 
7
7
  # A checkout's packages import beside the harness (paths.py).
8
8
  from . import paths as _paths # noqa: E402,F401
@@ -6,7 +6,7 @@ A bench is a package's `benches/<name>/` with
6
6
  factory and the [worker] keys it takes, its [environment] and [sandbox]
7
7
  bench.py its hooks (BENCH_KEYS `hooks`, a subclass of the eval package's Bench)
8
8
 
9
- The core reads what starts a worker (bench_specs): the computer's workspaces start a
9
+ The core reads what starts a worker (bench_specs): a package's workspaces start a
10
10
  bench's worker from it, the session host knows a bench's embodiment kind from it, active
11
11
  learning its sandbox, `harness install` its environment. Running a bench as a benchmark
12
12
  (its tasks, the keys of a deploy's [benches.<name>] table, its checkout and assets) is the
@@ -14,7 +14,7 @@ eval package's: those keys of bench.toml stay in BenchSpec.benchmark, which the
14
14
  package reads and checks (harness_eval/bench.py), with the hooks.
15
15
 
16
16
  Adding a bench touches none of the code that reads it. A bench's hooks import only the standard library and their own package's light modules at import;
17
- the simulator, the VM and the benchmark's code stay in the worker process.
17
+ the environment and the benchmark's code stay in the worker process.
18
18
  """
19
19
 
20
20
  from dataclasses import dataclass, field
@@ -1,5 +1,4 @@
1
1
  # Benches
2
2
 
3
- The benchmarks are packages: `packages/<name>/benches/<name>/` (robodojo, robotwin, osworld,
4
- osomni, computer, browser, minecraft, gamescientist, fakegame in game). This folder stays so
3
+ The benchmarks are packages: `packages/<name>/benches/<name>/`. This folder stays so
5
4
  that each package adds its own `benches.<name>` beside the others.
@@ -1,9 +1,8 @@
1
- # The agent: what `harness run` runs unless an experiment or --agent names another (a
2
- # package's profile: configs/profiles/<name>.toml, e.g. robodojo). Generic: the page every
3
- # agent reads, the prompt of the kind's package (a computer's, a game's), the skills of the
4
- # packages a run uses, the success verifier.
1
+ # The agent: what `harness run` runs unless an experiment or --agent names another. It holds
2
+ # what is the same for every kind of environment. A kind's prompt and the agent's settings
3
+ # on it are its package's (kinds.toml: prompt, agent); without one, the prompt is the page
4
+ # every agent reads (prompts/core).
5
5
  description = "The Harness: programs over the skills of the packages a task uses"
6
- prompt = { robot = "../prompts/core", desktop = "../prompts/computer", game = "../prompts/game" }
7
6
  # The model roles (configs/models/<name>.toml); an experiment's `model` or --model NAME
8
7
  # picks another.
9
8
  model = "deepseek-flash"
@@ -17,17 +16,3 @@ isolation = "auto"
17
16
 
18
17
  [budget]
19
18
  max_model_calls = 60
20
-
21
- # A computer: its state every turn; the screen when a program looks (look, watch).
22
- [desktop]
23
- runtime = { contract = "screenshot", strategy_first = false }
24
- budget = { max_model_calls = 60 }
25
-
26
- # A game: its window when a program looks (the model turns watch() on itself) and eight
27
- # exchanges; the game keeps running while rules and programs handle changes. Unresolved
28
- # events can ask the model.
29
- [game]
30
- knowledge = "learned"
31
- skills = { enable = ["vision"] }
32
- runtime = { contract = "native", strategy_first = false, compact_at_tokens = 150000, clear_results_after_minutes = 60, thinking = "low", max_wait_seconds = 30 }
33
- budget = { max_model_calls = 5000 }
@@ -1,4 +1,4 @@
1
- # No GPU for models: only the simulator runs here, every model is hosted (the main and
1
+ # No GPU for models: only the environment runs here, every model is hosted (the main and
2
2
  # vlm roles). Without a segmenter, segmentation and the tools built on it (locate, pick,
3
3
  # release, ...) drop out of runs on this machine, and without a policy server the
4
4
  # learned skills: a smaller configuration with another identity.
@@ -1,5 +1,5 @@
1
1
  # DeepSeek V4.1 Flash writes the programs: the development model, at medium reasoning
2
- # effort for a few cents per RoboDojo episode.
2
+ # effort.
3
3
  description = "DeepSeek V4.1 Flash writes programs, answers questions about images and points; Molmo2 for a pointer role"
4
4
  include = ["grok-medium.toml"]
5
5
 
@@ -1,6 +1,6 @@
1
1
  # grok-4.7 at low reasoning effort, for development. At medium effort xAI streams no
2
2
  # reasoning, and OpenRouter cuts a request after about 5 minutes with nothing received:
3
- # long replies are lost. Low effort answers in 13-60 s (about $0.11 per RoboDojo episode).
3
+ # long replies are lost. Low effort answers in 13-60 s.
4
4
  description = "grok-4.7 (low) writes programs, answers questions about images and points; Molmo2 for a pointer role"
5
5
  include = ["grok-medium.toml"]
6
6
 
@@ -13,15 +13,12 @@ max_output_tokens = 16000
13
13
  stream = true
14
14
  timeout_seconds = 120
15
15
  # Completions have no side effects; retry dropped connections and rate limits for up to
16
- # 30 minutes (the simulator waits while the model is called).
16
+ # 30 minutes (the environment waits while the model is called).
17
17
  retries = 3
18
18
  retry_seconds = 1800
19
19
 
20
- # Questions about images inside programs (query_vlm, holding() without a measured
21
- # gripper, pointing when there is no pointer) go to the main model itself: one model
22
- # sees the task and the images, as in Z2_v01, instead of a second, weaker model
23
- # answering for it (1.1.0 asked qwen3.8-flash, whose answers about what an object is
24
- # changed from one question to the next).
20
+ # Questions about images inside programs go to the main model itself: one model sees the
21
+ # task and the images, instead of a second, weaker model answering for it.
25
22
  [vlm]
26
23
  backend = "openrouter"
27
24
  model = "x-ai/grok-4.7"
@@ -8,22 +8,13 @@ own under `~/.cache/harness/envs/` (`HARNESS_HOME` moves it), built from the
8
8
  `[environment]` table of its manifest (`services/<name>.toml`,
9
9
  `benches/<name>/bench.toml`).
10
10
 
11
- This folder holds the pinned core (`constraints.txt`: the browser benchmark's
12
- environment, and `install.sh` of an exported XPolicyLab policy). What the environments of
13
- services and benchmarks share is the local-models package's `environment/`:
14
-
15
- | File | Used by |
16
- |---|---|
17
- | `lock/pip-freeze.txt` | the pins every service's and benchmark's environment installs under (`constraints = "environment/lock/pip-freeze.txt"`) |
18
- | `requirements-skills.txt` | what `install.sh` of an exported XPolicyLab policy installs into RoboDojo's policy environment: the packages of the analytic and learned skills |
19
- | `cuda_toolkit.sh` | the CUDA 12.8 build toolkit cuRobo is compiled with (RoboDojo's and RoboTwin's environments) |
20
-
21
- RoboTwin's two source edits and its own cuRobo build are the robotwin package's
22
- (`environment/robotwin_edits.py`, `environment/robotwin_curobo.sh`).
23
-
24
- Every install runs under the pins, so no service or benchmark can move torch, numpy,
25
- Isaac Sim or websockets: a package that cannot be installed under them fails instead of
26
- upgrading the core. An environment's directory is named by a hash of everything that
11
+ What the environments of services and benchmarks share is in the packages that bring them
12
+ (their `environment/` folders): the pins an install respects (`constraints` in the
13
+ `[environment]` table), and whatever a package's own environment needs to build.
14
+
15
+ An install runs under the pins its table names, so it cannot move a pinned
16
+ dependency: a package that cannot be installed under them fails instead of
17
+ upgrading it. An environment's directory is named by a hash of everything that
27
18
  decides what is installed (its table and the pins, comments excluded), so changing a pin
28
19
  builds the environments that use it anew the next time a run needs them and leaves the
29
20
  others as they are.
@@ -42,12 +33,4 @@ something that uses it, and commit the manifest and the pins together.
42
33
  `HARNESS_ENVIRONMENTS=project` (or `environments = "project"` in a deploy) installs
43
34
  nothing but weights: every service and worker runs in the interpreter of the harness
44
35
  itself. It is for a machine where one environment already holds everything, not a way
45
- to install; that machine also sets what those environments would set, such as
46
- `OMNI_KIT_ACCEPT_EULA=YES` for RoboDojo's workers.
47
-
48
- ## Known deviations from upstream
49
-
50
- - `isaacsim-kernel` declares `websockets==12.0`, which only Kit's asset-search
51
- extensions use; headless simulation does not load them. XPolicyLab policy servers
52
- need the websockets 13+ asyncio API, so RoboDojo's environment overrides it with 17.1
53
- (`overrides` in `benches/robodojo/bench.toml`).
36
+ to install; that machine also sets what those environments would set.
@@ -1,5 +1,6 @@
1
- This conversation has no environment: no screen, no project folder and no browser. You
2
- have your own knowledge, the user's messages and files, plain Python in your programs,
3
- and the connected tools listed below when there are any. Answer questions directly in
4
- plain text. Do not claim to have looked at, opened or changed anything on the user's
5
- computer.
1
+ This conversation has no environment: no screen, no project folder and no browser.
2
+
3
+ - You have your own knowledge, the user's messages and files, plain Python in your
4
+ programs, and the connected tools listed below when there are any.
5
+ - Answer questions directly in plain text.
6
+ - Do not claim to have looked at, opened or changed anything on the user's computer.