REA computer-use environment, v0.1.0
Browse files- README.md +89 -0
- bundle/README.md +38 -0
- bundle/artifacts/add-holes-check/verify.py +198 -0
- bundle/envs/librecad/SKILL.md +10 -0
- bundle/envs/librecad/env.toml +4 -0
- bundle/envs/librecad/librecad_app.py +313 -0
- bundle/envs/librecad/seed/.config/LibreCAD/LibreCAD.conf +35 -0
- bundle/envs/librecad/seed/.local/share/LibreCAD/LibreCAD/librecad.alias +100 -0
- bundle/envs/librecad/seed/Documents/plate.dxf +132 -0
- bundle/evals/librecad.toml +1 -0
- bundle/tasks/add-holes.json +9 -0
- bundle/tasks/smoke.json +7 -0
- media/hero.gif +3 -0
- media/solve-1.gif +3 -0
- media/solve-1.mp4 +3 -0
- media/solve-2.mp4 +3 -0
- media/solve-3.mp4 +3 -0
- results.json +66 -0
README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pretty_name: LibreCAD computer-use environment (REA)
|
| 4 |
+
tags:
|
| 5 |
+
- computer-use
|
| 6 |
+
- cua
|
| 7 |
+
- gui-agent
|
| 8 |
+
- rl-environment
|
| 9 |
+
- agentenv
|
| 10 |
+
- desktop
|
| 11 |
+
- linux
|
| 12 |
+
- rea
|
| 13 |
+
- cad
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# LibreCAD: a computer-use environment
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
|
| 20 |
+
**The real LibreCAD 2.2 2D CAD running on an Ubuntu 24.04 desktop, as an [agentenv](https://pypi.org/project/agentenv-framework/) computer environment. An agent completes the task only through screenshots, mouse and keyboard, and a verifier grades the saved files with no model.**
|
| 21 |
+
|
| 22 |
+
LibreCAD opens a mounting plate drawing with one centre hole. The agent has to add four more mounting holes as circles and save the DXF, working only with LibreCAD's tools through the screen, mouse and keyboard.
|
| 23 |
+
|
| 24 |
+
## Watch
|
| 25 |
+
|
| 26 |
+
- Agent runs (Claude Code with Claude Sonnet 5.5): [run 1](media/solve-1.mp4), [run 2](media/solve-2.mp4), [run 3](media/solve-3.mp4)
|
| 27 |
+
|
| 28 |
+
Each video is the computer's own screen recording at 10 frames per second.
|
| 29 |
+
|
| 30 |
+
## The task
|
| 31 |
+
|
| 32 |
+
> Add four more mounting holes to the plate drawing in LibreCAD and save it.
|
| 33 |
+
|
| 34 |
+
`bundle/artifacts/add-holes-check/verify.py` reads the app's files through the computer's `data/get` view and passes only if every check holds:
|
| 35 |
+
|
| 36 |
+
| Check | Kind | File |
|
| 37 |
+
| --- | --- | --- |
|
| 38 |
+
| `nine-circles` | `line_count` | `Documents/plate.dxf` |
|
| 39 |
+
|
| 40 |
+
The checks read the saved DXF: it now holds 9 circle entities (the plate's 5 starting circles plus the 4 new holes).
|
| 41 |
+
|
| 42 |
+
## Results
|
| 43 |
+
|
| 44 |
+
3 of 3 runs passed, about $0.49 per run.
|
| 45 |
+
|
| 46 |
+
| Run | Outcome | Cost | Video |
|
| 47 |
+
| --- | --- | --- | --- |
|
| 48 |
+
| 1 | passed | $0.81 | [video](media/solve-1.mp4) |
|
| 49 |
+
| 2 | passed | $0.32 | [video](media/solve-2.mp4) |
|
| 50 |
+
| 3 | passed | $0.34 | [video](media/solve-3.mp4) |
|
| 51 |
+
|
| 52 |
+
## Run it
|
| 53 |
+
|
| 54 |
+
You need Docker. `agentenv-framework` builds the computer: Ubuntu 24.04 with the app installed from Ubuntu's archive (`librecad` 2.2.0.2-1build3).
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
pip install agentenv-framework==0.9.1431
|
| 58 |
+
hf download earakely-scale/LibreCADComputerEnv-REA --repo-type dataset --local-dir librecad
|
| 59 |
+
agent-env run librecad/bundle --task add-holes --agent claude-code --model <model>
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
The agent needs a model provider configured for agentenv. `--task smoke` only boots the computer, with no agent. `bundle/README.md` describes the bundle in detail.
|
| 63 |
+
|
| 64 |
+
## How it was made
|
| 65 |
+
|
| 66 |
+
[REA](https://github.com/morluto/rea) built this environment from a real session with the app:
|
| 67 |
+
|
| 68 |
+
1. **Capture.** REA launched LibreCAD on a Linux desktop and recorded its package, windows and opened files while a scripted user made the edit. It also recorded the app's state folders before and after.
|
| 69 |
+
2. **Export.** REA turned the capture into an agentenv `computer_app`. It installs the app, seeds the starting files, starts the app, and waits for its main window. It also serves typed views of the app's files for verifiers.
|
| 70 |
+
3. **Task.** The task's checks were validated against the capture: they fail on the starting state and pass on the captured end state.
|
| 71 |
+
4. **Witness and runs.** Scripted computer actions solved the task in a kept computer, and the verifier failed before and passed after. Then an agent solved it 3 times, each run recorded.
|
| 72 |
+
|
| 73 |
+
## What's inside
|
| 74 |
+
|
| 75 |
+
```
|
| 76 |
+
bundle/ the agentenv bundle: envs/ (app module, seed files), tasks/, artifacts/ (verifier), evals/
|
| 77 |
+
media/ witness and agent-run recordings (MP4) with short GIF previews
|
| 78 |
+
results.json the runs above, with each check's result
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Limits
|
| 82 |
+
|
| 83 |
+
- The check counts circles; it does not check where they are or their size.
|
| 84 |
+
- The computer uses the `librecad` version in Ubuntu 24.04's archive at build time; it is not pinned.
|
| 85 |
+
- Three runs is a small sample.
|
| 86 |
+
|
| 87 |
+
## Licences
|
| 88 |
+
|
| 89 |
+
The bundle code, the task and the synthetic seed files are Apache-2.0. LibreCAD itself is not included: the computer installs it from Ubuntu's archive (`librecad` 2.2.0.2-1build3) at build time, under its own licence (GPL-2.0).
|
bundle/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LibreCAD computer app
|
| 2 |
+
|
| 3 |
+
Exported by REA's `export-desktop-application` from a capture of the `librecad` package
|
| 4 |
+
(capture Evidence `ev_6da77e96c478fb46bed2c9160b524d44d89f7de57d2ac758feed45feb5482405`). It was checked against agentenv-framework
|
| 5 |
+
0.9.1431.
|
| 6 |
+
|
| 7 |
+
- `envs/librecad/` is a computer app on the `ubuntu-24.04` base with the `reference` driver, for
|
| 8 |
+
`amd64` and `arm64`. It installs `librecad` from the distribution archive, launches `sh -c exec 'librecad' "$HOME"/'Documents/plate.dxf'` at boot and is ready
|
| 9 |
+
when a window of class `LibreCAD` appears.
|
| 10 |
+
- Owned paths: `~/.config/LibreCAD`, `~/.local/share/LibreCAD`, `~/Documents`.
|
| 11 |
+
`data/get` returns their files and a typed JSON view of each; `data/reset` restores the seed.
|
| 12 |
+
- Seed: 3 file(s) from the user's home before the capture, with the captured home path
|
| 13 |
+
respelled in text files.
|
| 14 |
+
- `tasks/smoke.json` deploys the app.
|
| 15 |
+
|
| 16 |
+
Run the task with `agent-env run <this folder>`, or only the deploy with `--task smoke`.
|
| 17 |
+
|
| 18 |
+
The seed is synthetic test data made for this showcase; it holds no one's real files.
|
| 19 |
+
|
| 20 |
+
## Task `add-holes`
|
| 21 |
+
|
| 22 |
+
`tasks/add-holes.json` deploys the app, has the agent work through the computer from the prompt below, and grades
|
| 23 |
+
the outcome with `artifacts/add-holes-check/verify.py`, which reads the app's `data/get` views and needs
|
| 24 |
+
no model. `evals/librecad.toml` names it, so a run of the bundle runs it.
|
| 25 |
+
|
| 26 |
+
> Add four more mounting holes to the plate drawing in LibreCAD and save it.
|
| 27 |
+
|
| 28 |
+
Checks, each of which must pass:
|
| 29 |
+
|
| 30 |
+
- `nine-circles`: `{"kind":"line_count","file":"Documents/plate.dxf","exact":"CIRCLE","equals":9}`
|
| 31 |
+
|
| 32 |
+
REA kept the task because its checks fail on the seed (`nine-circles`) and all
|
| 33 |
+
pass on the captured end state.
|
| 34 |
+
|
| 35 |
+
To measure a solve rate, run the task k times (3 by default) with the agent and model to measure, and count the runs
|
| 36 |
+
whose summary line says `passed`; a run that says `failed` did not finish and is run again rather than counted:
|
| 37 |
+
|
| 38 |
+
agent-env run <this folder> --task add-holes --agent claude-code --model MODEL
|
bundle/artifacts/add-holes-check/verify.py
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Checks of the task add-holes against the librecad app's state, exported by REA from a desktop application capture.
|
| 2 |
+
|
| 3 |
+
It reads the app's data/get through the computer, takes the typed views of its files and evaluates each check: no
|
| 4 |
+
model, no code from the task. A failure to reach the app raises, so the run fails rather than scoring the agent.
|
| 5 |
+
"""
|
| 6 |
+
import json
|
| 7 |
+
import re
|
| 8 |
+
|
| 9 |
+
from agentenv_protocol import client as protocol
|
| 10 |
+
from agentenv_protocol.types import RPC_PATH
|
| 11 |
+
|
| 12 |
+
APP = "librecad"
|
| 13 |
+
CHECKS = [
|
| 14 |
+
{"id": "nine-circles", "kind": "line_count", "file": "Documents/plate.dxf", "exact": "CIRCLE", "equals": 9},
|
| 15 |
+
]
|
| 16 |
+
|
| 17 |
+
MISSING = object()
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def _shown(value) -> str:
|
| 21 |
+
text = json.dumps(value, ensure_ascii=False, separators=(",", ":"))
|
| 22 |
+
return text if len(text) <= 200 else text[:200] + "…"
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def _same(actual, expected) -> bool:
|
| 26 |
+
"""JSON equality: numbers by value but never a boolean for a number, objects by their keys, arrays in order."""
|
| 27 |
+
if isinstance(expected, list):
|
| 28 |
+
return (isinstance(actual, list) and len(actual) == len(expected)
|
| 29 |
+
and all(_same(item, wanted) for item, wanted in zip(actual, expected)))
|
| 30 |
+
if isinstance(expected, dict):
|
| 31 |
+
return (isinstance(actual, dict) and len(actual) == len(expected)
|
| 32 |
+
and all(key in actual and _same(actual[key], value) for key, value in expected.items()))
|
| 33 |
+
if isinstance(expected, bool) or isinstance(actual, bool):
|
| 34 |
+
return isinstance(expected, bool) and isinstance(actual, bool) and actual == expected
|
| 35 |
+
if isinstance(expected, (int, float)):
|
| 36 |
+
return isinstance(actual, (int, float)) and actual == expected
|
| 37 |
+
return type(actual) is type(expected) and actual == expected
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def _resolve(view, pointer: str):
|
| 41 |
+
current = view
|
| 42 |
+
for raw in pointer[1:].split("/"):
|
| 43 |
+
token = raw.replace("~1", "/").replace("~0", "~")
|
| 44 |
+
if isinstance(current, list):
|
| 45 |
+
if not re.fullmatch(r"0|[1-9][0-9]*", token) or int(token) >= len(current):
|
| 46 |
+
return MISSING
|
| 47 |
+
current = current[int(token)]
|
| 48 |
+
elif isinstance(current, dict) and token in current:
|
| 49 |
+
current = current[token]
|
| 50 |
+
else:
|
| 51 |
+
return MISSING
|
| 52 |
+
return current
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def _truncated(form, view) -> bool:
|
| 56 |
+
if not isinstance(view, dict):
|
| 57 |
+
return False
|
| 58 |
+
if form in ("text", "xml"):
|
| 59 |
+
return view.get("truncated") is True
|
| 60 |
+
if form != "sqlite":
|
| 61 |
+
return False
|
| 62 |
+
tables = view.get("tables")
|
| 63 |
+
return view.get("tables_truncated") is True or any(
|
| 64 |
+
isinstance(table, dict) and (table.get("truncated") is True or isinstance(table.get("error"), str))
|
| 65 |
+
for table in (tables.values() if isinstance(tables, dict) else []))
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def _view_of(check, entry, form):
|
| 69 |
+
"""The view, whether it is truncated, and why the check cannot read it; an absent file reads as empty."""
|
| 70 |
+
if entry is None:
|
| 71 |
+
return None, False, None
|
| 72 |
+
if isinstance(entry.get("error"), str):
|
| 73 |
+
return None, False, f"{check['file']} has no view: {entry['error']}"
|
| 74 |
+
if entry.get("format") in (None, "binary"):
|
| 75 |
+
return None, False, f"{check['file']} is binary and has no view"
|
| 76 |
+
if form is not None and entry.get("format") != form:
|
| 77 |
+
return None, False, f"{check['file']} is read as {entry.get('format')}, not {form}"
|
| 78 |
+
return entry.get("view"), _truncated(entry.get("format"), entry.get("view")), None
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def _undecided(check):
|
| 82 |
+
return False, f"the view of {check['file']} is truncated, so what it leaves out is unknown"
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
def _compared(check, n: int, what: str):
|
| 86 |
+
operator = next(key for key in ("equals", "at_least", "at_most") if check.get(key) is not None)
|
| 87 |
+
expected = check[operator]
|
| 88 |
+
met = n == expected if operator == "equals" else n >= expected if operator == "at_least" else n <= expected
|
| 89 |
+
return met, f"{n} {what}, expected {operator.replace('_', ' ')} {expected}"
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
def _lines(check, entry):
|
| 93 |
+
view, truncated, problem = _view_of(check, entry, "text")
|
| 94 |
+
if problem is not None:
|
| 95 |
+
return False, problem
|
| 96 |
+
lines = view.get("lines") if isinstance(view, dict) and isinstance(view.get("lines"), list) else []
|
| 97 |
+
lines = [line for line in lines if isinstance(line, str)]
|
| 98 |
+
file = check["file"]
|
| 99 |
+
if check["kind"] == "lines_present":
|
| 100 |
+
missing = next((line for line in check["lines"] if line not in lines), None)
|
| 101 |
+
return (True, f"{file} has the line(s) {_shown(check['lines'])}") if missing is None else (
|
| 102 |
+
False, f"{file} has no line {_shown(missing)}")
|
| 103 |
+
if truncated:
|
| 104 |
+
return _undecided(check)
|
| 105 |
+
if check["kind"] == "lines_absent":
|
| 106 |
+
found = next((line for line in check["lines"] if line in lines), None)
|
| 107 |
+
return (True, f"{file} has none of the lines {_shown(check['lines'])}") if found is None else (
|
| 108 |
+
False, f"{file} still has the line {_shown(found)}")
|
| 109 |
+
if check.get("contains") is not None:
|
| 110 |
+
n = sum(1 for line in lines if check["contains"] in line)
|
| 111 |
+
return _compared(check, n, f"line(s) of {file} contain {_shown(check['contains'])}")
|
| 112 |
+
n = sum(1 for line in lines if line == check["exact"])
|
| 113 |
+
return _compared(check, n, f"line(s) of {file} match {_shown(check['exact'])}")
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def _value(check, entry):
|
| 117 |
+
view, truncated, problem = _view_of(check, entry, None)
|
| 118 |
+
if problem is not None:
|
| 119 |
+
return False, problem
|
| 120 |
+
found = MISSING if entry is None else _resolve(view, check["pointer"])
|
| 121 |
+
at = f"{check['file']} at {check['pointer']}"
|
| 122 |
+
if check["kind"] == "value_equals" and isinstance(check["value"], (dict, list)) and truncated:
|
| 123 |
+
return _undecided(check)
|
| 124 |
+
if check["kind"] == "value_equals":
|
| 125 |
+
if found is not MISSING and _same(found, check["value"]):
|
| 126 |
+
return True, f"{at} is {_shown(check['value'])}"
|
| 127 |
+
return False, f"{at} has no value" if found is MISSING else f"{at} is {_shown(found)}, not {_shown(check['value'])}"
|
| 128 |
+
if truncated:
|
| 129 |
+
return _undecided(check)
|
| 130 |
+
return (True, f"{at} has no value") if found is MISSING else (False, f"{at} is {_shown(found)}")
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
def _rows(check, entry):
|
| 134 |
+
view, _, problem = _view_of(check, entry, "sqlite")
|
| 135 |
+
if problem is not None:
|
| 136 |
+
return False, problem
|
| 137 |
+
view = view if isinstance(view, dict) else {}
|
| 138 |
+
tables = view.get("tables") if isinstance(view.get("tables"), dict) else {}
|
| 139 |
+
table = tables[check["table"]] if check["table"] in tables else MISSING
|
| 140 |
+
name = f"{check['file']} table {check['table']}"
|
| 141 |
+
if table is MISSING and view.get("tables_truncated") is True:
|
| 142 |
+
return _undecided(check)
|
| 143 |
+
table = table if isinstance(table, dict) else {}
|
| 144 |
+
if isinstance(table.get("error"), str):
|
| 145 |
+
return False, f"{name} could not be read: {table['error']}"
|
| 146 |
+
columns = table.get("columns") if isinstance(table.get("columns"), list) else []
|
| 147 |
+
rows = table.get("rows") if isinstance(table.get("rows"), list) else []
|
| 148 |
+
where = check.get("where") or {}
|
| 149 |
+
|
| 150 |
+
def matches(row) -> bool:
|
| 151 |
+
return isinstance(row, list) and all(
|
| 152 |
+
column in columns and columns.index(column) < len(row) and _same(row[columns.index(column)], value)
|
| 153 |
+
for column, value in where.items())
|
| 154 |
+
|
| 155 |
+
n = sum(1 for row in rows if matches(row))
|
| 156 |
+
if check["kind"] == "row_present":
|
| 157 |
+
return (n > 0, f"{name} has a row with {_shown(where)}" if n > 0 else f"{name} has no row with {_shown(where)}")
|
| 158 |
+
if table.get("truncated") is True:
|
| 159 |
+
return _undecided(check)
|
| 160 |
+
if check["kind"] == "row_absent":
|
| 161 |
+
return (True, f"{name} has no row with {_shown(where)}") if n == 0 else (
|
| 162 |
+
False, f"{name} has {n} row(s) with {_shown(where)}")
|
| 163 |
+
return _compared(check, n, f"row(s) of {name}" + (f" with {_shown(where)}" if "where" in check else ""))
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def _verdict(check, entry):
|
| 167 |
+
kind = check["kind"]
|
| 168 |
+
if kind == "file_present":
|
| 169 |
+
return (entry is not None, f"{check['file']} exists" if entry is not None else f"{check['file']} does not exist")
|
| 170 |
+
if kind == "file_absent":
|
| 171 |
+
return (entry is None, f"{check['file']} does not exist" if entry is None else f"{check['file']} exists")
|
| 172 |
+
if kind in ("lines_present", "lines_absent", "line_count"):
|
| 173 |
+
return _lines(check, entry)
|
| 174 |
+
if kind in ("value_equals", "value_absent"):
|
| 175 |
+
return _value(check, entry)
|
| 176 |
+
return _rows(check, entry)
|
| 177 |
+
|
| 178 |
+
|
| 179 |
+
def evaluate(checks: list, views: dict) -> list:
|
| 180 |
+
"""One result per check against the views data/get returned, by home path."""
|
| 181 |
+
results = []
|
| 182 |
+
for check in checks:
|
| 183 |
+
passed, description = _verdict(check, views.get(check["file"]))
|
| 184 |
+
results.append({"id": check["id"], "result": passed, "description": description})
|
| 185 |
+
return results
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
async def verify(mcp_url, env_url):
|
| 189 |
+
card = await protocol.get_card(env_url)
|
| 190 |
+
child = protocol.find_child(card, APP)
|
| 191 |
+
if child is None:
|
| 192 |
+
raise RuntimeError(f"the computer at {env_url} lists no app named {APP}")
|
| 193 |
+
answer = await protocol.get_data(env_url + (child.get("url") or RPC_PATH).removesuffix(RPC_PATH), timeout=120)
|
| 194 |
+
states = [part.data["state"] for part in answer.parts
|
| 195 |
+
if part.kind == "data" and isinstance(part.data.get("state"), dict)]
|
| 196 |
+
if not states:
|
| 197 |
+
raise RuntimeError(f"the {APP} app's data/get returned no state views")
|
| 198 |
+
return evaluate(CHECKS, states[0])
|
bundle/envs/librecad/SKILL.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Use LibreCAD on this Linux desktop; its window has class LibreCAD.
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# LibreCAD
|
| 6 |
+
|
| 7 |
+
LibreCAD is open on the desktop at boot. Its window's class is `LibreCAD`.
|
| 8 |
+
|
| 9 |
+
Its files live under `~/.config/LibreCAD`, `~/.local/share/LibreCAD`, `~/Documents`. Work through the application's own
|
| 10 |
+
window and dialogs; the result is read from those files.
|
bundle/envs/librecad/env.toml
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
type = "computer_app"
|
| 2 |
+
module = "librecad_app.py:Librecad"
|
| 3 |
+
computer = "ubuntu-24.04"
|
| 4 |
+
driver = "reference"
|
bundle/envs/librecad/librecad_app.py
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""LibreCAD as an agentenv computer app, exported by REA from a desktop application capture.
|
| 2 |
+
|
| 3 |
+
Package: librecad (captured at 2.2.0.2-1build3). Capture Evidence: ev_6da77e96c478fb46bed2c9160b524d44d89f7de57d2ac758feed45feb5482405.
|
| 4 |
+
The seed is synthetic test data made for this showcase.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
|
| 9 |
+
import contextlib
|
| 10 |
+
import json
|
| 11 |
+
import os
|
| 12 |
+
import re
|
| 13 |
+
import sqlite3
|
| 14 |
+
import subprocess
|
| 15 |
+
import sys
|
| 16 |
+
import tempfile
|
| 17 |
+
import xml.etree.ElementTree as ElementTree
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
|
| 20 |
+
from agentenv_protocol import add_data, get_data, reset_data
|
| 21 |
+
from agentenv_protocol.computer import AptSource, ComputerAppEnvironment, Launch, Packages, Ready, computer_app, linux
|
| 22 |
+
from agentenv_protocol.computer.app_data import INITIAL, add, get, in_thread, keep_initial, reset
|
| 23 |
+
from agentenv_protocol.types import DataPart
|
| 24 |
+
|
| 25 |
+
HERE = Path(__file__).resolve().parent
|
| 26 |
+
CAPTURED_HOME = "/home/ada"
|
| 27 |
+
PATHS = [".config/LibreCAD", ".local/share/LibreCAD", "Documents"]
|
| 28 |
+
DCONF = ""
|
| 29 |
+
TEXT_SEEDS = frozenset([".config/LibreCAD/LibreCAD.conf", ".local/share/LibreCAD/LibreCAD/librecad.alias", "Documents/plate.dxf"])
|
| 30 |
+
|
| 31 |
+
XML_SUFFIXES = (".xml", ".xbel", ".plist", ".svg", ".ui")
|
| 32 |
+
GROUP_HEADER = re.compile(r"^\[([^\]]+)\]$")
|
| 33 |
+
LINE_BREAK = re.compile(r"\r?\n")
|
| 34 |
+
SQLITE_HEADER = b"SQLite format 3\x00"
|
| 35 |
+
XML_SPACE = "{http://www.w3.org/XML/1998/namespace}space"
|
| 36 |
+
MAX_VIEW_BYTES = 64 * 1024 * 1024
|
| 37 |
+
MAX_SAFE_INTEGER = 2**53 - 1
|
| 38 |
+
MAX_TABLES = 64
|
| 39 |
+
MAX_ROWS = 500
|
| 40 |
+
MAX_LINES = 5000
|
| 41 |
+
MAX_XML_NODES = 5000
|
| 42 |
+
MAX_XML_DEPTH = 64
|
| 43 |
+
SQLITE_BUSY_S = 0.25
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def _respelled(text: str, home: Path) -> str:
|
| 47 |
+
"""The captured home path respelled to this computer's home, only where a whole path segment ends after it."""
|
| 48 |
+
return re.sub(re.escape(CAPTURED_HOME) + r"(?![\w.@+~-])", lambda _: str(home), text)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def _seed_home(home: Path) -> None:
|
| 52 |
+
"""Copy the captured files into this computer's home; only text files have the captured home path respelled."""
|
| 53 |
+
seed = HERE / "seed"
|
| 54 |
+
for source in sorted(seed.rglob("*")) if seed.is_dir() else []:
|
| 55 |
+
if not source.is_file():
|
| 56 |
+
continue
|
| 57 |
+
relative = source.relative_to(seed).as_posix()
|
| 58 |
+
target = home / relative
|
| 59 |
+
target.parent.mkdir(parents=True, exist_ok=True)
|
| 60 |
+
data = source.read_bytes()
|
| 61 |
+
if relative in TEXT_SEEDS:
|
| 62 |
+
data = _respelled(data.decode("utf-8"), home).encode("utf-8")
|
| 63 |
+
target.write_bytes(data)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def _dconf(arguments: list, environment: dict) -> str:
|
| 67 |
+
return subprocess.run(["dconf", *arguments], env={**os.environ, **environment}, capture_output=True, text=True,
|
| 68 |
+
check=True).stdout
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def _load_dconf(home: Path) -> None:
|
| 72 |
+
"""Compile the captured dconf keys into the user database without D-Bus, which is not up yet. Keys already there
|
| 73 |
+
stay unless captured: dconf compile reads the key files in name order and a later file wins. A failure is
|
| 74 |
+
reported and the app starts without them."""
|
| 75 |
+
if not DCONF:
|
| 76 |
+
return
|
| 77 |
+
database = home / ".config" / "dconf" / "user"
|
| 78 |
+
try:
|
| 79 |
+
database.parent.mkdir(parents=True, exist_ok=True)
|
| 80 |
+
with tempfile.TemporaryDirectory(dir=database.parent) as scratch:
|
| 81 |
+
keyfiles = Path(scratch, "keyfiles")
|
| 82 |
+
keyfiles.mkdir()
|
| 83 |
+
if database.is_file():
|
| 84 |
+
profile = Path(scratch, "profile")
|
| 85 |
+
profile.write_text(f"file-db:{database}\n")
|
| 86 |
+
existing = _dconf(["dump", "/"], {"DCONF_PROFILE": str(profile)})
|
| 87 |
+
(keyfiles / "00-existing").write_text(existing)
|
| 88 |
+
(keyfiles / "01-captured").write_text(_respelled(DCONF, home))
|
| 89 |
+
_dconf(["compile", str(Path(scratch, "user")), str(keyfiles)], {})
|
| 90 |
+
os.replace(Path(scratch, "user"), database)
|
| 91 |
+
except (OSError, subprocess.CalledProcessError) as error:
|
| 92 |
+
detail = (getattr(error, "stderr", None) or "").strip().splitlines()
|
| 93 |
+
print(f"warning: the captured dconf settings were not loaded: {detail[-1] if detail else error}",
|
| 94 |
+
file=sys.stderr)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def _sqlite_text(data: bytes):
|
| 98 |
+
text = data.decode("utf-8", "replace")
|
| 99 |
+
return {"text": text, "bytes_hex": data.hex()} if "�" in text else text
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def _cell(value):
|
| 103 |
+
if isinstance(value, bytes):
|
| 104 |
+
return {"blob_hex": value.hex()}
|
| 105 |
+
if isinstance(value, int) and abs(value) > MAX_SAFE_INTEGER:
|
| 106 |
+
return {"integer": str(value)}
|
| 107 |
+
return value
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def _table(db, name: str, primary_key: list) -> dict:
|
| 111 |
+
quoted = '"' + name.replace('"', '""') + '"'
|
| 112 |
+
cursor = db.execute(f"select * from main.{quoted} not indexed limit {MAX_ROWS + 1}")
|
| 113 |
+
rows = [[_cell(value) for value in row] for row in cursor]
|
| 114 |
+
return {"columns": [column[0] for column in cursor.description], "primary_key": primary_key,
|
| 115 |
+
"rows": rows[:MAX_ROWS], "truncated": len(rows) > MAX_ROWS}
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
def _sqlite(path: Path) -> dict:
|
| 119 |
+
"""The database's ordinary tables, in schema order, up to REA's table and row limits."""
|
| 120 |
+
with contextlib.closing(sqlite3.connect(path.resolve().as_uri() + "?mode=ro", uri=True, timeout=SQLITE_BUSY_S)) as db:
|
| 121 |
+
kinds = dict(db.execute("select name, type from pragma_table_list where schema = 'main'"))
|
| 122 |
+
names = [name for (name,) in db.execute("select name from sqlite_schema where type = 'table'")
|
| 123 |
+
if kinds.get(name) == "table"]
|
| 124 |
+
keys = {name: [key for (key,) in db.execute(
|
| 125 |
+
"select name from pragma_table_info(?, 'main') where pk > 0 order by pk", (name,))]
|
| 126 |
+
for name in names[:MAX_TABLES]}
|
| 127 |
+
db.text_factory = _sqlite_text
|
| 128 |
+
tables = {name: _table(db, name, keys[name]) for name in names[:MAX_TABLES]}
|
| 129 |
+
cut = len(names) > MAX_TABLES
|
| 130 |
+
return {"format": "sqlite", "view": {"tables": tables, "tables_truncated": cut},
|
| 131 |
+
"truncated": cut or any(table["truncated"] for table in tables.values())}
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
def _text(text: str) -> dict:
|
| 135 |
+
lines = LINE_BREAK.split(text)
|
| 136 |
+
if lines[-1] == "":
|
| 137 |
+
lines.pop()
|
| 138 |
+
view = {"lines": lines[:MAX_LINES], "line_count": len(lines), "truncated": len(lines) > MAX_LINES}
|
| 139 |
+
return {"format": "text", "view": view, "truncated": view["truncated"]}
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
def _keyfile_line(raw: str) -> tuple:
|
| 143 |
+
"""A key file line as REA reads it: skip (blank or comment), group, entry or other."""
|
| 144 |
+
line = raw.strip()
|
| 145 |
+
if not line or line[0] in "#;":
|
| 146 |
+
return ("skip",)
|
| 147 |
+
header = GROUP_HEADER.match(line)
|
| 148 |
+
if header:
|
| 149 |
+
return ("group", header.group(1))
|
| 150 |
+
key, equals, value = line.partition("=")
|
| 151 |
+
return ("entry", key.strip(), value.strip()) if equals and key else ("other",)
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def _is_keyfile(text: str) -> bool:
|
| 155 |
+
"""REA's rule: at least one group, and nothing a key file view would drop."""
|
| 156 |
+
kinds = {_keyfile_line(line)[0] for line in LINE_BREAK.split(text)}
|
| 157 |
+
return "group" in kinds and "other" not in kinds
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
def _keyfile(text: str) -> dict:
|
| 161 |
+
groups, group = {}, ""
|
| 162 |
+
for line in map(_keyfile_line, LINE_BREAK.split(text)):
|
| 163 |
+
if line[0] == "group":
|
| 164 |
+
group = line[1]
|
| 165 |
+
groups.setdefault(group, {})
|
| 166 |
+
elif line[0] == "entry":
|
| 167 |
+
groups.setdefault(group, {})[line[1]] = line[2]
|
| 168 |
+
return groups
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
class _XmlTree(ElementTree.TreeBuilder):
|
| 172 |
+
"""Keeps comments and processing instructions, which REA's node limit counts, and refuses DOCTYPEs as REA does."""
|
| 173 |
+
|
| 174 |
+
def __init__(self) -> None:
|
| 175 |
+
super().__init__(insert_comments=True, insert_pis=True)
|
| 176 |
+
|
| 177 |
+
def doctype(self, name, pubid, system) -> None:
|
| 178 |
+
raise ValueError("the document declares a DOCTYPE")
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
def _xml_children(element) -> list:
|
| 182 |
+
nodes = [element.text] if element.text else []
|
| 183 |
+
for child in element:
|
| 184 |
+
nodes.append(child)
|
| 185 |
+
if child.tail:
|
| 186 |
+
nodes.append(child.tail)
|
| 187 |
+
return nodes
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
def _xml(node, depth: int, budget: dict, scope: tuple):
|
| 191 |
+
"""A node as REA's XML view keeps it: an element with its attributes and children, or its text; None when it is
|
| 192 |
+
formatting whitespace, a comment, or past REA's node and depth limits."""
|
| 193 |
+
if budget["remaining"] <= 0 or depth > MAX_XML_DEPTH:
|
| 194 |
+
budget["truncated"] = True
|
| 195 |
+
return None
|
| 196 |
+
budget["remaining"] -= 1
|
| 197 |
+
preserve, element_content = scope
|
| 198 |
+
if isinstance(node, str):
|
| 199 |
+
return None if not node.strip() and element_content and not preserve else node
|
| 200 |
+
if not isinstance(node.tag, str):
|
| 201 |
+
return None
|
| 202 |
+
space = node.get(XML_SPACE)
|
| 203 |
+
nodes = _xml_children(node)
|
| 204 |
+
inner = (space == "preserve" if space else preserve,
|
| 205 |
+
any(not isinstance(child, str) and isinstance(child.tag, str) for child in nodes))
|
| 206 |
+
children = [_xml(child, depth + 1, budget, inner) for child in nodes]
|
| 207 |
+
return {"name": node.tag, "attributes": dict(node.attrib), "children": [c for c in children if c is not None]}
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
def _xml_view(text: str):
|
| 211 |
+
parser = ElementTree.XMLParser(target=_XmlTree())
|
| 212 |
+
try:
|
| 213 |
+
parser.feed(text)
|
| 214 |
+
root = parser.close()
|
| 215 |
+
except (ElementTree.ParseError, ValueError):
|
| 216 |
+
return None
|
| 217 |
+
budget = {"remaining": MAX_XML_NODES, "truncated": False}
|
| 218 |
+
tree = _xml(root, 0, budget, (False, False))
|
| 219 |
+
return None if tree is None else {"root": tree, "truncated": budget["truncated"]}
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
def _not_json(constant: str):
|
| 223 |
+
raise ValueError(f"{constant} is not JSON")
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
def _text_view(name: str, text: str) -> dict:
|
| 227 |
+
"""The format REA's state view detects for decoded text, and its view."""
|
| 228 |
+
trimmed = re.sub(r"^[\s]+", "", text)
|
| 229 |
+
if name.endswith(".json") or trimmed[:1] in ("[", "{"):
|
| 230 |
+
try:
|
| 231 |
+
return {"format": "json", "view": json.loads(text, parse_constant=_not_json), "truncated": False}
|
| 232 |
+
except ValueError:
|
| 233 |
+
pass
|
| 234 |
+
lowered = name.lower()
|
| 235 |
+
if lowered.endswith(XML_SUFFIXES) or trimmed.startswith("<?xml"):
|
| 236 |
+
view = _xml_view(text)
|
| 237 |
+
return _text(text) if view is None else {"format": "xml", "view": view, "truncated": view["truncated"]}
|
| 238 |
+
if _is_keyfile(text):
|
| 239 |
+
return {"format": "keyfile", "view": {"groups": _keyfile(text)}, "truncated": False}
|
| 240 |
+
return _text(text)
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
def _view(path: Path) -> dict:
|
| 244 |
+
"""A typed JSON view of one file in the shapes of REA's state view; truncated says the view is partial."""
|
| 245 |
+
too_large = {"format": None, "view": None, "error": "larger than 64 MiB, the most the view reads"}
|
| 246 |
+
if path.stat().st_size > MAX_VIEW_BYTES:
|
| 247 |
+
return too_large
|
| 248 |
+
with path.open("rb") as file:
|
| 249 |
+
data = file.read(8192)
|
| 250 |
+
whole = not data.startswith(SQLITE_HEADER) and b"\x00" not in data
|
| 251 |
+
data += file.read(MAX_VIEW_BYTES + 1 - len(data)) if whole else b""
|
| 252 |
+
if data.startswith(SQLITE_HEADER):
|
| 253 |
+
return _sqlite(path)
|
| 254 |
+
if len(data) > MAX_VIEW_BYTES:
|
| 255 |
+
return too_large
|
| 256 |
+
try:
|
| 257 |
+
text = data.decode("utf-8-sig") if whole else None
|
| 258 |
+
except UnicodeDecodeError:
|
| 259 |
+
text = None
|
| 260 |
+
return {"format": "binary", "view": None, "truncated": False} if text is None else _text_view(path.name, text)
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
def _views(home: Path, paths: list) -> dict:
|
| 264 |
+
"""A view of every file under the app's paths, keyed by its home-relative path."""
|
| 265 |
+
files = {}
|
| 266 |
+
for owned in paths:
|
| 267 |
+
root = home / owned
|
| 268 |
+
candidates = [root] if root.is_file() else sorted(root.rglob("*")) if root.is_dir() else []
|
| 269 |
+
for path in candidates:
|
| 270 |
+
if path.is_file() and not path.is_symlink():
|
| 271 |
+
key = path.relative_to(home).as_posix()
|
| 272 |
+
try:
|
| 273 |
+
files[key] = _view(path)
|
| 274 |
+
except (OSError, ValueError, sqlite3.Error, RecursionError) as error:
|
| 275 |
+
files[key] = {"format": None, "view": None, "error": str(error)}
|
| 276 |
+
return files
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
@computer_app(supports=[{"os": {"type": "linux", "display": ["x11"]}, "arch": ["amd64", "arm64"]}])
|
| 280 |
+
@linux(
|
| 281 |
+
packages=Packages(apt=["librecad"]),
|
| 282 |
+
launch=Launch(at="boot", command=["sh", "-c", "exec 'librecad' \"$HOME\"/'Documents/plate.dxf'"], window={"class": "LibreCAD"}, ready=Ready(window=True)),
|
| 283 |
+
paths=PATHS,
|
| 284 |
+
skill="SKILL.md",
|
| 285 |
+
)
|
| 286 |
+
class Librecad(ComputerAppEnvironment):
|
| 287 |
+
"""LibreCAD, launched at boot with the captured state in its home.
|
| 288 |
+
|
| 289 |
+
Declaring data hooks switches off agentenv's default data plane, so these call its helpers: the seed is kept as
|
| 290 |
+
the initial state, reset restores it, add writes files under PATHS, and get returns those files plus a typed JSON
|
| 291 |
+
view of each.
|
| 292 |
+
"""
|
| 293 |
+
|
| 294 |
+
def __init__(self) -> None:
|
| 295 |
+
super().__init__()
|
| 296 |
+
if not INITIAL.exists():
|
| 297 |
+
_seed_home(Path.home())
|
| 298 |
+
_load_dconf(Path.home())
|
| 299 |
+
keep_initial(self.paths)
|
| 300 |
+
|
| 301 |
+
@add_data
|
| 302 |
+
async def add_files(self, parts: list) -> None:
|
| 303 |
+
await add(parts, self.paths)
|
| 304 |
+
|
| 305 |
+
@get_data
|
| 306 |
+
async def get_files(self, write_namespace=None) -> list:
|
| 307 |
+
files = await get(self.paths, write_namespace)
|
| 308 |
+
views = await in_thread(_views, Path.home(), self.paths)
|
| 309 |
+
return [*files, DataPart(data={"state": views})]
|
| 310 |
+
|
| 311 |
+
@reset_data
|
| 312 |
+
async def reset_files(self) -> None:
|
| 313 |
+
await reset(self.paths)
|
bundle/envs/librecad/seed/.config/LibreCAD/LibreCAD.conf
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[Appearance]
|
| 2 |
+
Language=en
|
| 3 |
+
LanguageCmd=en
|
| 4 |
+
|
| 5 |
+
[CustomToolbars]
|
| 6 |
+
DefaultCustom=DrawMText, DrawHatch, DrawImage, BlocksCreate, DrawPoint
|
| 7 |
+
|
| 8 |
+
[Defaults]
|
| 9 |
+
Unit=Millimeter
|
| 10 |
+
UseQtFileOpenDialog=1
|
| 11 |
+
|
| 12 |
+
[Geometry]
|
| 13 |
+
BottomDockArea=0
|
| 14 |
+
FloatingDockwidgets=0
|
| 15 |
+
LeftDockArea=0
|
| 16 |
+
RightDockArea=1
|
| 17 |
+
StateOfWidgets=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\0\xaa\0\0\x1\xa4\xfc\x2\0\0\0\x4\xfc\0\0\0\0\0\0\0\xb4\0\0\0\0\0\xff\xff\xff\xfa\xff\xff\xff\xff\x2\0\0\0\x2\xfb\0\0\0\x12\0\x64\0o\0\x63\0k\0_\0l\0i\0n\0\x65\0\0\0\0\0\xff\xff\xff\xff\0\0\0\x97\0\xff\xff\xff\xfb\0\0\0\x1a\0\x64\0o\0\x63\0k\0_\0p\0o\0l\0y\0l\0i\0n\0\x65\0\0\0\0\0\xff\xff\xff\xff\0\0\0U\0\xff\xff\xff\xfc\0\0\0\xba\0\0\0r\0\0\0\0\0\xff\xff\xff\xfa\xff\xff\xff\xff\x2\0\0\0\x3\xfb\0\0\0\x16\0\x64\0o\0\x63\0k\0_\0\x63\0i\0r\0\x63\0l\0\x65\0\0\0\0\0\xff\xff\xff\xff\0\0\0U\0\xff\xff\xff\xfb\0\0\0\x14\0\x64\0o\0\x63\0k\0_\0\x63\0u\0r\0v\0\x65\0\0\0\0\0\xff\xff\xff\xff\0\0\0U\0\xff\xff\xff\xfb\0\0\0\x18\0\x64\0o\0\x63\0k\0_\0\x65\0l\0l\0i\0p\0s\0\x65\0\0\0\0\0\xff\xff\xff\xff\0\0\0\x34\0\xff\xff\xff\xfc\0\0\x1\x32\0\0\0r\0\0\0\0\0\xff\xff\xff\xfa\xff\xff\xff\xff\x2\0\0\0\x3\xfb\0\0\0\x1c\0\x64\0o\0\x63\0k\0_\0\x64\0i\0m\0\x65\0n\0s\0i\0o\0n\0\0\0\0\0\xff\xff\xff\xff\0\0\0U\0\xff\xff\xff\xfb\0\0\0\x12\0\x64\0o\0\x63\0k\0_\0i\0n\0\x66\0o\0\0\0\0\0\xff\xff\xff\xff\0\0\0\x34\0\xff\xff\xff\xfb\0\0\0\x16\0\x64\0o\0\x63\0k\0_\0s\0\x65\0l\0\x65\0\x63\0t\0\0\0\0\0\xff\xff\xff\xff\0\0\0U\0\xff\xff\xff\xfb\0\0\0\x16\0\x64\0o\0\x63\0k\0_\0m\0o\0\x64\0i\0\x66\0y\0\0\0\0\0\xff\xff\xff\xff\0\0\0\x97\0\xff\xff\xff\0\0\0\x1\0\0\x1\x31\0\0\x2\x41\xfc\x2\0\0\0\x3\xfb\0\0\0\xe\0p\0\x65\0n\0_\0w\0i\0z\x1\0\0\0_\0\0\0\xdc\0\0\0\xa1\0\xff\xff\xff\xfc\0\0\x1\x41\0\0\0\xfd\0\0\x1\x1\x1\0\0\x1c\xfa\0\0\0\x2\x2\0\0\0\x3\xfb\0\0\0$\0l\0i\0\x62\0r\0\x61\0r\0y\0_\0\x64\0o\0\x63\0k\0w\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xdd\0\xff\xff\xff\xfb\0\0\0 \0\x62\0l\0o\0\x63\0k\0_\0\x64\0o\0\x63\0k\0w\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xaf\0\xff\xff\xff\xfb\0\0\0 \0l\0\x61\0y\0\x65\0r\0_\0\x64\0o\0\x63\0k\0w\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xe4\0\xff\xff\xff\xfb\0\0\0$\0\x63\0o\0m\0m\0\x61\0n\0\x64\0_\0\x64\0o\0\x63\0k\0w\0i\0\x64\0g\0\x65\0t\x1\0\0\x2\x44\0\0\0\\\0\0\0X\0\xff\xff\xff\0\0\x3\xa0\0\0\x2\x41\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x2\xfc\0\0\0\x4\0\0\0\0\0\0\0\x3\0\0\0$\0\x63\0\x61\0t\0\x65\0g\0o\0r\0i\0\x65\0s\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x3\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1a\0o\0r\0\x64\0\x65\0r\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x2\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1a\0\x44\0\x65\0\x66\0\x61\0u\0l\0t\0\x43\0u\0s\0t\0o\0m\x3\0\0\x1\x39\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x2\0\0\0\x3\0\0\0\x18\0\x66\0i\0l\0\x65\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x18\0\x65\0\x64\0i\0t\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x1 \xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x18\0v\0i\0\x65\0w\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x2\n\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x2\0\0\0\x2\0\0\0\x16\0p\0\x65\0n\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1e\0o\0p\0t\0i\0o\0n\0s\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x1\xc7\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x3\0\0\0\f\0\0\0\x18\0l\0i\0n\0\x65\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1c\0\x63\0i\0r\0\x63\0l\0\x65\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1a\0\x63\0u\0r\0v\0\x65\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1e\0\x65\0l\0l\0i\0p\0s\0\x65\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0 \0p\0o\0l\0y\0l\0i\0n\0\x65\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\"\0\x64\0i\0m\0\x65\0n\0s\0i\0o\0n\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1c\0m\0o\0\x64\0i\0\x66\0y\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x18\0i\0n\0\x66\0o\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x1c\0s\0\x65\0l\0\x65\0\x63\0t\0_\0t\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x18\0s\0n\0\x61\0p\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\"\0\x64\0o\0\x63\0k\0\x61\0r\0\x65\0\x61\0s\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x1\xfa\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0 \0\x63\0r\0\x65\0\x61\0t\0o\0r\0s\0_\0t\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\x2\xb4\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
|
| 18 |
+
TopDockArea=0
|
| 19 |
+
WindowHeight=776
|
| 20 |
+
WindowWidth=1280
|
| 21 |
+
WindowX=0
|
| 22 |
+
WindowY=0
|
| 23 |
+
|
| 24 |
+
[Print]
|
| 25 |
+
PaperSizeX=210
|
| 26 |
+
PaperSizeY=297
|
| 27 |
+
|
| 28 |
+
[Startup]
|
| 29 |
+
FirstLoad=0
|
| 30 |
+
|
| 31 |
+
[Widgets]
|
| 32 |
+
KeycodeMode=false
|
| 33 |
+
|
| 34 |
+
[WindowOptions]
|
| 35 |
+
SubWindowMode=0
|
bundle/envs/librecad/seed/.local/share/LibreCAD/LibreCAD/librecad.alias
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#LibreCAD alias v1
|
| 2 |
+
|
| 3 |
+
# lines starting with # are comments
|
| 4 |
+
# format are:
|
| 5 |
+
# <alias>\t<command-untranslated>
|
| 6 |
+
# example
|
| 7 |
+
# l line
|
| 8 |
+
|
| 9 |
+
a arc
|
| 10 |
+
ang angle
|
| 11 |
+
ar area
|
| 12 |
+
attr modifyattr
|
| 13 |
+
bev bevel
|
| 14 |
+
bi bisect
|
| 15 |
+
c2 circle2
|
| 16 |
+
c3 circle3
|
| 17 |
+
cc circlecr
|
| 18 |
+
ch bevel
|
| 19 |
+
ci circle
|
| 20 |
+
ct3 tan3
|
| 21 |
+
da dimaligned
|
| 22 |
+
dan dimangular
|
| 23 |
+
dd dimdiametric
|
| 24 |
+
del delete
|
| 25 |
+
dh dimhorizontal
|
| 26 |
+
di cut
|
| 27 |
+
dimdiameter dimdiametric
|
| 28 |
+
dimradius dimradial
|
| 29 |
+
dist distance
|
| 30 |
+
div cut
|
| 31 |
+
dl dimlinear
|
| 32 |
+
dpp distance
|
| 33 |
+
dr dimlinear
|
| 34 |
+
dv dimvertical
|
| 35 |
+
ei ellipseinscribed
|
| 36 |
+
er delete
|
| 37 |
+
fhl free
|
| 38 |
+
fi fillet
|
| 39 |
+
ha hatch
|
| 40 |
+
hor horizontal
|
| 41 |
+
ie ellipseinscribed
|
| 42 |
+
k kill
|
| 43 |
+
l line
|
| 44 |
+
ld dimleader
|
| 45 |
+
le lengthen
|
| 46 |
+
li line
|
| 47 |
+
ma modifyattr
|
| 48 |
+
mi mirror
|
| 49 |
+
mp properties
|
| 50 |
+
mtxt mtext
|
| 51 |
+
mv move
|
| 52 |
+
np snaponentity
|
| 53 |
+
o offset
|
| 54 |
+
ortho perp
|
| 55 |
+
os snapfree
|
| 56 |
+
pa offset
|
| 57 |
+
pl polyline
|
| 58 |
+
po point
|
| 59 |
+
poly2 polygon2v
|
| 60 |
+
pp ptp
|
| 61 |
+
prop properties
|
| 62 |
+
r redo
|
| 63 |
+
rec rectangle
|
| 64 |
+
rect rectangle
|
| 65 |
+
rectang rectangle
|
| 66 |
+
rev revert
|
| 67 |
+
rg redraw
|
| 68 |
+
rh restricthorizontal
|
| 69 |
+
rn restrictnothing
|
| 70 |
+
ro rotate
|
| 71 |
+
rr restrictorthogonal
|
| 72 |
+
rv restrictvertical
|
| 73 |
+
rz setrelativezero
|
| 74 |
+
sa selectall
|
| 75 |
+
sc snapcenter
|
| 76 |
+
sd snapdist
|
| 77 |
+
se snapend
|
| 78 |
+
sf snapfree
|
| 79 |
+
sg snapgrid
|
| 80 |
+
si snapintersection
|
| 81 |
+
sm snapmiddle
|
| 82 |
+
sn snaponentity
|
| 83 |
+
spl spline
|
| 84 |
+
ss stretch
|
| 85 |
+
stp spline2
|
| 86 |
+
sz scale
|
| 87 |
+
t2 trim2
|
| 88 |
+
tanpc tangentpc
|
| 89 |
+
tm trim
|
| 90 |
+
tm2 trim2
|
| 91 |
+
tn deselectall
|
| 92 |
+
txt text
|
| 93 |
+
u undo
|
| 94 |
+
ver vertical
|
| 95 |
+
xp explode
|
| 96 |
+
za zoomauto
|
| 97 |
+
zp zoompan
|
| 98 |
+
zr redraw
|
| 99 |
+
zv zoomprevious
|
| 100 |
+
zw zoomwindow
|
bundle/envs/librecad/seed/Documents/plate.dxf
ADDED
|
|
bundle/evals/librecad.toml
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
tasks = ["add-holes"]
|
bundle/tasks/add-holes.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{"id":"env","type":"deploy_env","env_id":"librecad"},
|
| 3 |
+
{"id":"agent","type":"deploy_agent","env_ids":["librecad"]},
|
| 4 |
+
{"id":"skills","type":"add_skills","env_ids":["librecad"]},
|
| 5 |
+
{"id":"record","type":"start_computer_recording","env_id":"librecad","name":"agent","depends_on":["env"]},
|
| 6 |
+
{"id":"task","type":"prompt_agent","depends_on":["skills","record"],"prompt":"Add four more mounting holes to the plate drawing in LibreCAD and save it."},
|
| 7 |
+
{"id":"check","type":"env_outcome_verifier","env_id":"librecad","file_artifact_id":"add-holes-check","verifier_id":"add-holes","depends_on":["task"]},
|
| 8 |
+
{"id":"end","type":"end_computer_recording","name":"agent","depends_on":["task"]}
|
| 9 |
+
]
|
bundle/tasks/smoke.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"id": "env",
|
| 4 |
+
"type": "deploy_env",
|
| 5 |
+
"env_id": "librecad"
|
| 6 |
+
}
|
| 7 |
+
]
|
media/hero.gif
ADDED
|
Git LFS Details
|
media/solve-1.gif
ADDED
|
Git LFS Details
|
media/solve-1.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a308aa1a8f5584b25e55cfe58d3334383f65ebb1d5309bda8ea2b7f722741469
|
| 3 |
+
size 2155038
|
media/solve-2.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95639b2c420fd20f1732f9ad3275277c0125ca0b6bef9a31e1bc4bffdb430482
|
| 3 |
+
size 1818169
|
media/solve-3.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27e59496349447567879c5334c3eb39e0bdc3470cf5bc4daff1e0a3dd147ded8
|
| 3 |
+
size 1810235
|
results.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"environment": "LibreCAD",
|
| 3 |
+
"app_version": "LibreCAD 2.2 2D CAD",
|
| 4 |
+
"task": "add-holes",
|
| 5 |
+
"prompt": "Add four more mounting holes to the plate drawing in LibreCAD and save it.",
|
| 6 |
+
"agent": "claude-code",
|
| 7 |
+
"model": "claude-sonnet-5-5",
|
| 8 |
+
"agentenv_framework": "0.9.1431",
|
| 9 |
+
"witness": "verifier failed on the seed and passed after an edit made through computer actions in a kept computer",
|
| 10 |
+
"runs": [
|
| 11 |
+
{
|
| 12 |
+
"run": 1,
|
| 13 |
+
"verdict": "passed",
|
| 14 |
+
"turns": null,
|
| 15 |
+
"usd": 0.81,
|
| 16 |
+
"checks": {
|
| 17 |
+
"add-holes": {
|
| 18 |
+
"score": 1.0,
|
| 19 |
+
"results": [
|
| 20 |
+
{
|
| 21 |
+
"id": "nine-circles",
|
| 22 |
+
"result": true,
|
| 23 |
+
"description": "9 line(s) of Documents/plate.dxf match \"CIRCLE\", expected equals 9"
|
| 24 |
+
}
|
| 25 |
+
]
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"run": 2,
|
| 31 |
+
"verdict": "passed",
|
| 32 |
+
"turns": null,
|
| 33 |
+
"usd": 0.32,
|
| 34 |
+
"checks": {
|
| 35 |
+
"add-holes": {
|
| 36 |
+
"score": 1.0,
|
| 37 |
+
"results": [
|
| 38 |
+
{
|
| 39 |
+
"id": "nine-circles",
|
| 40 |
+
"result": true,
|
| 41 |
+
"description": "9 line(s) of Documents/plate.dxf match \"CIRCLE\", expected equals 9"
|
| 42 |
+
}
|
| 43 |
+
]
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"run": 3,
|
| 49 |
+
"verdict": "passed",
|
| 50 |
+
"turns": null,
|
| 51 |
+
"usd": 0.34,
|
| 52 |
+
"checks": {
|
| 53 |
+
"add-holes": {
|
| 54 |
+
"score": 1.0,
|
| 55 |
+
"results": [
|
| 56 |
+
{
|
| 57 |
+
"id": "nine-circles",
|
| 58 |
+
"result": true,
|
| 59 |
+
"description": "9 line(s) of Documents/plate.dxf match \"CIRCLE\", expected equals 9"
|
| 60 |
+
}
|
| 61 |
+
]
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
]
|
| 66 |
+
}
|