Skip to content

feat(skills): build a computer-app environment from a request - #9049

Merged
morluto merged 53 commits into
morluto:mainfrom
earakely-scale:feat/desktop-build-skill
Nov 8, 2026
Merged

morluto merged 53 commits into
morluto:mainfrom
earakely-scale:feat/desktop-build-skill

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #9045 and #9050. The branch starts with a merge of the two (39b53a0d1, which also reconciles #9050's whole-text checks with #9045's cut-view rule), so its diff includes them until they merge. Review only 0bfc64bfa, then b1c227528, 721d2da27, 86b2a1e1c, 2bc9b7bab, 61bf5870b and fed97718f: about 490 lines, mostly one skill reference.

Summary

This adds the skill that takes Claude from a request such as "Build me an Inkscape environment where the agent changes a poster's headline and saves it" to a witnessed computer-app bundle and a report. It uses the tools from #9037, #9041 and #9045. It is the last of four PRs for "a bundle from a request". The requester's own Claude is the building agent, and REA embeds no model.

Problem and expected behavior

The build tools existed, but nothing told an agent how to use them well: what to ask, how to make a seed, which checks prove an edit, or how to witness. After this change, the product skill routes a request like that to references/desktop-build.md. That procedure covers:

  • the questions to ask once upfront, and when to pause, never accepting a licence for the person;
  • choosing the install;
  • driving the app through act_on_build_computer only;
  • making the seed in the app, then seed, the edit, then end;
  • writing content checks by selector;
  • exporting;
  • a witness in a fresh computer from the prompt alone, with a near miss and a reset;
  • solver runs only within a budget;
  • the final report.

Change and scope

  • The skill: .agents/skills/reverse-engineer-anything/references/desktop-build.md. A routing bullet and a guide entry in SKILL.md, and one line in references/environments.md.
  • Setup: MANAGED_SKILL_FILES installs the new reference. The setup conformance test lists it.
  • skillVersion: 60 → 61, regenerated metadata.
  • Docs: pointers to the skill from the build-computer and build-witness guides.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the product skill.
  • Contribution scope fit and linked maintainer decision: same approved desktop-environments work as feat(desktop): capture a Linux desktop application in use #8874.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup details: unchanged.
  • Generated metadata: the skill and package metadata (skillVersion 61).

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Two blind runs on an Ubuntu 24.04 amd64 VM (agentenv-framework 0.9.1431) validated the whole stack. In each, a fresh agent got only the request, this skill and REA's MCP tools.

1. Inkscape: "an Inkscape environment where the agent changes a poster's headline and saves it"

The agent was barred from the Inkscape environment built earlier.

  • Build: about 19 minutes from the request alone, with no app-specific scripts. The export was accepted on the first try.

  • Checks: the headline is checked by layer label, text id and tspan, plus one check that the date line is unchanged. The pointer matches the earlier, hand-built Inkscape environment character for character. The poster's wording differs, because both were invented independently.

  • Witness: held on the first try:

    Stage Result
    seed fails
    after_edit passes
    near_miss (a typo) fails
    after_reset fails
  • Solver runs: Claude Code with Sonnet 5.5 passed 3 of 3 ($1.55, $0.51, $0.70; 18 to 23 turns).

2. AbiWord (held out): "an AbiWord environment where the agent changes the meeting time in a memo and saves it"

No one had built this app with REA before.

  • Build: about 27 minutes.
  • First witness: failed after_edit while the memo on screen was right. REA refuses .abw's DOCTYPE, so the file is read as text. AbiWord also saves a reloaded document's new insertions in their own markup, so a multi-word line check broke. The agent rewrote the checks to the short value the edit types.
  • Second witness: held at all four stages.
  • Solver runs: 2 of 3 passed. The failure was a correct edit (the old time gone, "PM" kept) whose 3:30 AbiWord stored across markup. This is the limit of text-line checks on that format, not a solver error.

What both runs taught the skill (b1c227528, 721d2da27):

  • The act tool: its argument shapes, including key taking an array, and a region screenshot becoming the latest frame.
  • Focus: a visible caret is not focus, and text typed in Inkscape without a text cursor runs as shortcuts.
  • Saving: in Save As, click Documents and type only the name. Confirm dialogs with Return.
  • Seed hygiene: what reaches the seed (the Trash, stray files) and first-run dialogs.
  • What a bundle's app opens with: the seed's files, not the document itself.
  • XML read as text: when the draft shows an XML file's changes as lines, use short line checks.
  • Reloaded documents: some apps save a reloaded document differently, so keep text checks to the typed value.
  • The witness: only its seed stage takes directory.

Product fixes from the same runs are in #9045 (f6e9decf7):

  • the Trash is kept out of seeds;
  • starting a computer from a bundle no longer writes into the bundle;
  • the first screenshot waits for the desktop to draw;
  • a .deb that apt also offers exports from apt.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • After merging main c928bb8d, Node 24 build and five focused Ghidra MCP parity, skill setup, desktop check/draft, and XML parity suites passed (123 tests); check:fast and format:check passed. Real application builds were not rerun after this integration.

  • Passed with no new lint diagnostics in this PR's files: npm run typecheck, format:check, metadata:check, docs:check (including the skill-metadata, product-catalog, conformance-ledger and skill-bundle link checks), docs:build, mcp-catalog:check and knip.

  • Skill and setup tests passed, with the build tests: 419 passed and 12 skipped.

  • verify:package needs the commit; it reads git-tracked files.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Inkscape 1.2.2 and AbiWord 3.0.5 in real Ubuntu 24.04 amd64 agentenv computers.
  • Package or release metadata impact: skillVersion 61.
  • Security, privacy, process, or containment review: the skill keeps seeds synthetic, never accepts a licence for the person, and never publishes a bundle.

AbiWord rebuilt with #9050: with plain-DOCTYPE XML and whole-text checks, a fresh blind AbiWord build took 13 minutes. Its text_equals reads the meeting paragraph by xid. The witness held on the first try, with the reopened memo split across runs, and Claude Code with Sonnet 5.5 passed 3 of 3. The skill now points text checks at the paragraph, never at a run.

Known gaps, for follow-up PRs:

  • Opening the document: a bundle's app does not open the seed document. Opening it at launch when the seed holds one app-saved document is about 30–50 lines in export.
  • Seed note: the export's README still calls a seed "the user's real data", and there is no way to mark it synthetic.

Final review round

main, #9045 and #9050 are merged in, with their final review fixes. An independent review of this PR's own commits found nothing that needed a change.

Author readiness

Human owner: @earakely-scale

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] The PR reaches agent guidance and desktop task checks, within the desktop-app build workflow.

The draft-check gap should be fixed before merging because an incomplete edit can pass grading.

Findings

  1. P1 Missing breaks pass grading ▶
Fix with agent prompt
### Issue 1
src/domain/desktop/appTaskDraftText.ts:94
A whitespace-only wrapper can now hide a line break or image from the drafted checks. Changing `<p>Hello</p>` to `<p>Hello there<span xml:space="preserve"> <br/></span></p>` drafts only the paragraph's `text_equals` check. The wrapper's text is `" "`, so `textlessAt` returns false and `covers` makes `added` skip the whole wrapper, including its break.

`<p>Hello there </p>` then passes despite missing the break. Before this change, the wrapper kept a separate check. Preserve checks for non-text children while allowing whitespace runs to split or merge.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds a skill that guides an agent from a desktop-app request through installation, seed creation, task checks, export, witness stages, and reporting.

  • An agent can turn a desktop-app request into a witnessed bundle.
  • Cut XML views no longer let incomplete element text settle a task check.
  • Paragraph checks now cover whitespace-only runs in saved text.

earakely-scale explicitly leaves automatic document opening and the README's synthetic-seed wording for follow-up PRs.

Validation was source-based. A runtime probe could not start because zod was not installed. GitHub supersession status could not be checked because gh lacked credentials. The prior-review merge bases differed, so this review used the full PR range.

Reviews (22) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread src/domain/desktop/appTaskDraftNamed.ts Resolved
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 5, 2026
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	docs/specs/desktop-app-environments/build-witness/tasks.md
#	docs/specs/desktop-app-environments/build-witness/verification.md
#	src/application/desktop/DesktopApplicationExport.ts
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	docs/specs/desktop-app-environments/build-witness/tasks.md
#	docs/specs/desktop-app-environments/build-witness/verification.md
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
Comment thread src/domain/desktop/appTaskChecks.ts Resolved
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
@earakely-scale
earakely-scale marked this pull request as ready for review November 6, 2026 01:27
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-06T01:27:11.636390Z
We couldn’t complete this review. Comment @codex review to try again.
9beb59e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
earakely-scale and others added 7 commits November 5, 2026 20:13
…ld computer

- start_build_capture runs REA's capture inside the computer through a
  small controller over computer-exec, after a user-space apt-get update;
  mark_build_checkpoint returns once the capture confirms the checkpoint;
  stop_build_capture returns the draft between seed and end.
- export_build_environment exports with the requester's task inside the
  computer and fetches the bundle through data/get in bounded batches.
- check_build_task grades a computer's data/get with REA's evaluator and,
  through seed, after_edit, near_miss and after_reset stages, records a
  witness with the action log and the screen recording; act_on_build_computer
  gains reset.
- Capture progress lines carry window, checkpoint and refusal events; apps
  start in the home; a pack script builds the runtime archive; long tools
  send progress notifications.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…se the near-miss reset hole

- A capture whose start answer is lost is stopped at once and kept
  unreleased until the stop is confirmed; a lost checkpoint answer is
  recovered from the capture's own log, and draft and export use the
  checkpoints its Evidence records; stop can be repeated to resume
  reading its result.
- A witness can check its seed again after a failed read, and keeps its
  stages in a saving state until the record is written, so a failed save
  can be retried without reading the app again.
- after_edit and near_miss count only click, drag, scroll, type and key,
  so a reset no longer stands in for the near-miss edit.
- A .deb build keeps its package file for capture and passes its URL to
  export; bundle downloads write each checked file before fetching the
  next; an apt-get update failure reports its exit code and log tail;
  reset sends progress while it waits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd first frames drawn

From the blind Inkscape rebuild:
- Paths in ~/.local/share/Trash get a desktop_trash reason and the
  shared_desktop role, so a file trashed before seed is neither owned nor
  seeded; the export names it in a limitation.
- The keep helper runs with PYTHONDONTWRITEBYTECODE=1, so starting a
  computer from a bundle folder no longer writes __pycache__ into it.
- start_build_computer waits, bounded, until the first frame is not one
  colour before returning it.
From review: a .deb that apt also offers exports from apt, since export
passes --package-url only when the capture says the package must come
from its file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…with progress throughout

Each retry of the drawn-first-frame wait runs under an abort that fires at
the 10 s deadline, and the latest frame is returned when time runs out.
connect takes the first frame itself while its progress heartbeat still
runs, reporting "waiting for the desktop to draw". The wait moves to
DrawnScreenshot.ts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng id, and separate unreadable checks from failures

- One queue per computer: actions, capture steps and witness checks run one
  at a time, so two overlapping after_edit checks can no longer both be filed
  and let the witness hold without a near miss. Close cancels the running and
  queued calls; different computers still run concurrently.
- The witness keeps one recording request id per computer, so a seed retried
  after a lost reply recovers the recording it started.
- A check that could not read its file is undecided, not a failure, so a
  temporary read error can't satisfy seed, near_miss or after_reset; such a
  stage is refused and can be checked again.
- The export's file listing is written to a file and read back in bounded
  batches, so a large bundle no longer overruns exec's 1 MiB output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ided seed failure at export, and keep a close's cancellation

- A presence check that misses its line, row or pointed value in a view cut
  short is undecided rather than failed, since the data may sit in the part
  left out; a witness stage can no longer be proved by such a failure.
- Export counts only decided failures on the seed, and refuses a task whose
  every seed failure is undecided.
- A step whose turn was aborted by a close or the caller returns cancelled
  even when its work finished, so start_build_capture no longer reports
  success for a computer being removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…during its commit

Reporting cancelled for any step whose turn was aborted after its work
replaced a completed export or witness save with a bare cancellation, losing
what was saved and leaving the witness unreadable. Steps now return what they
completed; only start_build_capture, which commits nothing, checks its turn
after the post-launch screenshot and reports cancelled. Asking again for a
saved witness's final check returns its record.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
earakely-scale and others added 5 commits November 6, 2026 10:41
…ery JS regex mode

main's advertised-pattern test compiles every input schema pattern in v
mode, which refuses an unescaped hyphen in a character class. The
checkpoint name's hyphen is now escaped, and it means the same in u mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
main's mixed-case JSON suffix fix and this branch both added the import,
and the merge kept both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
@earakely-scale

Copy link
Copy Markdown
Contributor Author

@morluto this one is ready for review. It merges cleanly into main, and all checks pass. It is stacked on #9045 and #9050, so once that merges, its diff shrinks to this PR's own commits.

The description's "Final review round" section lists the main merges and the fixes from an independent review of this PR's diff.

cursoragent and others added 4 commits November 7, 2026 04:12
Keep the build-witness spec beside the XML text-check spec, and keep
cut-view failures undecided while accepting main's whole-text checks.

Co-authored-by: morluto <[email protected]>
…t update

A cancel after data/reset no longer drops the restore from the action log,
so a near miss cannot treat the restored seed as an edit. An unreadable
seed check that later passes leaves after_reset undecided instead of
failing the witness. apt-get update is kept only when Error-Mode reports
success and a package list was fetched. The controller reply schema lives
with the controller, and capture progress lines are read by their domain
parser.
Bring the reset, seed-comparison and apt-list fixes forward, and keep
morluto#9049's rule that a cut element's text stays undecided.
A run whose only text is whitespace is still text the paragraph check
reads. It no longer gets its own presence check, which a later save of
the same words without that run would fail. Images and breaks, whose
text is empty, still keep their own checks.
after_reset stays undecided when any check was not read, even if another
check still fails and the unread result's boolean matches the seed. A
text check for a child past a truncated view is undecided in both
evaluators. A reset whose reply is lost blocks a near miss until a later
input or a reset whose reply arrives.
A recording that fails to end or download is not written into the witness
folder, and a manifest already received is fetched again without ending
the recording twice. A folder that is published while its handles fail to
close keeps that record and retries the same cleanup instead of writing
the folder again.
Keep a missing child of a cut view undecided, and keep morluto#9049's note that
a cut element's kept runs are not its whole text.
Comment thread src/domain/desktop/appTaskPython.ts Resolved
A second failure to close a published witness returns the original error,
so its record and cleanup lease stay bound. A reset the app itself
refuses is an AppDataRefusal; only a reply that is not that refusal stays
unsettled. A missing child of a cut view is undecided with the same
description in both evaluators, and the shared cases cover it.
cursoragent and others added 5 commits November 7, 2026 05:00
A missing child of a truncated view is undecided for the same sentence in both evaluators, including the pointer the view does not contain.
A published record and its bound cleanup error stay together. A later close failure returns that error, and the unused path that built a fresh adapter error is gone.
# Conflicts:
#	docs/desktop-build-computer.md
#	docs/desktop-build-witness.md
#	docs/specs/desktop-app-environments/build-witness/spec.md
#	src/domain/desktop/appTaskChecks.fixture.ts
#	src/domain/desktop/appTaskChecks.test.ts
#	src/domain/desktop/appTaskChecks.ts
#	src/domain/desktop/appTaskPython.ts
@morluto
morluto merged commit 03a3fcb into morluto:main Nov 8, 2026
47 of 49 checks passed
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 8, 2026
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
[ends.baseline, ends.final].some((view) => {
const value = resolvePointer(view, pointer);
return isXmlElement(value) && isWhitespace(elementText(value));
return isXmlElement(value) && elementText(value) === "";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing breaks pass grading

A whitespace-only wrapper can now hide a line break or image from the drafted checks. Changing <p>Hello</p> to <p>Hello there<span xml:space="preserve"> <br/></span></p> drafts only the paragraph's text_equals check. The wrapper's text is " ", so textlessAt returns false and covers makes added skip the whole wrapper, including its break.

<p>Hello there </p> then passes despite missing the break. Before this change, the wrapper kept a separate check. Preserve checks for non-text children while allowing whitespace runs to split or merge.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/desktop/appTaskDraftText.ts
Line: 94

Comment:
**Missing breaks pass grading**

A whitespace-only wrapper can now hide a line break or image from the drafted checks. Changing `<p>Hello</p>` to `<p>Hello there<span xml:space="preserve"> <br/></span></p>` drafts only the paragraph's `text_equals` check. The wrapper's text is `" "`, so `textlessAt` returns false and `covers` makes `added` skip the whole wrapper, including its break.

`<p>Hello there </p>` then passes despite missing the break. Before this change, the wrapper kept a separate check. Preserve checks for non-text children while allowing whitespace runs to split or merge.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@morluto morluto added enhancement New feature or request area: bridge Hopper bridge (Python) related changes labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: bridge Hopper bridge (Python) related changes enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants