Skip to content

feat(desktop): install extra packages beside an archive app, and keep a package file's dependencies at export - #9112

Merged
morluto merged 443 commits into
morluto:mainfrom
earakely-scale:feat/desktop-archive-extra-packages
Nov 9, 2026
Merged

morluto merged 443 commits into
morluto:mainfrom
earakely-scale:feat/desktop-archive-extra-packages

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Contributor

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.

Stacked on #9111.

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: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/domain/desktop/seedDocument.test.ts src/application/desktop/DesktopExportLaunch.test.ts src/domain/desktop/appTaskDraft.test.ts src/domain/desktop/appTaskDraftValues.test.ts src/domain/desktop/appExportUnowned.test.ts src/application/desktop/DesktopApplicationExport.test.ts tests/boundary/providers/desktopExportPython.test.ts src/application/desktop/DesktopTaskDraftNotes.test.ts src/domain/desktop/stateRoles.test.ts

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:check 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/domain/desktop/seedDocument.test.ts src/application/desktop/DesktopExportLaunch.test.ts src/domain/desktop/appTaskDraft.test.ts src/domain/desktop/appTaskDraftValues.test.ts src/domain/desktop/appExportUnowned.test.ts src/application/desktop/DesktopApplicationExport.test.ts tests/boundary/providers/desktopExportPython.test.ts src/application/desktop/DesktopTaskDraftNotes.test.ts src/domain/desktop/stateRoles.test.ts

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-06T08:15:21.363373Z
We couldn’t complete this review. Comment @codex review to try again.
62d4697 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

[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

  1. P1 Older runtimes cannot export ▶
  2. P2 Duplicate helper hides future changes ▶
  3. P2 Cleanup can leave files behind ▶
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.

Summary

This PR carries requested packages through build and export, preserves package-file dependencies when apt installs the app by name, and updates seed handling.

  • Build requests can install extra packages beside an exported app.
  • Exported seeds keep useful app files and leave out recognized locks and recovery entries.
  • Checkpoint lists put files named by app windows ahead of other changed files.
  • Task drafts skip excluded locks and avoid calling incomplete captures unchanged.
  • Build-computer tools explain screenshot crops and limit drag paths to 50 points.

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]
Loading

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

Comment thread src/domain/desktop/appExportInstall.ts Resolved
Comment thread src/domain/desktop/appTaskDraftAdded.ts Resolved
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
Comment thread src/domain/desktop/appTaskDraftText.ts Resolved
Comment thread src/domain/desktop/seedRecoveryList.ts Resolved
Comment thread src/domain/desktop/appExportUnowned.ts Resolved
Comment thread src/domain/desktop/appExport.ts Resolved
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
…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]>
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
Comment thread src/domain/desktop/appExport.ts Resolved
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
- 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]>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
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]>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
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]>
earakely-scale added a commit to earakely-scale/rea that referenced this pull request Nov 6, 2026
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]>
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
Comment thread src/domain/desktop/buildWitness.ts Resolved
Comment thread src/domain/desktop/appTaskDraftNotes.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 6, 2026
# 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
Comment thread docs/desktop-build-witness.md 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:
#	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
@morluto
morluto merged commit 35f1c35 into morluto:main Nov 9, 2026
10 checks passed
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
...(capture.packageUrl === undefined
? []
: ["--package-url", capture.packageUrl]),
...capture.extraPackages.flatMap((name) => ["--extra-package", name]),

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 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

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.

Comment on lines +122 to +124
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))

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.

P2 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)

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.

Comment on lines 51 to +53
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

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.

P2 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!

@morluto morluto added area: build Build, CI, packaging, and publishing 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: build Build, CI, packaging, and publishing enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants