Skip to content

feat(desktop): set up and check a desktop build host in one command - #9199

Merged
morluto merged 703 commits into
morluto:mainfrom
earakely-scale:feat/desktop-build-doctor
Nov 9, 2026
Merged

morluto merged 703 commits into
morluto:mainfrom
earakely-scale:feat/desktop-build-doctor

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Contributor

rea setup --client <id> --desktop-build prepares the supported parts of a desktop build host, and rea doctor --provider desktop_build checks remaining prerequisites.

Setup reports its planned changes and uses the existing approval flow. Doctor reports actionable host, runtime and dependency checks.

Stacked on #9184.

Maintainer follow-up and validation

Setup command ownership now preserves an earlier command failure and bounded output when caller cancellation arrives during cleanup. Cancellation conversion lives at the owned-command boundary and reuses the shared command-output projection; resource cleanup remains retryable. The deterministic completed-failure/during-cleanup ordering uses the existing command spy, while the real subprocess fixture separately checks active installer cancellation. This is not a real-provider verification of the finalization ordering. Existing failed-setup settings, stale-client-path and process-family ownership repairs are included with the corrected parent stack. Doctor now uses the runtime owner's empty-runner PATH fallback and validates its resolved version; its observed PATH cannot establish a separately launched client's PATH. Numeric seed-check repair is inherited from #9132.

At head e710756c41, the affected tests below completed with 83 passed (83); npm run check:fast and git diff --check passed. This includes the updated parent stack and main through 25d3c7237f. Checks use source/domain and controlled boundary fixtures; no real desktop provider qualification was performed. Current-head CI and review remain required before auto-merge.

node node_modules/vitest/vitest.mjs run src/application/Setup.desktopBuild.test.ts src/desktop/DesktopBuildSetupHost.test.ts src/desktop/DesktopBuildOwnedCommand.test.ts src/desktop/DesktopBuildDoctorFacts.test.ts src/application/DesktopBuildDoctor.test.ts tests/boundary/process/desktopBuildOwnedCommand.test.ts src/desktop/BuildComputerEnvironment.test.ts src/application/desktop/DesktopTaskDraftNotes.test.ts src/domain/desktop/stateRoles.test.ts

Maintainer follow-up

Doctor now asks the pinned agentenv configuration owner for the selected configuration and model endpoint instead of treating any [model] table as an endpoint or duplicating config precedence. It preserves missing, unknown, and configured facts without claiming endpoint availability. Queries use the existing bounded, cancellable command owner; selected config inputs must pass the bounded regular-file check. Empty environment overrides remain unknown when the owner APIs disagree. Setup's selected archive spelling, command failure/output, cleanup retries, and live unresolved-resource labels remain preserved.

At 4412f15de2, the focused doctor suites passed 33 tests, npm run check:fast and full npm run format:check passed. The query-timeout regression injects a timeout result and verifies deadline/stop controls; it does not establish behavior of a genuinely stalled agentenv process. No real desktop-provider qualification was performed. Current-head CI and review remain required.

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.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-06T22:46:39.026054Z
We couldn’t complete this review. Comment @codex review to try again.
aafc46f PR opened
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[High impact] The changes reach REA’s desktop build, capture, export, and task-check workflows.

Fix file-target aliases and the XML warning's shared-owner requirement before merging; doctor should also reuse the runner's Python.

Findings

  1. P1 Settings file aliases break boot ▶
  2. P2 Doctor needs another Python ▶
  3. P2 XML fallback loses its warning ▶
Fix with agent prompt
### Issue 1
src/domain/desktop/appExportPython.ts:163
A selected alias can target a regular settings file, such as `.config/tellicorc`; `capturedStateAliases` does not filter out files. After `_seed_home` writes that file, the new unconditional `destination.mkdir(...)` raises `FileExistsError`, so the exported app cannot start. The same problem occurs at line 158 when the link already exists.

Preserve whether an alias targets a file or a folder, and create only folder targets. This also follows the requirement in `AGENTS.md` to preserve caller-selected paths.

### Issue 2
src/desktop/DesktopBuildDoctorFacts.ts:265
If a host uses uv's managed Python but has no `python3` on `PATH`, the new probe reports every explicitly selected archive as `unknown`. Doctor then fails and setup returns `needs_human`, even when builds can use the archive. Repacking does not fix the missing command.

Builds already find Python through `agentEnvInterpreter`, and archive extraction runs inside the computer. Reuse the runner's resolved Python for this probe.

### Issue 3
src/domain/desktop/stateFormats.ts:37-40
The new `nameSupported` policy makes well-formed XML with names such as `<Ϳ/>` read as text. But `readAsTextNotes` repeats the syntax check without that policy, so it emits no `read_as_text` warning for the same document. Authors get line-based checks without the expected explanation.

`AGENTS.md` requires consumers to use the owner's parsed facts rather than reinterpret raw source. Have the draft consume the desktop reader's decision and reason. This repository requirement must be satisfied before merging.

---

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

Summary

Adds one-command desktop build-host setup and scoped doctor checks.

  • One setup command prepares a selected client for desktop builds.
  • Doctor reports which desktop build host requirements are ready.
  • Desktop build captures keep more app state and explain build results in greater detail.
  • Desktop exports preserve and explain more of an app’s starting state.
  • Desktop task drafts suggest checks for more kinds of app changes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Desktop setup request"] --> B["Read host and client facts"]
  B --> C["Show planned changes"]
  C --> D{"Approved?"}
  D -- No --> E["Return plan"]
  D -- Yes --> F["Install agentenv if requested"]
  F --> G["Pack runtime if needed"]
  G --> H["Record client settings and refresh skill"]
  H --> I["Run desktop doctor checks"]
  I --> J["Return ready or required fixes"]
Loading

Reviews (15) · Last reviewed commit: "fix(desktop): inspect supported runtime ..." · Reviewed by Greptile

Comment thread src/desktop/DesktopBuildSetupHost.ts Resolved
Comment thread src/desktop/DesktopBuildSetupHost.ts Resolved
@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's stacked on #9184.

It turns the setup steps a blind run on a fresh Ubuntu machine had to work out alone into two commands: rea setup --client <id> --desktop-build packs the build-computer runtime and records the build settings in the client's registration, and rea doctor --provider desktop_build checks the rest (Docker and its group, disk, the agentenv version, the archive, the registration, the skill) and prints the exact fix for each failure. Setup never runs sudo, and doctor reads registration settings by name only.

Greptile's two findings (a runner not installed yet, and a deleted archive setup had packed) are fixed in 5454c66da, with tests.

cursoragent and others added 16 commits November 7, 2026 10:18
…-checks

# Conflicts:
#	src/domain/desktop/appTaskDraftLineGuards.ts
An empty assignment is not a path. Resolving it named the working directory
and rewrote the value when that directory's spelling moved.
A formatting attribute such as Scribus FONT is not the document's words.
Joining it across runs made a frame-wide text check of ItalicBold that
failed when a run was split. The font stays a value check on its own run.
A field named @record_id matched the id suffix and became [@record_id=one],
which reads an XML attribute. Records paired while their pointers matched
nothing. Names that start with @ or > are not id fields.
xml:id and draw:id values such as id123456 were both generated and
numbered, so the same selector was counted twice and refused. A text
edit of two elements keyed only by those ids now keeps its check.
Comment thread src/domain/desktop/appExportPython.ts Resolved
Comment thread src/desktop/DesktopBuildDoctorFacts.ts Resolved
Comment thread src/domain/desktop/stateFormats.ts Resolved
# Conflicts:
#	src/domain/desktop/appTaskDraftNoise.test.ts
# Conflicts:
#	src/application/desktop/DesktopApplicationExport.ts
#	src/application/desktop/DesktopBuildComputers.ts
#	src/desktop/AgentEnvComputer.ts
#	src/domain/desktop/stateRoles.ts
# Conflicts:
#	docs/desktop-application-tasks.md
#	docs/desktop-build-witness.md
#	docs/specs/desktop-app-environments/build-witness/spec.md
#	src/domain/desktop/appTaskDraftNamed.ts
#	src/domain/desktop/appTaskDraftNoise.ts
#	src/domain/desktop/appTaskDraftValues.test.ts
# Conflicts:
#	src/domain/desktop/appTaskDraftNamed.ts
#	src/domain/desktop/appTaskDraftNoise.ts
# Conflicts:
#	src/application/Setup.ts
#	src/composition/capabilityServices.ts
#	src/doctorRuntime.ts
# Conflicts:
#	.agents/skills/reverse-engineer-anything/references/desktop-build.md
#	docs/desktop-application-capture.md
#	docs/desktop-application-export.md
#	docs/desktop-application-state.md
#	docs/desktop-application-tasks.md
#	docs/desktop-build-computer.md
#	docs/desktop-build-witness.md
#	docs/specs/desktop-app-environments/build-witness/spec.md
#	docs/specs/desktop-app-environments/build-witness/verification.md
#	src/application/desktop/DesktopApplicationCapture.ts
#	src/application/desktop/DesktopApplicationExport.test.ts
#	src/application/desktop/DesktopApplicationExport.ts
#	src/application/desktop/DesktopBuildBundle.ts
#	src/application/desktop/DesktopBuildCapture.ts
#	src/application/desktop/DesktopBuildComputers.ts
#	src/application/desktop/DesktopBuildOutputRead.test.ts
#	src/application/desktop/DesktopBuildSummary.ts
#	src/application/desktop/DesktopBuildWitness.test.ts
#	src/application/desktop/DesktopExportFiles.ts
#	src/application/desktop/DesktopExportLaunch.ts
#	src/application/desktop/DesktopGzipDocument.test.ts
#	src/application/desktop/DesktopTaskDraft.ts
#	src/application/desktop/DesktopTaskDraftNotes.test.ts
#	src/application/desktop/DesktopTaskExport.test.ts
#	src/composition/capabilityServices.ts
#	src/contracts/desktopBuildToolContracts.ts
#	src/desktop/DesktopApplicationSession.test.ts
#	src/domain/desktop/appExport.test.ts
#	src/domain/desktop/appExport.ts
#	src/domain/desktop/appExportPython.ts
#	src/domain/desktop/appExportUnowned.test.ts
#	src/domain/desktop/appExportUnowned.ts
#	src/domain/desktop/appTaskChecks.fixture.ts
#	src/domain/desktop/appTaskChecks.ts
#	src/domain/desktop/appTaskDraft.fixture.ts
#	src/domain/desktop/appTaskDraft.ts
#	src/domain/desktop/appTaskDraftAdded.test.ts
#	src/domain/desktop/appTaskDraftAdded.ts
#	src/domain/desktop/appTaskDraftFileNotes.test.ts
#	src/domain/desktop/appTaskDraftFileNotes.ts
#	src/domain/desktop/appTaskDraftGuards.test.ts
#	src/domain/desktop/appTaskDraftGuards.ts
#	src/domain/desktop/appTaskDraftLineGuards.ts
#	src/domain/desktop/appTaskDraftNamed.ts
#	src/domain/desktop/appTaskDraftNoise.test.ts
#	src/domain/desktop/appTaskDraftNoise.ts
#	src/domain/desktop/appTaskDraftNotes.ts
#	src/domain/desktop/appTaskDraftPositional.test.ts
#	src/domain/desktop/appTaskDraftScalars.ts
#	src/domain/desktop/appTaskDraftText.ts
#	src/domain/desktop/appTaskDraftTextAdded.test.ts
#	src/domain/desktop/appTaskDraftValues.test.ts
#	src/domain/desktop/appTaskDraftValues.ts
#	src/domain/desktop/appTaskPython.ts
#	src/domain/desktop/attributeRank.ts
#	src/domain/desktop/desktopCapture.test.ts
#	src/domain/desktop/desktopCapture.ts
#	src/domain/desktop/positionalKeys.ts
#	src/domain/desktop/runtimeFiles.ts
#	src/domain/desktop/seedDocument.test.ts
#	src/domain/desktop/seedScrub.ts
#	src/domain/desktop/selectorCandidates.ts
#	src/domain/desktop/stateChanges.ts
#	src/domain/desktop/stateFormats.ts
#	src/domain/desktop/stateRoles.test.ts
#	src/domain/desktop/stateRoles.ts
#	src/domain/desktop/viewPointer.test.ts
#	src/domain/desktop/viewPointer.ts
#	tests/boundary/mcp/buildCaptureDraftMcp.test.ts
#	tests/boundary/mcp/buildCaptureRetryMcp.test.ts
#	tests/boundary/mcp/buildComputerMcp.test.ts
#	tests/boundary/providers/desktopExportPython.test.ts
#	tests/fixtures/buildCaptureFakes.ts
#	tests/fixtures/buildComputerMcp.ts
# Conflicts:
#	docs/desktop-build-computer.md
#	src/domain/desktop/appExportPython.ts
#	src/domain/desktop/appTaskChecks.fixture.ts
#	src/domain/desktop/appTaskDraftFileNotes.ts
#	src/domain/desktop/appTaskDraftLineGuards.test.ts
#	src/domain/desktop/appTaskPythonPointer.ts
#	src/domain/desktop/stateFormats.ts
@morluto
morluto merged commit 240f08d into morluto:main Nov 9, 2026
4 checks passed
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
@morluto morluto added area: cli CLI adapter and one-shot commands enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants