Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
ADR 0263: Expose a Project's Folder Roots and Complete References Across Them
- Status: Accepted
- Date: 2026-09-14 (amends ADR 0262)
- Related: ADR 0016 · ADR 0233 · ADR 0241 · ADR 0249 · 07-plugins/03-plugin-api
Context
ADR 0249 made a project a host-owned logical group with an ordered list of local
folder roots and a primary root that stays the visible workspace. None of that
reached a plugin: pi.workspace.get() returned only { path, name } for the visible
workspace, so a contributed view could not learn that its project had other folders.
After ADR 0262 a chat file reference opened as a project-root-relative path, which is
ambiguous in a group, so a reference resolving into a sibling folder could only open
as an external file with the jail bypassed.
Decision
pi.workspace.get()gainsprojectIdandroots.pathandnamekeep their meaning,rootsis{ path, name, primary }[]in group order with the primary first, andworkspace:changedcarries the same object. This is project metadata the sidebar already shows, so it needs no new permission and no new method.- Main answers from a snapshot of the group records. The authoritative
project.groups.listcall fills it and every group mutation refreshes it, so the synchronous broadcast and asynchronous pull cannot disagree. - Completion searches the whole project.
fs.resolveRefwalks the group's folders, primary first and then group order, before the session scratch store, and the first root that answers wins outright. - The address shape follows the folder. A primary-root match travels as a project-relative path, while a sibling-folder match travels as an absolute path, the shape scratch and attachment files already use, so the payload stays one opaque string.
- The host file tab reaches the group too, gaining the project's other folders as containment roots under ADR 0249 §5.
- The file view's jail base becomes the selected folder. Reads, writes, listing, and search stay confined to one registered root at a time, never the whole group, with the same symlink refusals and credential deny list.
- The switch is plugin-local. Choosing another folder changes only what that view browses, not the visible workspace, the agent's tool roots, a session's primary path, project instructions, or project memory.
Consequences
- A short reference resolves anywhere in the project and opens in its own folder instead of as an external file.
- A multi-folder project can be browsed folder by folder in the work panel, remembered per project, without changing what the agent works on.
- The container, permission, and session models are unchanged, and a plugin that
ignores
rootskeeps working because a host that cannot resolve a group sends the original payload.
Alternatives
- Let the renderer push the group into the view payload — rejected: a view also loads
with no chat reference, and
locationis a one-shot subject. - Make the folder switch activate that folder as the workspace — rejected: it would move the agent's tool roots and the session's primary path.