Repository navigation
feat(desktop): install extra packages beside an archive app, and keep a package file's dependencies at export - #9112
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The changes affect desktop app build, capture, and export workflows. Check guest support for the new export flag and satisfy the cleanup requirements before merging. Findings
Fix with agent prompt### Issue 1
src/application/desktop/DesktopBuildExport.ts:149
If `REA_BUILD_COMPUTER_REA_ARCHIVE` contains a runtime from before this PR, `checkExportRuntime` accepts it because it supports `syntheticSeed`. But that runtime rejects the new `--extra-package` flag. A package-file request with dependencies can therefore finish capture and then become impossible to export on that computer.
Check for `extraPackage` support before capture when the request needs it, and return the existing repack instructions.
### Issue 2
src/domain/desktop/appExportPython.ts:122-124
The added `_ensure_state_aliases` is identical to the definition immediately below it. Python replaces the first definition with the second, so future changes to the added copy will have no effect.
The repository requires removing superseded code. Complete that cleanup before merging:
- Remove the duplicate helper.
- Remove the stale log-exclusion descriptions in `DesktopExportLaunch.ts` and `docs/specs/desktop-app-environments/build-witness/spec.md`, since logs are now retained.
### Issue 3
docs/desktop-application-export.md:51-53
The guide now promises that a failed export leaves no partial copy, but `SafeOutputTree.rollback` can fail and report incomplete cleanup with the output path. Permission failures or changed output paths can still leave files behind.
Restore the previous qualification and tell callers to inspect the cleanup error. The same unconditional promise appears in `docs/desktop-build-witness.md`. The documentation requirement to describe existing behavior and limitations must be satisfied before merging.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR carries requested packages through build and export, preserves package-file dependencies when apt installs the app by name, and updates seed handling.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
R[Build request] --> P[Requested extra packages]
P --> B[Build computer installation]
P --> C[Capture owner]
C --> F[Repeated --extra-package flags]
F --> V[Validate package names]
V --> I[Chosen export plan]
I --> A[Apt app plus extras]
I --> D[Package file dependencies plus extras]
Reviews (51) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
…luto#9105, morluto#9111, morluto#9112 Both add to the export's seed handling: morluto#9111 lists gzip seeds recompressed only for their headers apart, and morluto#9112 drops LibreOffice's recovery list and leaves locks and logs out. A seed now ships through both, in that order. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… into morluto#9132 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The build-computer spec names both extra archive packages and main's Electron launch rewrite. - The Python export test keeps both sides' imports. - main's build tests pass extra_packages, which this branch's archive install requires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
main's morluto#9139 bounds the exported verifier's array-index conversion in the pointer code this branch moved into appTaskPythonPointer.ts. The bound is applied there, and appTaskPython.ts keeps this branch's shared pointer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
morluto#9089 moved the lock names into runtimeFiles.ts as isLockName. That list gains this branch's Lucene write.lock, and appExportUnowned.ts keeps this branch's sibling-lock patterns and home-root rule. The export test helpers take one `content` option, which both sides had added under different names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The build computers module keeps this branch's extraPackagesOf import and drops the BuildRequest type morluto#9045's fix no longer uses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # src/application/desktop/DesktopExportFiles.ts
# Conflicts: # .agents/skills/reverse-engineer-anything/references/desktop-build.md # docs/desktop-build-witness.md # docs/specs/desktop-app-environments/build-witness/verification.md # src/application/desktop/DesktopApplicationExport.test.ts # src/application/desktop/DesktopApplicationExport.ts # src/application/desktop/DesktopBuildCapture.ts # src/application/desktop/DesktopExportLaunch.ts # src/domain/desktop/appExport.test.ts # src/domain/desktop/appExport.ts # src/domain/desktop/seedDocument.test.ts # src/domain/desktop/seedDocument.ts # tests/boundary/mcp/buildCaptureMcp.test.ts # tests/fixtures/fakeBuildComputerRea.ts
# 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: # src/composition/capabilityServices.ts
# Conflicts: # .agents/skills/reverse-engineer-anything/references/desktop-build.md # docs/desktop-application-capture.md # docs/desktop-application-export.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/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/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/appTaskDraft.fixture.ts # src/domain/desktop/appTaskDraft.ts # src/domain/desktop/appTaskDraftNoise.test.ts # src/domain/desktop/desktopCapture.test.ts # src/domain/desktop/desktopCapture.ts # src/domain/desktop/runtimeFiles.ts # src/domain/desktop/seedScrub.ts # src/domain/desktop/stateRoles.test.ts # src/domain/desktop/stateRoles.ts # tests/boundary/mcp/buildCaptureRetryMcp.test.ts # tests/boundary/mcp/buildComputerMcp.test.ts # tests/boundary/providers/desktopExportPython.test.ts # tests/fixtures/buildCaptureFakes.ts
| ...(capture.packageUrl === undefined | ||
| ? [] | ||
| : ["--package-url", capture.packageUrl]), | ||
| ...capture.extraPackages.flatMap((name) => ["--extra-package", name]), |
There was a problem hiding this comment.
If REA_BUILD_COMPUTER_REA_ARCHIVE contains a runtime from before this PR, checkExportRuntime accepts it because it supports syntheticSeed. But that runtime rejects the new --extra-package flag. A package-file request with dependencies can therefore finish capture and then become impossible to export on that computer.
Check for extraPackage support before capture when the request needs it, and return the existing repack instructions.
Knowledge Base Used: Desktop application environments
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/desktop/DesktopBuildExport.ts
Line: 149
Comment:
**Older runtimes cannot export**
If `REA_BUILD_COMPUTER_REA_ARCHIVE` contains a runtime from before this PR, `checkExportRuntime` accepts it because it supports `syntheticSeed`. But that runtime rejects the new `--extra-package` flag. A package-file request with dependencies can therefore finish capture and then become impossible to export on that computer.
Check for `extraPackage` support before capture when the request needs it, and return the existing repack instructions.
**Knowledge Base Used:** [Desktop application environments](https://app.greptile.com/-/switch-tenant?tenant=pre&next=%2Fcustom-context%2Fknowledge-base%2Fmorluto%2Frea%2F-%2Fdocs%2Fdesktop-application-environments.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| def _ensure_state_aliases(home: Path) -> None: | ||
| """Restore selected aliases without replacing any existing user data.""" | ||
| aliases = sorted(STATE_ALIASES, key=lambda pair: len(Path(pair[0]).parts)) |
There was a problem hiding this comment.
Duplicate helper hides future changes
The added _ensure_state_aliases is identical to the definition immediately below it. Python replaces the first definition with the second, so future changes to the added copy will have no effect.
The repository requires removing superseded code. Complete that cleanup before merging:
- Remove the duplicate helper.
- Remove the stale log-exclusion descriptions in
DesktopExportLaunch.tsanddocs/specs/desktop-app-environments/build-witness/spec.md, since logs are now retained.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/desktop/appExportPython.ts
Line: 122-124
Comment:
**Duplicate helper hides future changes**
The added `_ensure_state_aliases` is identical to the definition immediately below it. Python replaces the first definition with the second, so future changes to the added copy will have no effect.
The repository requires removing superseded code. Complete that cleanup before merging:
- Remove the duplicate helper.
- Remove the stale log-exclusion descriptions in `DesktopExportLaunch.ts` and `docs/specs/desktop-app-environments/build-witness/spec.md`, since logs are now retained.
**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| bundle. A failed export, cancellation | ||
| included, attempts to remove the bundle it had not yet published. If rollback | ||
| fails, partial files can remain; the error reports resources whose cleanup | ||
| is incomplete. If the bundle was published but its output handles could | ||
| included, removes the bundle it had not yet published, so no partial copy of the | ||
| user's data remains. If the bundle was published but its output handles could |
There was a problem hiding this comment.
Cleanup can leave files behind
The guide now promises that a failed export leaves no partial copy, but SafeOutputTree.rollback can fail and report incomplete cleanup with the output path. Permission failures or changed output paths can still leave files behind.
Restore the previous qualification and tell callers to inspect the cleanup error. The same unconditional promise appears in docs/desktop-build-witness.md. The documentation requirement to describe existing behavior and limitations must be satisfied before merging.
Context Used: Documentation (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/desktop-application-export.md
Line: 51-53
Comment:
**Cleanup can leave files behind**
The guide now promises that a failed export leaves no partial copy, but `SafeOutputTree.rollback` can fail and report incomplete cleanup with the output path. Permission failures or changed output paths can still leave files behind.
Restore the previous qualification and tell callers to inspect the cleanup error. The same unconditional promise appears in `docs/desktop-build-witness.md`. The documentation requirement to describe existing behavior and limitations must be satisfied before merging.
**Context Used:** Documentation ([source](https://github.com/morluto/rea/blob/main/docs))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Build requests can install extra Ubuntu packages beside an archive app, and exports retain a package file’s dependencies when installing that app from apt.
The build and export paths carry and validate package names and remove duplicates while preserving the selected installation plan.
Maintainer follow-up and validation
Propagated the owning #9089 file-URL seed-path repair and #9058 scratch-export guidance correction. Previously validated format, selection and cleanup fixes remain included. Local file URLs now reopen the selected exported seed path while preserving their URL suffix and unchanged encoded segments. Removed extension-only log exclusion at its owning boundary: retained application logs remain available for seed export and task checks; only proven lock exclusions remain. Removed obsolete log-specific notices, wrappers and docs. Additional checks passed:
npm run docs:check.At head
7a338e8282, the affected tests below completed with 190 passed (190);npm run check:fastandgit diff --checkpassed. This includes the updated parent stack and main through25d3c7237f. 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.Maintainer follow-up
Recompressed gzip seeds now use the actual shipped format and bounded ZIP view, so an already-complete archive cannot be accepted as a task because of an invented empty view. XML format detection uses the existing syntax-only parser rather than allocating a full tree. The whole-note timestamp regression now checks current equality behavior and rejects substituted text. One-time launch path mapping and simplified whole-text ownership are inherited. Regression controls failed before the fixes and pass after them. Full XML-view construction remains under its existing limits; no peak-memory measurement or real-provider qualification was performed. Additional checks passed:
npm run docs:check.At head
deb8bf73b7, the affected tests below completed with 196 passed (196);npm run check:fast,npm run format:checkandgit diff --checkpassed. This includes the updated parent stack and main through25d3c7237f. 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.Author readiness
Human owner: @earakely-scale