Files
reverse-engineering-anything/docs/specs/desktop-app-environments
Aniket Rawatandmorluto dd1bb43db3 feat(elf): decode FDO packaging and dlopen note metadata (#7237)
* feat(elf): decode FDO packaging and dlopen note metadata

Name FDO notes within their owner's namespace: type 0xcafe1a7e is
fdo_packaging_metadata and 0x407c0c0a is fdo_dlopen_metadata. One
elfNoteTypeName(owner, type) replaces the GNU-only gnuNoteTypeName.

Each entry gains an fdo field next to gnu. metadata holds the descriptor's
JSON object (packaging) or array (dlopen) when it is NUL-terminated UTF-8
JSON followed only by NUL padding; otherwise metadata is null and issue
names the broken rule, without failing the inspection. Each descriptor
range is decoded once and its retained JSON text is charged to the shared
note text budget per repeated entry. A limitation marks the metadata as a
producer declaration.

Fixes #7235

* fix(elf): key FDO note decoding by note type

The FDO decode cache was keyed by descriptor range only, but the note
type selects the required JSON shape. Overlapping PT_NOTE and SHT_NOTE
tables can give one descriptor range a packaging note and a dlopen note,
and the second reused the first note's verdict. Include the type name in
the key.

Refs #7235

* fix(elf): bound FDO note decoding before parsing JSON

The FDO decoder charged only descriptor source bytes before JSON.parse,
but a dense JSON value such as [{},{},...] decodes to about 50 times its
source size in heap before the service and Evidence copy it again. A
16 MiB descriptor took about 790 MiB of heap; one near the default
64 MiB file budget could exhaust the Node heap. Leave descriptors above
64 KiB undecoded with an issue naming the limit; real FDO notes are a
few hundred bytes.

Refs #7235

* fix(elf): share one FDO decode allowance across the report

The 64 KiB FDO decode bound applied to each descriptor, so raising
max_entries to 256 admitted 256 distinct dense 64 KiB notes: a 16 MiB
file added about 700 MiB of heap before Evidence copied it again.
Charge each distinct descriptor's size to one 64 KiB allowance per
report; a range repeated by another table reuses its decode, and notes
past the allowance keep their entry with an issue.

Refs #7235

* test(desktop): exercise the shared JSON depth guard in the heap suite

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-19 06:01:39 +00:00
..

Desktop application environments

This roadmap records the planned implementation sequence. It does not establish current completion, review approval or verification status. For current workflows, see desktop capture, build computers, tasks and export. Individual verification records retain their original scope and limitations.

Goal: REA turns an application installed and used on a Linux desktop into an agent environment's computer application. The real application installs into a computer image, launches to ready, exposes reset, load and get over its own state, and ships with tasks graded through that state.

The planned sequence was one PR per step:

  1. Pin the real agent environment lane to the framework release that carries the computer application contract.
  2. Capture: launch the application on the user's desktop and record its inventory, windows and home-directory state at checkpoints.
  3. State view: decide which paths are the application's state and read their formats into a typed JSON view.
  4. Export: write the computer application class, environment card, skill and seed.
  5. Verification inside an agent environment computer: put, boot, ready, reset equals the seed, grader checks.
  6. Tasks: an agent writes a prompt and declarative checks from the observed change, REA keeps the task when the checks fail on the seed and pass on the captured end state, and a run of the bundle measures an agent's solve rate.
  7. Three applications end to end: Mousepad (plain files), GnuCash saving to SQLite, and Joplin (Electron, SQLite).
  8. Vendor packages: closed-source applications from a vendor apt repository, with its verified signing key and the packages of the libraries they load, starting with Typora.
  9. Vendor .deb files: closed-source applications installed from a downloaded .deb file, which the computer downloads from an operator's URL and checks by its captured SHA-256, starting with VariCAD.
  10. Document views: documents saved as zip archives (FreeCAD, OpenDocument, Office Open XML, EPUB) read as their entries, checked by name rather than position, namespaced XML included, and numbers compared within a tolerance, starting with FreeCAD.
  11. Capture for building: one capture makes the seed and then the change, at checkpoints the export and the task draft are told; apt lists from a user-space apt-get update are found; the application does not inherit the computer's control token; and the bundle holds neither the capture host's name nor its user's.
  12. Build computer: an agentenv computer REA keeps up from a request or a bundle, with REA installed inside for building, driven through REA's MCP tools while an agent builds the environment.
  13. Build and witness: REA's capture, task draft and export run inside the build computer with acknowledged checkpoints, the bundle comes back to the host, and the task is witnessed live in a fresh computer of it: seed, edit, near miss and reset, recorded.
  14. XML text checks: XML whose DOCTYPE only names its DTD read as XML, starting with AbiWord, and checks of an element's whole text across the runs an app splits a paragraph into.
  15. Download installs: applications no package offers, from their project's AppImage or tarball pinned by URL and SHA-256, unpacked under /opt/rea-apps by the build computer and the export alike, starting with FreeCAD.
  16. Readers: checks of a file REA reads as binary, such as GIMP's .xcf or Blender's .blend, through the app's own headless command, run in the computer on a private copy of the file.
  17. Screen judges: checks of state no file shows, such as a calculator's result, by a model judging a screenshot against the build's labelled seed and end screenshots.
  18. Secrets typed unseen: a password or key the person keeps in a file on the build host, typed by its handle, which no result, log, record or exported bundle holds; sign-in and licence state withheld from the seed and supplied at run time, seeded only with the person's recorded consent; known handle values are checked explicitly.
  19. Several tasks: one capture yields several tasks, each checked at its own end checkpoint and, when one was taken, failing at its near miss; the eval lists them all and each is witnessed on its own fresh computer.
  20. Task difficulty: a build tool solves a bundle's task in fresh computers for a model, 3 times and 2 more unless they passed none or all, within a budget, and records its band, cost, turns and failures per check in the bundle.

Version 1 covers Linux with X11, applications whose state lives in files or SQLite under the home directory, and real applications from public packages. It uses the user's real state and keeps everything local.