REA computer-use environment, v0.1.0
Browse filesFiles changed (17)
- README.mdAdded+110
- bundle/README.mdAdded+40
- bundle/artifacts/change-meeting-time-check/verify.pyAdded+431
- bundle/envs/abiword/SKILL.mdAdded+10
- bundle/envs/abiword/abiword_app.pyAdded+790
- bundle/envs/abiword/env.tomlAdded+4
- bundle/envs/abiword/seed/.config/abiword/profileAdded+190
- bundle/envs/abiword/seed/Documents/book-sale-memo.abwAdded+43
- bundle/evals/abiword.tomlAdded+1
- bundle/tasks/change-meeting-time.jsonAdded+9
- bundle/tasks/smoke.jsonAdded+7
- media/hero.gifAdded
- media/solve-1.mp4Added+3
- media/solve-2.mp4Added+3
- media/solve-3.mp4Added+3
- media/witness.mp4Added+3
- results.jsonAdded+81
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110---license: apache-2.0pretty_name: AbiWord computer-use environment from a one-line request (REA)tags:- computer-use- cua- gui-agent- rl-environment- agentenv- desktop- linux- rea- word-processor- office- from-request---
# AbiWord: a computer-use environment built from a one-line request

**The real AbiWord 3.0 word processor 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.**
Claude Code built this environment from a one-line request in about 13 minutes, with only REA's build skill and MCP tools; [How it was made](#how-it-was-made) has the request and the steps. AbiWord starts with a blank document. The agent has to open the memo in `Documents/book-sale-memo.abw`, move the planning meeting from 10:00 AM to 2:30 PM, and save, leaving the memo's other 10:00 AM, an agenda deadline, alone. It sees only the screen and acts only with the mouse and keyboard.
## Watch
- 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)- Witness, which proves the task can be done through the computer: [witness.mp4](media/witness.mp4)
Each video is the computer's own screen recording at 10 frames per second.
## The task
> The book sale planning meeting has moved. Change the meeting time in the memo Documents/book-sale-memo.abw to 2:30 PM and save it.
`bundle/artifacts/change-meeting-time-check/verify.py` reads the app's files through the computer's `data/get` view and passes only if every check holds:
| Check | Kind | File || --- | --- | --- || `meeting-time` | `text_equals` | `Documents/book-sale-memo.abw` || `agenda-deadline-kept` | `text_contains` | `Documents/book-sale-memo.abw` |
An `.abw` file is XML that declares a DOCTYPE; REA reads it without fetching the DTD and finds each paragraph by its `xid`, never by position. The checks compare a paragraph's whole text, with whitespace collapsed, however AbiWord splits it into `<c>` runs. The meeting paragraph must read "...at 2:30 PM in the Community Room on the second floor." in full, and the next paragraph must still contain "by 10:00 AM on Wednesday". That second 10:00 AM is there on purpose, so replacing every 10:00 AM fails.
## Results
3 of 3 runs passed, about $1.09 per run.
| Run | Outcome | Turns | Cost | Video || --- | --- | --- | --- | --- || 1 | passed | 19 | $1.20 | [video](media/solve-1.mp4) || 2 | passed | 18 | $1.62 | [video](media/solve-2.mp4) || 3 | passed | 20 | $0.46 | [video](media/solve-3.mp4) |
## Run it
You need Docker. `agentenv-framework` builds the computer: Ubuntu 24.04 with the app installed from Ubuntu's archive (`abiword` 3.0.5).
```bashpip install agentenv-framework==0.9.1431hf download earakely-scale/AbiWordFromRequestComputerEnv-REA --repo-type dataset --local-dir abiword-requestagent-env run abiword-request/bundle --task change-meeting-time --agent claude-code --model <model>```
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.
## How it was made
Claude Code built this environment from a one-line request, given only [REA](https://github.com/morluto/rea)'s build skill and REA's MCP tools:
> Build me an AbiWord environment where the agent changes the meeting time in a memo and saves it.
It asked only the skill's upfront questions, wrote no app-specific scripts, and finished in about 13 minutes.
This is the second build of the request. The first, earlier the same evening, exposed a gap in REA: AbiWord's `.abw` declares a DOCTYPE, which REA refused, so the file could only be checked as raw text lines. AbiWord also splits an edited paragraph into `<c>` runs, so those line checks failed one correct solve, and that build passed 2 of 3. REA then gained two things: reading XML with a plain DOCTYPE, never fetching the DTD, and checking an element's whole text (`text_equals`, `text_contains`) however an app splits it into runs. This rebuild uses them. The steps were REA's usual ones:
1. **Capture.** REA launched AbiWord on a Linux desktop and recorded its package, windows and opened files while the edit was made. It also recorded the app's state folders before and after.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.3. **Task.** The task's checks were validated against the capture: they fail on the starting state and pass on the captured end state.4. **Witness.** In a fresh computer, the edit was made through computer actions alone, and the checks were read at four stages. They held on the first try:
| Stage | Checks || --- | --- || `seed` | fail, as expected || `after_edit` | pass: the saved memo split the edited paragraph across several `<c>` runs, and the check still read its whole text || `near_miss` | fail, as expected: the time was changed to "2:30 AM" || `after_reset` | fail, as expected: `data/reset` restored the seed |
The agent runs came after the build: Claude Code with Claude Sonnet 5.5 (`--model anthropic/claude-sonnet-5-5 --no-emulate`, on an amd64 host) solved the task 3 times, each run recorded.
## What's inside
```bundle/ the agentenv bundle: envs/ (app module, seed files), tasks/, artifacts/ (verifier), evals/media/ witness and agent-run recordings (MP4) with short GIF previewsresults.json the runs above, with each check's result```
## Limits
- AbiWord starts with a blank document, not the memo, so the agent must open `Documents/book-sale-memo.abw` itself.- The prompt fixes the spelling "2:30 PM", and the check compares the whole sentence, so "2:30 p.m." or "14:30" fails.- The computer installs whatever `abiword` Ubuntu 24.04's archive holds at build time (3.0.5 for these runs); it is not pinned.- AbiWord stamps the author `user`, the computer's generic account, into the memo's metadata.- Three runs is a small sample: the solve rate shows the task is solvable, not how hard it is.
## Licences
The bundle code, the task and the synthetic seed files are Apache-2.0. AbiWord itself is not included: the computer installs it from Ubuntu's archive (`abiword` 3.0.5) at build time, under its own licence (GPL-2.0-or-later).12345678910111213141516171819202122232425262728293031323334353637383940# AbiWord computer app
Exported by REA's `export-desktop-application` from a capture of the `abiword` package(capture Evidence `ev_d5fbe84e3808b08f5b92060897d55564d9ffa4c6da301b681cfec8eb78ed0990`). It was checked against agentenv-framework0.9.1431.
- `envs/abiword/` is a computer app on the `ubuntu-24.04` base with the `reference` driver, for `amd64` and `arm64`. It installs `abiword` from the distribution archive, launches `sh -c cd "$HOME" 2>/dev/null; exec 'abiword'` at boot and is ready when a window of class `Abiword` appears.- Owned paths: `~/.config/abiword`, `~/Documents`. `data/get` returns their files and a typed JSON view of each; `data/reset` restores the seed.- Seed: 2 file(s) from the user's home at checkpoint `seed`. Text files and dconf keys spell the capture host's name as `localhost`, `user@host` as `user@localhost` and the home as `/home/user`, which the computer respells to its own at boot.- `tasks/smoke.json` deploys the app.
Run the task with `agent-env run <this folder>`, or only the deploy with `--task smoke`.
The seed is synthetic test data made for this showcase; it holds no one's real files.
## Task `change-meeting-time`
`tasks/change-meeting-time.json` deploys the app, has the agent work through the computer from the prompt below, and gradesthe outcome with `artifacts/change-meeting-time-check/verify.py`, which reads the app's `data/get` views and needsno model. `evals/abiword.toml` names it, so a run of the bundle runs it.
> The book sale planning meeting has moved. Change the meeting time in the memo Documents/book-sale-memo.abw to 2:30 PM and save it.
Checks, each of which must pass:
- `meeting-time`: `{"kind":"text_equals","file":"Documents/book-sale-memo.abw","pointer":"/root/children/[name=section]/children/[name=p][@xid=6]","value":"The spring book sale planning meeting will be held on Thursday, 12 February at 2:30 PM in the Community Room on the second floor.","normalize_whitespace":true}`- `agenda-deadline-kept`: `{"kind":"text_contains","file":"Documents/book-sale-memo.abw","pointer":"/root/children/[name=section]/children/[name=p][@xid=7]","value":"by 10:00 AM on Wednesday","normalize_whitespace":true}`
REA kept the task because its checks fail on the seed (`meeting-time`) and allpass on the captured end state.
To measure a solve rate, run the task k times (3 by default) with the agent and model to measure, and count the runswhose summary line says `passed`; a run that says `failed` did not finish and is run again rather than counted:
agent-env run <this folder> --task change-meeting-time --agent claude-code --model MODEL123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431"""Checks of the task change-meeting-time against the abiword app's state, exported by REA from a desktop application capture.
It reads the app's data/get through the computer, takes the typed views of its files and evaluates each check: nomodel, no code from the task. A failure to reach the app raises, so the run fails rather than scoring the agent."""import jsonimport mathimport re
from agentenv_protocol import client as protocolfrom agentenv_protocol.types import RPC_PATH
APP = "abiword"CHECKS = [ {"id": "meeting-time", "kind": "text_equals", "file": "Documents/book-sale-memo.abw", "pointer": "/root/children/[name=section]/children/[name=p][@xid=6]", "value": "The spring book sale planning meeting will be held on Thursday, 12 February at 2:30 PM in the Community Room on the second floor.", "normalize_whitespace": True}, {"id": "agenda-deadline-kept", "kind": "text_contains", "file": "Documents/book-sale-memo.abw", "pointer": "/root/children/[name=section]/children/[name=p][@xid=7]", "value": "by 10:00 AM on Wednesday", "normalize_whitespace": True},]
MISSING = object()INDEX = re.compile(r"0|[1-9][0-9]*")VIEW_FORMATS = ("text", "json", "keyfile", "xml")NUMERAL = re.compile(r"[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?")WHITESPACE_RUN = re.compile(r"[ \t\r\n]+")
def _shown(value) -> str: text = json.dumps(value, ensure_ascii=False, separators=(",", ":")) return text if len(text) <= 200 else text[:200] + "…"
def _same(actual, expected) -> bool: """JSON equality: numbers by value but never a boolean for a number, objects by their keys, arrays in order.""" if isinstance(expected, list): return (isinstance(actual, list) and len(actual) == len(expected) and all(_same(item, wanted) for item, wanted in zip(actual, expected))) if isinstance(expected, dict): return (isinstance(actual, dict) and len(actual) == len(expected) and all(key in actual and _same(actual[key], value) for key, value in expected.items())) if isinstance(expected, bool) or isinstance(actual, bool): return isinstance(expected, bool) and isinstance(actual, bool) and actual == expected if isinstance(expected, (int, float)): return isinstance(actual, (int, float)) and actual == expected return type(actual) is type(expected) and actual == expected
def _bracketed(token: str) -> bool: return len(token) >= 2 and token.startswith("[") and token.endswith("]")
def _selector(token: str): """A selector's conditions, [KEY=VALUE] or [@KEY=VALUE] one or more times, or None when the token is not one.""" if not _bracketed(token): return None conditions = [] for part in token[1:-1].split("]["): key, equals, value = part.partition("=") name = key[1:] if key.startswith("@") else key if not equals or not name: return None conditions.append((key.startswith("@"), name, value)) return conditions
def _selects(member, conditions) -> bool: """Whether an array member meets every condition; selectors compare strings only.""" if not isinstance(member, dict): return False for attribute, key, value in conditions: fields = member.get("attributes") if attribute else member if not isinstance(fields, dict) or not isinstance(fields.get(key), str) or fields[key] != value: return False return True
def _step(items: list, token: str, last: bool): """One step into an array, by index or by a selector that must match one member, or none when it is the last.""" if INDEX.fullmatch(token): return ("member", items[int(token)]) if int(token) < len(items) else ("none", None) conditions = _selector(token) if conditions is None: return ("unresolved", f"{token} is not a selector of the form [KEY=VALUE]") if _bracketed(token) else ( "none", None) matched = [item for item in items if _selects(item, conditions)] if len(matched) == 1: return "member", matched[0] if len(matched) > 1: return "unresolved", f"{token} matches {len(matched)} members, not one" return ("none" if last else "unresolved"), f"{token} matches no member"
def _locate(view, pointer: str): """Where a pointer leads: ("value", value), ("none", why or None) or ("unresolved", problem), with the pointers to the arrays a selector searched on the way.""" current, searched = view, [] segments = pointer[1:].split("/") for position, segment in enumerate(segments): token = segment.replace("~1", "/").replace("~0", "~") if isinstance(current, list): if not INDEX.fullmatch(token) and _selector(token) is not None: searched.append("".join("/" + part for part in segments[:position])) kind, found = _step(current, token, position == len(segments) - 1) if kind != "member": return kind, found, searched current = found elif isinstance(current, dict) and token in current: current = current[token] else: return "none", None, searched return "value", current, searched
def _number(value): """A number, or a numeral string read as one; None for anything else, a boolean, or a numeral past the doubles.""" if isinstance(value, bool): return None if isinstance(value, (int, float)): return value if not isinstance(value, str) or not NUMERAL.fullmatch(value): return None number = float(value) return number if math.isfinite(number) else None
def _entry_leaves_out(entry) -> bool: return isinstance(entry, dict) and (isinstance(entry.get("view_error"), str) or ( entry.get("format") in ("text", "xml") and isinstance(entry.get("view"), dict) and entry["view"].get("truncated") is True))
def _viewless_entry(view, pointer: str): """The name of the entry whose view a pointer goes into when it has none, so its null is no JSON value, and why: binary, unread, or of a format without a view; None when it has one.""" parts = pointer[1:].split("/") if len(parts) < 3 or parts[0] != "entries" or parts[2] != "view": return None kind, item, _ = _locate(view, "/entries/" + parts[1]) if kind != "value" or not isinstance(item, dict): return None if isinstance(item.get("view_error"), str): reason = f"has no view: {item['view_error']}" elif item.get("format") == "binary": reason = "is binary and has no view" elif item.get("format") not in VIEW_FORMATS: reason = "has no view" else: return None return (item["name"] if isinstance(item.get("name"), str) else ""), reason
def _array_leaves_out(form, view, array: str) -> bool: """Whether an array a selector searched may lack members: in a zip the listing or its entry's view, else the view's own truncation.""" if form != "zip": return _truncated(form, view) if array == "/entries": return isinstance(view, dict) and view.get("truncated") is True return _zip_leaves_out(view, array)
def _zip_leaves_out(view, pointer: str) -> bool: """Whether a zip view leaves out what a pointer reaches: for a pointer into one listed entry, only that entry.""" if not isinstance(view, dict): return False parts = pointer[1:].split("/") if parts[0] == "entries" and len(parts) > 1: kind, entry, _ = _locate(view, "/entries/" + parts[1]) return _entry_leaves_out(entry) if kind == "value" else view.get("truncated") is True entries = view.get("entries") if isinstance(view.get("entries"), list) else [] return view.get("truncated") is True or any(_entry_leaves_out(entry) for entry in entries)
def _truncated(form, view) -> bool: if not isinstance(view, dict): return False if form in ("text", "xml"): return view.get("truncated") is True if form != "sqlite": return False tables = view.get("tables") return view.get("tables_truncated") is True or any( isinstance(table, dict) and (table.get("truncated") is True or isinstance(table.get("error"), str)) for table in (tables.values() if isinstance(tables, dict) else []))
def _view_of(check, entry, form): """The view, whether it is truncated, and why the check cannot read it; an absent file reads as empty.""" if entry is None: return None, False, None if isinstance(entry.get("error"), str): return None, False, f"{check['file']} has no view: {entry['error']}" if entry.get("format") in (None, "binary"): return None, False, f"{check['file']} is binary and has no view" if form is not None and entry.get("format") != form: return None, False, f"{check['file']} is read as {entry.get('format')}, not {form}" return entry.get("view"), _truncated(entry.get("format"), entry.get("view")), None
def _undecided(check): return False, f"the view of {check['file']} is truncated, so what it leaves out is unknown"
def _compared(check, n: int, what: str): operator = next(key for key in ("equals", "at_least", "at_most") if check.get(key) is not None) expected = check[operator] met = n == expected if operator == "equals" else n >= expected if operator == "at_least" else n <= expected return met, f"{n} {what}, expected {operator.replace('_', ' ')} {expected}"
def _lines(check, entry): view, truncated, problem = _view_of(check, entry, "text") if problem is not None: return False, problem lines = view.get("lines") if isinstance(view, dict) and isinstance(view.get("lines"), list) else [] lines = [line for line in lines if isinstance(line, str)] file = check["file"] if check["kind"] == "lines_present": missing = next((line for line in check["lines"] if line not in lines), None) return (True, f"{file} has the line(s) {_shown(check['lines'])}") if missing is None else ( False, f"{file} has no line {_shown(missing)}") if truncated: return _undecided(check) if check["kind"] == "lines_absent": found = next((line for line in check["lines"] if line in lines), None) return (True, f"{file} has none of the lines {_shown(check['lines'])}") if found is None else ( False, f"{file} still has the line {_shown(found)}") if check.get("contains") is not None: n = sum(1 for line in lines if check["contains"] in line) return _compared(check, n, f"line(s) of {file} contain {_shown(check['contains'])}") n = sum(1 for line in lines if line == check["exact"]) return _compared(check, n, f"line(s) of {file} match {_shown(check['exact'])}")
def _near(at: str, found, expected, tolerance): """A value compared within a tolerance: numbers, and numeral strings, by their difference.""" number = _number(found) within = f"within {_shown(tolerance)} of {_shown(expected)}" if number is None: return False, f"{at} is {_shown(found)}, not a number" if abs(number - expected) <= tolerance: return True, f"{at} is {_shown(found)}, {within}" return False, f"{at} is {_shown(found)}, not {within}"
def _value(check, entry): view, truncated, problem = _view_of(check, entry, None) if problem is not None: return False, problem kind, found, searched = ("none", None, []) if entry is None else _locate(view, check["pointer"]) at = f"{check['file']} at {check['pointer']}" viewless = _viewless_entry(view, check["pointer"]) if entry is not None and entry.get("format") == "zip" else None if viewless is not None: return False, f"{check['file']} entry {viewless[0]} {viewless[1]}" # A selector tells one member from several only in an array the view holds whole. if any(_array_leaves_out(entry.get("format"), view, array) for array in searched): return _undecided(check) if kind == "unresolved": return False, f"{at}: {found}" if entry is not None and entry.get("format") == "zip": truncated = _zip_leaves_out(view, check["pointer"]) if check["kind"] == "value_equals" and isinstance(check["value"], (dict, list)) and truncated: return _undecided(check) if check["kind"] == "value_equals": if kind == "none": return False, f"{at} has no value" if found is None else f"{at}: {found}" expected = check["value"] if check.get("tolerance") is not None and isinstance(expected, (int, float)) and not isinstance(expected, bool): return _near(at, found, expected, check["tolerance"]) if _same(found, check["value"]): return True, f"{at} is {_shown(check['value'])}" return False, f"{at} is {_shown(found)}, not {_shown(check['value'])}" if truncated: return _undecided(check) return (True, f"{at} has no value") if kind == "none" else (False, f"{at} is {_shown(found)}")
def _is_element(value) -> bool: return (isinstance(value, dict) and isinstance(value.get("name"), str) and isinstance(value.get("attributes"), dict) and isinstance(value.get("children"), list))
def _element_text(element) -> str: """An element's text as XPath's string() reads it from what the view keeps: every text node among its children and its descendants', in document order.""" parts, pending = [], [element] while pending: node = pending.pop() if isinstance(node, str): parts.append(node) elif _is_element(node): pending.extend(reversed(node["children"])) return "".join(parts)
def _collapse_whitespace(text: str) -> str: """Each run of XML whitespace (space, tab, CR, LF) made one space, none at either end, as normalize-space().""" return WHITESPACE_RUN.sub(" ", text).strip(" ")
def _not_xml_entry(check, view): """Why a text check's pointer into an archive goes into no XML entry's view, or None when it does or names an entry not listed.""" parts = check["pointer"].split("/") if len(parts) < 4 or parts[3] != "view": return f"{check['file']} at {check['pointer']} does not point into an entry's view" if parts[1] != "entries": return None kind, item, _ = _locate(view, "/entries/" + parts[2]) if kind != "value" or not isinstance(item, dict) or item.get("format") == "xml": return None # An entry without a view failed before this, so its format is one with a view. name, form = (value if isinstance(value, str) else "" for value in (item.get("name"), item.get("format"))) return f"{check['file']} entry {name} is read as {form}, not xml"
def _whole_text(check, entry): """An element's whole text, or a text node's, compared with the value or searched for it.""" view, truncated, problem = _view_of(check, entry, None) if problem is not None: return False, problem at = f"{check['file']} at {check['pointer']}" if entry is None: return False, f"{at} has no value" form = entry.get("format") if form not in ("xml", "zip"): return False, f"{check['file']} is read as {form}, not xml" kind, found, searched = _locate(view, check["pointer"]) viewless = _viewless_entry(view, check["pointer"]) if form == "zip" else None if viewless is not None: return False, f"{check['file']} entry {viewless[0]} {viewless[1]}" if any(_array_leaves_out(form, view, array) for array in searched): return _undecided(check) problem = _not_xml_entry(check, view) if form == "zip" else None if problem is not None: return False, problem if kind == "unresolved": return False, f"{at}: {found}" if kind == "none": return False, f"{at} has no value" if found is None else f"{at}: {found}" if not isinstance(found, str) and not _is_element(found): return False, f"{at} is {_shown(found)}, not an element or its text" # A text node is whole; an element's text is whole only if its view left nothing out. if form == "zip": truncated = _zip_leaves_out(view, check["pointer"]) if not isinstance(found, str) and truncated: return _undecided(check) return _compared_text(check, at, _element_text(found))
def _compared_text(check, at: str, found: str): """A text found at a pointer compared with the check's value or searched for it, both collapsed when it asks.""" collapse = check.get("normalize_whitespace") is True text = _collapse_whitespace(found) if collapse else found value = _collapse_whitespace(check["value"]) if collapse else check["value"] how = " with whitespace collapsed" if collapse else "" if check["kind"] == "text_equals": if text == value: return True, f"{at} has the text {_shown(value)}{how}" return False, f"{at} has the text {_shown(text)}{how}, not {_shown(value)}" if value in text: return True, f"{at} has text containing {_shown(value)}{how}" return False, f"{at} has the text {_shown(text)}{how}, without {_shown(value)}"
def _rows(check, entry): view, _, problem = _view_of(check, entry, "sqlite") if problem is not None: return False, problem view = view if isinstance(view, dict) else {} tables = view.get("tables") if isinstance(view.get("tables"), dict) else {} table = tables[check["table"]] if check["table"] in tables else MISSING name = f"{check['file']} table {check['table']}" if table is MISSING and view.get("tables_truncated") is True: return _undecided(check) table = table if isinstance(table, dict) else {} if isinstance(table.get("error"), str): return False, f"{name} could not be read: {table['error']}" columns = table.get("columns") if isinstance(table.get("columns"), list) else [] rows = table.get("rows") if isinstance(table.get("rows"), list) else [] where = check.get("where") or {}
def matches(row) -> bool: return isinstance(row, list) and all( column in columns and columns.index(column) < len(row) and _same(row[columns.index(column)], value) for column, value in where.items())
n = sum(1 for row in rows if matches(row)) if check["kind"] == "row_present": return (n > 0, f"{name} has a row with {_shown(where)}" if n > 0 else f"{name} has no row with {_shown(where)}") if table.get("truncated") is True: return _undecided(check) if check["kind"] == "row_absent": return (True, f"{name} has no row with {_shown(where)}") if n == 0 else ( False, f"{name} has {n} row(s) with {_shown(where)}") return _compared(check, n, f"row(s) of {name}" + (f" with {_shown(where)}" if "where" in check else ""))
def _verdict(check, entry): kind = check["kind"] if kind == "file_present": return (entry is not None, f"{check['file']} exists" if entry is not None else f"{check['file']} does not exist") if kind == "file_absent": return (entry is None, f"{check['file']} does not exist" if entry is None else f"{check['file']} exists") if kind in ("lines_present", "lines_absent", "line_count"): return _lines(check, entry) if kind in ("value_equals", "value_absent"): return _value(check, entry) if kind in ("text_equals", "text_contains"): return _whole_text(check, entry) return _rows(check, entry)
def evaluate(checks: list, views: dict) -> list: """One result per check against the views data/get returned, by home path.""" results = [] for check in checks: passed, description = _verdict(check, views.get(check["file"])) results.append({"id": check["id"], "result": passed, "description": description}) return results
async def verify(mcp_url, env_url): card = await protocol.get_card(env_url) child = protocol.find_child(card, APP) if child is None: raise RuntimeError(f"the computer at {env_url} lists no app named {APP}") answer = await protocol.get_data(env_url + (child.get("url") or RPC_PATH).removesuffix(RPC_PATH), timeout=120) states = [part.data["state"] for part in answer.parts if part.kind == "data" and isinstance(part.data.get("state"), dict)] if not states: raise RuntimeError(f"the {APP} app's data/get returned no state views") return evaluate(CHECKS, states[0])12345678910---description: Use AbiWord on this Linux desktop; its window has class Abiword.---
# AbiWord
AbiWord is open on the desktop at boot. Its window's class is `Abiword`.
Its files live under `~/.config/abiword`, `~/Documents`. Work through the application's ownwindow and dialogs; the result is read from those files.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790"""AbiWord as an agentenv computer app, exported by REA from a desktop application capture.
Package: abiword (captured at 3.0.5~dfsg-3.2build4). Capture Evidence: ev_d5fbe84e3808b08f5b92060897d55564d9ffa4c6da301b681cfec8eb78ed0990.The seed is synthetic test data made for this showcase."""
from __future__ import annotations
import contextlibimport copyimport hashlibimport ioimport jsonimport mathimport osimport reimport sqlite3import structimport subprocessimport sysimport tempfileimport zipfileimport zlibfrom pathlib import Pathfrom xml.parsers import expat
from agentenv_protocol import add_data, get_data, reset_datafrom agentenv_protocol.computer import AptSource, ComputerAppEnvironment, Download, Launch, Packages, Ready, RunScript, computer_app, linux, ready_checkfrom agentenv_protocol.computer.app_data import INITIAL, add, get, in_thread, keep_initial, resetfrom agentenv_protocol.types import DataPart
HERE = Path(__file__).resolve().parentSEED_HOME = "/home/user"PATHS = [".config/abiword", "Documents"]DCONF = ""TEXT_SEEDS = frozenset([".config/abiword/profile", "Documents/book-sale-memo.abw"])WINDOW_CLASS = "Abiword"
XML_SUFFIXES = (".xml", ".xbel", ".plist", ".svg", ".ui")GROUP_HEADER = re.compile(r"^\[([^\]]+)\]$")LINE_BREAK = re.compile(r"\r?\n")SQLITE_HEADER = b"SQLite format 3\x00"GVDB_HEADER = b"GVariant"ZIP_HEADER = b"PK\x03\x04"XML_SPACE = "xml:space"MAX_VIEW_BYTES = 64 * 1024 * 1024MAX_SAFE_INTEGER = 2**53 - 1MAX_TABLES = 64MAX_ROWS = 500MAX_LINES = 5000MAX_XML_NODES = 5000MAX_XML_DEPTH = 64SQLITE_BUSY_S = 0.25MAX_PARSED_BYTES = 4 * 1024 * 1024MAX_JSON_VIEW_DEPTH = 500JSON_TOO_DEEP = f"nested deeper than the {MAX_JSON_VIEW_DEPTH} levels a JSON view keeps"
def _respelled(text: str, home: Path) -> str: """The seed's home path respelled to this computer's home, only where a whole path segment ends after it.""" return re.sub(re.escape(SEED_HOME) + r"(?![\w.@+~-])", lambda _: str(home), text)
def _respelled_utf16(data: bytes, home: Path) -> bytes: """A UTF-16 text file with a byte-order mark respelled like a text seed, its mark kept; any other bytes as given.""" for mark, codec in ((b"\xff\xfe", "utf-16-le"), (b"\xfe\xff", "utf-16-be")): if data.startswith(mark): try: text = data[len(mark):].decode(codec) except UnicodeDecodeError: return data return mark + _respelled(text, home).encode(codec) if SEED_HOME in text else data return data
#: What marks a window as not yet the app's own: skipping the taskbar, as splash screens and dialogs do, or a splash type.SPLASH_MARKS = ("_NET_WM_STATE_SKIP_TASKBAR", "_NET_WM_WINDOW_TYPE_SPLASH")
def _taskbar_window(window_class: str) -> bool: """Whether a top-level window of the given class that the taskbar lists is shown; a splash screen or a dialog skips the taskbar.""" def xprop(*args: str) -> str: done = subprocess.run(["xprop", *args], capture_output=True, text=True) return done.stdout if done.returncode == 0 else ""
for window in re.findall(r"0x[0-9a-f]+", xprop("-root", "_NET_CLIENT_LIST").partition("#")[2]): props = xprop("-id", window, "WM_CLASS", "_NET_WM_STATE", "_NET_WM_WINDOW_TYPE") classes = re.findall(r'"((?:[^"\\]|\\.)*)"', props.partition("WM_CLASS")[2].split("\n", 1)[0]) if window_class in classes and not any(mark in props for mark in SPLASH_MARKS): return True return False
def _seed_home(home: Path) -> None: """Copy the captured files into this computer's home; text files, UTF-16 ones too, have the seed's home path respelled.""" seed = HERE / "seed" for source in sorted(seed.rglob("*")) if seed.is_dir() else []: if not source.is_file(): continue relative = source.relative_to(seed).as_posix() target = home / relative target.parent.mkdir(parents=True, exist_ok=True) data = source.read_bytes() if relative in TEXT_SEEDS: data = _respelled(data.decode("utf-8"), home).encode("utf-8") else: data = _respelled_utf16(data, home) target.write_bytes(data)
def _dconf(arguments: list, environment: dict) -> str: return subprocess.run(["dconf", *arguments], env={**os.environ, **environment}, capture_output=True, text=True, check=True).stdout
def _load_dconf(home: Path) -> None: """Compile the captured dconf keys into the user database without D-Bus, which is not up yet. Keys already there stay unless captured: dconf compile reads the key files in name order and a later file wins. A failure is reported and the app starts without them.""" if not DCONF: return database = home / ".config" / "dconf" / "user" try: database.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(dir=database.parent) as scratch: keyfiles = Path(scratch, "keyfiles") keyfiles.mkdir() if database.is_file(): profile = Path(scratch, "profile") profile.write_text(f"file-db:{database}\n") existing = _dconf(["dump", "/"], {"DCONF_PROFILE": str(profile)}) (keyfiles / "00-existing").write_text(existing) (keyfiles / "01-captured").write_text(_respelled(DCONF, home)) _dconf(["compile", str(Path(scratch, "user")), str(keyfiles)], {}) os.replace(Path(scratch, "user"), database) except (OSError, subprocess.CalledProcessError) as error: detail = (getattr(error, "stderr", None) or "").strip().splitlines() print(f"warning: the captured dconf settings were not loaded: {detail[-1] if detail else error}", file=sys.stderr)
def _sqlite_text(data: bytes): text = data.decode("utf-8", "replace") return {"text": text, "bytes_hex": data.hex()} if "�" in text else text
def _cell(value): if isinstance(value, bytes): return {"blob_hex": value.hex()} if isinstance(value, int) and abs(value) > MAX_SAFE_INTEGER: return {"integer": str(value)} # JSON has no infinities or negative zero; REA's SQLite reader spells them as strings. if isinstance(value, float) and (math.isinf(value) or (value == 0 and math.copysign(1, value) < 0)): return "Infinity" if value == math.inf else "-Infinity" if value == -math.inf else "-0" return value
def _table(db, name: str, primary_key: list) -> dict: quoted = '"' + name.replace('"', '""') + '"' cursor = db.execute(f"select * from main.{quoted} not indexed limit {MAX_ROWS + 1}") rows = [[_cell(value) for value in row] for row in cursor] return {"columns": [column[0] for column in cursor.description], "primary_key": primary_key, "rows": rows[:MAX_ROWS], "truncated": len(rows) > MAX_ROWS}
def _sqlite(path: Path) -> dict: """The database's ordinary tables, in schema order, up to REA's table and row limits.""" with contextlib.closing(sqlite3.connect(path.resolve().as_uri() + "?mode=ro", uri=True, timeout=SQLITE_BUSY_S)) as db: kinds = dict(db.execute("select name, type from pragma_table_list where schema = 'main'")) names = [name for (name,) in db.execute("select name from sqlite_schema where type = 'table'") if kinds.get(name) == "table"] keys = {name: [key for (key,) in db.execute( "select name from pragma_table_info(?, 'main') where pk > 0 order by pk", (name,))] for name in names[:MAX_TABLES]} db.text_factory = _sqlite_text tables = {name: _table(db, name, keys[name]) for name in names[:MAX_TABLES]} cut = len(names) > MAX_TABLES return {"format": "sqlite", "view": {"tables": tables, "tables_truncated": cut}, "truncated": cut or any(table["truncated"] for table in tables.values())}
def _text(text: str) -> dict: lines = LINE_BREAK.split(text) if lines[-1] == "": lines.pop() view = {"lines": lines[:MAX_LINES], "line_count": len(lines), "truncated": len(lines) > MAX_LINES} return {"format": "text", "view": view, "truncated": view["truncated"]}
def _keyfile_line(raw: str) -> tuple: """A key file line as REA reads it: skip (blank or comment), group, entry or other.""" line = raw.strip() if not line or line[0] in "#;": return ("skip",) header = GROUP_HEADER.match(line) if header: return ("group", header.group(1)) key, equals, value = line.partition("=") return ("entry", key.strip(), value.strip()) if equals and key else ("other",)
def _is_keyfile(text: str) -> bool: """REA's rule: at least one group, and nothing a key file view would drop.""" kinds = {_keyfile_line(line)[0] for line in LINE_BREAK.split(text)} return "group" in kinds and "other" not in kinds
def _keyfile(text: str) -> dict: groups, group = {}, "" for line in map(_keyfile_line, LINE_BREAK.split(text)): if line[0] == "group": group = line[1] groups.setdefault(group, {}) elif line[0] == "entry": groups.setdefault(group, {})[line[1]] = line[2] return groups
#: XML's whitespace, which alone can be formatting between elements; Unicode's wider set is text.XML_WHITESPACE = " \t\r\n"PREDEFINED_ENTITIES = ("amp", "lt", "gt", "apos", "quot")ENTITY_REFERENCE = re.compile(r"&([^#;][^;]*);")
def _expat(namespaces: bool, doctype=None): """An expat parser that reads a DOCTYPE as REA does: one with an internal subset, which could declare entities, is refused, the DTD it names is never read, and a reference to an entity other than XML's five is refused where expat would skip it. With namespaces it also enforces their rules, as REA's parser does, and without them it reports names as the document spells them. doctype, when given, receives the declared name and identifiers.""" parser = expat.ParserCreate(namespace_separator=" " if namespaces else None) parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_NEVER)
def declared(name: str, system_id, public_id, internal_subset: bool) -> None: if internal_subset: raise ValueError("the document's DOCTYPE has an internal subset") if doctype is not None: doctype({"name": name, "public_id": public_id, "system_id": system_id})
def undeclared(name: str, _parameter: bool) -> None: raise ValueError(f"the document refers to the undeclared entity {name}")
def external(*_) -> None: raise ValueError("the document refers to an external entity")
parser.StartDoctypeDeclHandler = declared parser.SkippedEntityHandler = undeclared parser.ExternalEntityRefHandler = external return parser
def _check_tag(markup: str) -> None: """expat leaves an undeclared entity out of an attribute value without a word when a DOCTYPE names a DTD; REA's parser refuses it. With text taken by its own handler, a start tag is the only markup expat passes here that starts with < and a name, and it passes it whole.""" if markup[:1] == "<" and markup[1:2] not in ("!", "?", "/"): for name in ENTITY_REFERENCE.findall(markup): if name not in PREDEFINED_ENTITIES: raise ValueError(f"the document refers to the undeclared entity {name}")
def _ignore_text(_text: str) -> None: pass
class _XmlReader: """REA's XML view built as expat reads: names as spelled, declarations as attributes, text split where REA's DOM splits it (an empty CDATA section joins the text around it), and each node counted against REA's limits."""
def __init__(self) -> None: self.remaining, self.truncated, self.root, self.doctype = MAX_XML_NODES, False, None, None #: Per open element: its view or None when left out, whether xml:space="preserve" applies inside it, whether #: it holds an element, and whether it holds text other than whitespace: whitespace-only text is formatting #: only in an element that holds elements and no such text. self.open = [] self.text, self.cdata = [], None
def read(self, text: str) -> None: parser = _expat(False, self._doctype) parser.buffer_text = True parser.StartElementHandler, parser.EndElementHandler = self._start, self._end parser.CharacterDataHandler = self._data parser.StartCdataSectionHandler, parser.EndCdataSectionHandler = self._cdata_start, self._cdata_end parser.CommentHandler = parser.ProcessingInstructionHandler = self._other parser.Parse(text, True)
def _doctype(self, declared: dict) -> None: self.doctype = declared
def _admit(self) -> bool: """Whether the next node inside a kept element is kept, within the node and depth limits; one past them marks the view truncated.""" if self.open and self.open[-1][0] is None: return False if self.remaining <= 0 or len(self.open) > MAX_XML_DEPTH: self.truncated = True return False self.remaining -= 1 return True
def _text_node(self, text: str) -> None: if self.open and text.strip(XML_WHITESPACE): self.open[-1][3] = True if self._admit(): self.open[-1][0]["children"].append(text)
def _flush(self) -> None: if self.text: text, self.text = "".join(self.text), [] self._text_node(text)
def _data(self, text: str) -> None: (self.text if self.cdata is None else self.cdata).append(text)
def _cdata_start(self) -> None: self.cdata = []
def _cdata_end(self) -> None: text, self.cdata = "".join(self.cdata), None if text: self._flush() self._text_node(text)
def _other(self, *_) -> None: """A comment or processing instruction, counted like any node and never kept.""" self._flush() if self.open: self._admit()
def _start(self, name: str, attributes: dict) -> None: self._flush() parent = self.open[-1] if self.open else [None, False, False, False] parent[2] = True view = {"name": name, "attributes": attributes, "children": []} if self._admit() else None if view is not None and parent[0] is not None: parent[0]["children"].append(view) space = attributes.get(XML_SPACE) self.open.append([view, space == "preserve" if space else parent[1], False, False])
def _end(self, _name: str) -> None: self._flush() view, preserve, holds_element, holds_text = self.open.pop() if view is not None and holds_element and not holds_text and not preserve: view["children"] = [child for child in view["children"] if not isinstance(child, str) or child.strip(XML_WHITESPACE)] if not self.open: self.root = view
def _xml_view(text: str): """REA's XML view, or None for a document REA's parser refuses: a pass with namespaces checks the document as REA's parser does, then a pass without them reads names as spelled, as REA's view keeps them, and the DOCTYPE.""" reader = _XmlReader() try: check = _expat(True) check.CharacterDataHandler, check.DefaultHandler = _ignore_text, _check_tag check.Parse(text, True) reader.read(text) except (expat.ExpatError, ValueError): return None view = {"root": reader.root, "truncated": reader.truncated} return view if reader.doctype is None else {"doctype": reader.doctype, **view}
def _not_json(constant: str): raise ValueError(f"{constant} is not JSON")
class _Inexact(Exception): """A JSON number that REA's state view refuses, since reading it would change it."""
def _digits(text: str) -> str: return re.split(r"[eE]", text.lstrip("-"))[0].replace(".", "").strip("0") or "0"
def _js_string(value: float) -> str: """How JavaScript's String() writes a finite double: an integer below 1e21 in full, any other in shortest form.""" return str(int(value)) if value.is_integer() and abs(value) < 1e21 else repr(value)
def _safe_number(text: str) -> bool: """lossless-json's isSafeNumber: an integer spelling within 2^53, or a float spelling that keeps its digits.""" if re.fullmatch(r"-?[0-9]+", text): return len(text.lstrip("-")) <= 16 and abs(int(text)) <= MAX_SAFE_INTEGER value = float(text) if not math.isfinite(value): return False written = _js_string(value) return written == text or _digits(written) == _digits(text)
def _exact_number(text: str): """A JSON number read only when reading it changes nothing, as REA's state view rules: its spelling and its written-back form both safe, and not -0.""" value = float(text) if (not _safe_number(text) or not math.isfinite(value) or not _safe_number(_js_string(value)) or (value == 0 and math.copysign(1, value) < 0)): raise _Inexact(text) return int(text) if re.fullmatch(r"-?[0-9]+", text) else value
_INEXACT = object()_LEVEL_END = object()
def _number_or_mark(spelling: str): """A JSON number read exactly, or a mark for one REA's state view refuses.""" try: return _exact_number(spelling) except _Inexact: return _INEXACT
def _holds_inexact(value) -> bool: """Whether a parsed JSON value still holds a marked number once duplicate keys kept their last value; one iterator per nesting level, so no child list is copied.""" levels = [iter((value,))] while levels: item = next(levels[-1], _LEVEL_END) if item is _LEVEL_END: levels.pop() elif item is _INEXACT: return True elif isinstance(item, dict): levels.append(iter(item.values())) elif isinstance(item, list): levels.append(iter(item)) return False
def _deeper_than(root, limit: int) -> bool: """Whether a parsed JSON value nests deeper than a limit, as REA checks it: a value's depth is the number of iterators open above it, one per nesting level, so no child list is copied.""" levels = [iter((root,))] while levels: item = next(levels[-1], _LEVEL_END) if item is _LEVEL_END: levels.pop() elif len(levels) - 1 > limit: return True elif isinstance(item, dict): levels.append(iter(item.values())) elif isinstance(item, list): levels.append(iter(item)) return False
def _text_view(name: str, text: str) -> dict: """The format REA's state view detects for decoded text, and its view.""" trimmed = re.sub(r"^[\s]+", "", text) if name.endswith(".json") or trimmed[:1] in ("[", "{"): # The whole text must parse, and duplicate keys settle, before an inexact number makes it JSON with an error. try: view = json.loads(text, parse_constant=_not_json, parse_float=_number_or_mark, parse_int=_number_or_mark) except RecursionError: # Nesting too deep for Python to parse is far deeper than REA's view keeps. return {"format": "json", "view": None, "error": JSON_TOO_DEEP} except ValueError: pass else: if _holds_inexact(view): return {"format": "json", "view": None, "error": "a number in it cannot be read exactly, such as an integer above 2^53"} if _deeper_than(view, MAX_JSON_VIEW_DEPTH): return {"format": "json", "view": None, "error": JSON_TOO_DEEP} return {"format": "json", "view": view, "truncated": False} lowered = name.lower() if lowered.endswith(XML_SUFFIXES) or trimmed.startswith("<?xml"): view = _xml_view(text) return _text(text) if view is None else {"format": "xml", "view": view, "truncated": view["truncated"]} if _is_keyfile(text): return {"format": "keyfile", "view": {"groups": _keyfile(text)}, "truncated": False} return _text(text)
def _view(path: Path) -> dict: """A typed JSON view of one file in the shapes of REA's state view; truncated says the view is partial.""" too_large = {"format": None, "view": None, "error": "larger than 64 MiB, the most the view reads"} if path.stat().st_size > MAX_VIEW_BYTES: return too_large with path.open("rb") as file: data = file.read(8192) whole = not data.startswith(SQLITE_HEADER) and b"\x00" not in data data += file.read(MAX_VIEW_BYTES + 1 - len(data)) if whole else b"" if data.startswith(SQLITE_HEADER): return _sqlite(path) if data.startswith(ZIP_HEADER): return _zip(path) if len(data) > MAX_VIEW_BYTES: return too_large try: text = data.decode("utf-8-sig") if whole else None except UnicodeDecodeError: text = None return {"format": "binary", "view": None, "truncated": False} if text is None else _text_view(path.name, text)
def _views(home: Path, paths: list) -> dict: """A view of every file under the app's paths, keyed by its home-relative path.""" files = {} for owned in paths: root = home / owned candidates = [root] if root.is_file() else sorted(root.rglob("*")) if root.is_dir() else [] for path in candidates: if path.is_file() and not path.is_symlink(): key = path.relative_to(home).as_posix() try: files[key] = _view(path) except (OSError, ValueError, sqlite3.Error, RecursionError) as error: files[key] = {"format": None, "view": None, "error": str(error)} return files
MAX_ZIP_ENTRIES = 1000MAX_ZIP_ENTRY_BYTES = 16 * 1024 * 1024MAX_ZIP_BYTES = 64 * 1024 * 1024MAX_ZIP_RATIO = 100ZIP_READ_CHUNK = 64 * 1024ZIP_END = b"PK\x05\x06"ZIP_CENTRAL = b"PK\x01\x02"ZIP64_LOCATOR = b"PK\x06\x07"ZIP64_END = b"PK\x06\x06"#: Formats an archive entry may have whose reader needs a tool, a worker or another archive opened.NOT_READ_INSIDE = ((SQLITE_HEADER, "sqlite", "a SQLite database"), (GVDB_HEADER, "dconf", "a dconf database"), (ZIP_HEADER, "zip", "an archive"))
def _entry_view(name: str, data: bytes) -> dict: """An archive entry's format and view by the rules a file's follow; a database or an archive inside is not read.""" for header, form, inside in NOT_READ_INSIDE: if data.startswith(header): return {"format": form, "view": None, "error": f"{inside} inside an archive is not read"} try: text = data.decode("utf-8-sig") if b"\x00" not in data[:8192] else None except UnicodeDecodeError: text = None if text is None: return {"format": "binary", "view": None} view = _text_view(name, text) if view["format"] in ("json", "keyfile") and len(data) > MAX_PARSED_BYTES: return {"format": view["format"], "view": None, "error": "larger than the 4 MiB limit for JSON and key file views"} return view
def _zip_refusal(info, spent: int): """Why an entry is not read, checked in REA's order, or None; spent is the archive's bytes read so far.""" if info.flag_bits & 0x1: return "encrypted, so it is not read" if info.compress_type not in (zipfile.ZIP_STORED, zipfile.ZIP_DEFLATED): return f"compressed with method {info.compress_type}, which the view does not read" if info.file_size > MAX_ZIP_ENTRY_BYTES: return "larger than the 16 MiB an entry's view reads" if info.file_size > MAX_ZIP_RATIO * info.compress_size: return f"expands more than {MAX_ZIP_RATIO} times, so it is not read" if spent + info.file_size > MAX_ZIP_BYTES: return "past the 64 MiB read from one archive" return None
def _entry_bytes(archive, info): """An entry's uncompressed bytes, or None when they fail its CRC-32 or are not exactly its declared size. Reading stops one byte past that size, which data past a short declared size fills, and asks for a bounded chunk at a time, which bounds what the decompressor expands per call, so a forged small size holds no more than that.""" probe = copy.copy(info) probe.file_size = info.file_size + 1 data = bytearray() try: with archive.open(probe) as member: while len(data) <= info.file_size: chunk = member.read(min(probe.file_size - len(data), ZIP_READ_CHUNK)) if not chunk: break data += chunk except (zipfile.BadZipFile, zlib.error, EOFError, OSError, ValueError): return None return data if len(data) == info.file_size else None
def _zip_entry(archive, info, refusal): """One entry of a zip view: its name, size and digest, and its own format and view, or why it was not read.""" entry = {"name": info.filename, "size": info.file_size, "sha256": None, "format": None, "view": None, "view_error": refusal} if refusal is not None: return entry data = _entry_bytes(archive, info) if data is None: return {**entry, "view_error": "its compressed data is damaged"} view = _entry_view(info.filename, data) return {**entry, "sha256": hashlib.sha256(data).hexdigest(), "format": view["format"], "view": view.get("view"), "view_error": view.get("error")}
def _zip_end(file, size: int): """Where an archive's central directory ends, how long it is and the offset it declares, from the last end record whose comment reaches the end of the file and, when a Zip64 locator precedes it whatever that record holds, the Zip64 one just before the locator; None without an end record, or when sentinels defer to a Zip64 record that is missing.""" window = min(size, 22 + 0xFFFF) file.seek(size - window) tail = file.read(window) at = tail.rfind(ZIP_END, 0, len(tail) - 18) while at >= 0 and at + 22 + int.from_bytes(tail[at + 20:at + 22], "little") != len(tail): at = tail.rfind(ZIP_END, 0, at + 3) if at < 0: return None total, length, offset = struct.unpack_from("<HII", tail, at + 10) end = size - window + at record = end - 20 - 56 if record < 0: return end, length, offset file.seek(end - 20) if file.read(4) != ZIP64_LOCATOR: return end, length, offset file.seek(record) zip64 = file.read(56) if len(zip64) == 56 and zip64[:4] == ZIP64_END: length, offset = struct.unpack_from("<QQ", zip64, 40) return record, length, offset if total == 0xFFFF or 0xFFFFFFFF in (length, offset): return None return end, length, offset
def _zip_unicode_path(raw: bytes, flags: int, extra: bytes): """An Info-ZIP Unicode Path when zip.js uses it: version 1, no UTF-8 flag, and the CRC-32 of the stored name.""" at = 0 while at + 4 <= len(extra): kind, length = struct.unpack_from("<HH", extra, at) if kind == 0x7075: data = extra[at + 4:at + 4 + length] usable = (length >= 5 and len(data) == length and data[0] == 1 and not flags & 0x800 and int.from_bytes(data[1:5], "little") == zlib.crc32(raw)) return data[5:] if usable else None at += 4 + length return None
def _zip_ends_in_slash(raw: bytes, flags: int, extra: bytes): """Whether an entry's name, as REA decodes it, ends in a slash; None when it must be UTF-8 and is not.""" utf8 = _zip_unicode_path(raw, flags, extra) if utf8 is None and flags & 0x800: utf8 = raw if utf8 is None: return raw.endswith(b"/") try: return utf8.decode("utf-8").endswith("/") except UnicodeDecodeError: return None
def _zip_directory(file, size: int, keep: int): """An archive's central directory read a record at a time, keeping the first file entries' records, as many as keep allows, and counting the rest, as REA reads it: (start, declared offset, records, count), or None when it cannot be read. Directories are told apart as zip.js tells them: a final slash, a Unix directory mode, or the MS-DOS attribute.""" located = _zip_end(file, size) if located is None: return None end, length, declared = located start = end - length if start < 0: return None file.seek(start) records, count, at = [], 0, start while at < end: fixed = file.read(46) if at + 46 > end or len(fixed) < 46 or fixed[:4] != ZIP_CENTRAL: return None made_by, flags = struct.unpack_from("<H2xH", fixed, 4) name_length, extra_length, comment_length = struct.unpack_from("<HHH", fixed, 28) external = struct.unpack_from("<I", fixed, 38)[0] rest = file.read(name_length + extra_length + comment_length) at += 46 + name_length + extra_length + comment_length if len(rest) < name_length + extra_length + comment_length or at > end: return None slash = _zip_ends_in_slash(rest[:name_length], flags, rest[name_length:name_length + extra_length]) if slash is None: return None if not (slash or (external >> 16) & 0o170000 == 0o040000 or (made_by >> 8 == 0 and external & 0x10)): count += 1 if len(records) < keep: records.append(fixed + rest) return start, declared, records, count
class _BoundedArchive(io.RawIOBase): """An archive as zipfile reads it: its entries in place, then a directory of the kept records alone and end records for them, so zipfile parses no more records than the view lists."""
def __init__(self, file, start: int, tail: bytes) -> None: super().__init__() self._file, self._start, self._tail, self._at = file, start, tail, 0
def readable(self) -> bool: return True
def seekable(self) -> bool: return True
def tell(self) -> int: return self._at
def seek(self, offset: int, whence: int = 0) -> int: self._at = offset + (0, self._at, self._start + len(self._tail))[whence] return self._at
def readinto(self, buffer) -> int: view = memoryview(buffer) if self._at < self._start: self._file.seek(self._at) count = self._file.readinto(view[:self._start - self._at]) else: chunk = self._tail[self._at - self._start:self._at - self._start + len(view)] count = len(chunk) view[:count] = chunk self._at += count return count
def _zip(path: Path) -> dict: """A zip archive's file entries in archive order, up to REA's entry, size, ratio and archive limits; nothing is extracted to disk, no archive inside is opened, and zipfile is shown only the directory records listed.""" entries, spent = [], 0 try: with path.open("rb") as file: directory = _zip_directory(file, os.fstat(file.fileno()).st_size, MAX_ZIP_ENTRIES) if directory is None: raise zipfile.BadZipFile("no readable central directory") start, declared, records, count = directory kept = b"".join(records) offset = declared if declared <= 0xFFFFFFFF else start # zipfile follows a Zip64 locator signature wherever one sits before the end record, and the kept records # may end in those bytes, so a real Zip64 end record and locator for them come first. tail = (kept + struct.pack("<4sQ2H2I4Q", ZIP64_END, 44, 45, 45, 0, 0, len(records), len(records), len(kept), offset) + struct.pack("<4sIQI", ZIP64_LOCATOR, 0, offset + len(kept), 1) + struct.pack("<4s4H2IH", ZIP_END, 0, 0, len(records), len(records), len(kept), offset, 0)) with zipfile.ZipFile(_BoundedArchive(file, start, tail)) as archive: for info in archive.infolist(): refusal = _zip_refusal(info, spent) spent += info.file_size if refusal is None else 0 entries.append(_zip_entry(archive, info, refusal)) except (zipfile.BadZipFile, zlib.error, EOFError, NotImplementedError, OSError, ValueError, struct.error): return {"format": "zip", "view": None, "error": "not a readable zip archive"} view = {"entries": entries, "entry_count": count, "truncated": count > len(entries)} return {"format": "zip", "view": view, "truncated": view["truncated"]}
@computer_app(supports=[{"os": {"type": "linux", "display": ["x11"]}, "arch": ["amd64", "arm64"]}])@linux( packages=Packages(apt=["abiword"]), launch=Launch(at="boot", command=["sh", "-c", "cd \"$HOME\" 2>/dev/null; exec 'abiword'"], window={"class": "Abiword"}, ready=Ready(window=True)), paths=PATHS, skill="SKILL.md",)class Abiword(ComputerAppEnvironment): """AbiWord, launched at boot with the captured state in its home.
Declaring data hooks switches off agentenv's default data plane, so these call its helpers: the seed is kept as the initial state, reset restores it, add writes files under PATHS, and get returns those files plus a typed JSON view of each. """
def __init__(self) -> None: super().__init__() if not INITIAL.exists(): _seed_home(Path.home()) _load_dconf(Path.home()) keep_initial(self.paths)
@add_data async def add_files(self, parts: list) -> None: await add(parts, self.paths)
@get_data async def get_files(self, write_namespace=None) -> list: files = await get(self.paths, write_namespace) views = await in_thread(_views, Path.home(), self.paths) return [*files, DataPart(data={"state": views})]
@reset_data async def reset_files(self) -> None: await reset(self.paths)
@ready_check def main_window_shown(self) -> bool: """A window of the app's class that the taskbar lists is shown, not only a splash screen or a dialog.""" return _taskbar_window(WINDOW_CLASS)1234type = "computer_app"module = "abiword_app.py:Abiword"computer = "ubuntu-24.04"driver = "reference"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190<!-- ===================================================================== --><!-- This file contains AbiSuite Preferences. AbiSuite is a suite of Open --><!-- Source desktop applications developed by AbiSource, Inc. Information --><!-- about this application can be found at http://www.abisource.com --><!-- You should not edit this file by hand. --><!-- ===================================================================== -->
<!-- Build_ID = unknown --><!-- Build_Version = 3.0.5 --><!-- Build_CompileTime = 17:35:25 --><!-- Build_CompileDate = Mar 31 2024 -->
<AbiPreferences app="abiword" ver="1.0">
<Select scheme="_builtin_" autosaveprefs="1" useenvlocale="1" />
<!-- The following scheme, _builtin_, contains the built-in application **** defaults and adjusted by the installation system defaults. This scheme **** is only written here as a reference. Any schemes following this one **** only list values that deviate from the built-in values. **** Items values must observe XML encoding for double quote ("), **** ampersand (&), and angle brackets (< and >). -->
<Scheme name="_builtin_" SpellCheckDirectory="dictionary" RemapGlyphsDefault="°" AutoSaveFilePeriod="5" EnableSmoothScrolling="1" CursorBlink="1" ColorRevision8="0485c3" AutoGrammarCheck="0" ZoomType="Width" AutoSaveFile="1" SpellAutoReplace="0" NoMACinUUID="0" InsertModeToggle="0" HTML_Export_Options="?xml,xmlns:awml,+CSS" ColorRevision1="ab04fe" ColorRevision9="0712c3" SpellCheckInternet="1" OuterQuoteStyle="0" LatinLigatures="0" DefaultSaveFormat=".abw" InnerQuoteStyle="1" ColorSelBackground="c0c0c0" AutoLoadPlugins="1" DefaultDirectionRtl="0" ParaVisible="0" SmartQuotesEnable="1" ColorRevision2="ab1477" ColorRevision3="ff9708" ChangeLangWithKeyboard="0" TransparentColor="ffffff" RulerVisible="1" FormatBarVisible="1" ColorHyperLink="0000ff" ToolPaletteVisible="1" CustomSmartQuotes="0" />
<Plugin name="_AbiPaint_" szImageEditor="gimp" bLeaveImageAsPNG="1" />
<Recent max="9" />
<Geometry width="0" height="0" posx="0" posy="0" flags="0" />
<Log> <!-- [Thu 05 Nov 2026 09:59:19 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/kword.so --> <!-- [Thu 05 Nov 2026 09:59:19 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/kword.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/epub.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/epub.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/opml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/opml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/google.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/google.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/freetranslation.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/freetranslation.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/garble.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/garble.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/mht.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/mht.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/goffice.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/goffice.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/openxml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/openxml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/s5.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/s5.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/paint.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/paint.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/xslfo.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/xslfo.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wordperfect.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wordperfect.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/latex.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/latex.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/hrtext.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/hrtext.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/iscii.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/iscii.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/docbook.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/docbook.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/applix.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/applix.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/mif.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/mif.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/bmp.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/bmp.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/gimp.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L164): failed to register /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/gimp.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L170): error msg Unknown --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wpg.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wpg.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/passepartout.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/passepartout.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/t602.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/t602.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/sdw.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/sdw.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wikipedia.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wikipedia.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/clarisworks.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/clarisworks.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/openwriter.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/openwriter.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/babelfish.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/babelfish.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/gdict.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/gdict.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/command.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/command.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/loadbindings.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/loadbindings.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/ots.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/ots.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wmf.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wmf.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/mswrite.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/mswrite.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/pdf.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L164): failed to register /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/pdf.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L170): error msg Unknown --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/hancom.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/hancom.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/wml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/urldict.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/urldict.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/opendocument.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/opendocument.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/presentation.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/presentation.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/eml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/eml.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L104): loading /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/pdb.so --> <!-- [Thu 05 Nov 2026 09:59:20 PM UTC] message: XAP_ModuleManager::loadModule - (L189): success /usr/lib/x86_64-linux-gnu/abiword-3.0/plugins/pdb.so --> </Log>
<Fonts include="0"> <!-- Here you can put a list of fonts to limit the fonts that appear in the font UI:
<Face name="some face"/>
The include attribute of 'Fonts' controls the significance of the list: include="1" - limit fonts to those listed include="0" - exclude the listed fonts from the system font list --> </Fonts>
</AbiPreferences>12345678910111213141516171819202122232425262728293031323334353637383940414243<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE abiword PUBLIC "-//ABISOURCE//DTD AWML 1.0 Strict//EN" "http://www.abisource.com/awml.dtd"><abiword template="false" xmlns:ct="http://www.abisource.com/changetracking.dtd" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:math="http://www.w3.org/1998/Math/MathML" xid-max="13" xmlns:dc="http://purl.org/dc/elements/1.1/" styles="unlocked" fileformat="1.0" xmlns:svg="http://www.w3.org/2000/svg" xmlns:awml="http://www.abisource.com/awml.dtd" xmlns="http://www.abisource.com/awml.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" version="0.99.2" xml:space="preserve" props="dom-dir:ltr; document-footnote-restart-section:0; document-endnote-type:numeric; document-endnote-place-enddoc:1; document-endnote-initial:1; lang:en-US; document-endnote-restart-section:0; document-footnote-restart-page:0; document-footnote-type:numeric; document-footnote-initial:1; document-endnote-place-endsection:0"><!-- ======================================================================== --><!-- This file is an AbiWord document. --><!-- AbiWord is a free, Open Source word processor. --><!-- More information about AbiWord is available at http://www.abisource.com/ --><!-- You should not edit this file by hand. --><!-- ======================================================================== -->
<metadata><m key="abiword.date_last_changed">Thu Nov 5 22:02:07 2026</m><m key="abiword.generator">AbiWord</m><m key="dc.creator">user</m><m key="dc.date">Thu Nov 5 22:02:07 2026</m><m key="dc.format">application/x-abiword</m></metadata><rdf></rdf><history version="1" edit-time="167" last-saved="1793916127" uid="271a506a-d964-11f1-8728-ffab445e5204"><version id="1" started="1793916127" uid="8ad79658-d964-11f1-8728-ffab445e5204" auto="0" top-xid="13"/></history><styles><s type="P" name="Normal" followedby="Current Settings" props="font-family:Times New Roman; margin-top:0pt; color:000000; margin-left:0pt; text-position:normal; widows:2; font-style:normal; text-indent:0in; font-variant:normal; font-weight:normal; margin-right:0pt; font-size:12pt; text-decoration:none; margin-bottom:0pt; line-height:1.0; bgcolor:transparent; text-align:left; font-stretch:normal"/></styles><pagesize pagetype="Letter" orientation="portrait" width="8.500000" height="11.000000" units="in" page-scale="1.000000"/><section xid="12" props="page-margin-footer:0.5in; page-margin-header:0.5in"><p style="Normal" xid="13"><c>MEMO</c></p><p style="Normal" xid="1"><c>To: Harbor Street Library volunteers</c></p><p style="Normal" xid="2"><c>From: Dana Whitfield, Volunteer Coordinator</c></p><p style="Normal" xid="3"><c>Date: Monday, 9 February</c></p><p style="Normal" xid="4"><c>Subject: Spring book sale planning meeting</c></p><p style="Normal" xid="5"><c></c></p><p style="Normal" xid="6"><c>The spring book sale planning meeting will be held on Thursday, 12 February at 10:00 AM in the Community Room on the second floor.</c></p><p style="Normal" xid="7"><c>Please send agenda items to Marcus Lee by 10:00 AM on Wednesday so he can circulate them before the meeting.</c></p><p style="Normal" xid="8"><c>If you cannot attend, reply to this memo by Tuesday.</c></p><p style="Normal" xid="9"><c></c></p><p style="Normal" xid="10"><c>Thank you,</c></p><p style="Normal" xid="11"><c>Dana</c></p></section></abiword>1tasks = ["change-meeting-time"]123456789[ {"id":"env","type":"deploy_env","env_id":"abiword"}, {"id":"agent","type":"deploy_agent","env_ids":["abiword"]}, {"id":"skills","type":"add_skills","env_ids":["abiword"]}, {"id":"record","type":"start_computer_recording","env_id":"abiword","name":"agent","depends_on":["env"]}, {"id":"task","type":"prompt_agent","depends_on":["skills","record"],"prompt":"The book sale planning meeting has moved. Change the meeting time in the memo Documents/book-sale-memo.abw to 2:30 PM and save it."}, {"id":"check","type":"env_outcome_verifier","env_id":"abiword","file_artifact_id":"change-meeting-time-check","verifier_id":"change-meeting-time","depends_on":["task"]}, {"id":"end","type":"end_computer_recording","name":"agent","depends_on":["task"]}]1234567[ { "id": "env", "type": "deploy_env", "env_id": "abiword" }]123version https://git-lfs.github.com/spec/v1oid sha256:15cf6baec62554c2d2f7bb91e2d92a6c289cf17fa56507278ac6568d105fca8fsize 1698095123version https://git-lfs.github.com/spec/v1oid sha256:04f16a863c68b261e9b64c58bc5772a4465a8f17d41d4595d7f1c0aca62cd48csize 1780997123version https://git-lfs.github.com/spec/v1oid sha256:f86509ef42869b496a27d18b6562106e8243f5a63a7038241d6f64fae56f40f5size 1646644123version https://git-lfs.github.com/spec/v1oid sha256:8624d58da2318e9133e5cc748b245260dd824af23032e91a3f1a9f4b30b719efsize 9128169123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081{ "environment": "AbiWord", "app_version": "AbiWord 3.0 word processor", "task": "change-meeting-time", "prompt": "The book sale planning meeting has moved. Change the meeting time in the memo Documents/book-sale-memo.abw to 2:30 PM and save it.", "agent": "claude-code", "model": "claude-sonnet-5-5", "agentenv_framework": "0.9.1431", "witness": "checks failed on the seed, passed after an edit made through computer actions, failed on a near miss (\"2:30 AM\") and failed again after data/reset, in a fresh computer; held on the first try", "runs": [ { "run": 1, "verdict": "passed", "turns": 19, "usd": 1.2, "checks": { "change-meeting-time": { "score": 1.0, "results": [ { "id": "meeting-time", "result": true, "description": "Documents/book-sale-memo.abw at /root/children/[name=section]/children/[name=p][@xid=6] has the text \"The spring book sale planning meeting will be held on Thursday, 12 February at 2:30 PM in the Community Room on the second floor.\" with whitespace collapsed" }, { "id": "agenda-deadline-kept", "result": true, "description": "Documents/book-sale-memo.abw at /root/children/[name=section]/children/[name=p][@xid=7] has text containing \"by 10:00 AM on Wednesday\" with whitespace collapsed" } ] } } }, { "run": 2, "verdict": "passed", "turns": 18, "usd": 1.62, "checks": { "change-meeting-time": { "score": 1.0, "results": [ { "id": "meeting-time", "result": true, "description": "Documents/book-sale-memo.abw at /root/children/[name=section]/children/[name=p][@xid=6] has the text \"The spring book sale planning meeting will be held on Thursday, 12 February at 2:30 PM in the Community Room on the second floor.\" with whitespace collapsed" }, { "id": "agenda-deadline-kept", "result": true, "description": "Documents/book-sale-memo.abw at /root/children/[name=section]/children/[name=p][@xid=7] has text containing \"by 10:00 AM on Wednesday\" with whitespace collapsed" } ] } } }, { "run": 3, "verdict": "passed", "turns": 20, "usd": 0.46, "checks": { "change-meeting-time": { "score": 1.0, "results": [ { "id": "meeting-time", "result": true, "description": "Documents/book-sale-memo.abw at /root/children/[name=section]/children/[name=p][@xid=6] has the text \"The spring book sale planning meeting will be held on Thursday, 12 February at 2:30 PM in the Community Room on the second floor.\" with whitespace collapsed" }, { "id": "agenda-deadline-kept", "result": true, "description": "Documents/book-sale-memo.abw at /root/children/[name=section]/children/[name=p][@xid=7] has text containing \"by 10:00 AM on Wednesday\" with whitespace collapsed" } ] } } } ]}README.mdAdded+110
bundle/README.mdAdded+40
bundle/artifacts/change-meeting-time-check/verify.pyAdded+431
bundle/envs/abiword/SKILL.mdAdded+10
bundle/envs/abiword/abiword_app.pyAdded+790
bundle/envs/abiword/env.tomlAdded+4
bundle/envs/abiword/seed/.config/abiword/profileAdded+190
bundle/envs/abiword/seed/Documents/book-sale-memo.abwAdded+43
bundle/evals/abiword.tomlAdded+1
bundle/tasks/change-meeting-time.jsonAdded+9
bundle/tasks/smoke.jsonAdded+7
media/hero.gifAdded

Large File Pointer Details
- SHA256: b9ebc8f4f18759d64b4a8e65a17e9dd7dc2b469d393e87b34ad9e3bef3748cfd
- Pointer size: 131 Bytes
- Size of remote file: 318 kB
media/solve-1.mp4Added+3
media/solve-2.mp4Added+3
media/solve-3.mp4Added+3
media/witness.mp4Added+3
results.jsonAdded+81