Repository navigation
feat(desktop): install an app from an AppImage or an upstream tarball, pinned by its SHA-256 - #9215
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 reach Linux desktop build, capture, and export workflows. Do not merge until wrong positioned-note text is rejected, the remaining reference-number gap is closed, and the required owned file reader is used. FindingsFix with agent prompt### Issue 1
src/domain/desktop/appTaskDraftItems.ts:137-140
`placedItemCheck` searches the whole layer with `text_contains`. A task drafted from a new Xournal++ note saying `Buy eggs` also passes with `Do not Buy eggs`. The note count stays the same, the kept-note guards pass, and `texts.covers` prevents a more specific check. The agent can therefore receive full credit for the wrong note.
Compare the new note's whole text without tying it to its position.
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!
### Issue 2
src/domain/desktop/appTaskDraftLineGuards.ts:143-150
`volatileAt` treats every token matching the letters-underscore-six-digits pattern as an app-generated value, even inside ordinary user text. Adding `Reference: ABC_123456` therefore suggests a count of lines containing only `Reference: `, so `Reference: WRONG` passes. Tasks asking users to enter a reference number can pass without checking the number.
Only omit a value when the file's parsed facts identify it as generated metadata. Otherwise, keep the requested text exact.
### Issue 3
src/application/desktop/DesktopExportInstall.ts:79-81
`readDownloadInstall` checks `stat(path)`, then opens the path again with unbounded `readFile` and no cancellation signal. If the file grows or changes between those calls, the export can read more than its stated 64 KiB limit.
The repository requires: “Give descriptor-backed reads an owner before opening the file.” Reuse the shared owned reader, check the size on its open handle, and pass the export's signal. 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.SummaryAdds SHA-256-pinned AppImage and tarball installs through a shared build/export script.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Request["Build request: URL + SHA-256"] --> Download["agentenv checks downloaded bytes"]
Download --> Installer["Shared install-download.sh"]
Installer --> App["App under /opt/rea-apps"]
App --> Capture["Capture app and task"]
Request --> Description["Download install description"]
Description --> Export["Export bundle"]
Capture --> Export
Export --> Download
Reviews (9) · Last reviewed commit: "Merge remote-tracking branch 'live-5600/..." · Reviewed by Greptile |
# 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: # .agents/skills/reverse-engineer-anything/references/desktop-build.md # docs/desktop-application-export.md # docs/desktop-application-tasks.md # docs/desktop-build-computer.md # src/application/DesktopBuildDoctor.test.ts # src/application/DesktopBuildDoctor.ts # src/application/MacHopper.test.ts # src/application/desktop/DesktopApplicationExport.ts # src/application/desktop/DesktopBuildCapture.ts # src/application/desktop/DesktopBuildExport.ts # src/application/desktop/DesktopExportInstall.ts # src/cli/desktopCaptureCommands.ts # src/desktop/DesktopBuildDoctorFacts.test.ts # src/desktop/DesktopBuildDoctorFacts.ts # src/domain/desktop/appBuild.test.ts # src/domain/desktop/appBuild.ts # src/domain/desktop/appExport.ts # src/domain/desktop/appExportInstall.ts # src/domain/desktop/appExportPython.ts # src/domain/desktop/appTask.ts # src/domain/desktop/appTaskChecks.fixture.ts # src/domain/desktop/appTaskDraftItems.test.ts # src/domain/desktop/appTaskDraftItems.ts # src/domain/desktop/appTaskDraftLineGuards.test.ts # src/domain/desktop/appTaskPythonPointer.ts # src/domain/desktop/viewPointer.ts # tests/boundary/mcp/buildCaptureRetryMcp.test.ts # tests/fixtures/buildCaptureFakes.ts
Summary
A build request can now install an app from its project's AppImage or tarball, pinned by URL and SHA-256. The exported bundle downloads the same file and unpacks it with the same script. Neither the build nor the bundle holds the app.
Problem and expected behavior
Build computers installed only from apt: the Ubuntu archive, an apt repository, or a
.debby URL. The skill told the agent to stop for anything else. Three apps on an arm64 build host showed what that leaves out:--appimage-extract, it opened in the computer with no extra packages..debthat the existing path installs. Its Depends omits ALSA, so it exits withlibasound.so.2: cannot open shared object file.The capture of an extracted AppImage records its package as
unknown. The export then refused it as not an apt package.Expected now: a request names
{"kind": "appimage", ...}or{"kind": "tarball", ...}. The build computer installs it, and the export installs the same bytes the same way.Change and scope
Request.
installtakes two new kinds, each withurl,sha256, onearchitectureandextra_packages:appimage:desktop_entrynames the.desktopfile the image ships at its top, such asorg.freecad.FreeCAD.tarball: addsprogram, the program's path inside the archive, and an optionalnamefor the menu. REA writes the desktop entry.The schema refuses a program path with
..or a leading/, and an uppercase SHA-256. It refuses a URL with credentials or not over http or https, and a two-linename.Install. agentenv downloads the file when the bundle is put and refuses other bytes. A root run script,
install-download.sh, then works with the network off:/opt/rea-apps/<desktop_entry>and removes the download.--appimage-extract, so FUSE is not needed./usr/local/share/applications. EachExecprogram becomes the extractedAppRun,TryExecis dropped, and its SVG or PNG icon is copied.tarfile, since the computer has noxzprogram. gzip, bzip2 and xz work.program %F, and the script installs it.Order. The script runs after REA's own layer and before the Electron rewrite. So
electron: trueadds--no-sandboxto the entry the download installed.Export. The build computer passes the request's download to the export as a JSON file,
--download-install. The CLI takes the same flag. From it the export renders:downloads=[Download(...)]andrun=[RunScript(script="install-download.sh")];extra_packagesbeside it as before.It refuses (
download_install):/opt/rea-apps/<desktop_entry>;It also refuses
--package-urlbeside the file.Structure. The shared schema and script renderer are in
appDownloadInstall.ts. The export's decision is inappExportDownload.ts. The README install text moved fromappExport.tstoappExportInstallText.ts, which keeps both files under oxlint's 500-line limit.Docs and skill. The skill's install table gains both kinds. It says when to take each, and where the SHA-256 comes from. It also notes two VSCodium quirks found in validation. The build-computer and export guides describe the step and the flag. The spec, plan and verification are in
docs/specs/desktop-app-environments/download-installs/.Not included:
No permissions to create new namespace. With seccomp and AppArmor unconfined it still fails onsetting up uid map: Permission denied. That comes from the Ubuntu 24.04 host'skernel.apparmor_restrict_unprivileged_userns=1. Neither setting is REA's.--appimage-extract.Contract and boundary impact
start_build_computeraccepts theappimageandtarballinstall kinds.rea export-desktop-application --download-install FILEis new.download_install, true or false./opt/rea-apps/<desktop_entry>and/usr/local/share.docs/public/product-catalog.json), package, or installation impact: one new CLI option and two new MCP input kinds.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
Downloadfor its one architecture, passes itsextra_packages, and runs REA's layer, then the download, then the Electron rewrite;Downloadand the exact entry REA writes;shagainst a stub image. It installs the entry with absoluteExeclines, noTryExec, and the icon, in a readable folder;drawio.desktop;.tar.xz, installs the entry and removes the download, and a missing program fails;--package-urlbeside the file or a file naming no install;--download-installwith the request's download, and its bundle downloads the image.Document.xmlthrough the.FCStdview. The bundle's computer started in 267 s, and agentenv's probe passed with FreeCAD launched at boot. Witness held: seed, edit, 24 mm near miss, reset.electron: true. The installed entry readcodium --no-sandbox %F. The first capture exited onlibnspr4.so, so the request addedlibnss3andlibasound2t64. Adding "olive oil" to a list exported and witnessed: seed, edit, "olive oils" near miss, reset all held..debwithlibasound2t64, through the unchanged path. agentenv resolved the virtuallibgtk-3-0. Renaming a box from Draft to Approved witnessed all four stages.packages=Packages(apt=[]), the AppImage'sDownloadwithto="vendor/app.AppImage", arch="arm64", andrun=[RunScript(script="install-download.sh")]. Its limitation reads: "The computer downloads the AppImage from once, when the bundle is put, refuses it unless its SHA-256 is …".namecheck change. The rendered script is unchanged, and all tests pass after them.For evidence-bearing changes:
Validation performed
After
77206cc5cb, 17 build tests, 76 desktop entry/export tests, 51 application export tests, typecheck and targeted oxlint passed. The generated installer regression covers quotedenvand checks its installed command through the shared desktop parser. The offline Python parser must remain aligned with the TypeScript parser; real AppImage execution was not repeated after this fix. This stacked branch currently conflicts with the base.npx oxfmt --check .: passed.oxlint on the 16 changed and new source and test files: no diagnostics.
npm run typecheck: no errors outside the API-contract files, which fail only on a dependency missing locally.vitest over
src/domain/desktop src/application/desktop tests/boundary/providers tests/boundary/mcp/build tests/boundary/cli/desktopand the advertised-pattern test: 3,264 passed and 51 failed. The 51 are the same tests in the same 12 files that fail on the base. They are provider and CLI tests that need tools or a build this machine lacks.npx knip: the same two unresolved worker aliases as the base, which need build artifacts. Nothing new.npm run verify:module-boundaries: passed.Compatibility, safety, and release
namegoes into a file REA writes, never into the shell.tarfileextracts with thetarfilter, which keeps paths inside the folder.Maintainer follow-up
Preserved the author's spaced Exec/TryExec parsing fix and required task checklist. Moved subprocess-based installer/launcher proof to the provider boundary suite while keeping pure rendering cases in the domain suite. Integrated format ownership, seed/export and setup lifetime/readiness repairs from the corrected parents. Additional checks passed:
npm run docs:check.At head
d13b52bee1, the affected tests below completed with 317 passed (317);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
Before merge
type(scope): outcome.🤖 Generated with Claude Code