Multi-root named mounts
Status: implemented (#1010, #1011, #1012, #1013). Design note for #1008 (building on #845), unblocking ganymede-ui#465. See the roadmap and known gaps for current status.
A single Ganymede server can serve several filesystem folders as named mounts under one virtual root instead of running one embedded server per folder. This keeps one server process, one set of document rooms and file IDs, one kernel and session registry, and one MCP endpoint while allowing hosts like the iPhone, iPad, and Mac apps to attach and detach folders at runtime.
Decision and goals
In ganymede-ui#465, the iPhone and iPad sidebar needs to show the app's own container folder (On My iPhone › Ganymede) alongside user-picked folders, and the same capability is useful on Mac and for CLI workflows. Running named mounts inside ganymede core (Option 1) avoids multi-server coordination and URL shuffling on the frontend.
The design optimizes for four invariants:
- Single-root backwards compatibility — a server started with one root directory (
root_dir/--root-dir/ default$HOME) keeps the exact flat namespace it has today with no extra path segment. - Mount-level containment — each mount behaves as its own sandboxed filesystem boundary; symlinks,
.ganymede.tomlwalks, path normalization, and file-ID grants never leak across mounts or into unmounted host paths. - Live isolation across mounts — attaching or detaching one mount does not restart the server or close open rooms, watchers, or running kernels in other mounts.
- Distinct from connected machines — filesystem mounts live inside
/api/contents/<name>/...and manage local or security-scoped folders, whereas connected machines (/machines/{id}/...in Connected machines) proxy remote Ganymede servers.
Virtual root and path model
Two root modes: single-root vs multi-root
A server's root mode is fixed at startup so open URLs, document rooms, and stamps never shift paths mid-session:
- Single-root mode (default) — when started with
root_dir(or the default home directory) and nomountsconfiguration,FsContentsserves that directory directly at"". Existing REST, CLI, FFI, and MCP behavior is unchanged, and runtime mount add/remove returns an error. - Multi-root mode — enabled when
mountsis configured ([[mounts]]in config,"mounts"in FFI JSON even if[],--mount, or--multi-root). An embedded host such as the Apple app always starts in multi-root mode so folders can be attached and detached dynamically.
Layout under / and /api/contents
In multi-root mode, / (API path "") is a virtual read-only directory whose entries are the active mounts:
GET /api/contents("") — returns a synthetic directory model withtype: "directory",path: "",name: "",writable: false,format: "json",mimetype: null,size: null, deterministiccreated/last_modifiedtimestamps (server start or latest mount timestamp), andcontentlisting each mount sorted by name as a directory model (path: "<mount>",name: "<mount>",writablematching the mount's write mode). Passing?content=0returns metadata without the child array.- Mutations at
""and mount roots — creating files, notebooks, or directories at""(POST /api/contents), overwriting""(PUT), or renaming/deleting/replacing a mount directory itself (PATCHorDELETE /api/contents/<mount>) fails with403 Forbidden. Mounts are added and removed only through the lifecycle API. - Inside a mount (
<mount>/<rel>) — requests strip<mount>/and delegate to that mount'sFsContentsinstance, then re-prefix every returnedpath(including directory child entries and theLocationheader) with<mount>/(or<mount>when<rel>is empty). - Same-mount rename vs cross-mount copy/rename —
PATCHwithin one mount delegates cleanly, holding that mount's move lock and preservingFileIdsand rooms. Cross-mountPOST /api/contents/<dst>/<dir>with{"copy_from": "<src>/<rel>"}is supported when<dst>is writable, reading from<src>and creating an ungranted copy in<dst>. Cross-mountPATCH(renaming across distinct<src>and<dst>) fails with400 BadRequest, because mounts have separate security scopes,FileIdsroots, and grants; clients that offer cross-mount move compose copy plus delete explicitly. - Internal server writes, checkpoints, and redactions —
POST /api/notebooks/run(run::copy_path) with"save": "copy"currently writes toruns/...(RUNS_DIR), which would fail at read-only""; in multi-root mode it writes inside the notebook's own mount (<mount>/runs/<rel_stem>/<ts>.ipynb), failing with403/BadRequestif<mount>is read-only. When--checkpoint-diris set across multiple mounts, each mount namespaces checkpoints under<checkpoint_dir>/<sha256(canonical_root)>/(matchingrecovery::Store) so checkpoints never collide and remain tied to the physical folder across mount renames or standalone openings.server_redactions/publish_redactions(routes.rs, used bymcp.rs) collects every mounted root path (both configured and canonicalized) so published HTML never leaks any mount's local directory.
/files/..., /nbconvert/..., and ganymede:// links
/files/{*path}and/nbconvert/{format}/{*path}— both read throughAppState::contents(open_file/get), so<mount>/<rel>resolves through the routingContentslayer with no per-route special cases. Requesting/files/or/files/<mount>fails as a directory request does today.ganymede://links and relative paths — inside a notebook or document directory, relative URLs stay inside the notebook's mount while root-anchored paths (/api/contents/<mount>/...,/files/<mount>/...) address across mounts. On Apple hosts,ganymede://open?folder=<name>&file=<rel>(andnew/runlinks targeting a mount path) resolves<name>directly to"<mount>/<rel>"when mounted, or asks the bookmark host to attach the folder via runtimeadd_mountwithout restarting the server. OS paths inganymede://open?path=...canonicalize viastd::fs::canonicalize(for case-preserving APFS/Windows matching) and match against canonicalized mounted roots by longest prefix.
Mount naming and non-overlapping validation
- Valid mount names — a mount
<name>must be a single path segment accepted byApiPath::parse(non-empty, not.or.., no/,\,\0, or:), must not start with.(avoiding hidden-file filtering and.ipynb_checkpoints/.virtual_documentscollisions), and must be unique case-insensitively across active mounts so APFS/Windows case folding cannot shadow names. - Non-overlapping disk directories — every mount disk directory must exist and canonicalize cleanly (
std::fs::canonicalize). No mount's canonical path may equal, contain, or lie inside another active mount's canonical path (a == b || a.starts_with(b) || b.starts_with(a)). Overlapping mounts would give one physical file two API paths, two file IDs, and two collaborative rooms racing on saves (especially unsafe on iOS, where advisory room locks are disabled).
Document rooms, file IDs, recovery, and .ganymede.toml
Inspecting ganymede-server's collaboration layer shows why rooms should be coordinated by one Collab router holding per-mount state rather than one synthetic root:
- Per-mount
FileIds,Stamps, andmove_lock—FileIdskeys rows by(canonical_root, rel_api_path)inganymede_file_ids.db. Keeping oneFileIdshandle,Stamps, andmove_lockper mount keyed by that mount's canonical disk directory preserves continuity when the same folder is opened standalone viaganymede serve <folder>or edited byganymede grant, keepsmoved_in_other_roots/removed_in_other_rootsworking, and stops filesystem moves in one mount from blocking room opens in another. Every path-addressedCollabmethod — includingCollab::delete_if_unchanged,Collab::room_in_use,Collab::open_notebook, andCollab::fileid_id— must split<mount>/<rel>and use the mount's canonical root /FileIdshandle instead of relying oncollab.root()returningNone. - Shared UUID routing for rooms and file IDs — WebSocket room joins (
/api/collaboration/room/{room}), kernel cell execution (document_idon/api/kernels/{id}/execute),/api/fileid/path, andGET/DELETE /api/collaboration/recovery/{id}do not carry<mount>in their URL.Collabmaintains one sharedroomsmap and an index fromroom_id/file_idto its owning mount, while path-addressed calls (PUT /api/collaboration/session/{*path},/api/fileid/id,save,rename,delete) split<mount>first.GET /api/collaboration/roomsmerges active rooms across all mounts with virtual"<mount>/<rel>"paths sorted by path. - Shared
Watcherand crash recovery —Watcheralready tracks watched directories by canonical OSPathBuf, so one watcher serves all mounts. Underrecovery::Store, writes already recordmeta.fileon disk; each mount holds a recovery view keyed by its canonical disk root, andclaimedtries active mounts so crash copies written either standalone or under multi-root reappear under"<mount>/<rel>". UnfilteredGET /api/collaboration/recoveryaggregates active mounts' recovery entries and skips unmounted stores. .ganymede.tomlboundary —folder::default_kernel(root, dir)takes(mount_disk_root, rel_dir)so folder kernel config stops at the mount root and never walks into parent host directories.
Security and path traversal
Normalization and mount-boundary containment
..and lexical validation —ApiPath::parseandnormalize_api_pathvalidate the full virtual path before routing, rejecting\0(400 BadRequest),\, leading/,.and..components, and Windows drive prefixes (404 OutsideRoot). The mount segment undergoes the same check plus the non-hidden.restriction.- Symlink containment per mount — inside a mount,
FsContentsenforcesresolves_under(canonical_mount_root, os_path)(canonicalizing the target or its deepest existing ancestor). A symlink inside mountAwhose target resolves outsideA's canonical directory fails with404 OutsideRoot— even if the target lies inside another mountB. Checkpoints,.ganymede.tomltraversal, directory listings (dir_model), and terminalcwdresolution enforce the same per-mount canonical prefix check. - Canonical overlap checks — runtime and startup validation canonicalizes candidate mount directories before overlap comparison, preventing a symlink alias from registering a duplicate view of an existing mount.
Per-notebook [host] grants across mounts
- Server
[host]defaults —HostConfig(read,edit_self,run) remains global server config evaluated in virtual path space (""grants all active mounts; narrower defaults such asread = ["Shared"]scope to that mount or subtree). - Per-notebook stored
Grantisolation and normalization — per-notebook overrides live inganymede_file_ids.dbkeyed by(canonical_mount_root, rel_path)soganymede grantworks offline per folder. Because a standalone grant storingread = [""]meant "this folder" rather than "every sibling folder mounted later", and becausenormalize_api_pathtoday strips leading/unconditionally, storage and HTTP translation must preserve an explicit distinction:- Storage grammar (
GrantPath) —FileIds/Grantentries parse a single optional leading/before normalizing the remainder:GrantPath::MountRelative(norm)for unprefixed strings (""-> owning<mount>,"data/raw"-><mount>/data/raw) andGrantPath::ServerWide(norm)for leading-/strings ("/"-> virtual root"","/<other>/<rel>"-><other>/<rel>). Calling rawnormalize_api_pathdirectly on a stored grant path would strip/and corrupt the scope, soHostApi::grant_fromonly normalizes after splitting the prefix. - HTTP and CLI boundary — HTTP
GET /api/host/grants/{*path}returns unified virtual API paths (""for whole server,<mount>for own mount root,<mount>/<sub>,<other>/<sub>), andPUT /api/host/grants/<mount>/<rel>translates incoming virtual paths before storing:<mount>->"",<mount>/<sub>->"<sub>",""->"/", and"<other>/..."->"/<other>/...". Offlineganymede grantkeeps mount-relative normalization so pre-existing standalone grants stay sandboxed inside their own folder when mounted into a multi-root server.
- Storage grammar (
- Virtual evaluation and
HostApi::resolved— server[host]defaults, resolved per-notebookGrantentries,may_enter,may_read, andmay_run(including cross-mount prefix intersection during nested runs) all evaluate in virtual path space.HostApi::may_enterallows entering""while filtering each child mount through the caller's effective grant so ungranted mounts stay hidden inlist("")and search.HostApi::resolvedsplits<mount>/<rel>, canonicalizes inside that mount'sFsContents, returnsNoneon any symlink escape outside<mount>, and re-prefixes<mount>/before grant prefix checks.
Write-observer and event paths
- Native callback (
WriteObserverFn/ganymede_server_set_write_observer) — each mount'sStampingwrapper shares the server'sArc<WriteObserver>and passes the file's canonical OSPath(<mount_disk_root>/<rel>) with before/after stamps. Native ledgers such as iOSKeptAnswersand device permission tables remain invariant to mount names and consistent withAppKernels. - Event stream (
WriteEventon/api/events/subscribe) —Stampingpasses the full virtual API path"<mount>/<rel>"forWriteEvent.pathso clients listening over WebSocket can match/api/contentsand open tabs across mounts.
Lifecycle API
Adding or removing a mount at runtime must leave open rooms, watchers, file stamps, and running kernels in all other mounts undisturbed.
CLI and config
- Config (
ganymede.toml/config_file.rs/ FFI JSON) — addmounts: Option<Vec<MountSpec>>toConfig(withdeny_unknown_fields), where each entry is:
[[mounts]]
name = "Ganymede"
path = "/path/to/ganymede"
[[mounts]]
name = "Work"
path = "/path/to/work"
read_only = false- Distinguishing defaulted
$HOMEvs explicitroot_dir— todayConfig::root_dir(config.rs) isPathBufpopulated byDefault($HOME), so{"mounts": []}in FFI JSON or[[mounts]]inganymede.tomlwould otherwise carry a defaultedroot_dir. Track explicitroot_dirpresence at deserialization (or representConfig::root_dirasOption<PathBuf>internally with$HOMEdefault applied only in single-root mode) soconfig_file::set, TOML startup, and FFI reject explicitroot_dir+mountstogether without falsely conflicting against the fallback home directory. - CLI (
ganymede serve/serve.rs) — add repeatable--mount <name>=<path>and--multi-root(to start multi-root mode with zero initial mounts before dynamic attachment). Combining explicitroot_dir/--root-dirwithmounts/--mount/--multi-rootfails validation. Updateconfig::root_is_setandconfig::require_rootto acceptmounts.is_some()without requiringroot_dir, and skipcfg.root_dir.canonicalize()inserve.rswhen running in multi-root mode so--multi-rootand"mounts": []succeed even when$HOMEis unset or absent.
Embedded host (ganymede-ffi)
Mirroring the existing ganymede_server_add_machine / ganymede.h ABI (no <stdbool.h>, error-returning mutators return int with 0 on success and nonzero with *error_out freed via ganymede_string_free):
- Startup (
ganymede_server_start) — accepts"mounts": [{"name": ..., "path": ..., "read_only": ...}]in its JSON config; passing"mounts": []enables multi-root mode with no folders mounted yet. - Runtime functions (callable from any thread on a multi-root server; returning nonzero with
*error_outon single-root servers):int ganymede_server_add_mount(GanymedeServer *server, const char *name, const char *path, int read_only, char **error_out)— validates name and non-overlapping canonical path, opensFileIdsandStamps, inserts the mount atomically into the shared registry, and returns0on success.int ganymede_server_remove_mount(GanymedeServer *server, const char *name, char **error_out)— gracefully detaches the named mount (protocol below), returning0on success or nonzero with*error_outon unknown mount, single-root mode, or flush failure.char *ganymede_server_mounts(const GanymedeServer *server)— returns JSON array[{"name": ..., "path": ..., "writable": ...}], freed viaganymede_string_free.
- iOS security-scoped bookmark contract:
- Attach: app calls
url.startAccessingSecurityScopedResource()before callingganymede_server_add_mountso canonicalization andFileIdssucceed under sandbox access. - Detach: app calls
ganymede_server_remove_mountand waits for it to return before callingurl.stopAccessingSecurityScopedResource(). That ensures dirty rooms flush, in-flightStamping/run_notebookwrites drain, and watchers release OS file descriptors before access ends.
- Attach: app calls
HTTP lifecycle and security boundary
- Read-only listing (
GET /api/mountsandGET /api/contents) — authenticated HTTP clients can discover mounted folders fromGET /api/contentsand an optional read-onlyGET /api/mountsreturning[{"name": ..., "writable": ...}]. HTTP responses never include raw OS filesystem paths (pathon disk). - No HTTP mount mutation — HTTP endpoints (
POST/DELETE /api/mounts) are intentionally not exposed to set arbitrary host filesystem paths. Any client holding a server token (browser tab, connected machine, or kernel helper) could otherwise mount/Users/...or/over HTTP, mirroring why remote machines have no HTTP mutation routes and host grants keep native selection out of band. On iOS/macOS, mounts change only viaganymede-ffi; if CLI dynamic mount/unmount is added later, it belongs on a per-instance, PID-scoped local control path (alongsideganymede-kernels-<pid>.sockorSIGHUPconfig reload) rather than the HTTP listener or a global singleton socket.
Graceful unmount without dropping other mounts
remove_mount(name) executes in order without blocking or restarting other mounts:
- Transition to draining (hide publicly, keep internal handle) — remove
<name>from public/api/contents,/api/collaboration/session, and new room join dispatch so new client requests immediately return404 NotFound, while moving itsFsContents,FileIds, andStampshandle into an internal draining slot so open rooms can still flush and restamp to disk without hitting404. - Flush, drain writes, and close that mount's rooms — iterate active rooms owned by
<name>: flush dirty edits through the internal mount handle (writing a recovery copy viarecovery::Storeonly if writing to disk fails), send WebSocket close to those rooms' clients, drop theirWatcherhandles so OS directory descriptors close, and wait for in-flightStampingdetached tasks andPOST /api/notebooks/run(run_notebook) tasks on<name>to drain. - Stop that mount's sessions, kernels, and terminals — shut down kernels and sessions whose
pathmatchespath == name || path.starts_with("<name>/")(path_under(path, name).is_some()), including transientrun_notebookkernels and PTYs rooted inside<name>, and wait for process exit so no child holds working-directory FDs inside the unmounted folder, then drop the internal draining handle. Sessions, rooms, and kernels in other mounts continue running untouched. - Emit root change — broadcast a mount-change event on
/api/events/subscribe(on bothadd_mountandremove_mount) so open sidebars refresh the virtual/listing without reloading the page. Becausews::events(ws.rs) currently readsWriteObserver::eventsand uses receiver count (WriteObserver::is_set()) to gate file-stamp collection, multiplex a dedicated mount-event broadcast channel insidews::eventsso mount listeners do not inflateWriteObserverstamping.
Kernels, terminals, LSP, and MCP
Kernels (ganymede-api)
KernelManagerConfig currently accepts one root_dir: PathBuf and passes it to ganymede_contents::kernel_cwd(&root_dir, path) and session_name. In multi-root mode, replace the static path with a dynamic root resolver callback/trait backed by the live mount registry:
- Notebook/session kernel (
path = Some("<mount>/<rel>")) — resolves<mount>to<mount_disk_root>and computeskernel_cwd(&mount_disk_root, rel), confining symlink/missing-dir fallbacks to<mount_disk_root>and settingJPY_SESSION_NAMEto the resolved path under<mount_disk_root>. - Pathless or mountless kernel (
path = None,"", or unrecognized prefix) — resolves to the first active mount's disk directory (or fails cleanly with400 BadRequestwhen zero mounts are registered, rather than falling back to/). Falling back on an unrecognized first segment preserves compatibility with remote clients such as VS Code's Jupyter extension, which creates sessions with synthetic local-style paths likeUntitled-1-jvsc-<uuid>.ipynb(validation/vscode.cjs), matching how single-rootkernel_cwdfalls back toroot_dirfor non-existent paths. - Apple in-process kernels (
RegisteredKernels/AppKernels) —ganymede-uitoday resolves notebook paths under a singlenotebookRoot. In multi-root mode,KernelHost/AppKernelsmap<mount>to its mounted folderURL(while kernellaunch_json.cwdcarries the resolved OS directory).
Terminals (ganymede-terminals)
TerminalConfig today holds one root_dir: PathBuf, and TerminalManager::create sets the PTY's working directory (resolve_cwd) and JUPYTER_SERVER_ROOT. With a dynamic root resolver:
- Relative or virtual
cwd("<mount>"or"<mount>/<rel>") resolves into<mount_disk_root>/<rel>with symlink containment inside<mount_disk_root>and setsJUPYTER_SERVER_ROOTto<mount_disk_root>. - Omitted or empty
cwduses the first active mount's disk directory (or refuses with400 BadRequestwhen zero mounts exist). - Explicit OS
cwdinside an active mount matches that mount's root forJUPYTER_SERVER_ROOTand rejects paths outside active mounts. (iOS disables terminals.)
Language servers (ganymede-lsp) and JupyterLab (lab.rs)
LspManager spawns servers rooted at one root_dir and creates <root_dir>/.virtual_documents, and Lab::page_config (lab.rs) emits serverRoot, rootUri, and virtualDocumentsUri derived from Lab::server_root. Virtual "" is read-only and has no single filesystem path, so .virtual_documents cannot live there: either isolate .virtual_documents under a per-instance (PID- or temp-scoped) server runtime directory with per-mount LSP workspaceFolders, or explicitly disable LSP and document the gap in known gaps in the initial PRs while keeping single-root Lab / LspManager unchanged.
MCP (ganymede mcp and /mcp)
- Server discovery (
jpserver-<pid>.json/server_info.rs) — add optional"mounts": [{"name": ..., "path": ...}]. Because legacyganymede mcp(find_serverincrates/ganymede-cli/src/mcp.rs) expects"root_dir"and would compute a wrong mountlessDIR_METAif given mount 0's path, omit"root_dir"(or skip setting a misleading single root) in multi-rootServerInfowhile updatingfind_serverto matchcwdagainst each canonical mount"path"in"mounts"and computeDIR_META("ganymede/dir") as"<mount.name>"or"<mount.name>/<subpath>". (find_ownstays single-root or passes mount flags explicitly.) Rewritejpserver-<pid>.jsonwhen runtime mounts change on CLI/desktop hosts where info files are active. - Virtual path scoping inside
Notebooks(mcp.rs) —resolve_fromandshow_fromalready treatDIR_META = "Work/sub"as the working base directory for relative paths and leading/("/Other/b.ipynb") to reach across mounts. WithoutDIR_META(direct/mcp),notebooks_listat""lists active mounts andnotebooks_searchwalks across all mounts unless narrowed bydir. - Removing single-root
collab.root()assumptions (mcp.rs,routes.rs) —open_checked(Created { stamp }and root-banner text),notebook_paths(used bynotebooks_searchfor canonical symlink deduplication),cell_snapshot(snapshot image paths),notebook_publish(" On disk: ..."),folder_kernel(.ganymede.toml), androutes.rs'sserver_redactions/publish_redactionsmust all resolve against the target path's owning mount (or all active mounts for redactions) instead ofself.state.collab.root().
Standard Jupyter client compatibility and multiple instances
JupyterLab, VS Code, and other Jupyter clients
In single-root mode (the default), nothing changes on the wire or in behavior. In multi-root mode, all standard Jupyter Server REST and WebSocket endpoints (/api/contents, /api/kernels, /api/sessions, /api/kernelspecs, /api/terminals, /files, /nbconvert, /api/collaboration, /api/fileid) remain spec-compliant, using the same read-only virtual root (writable: false) model as Jupyter's HybridContentsManager. Additive Ganymede routes such as GET /api/mounts are ignored by standard clients.
Visible differences in multi-root mode:
- JupyterLab — lists active mounts as top-level folders at
/; once inside a mount, editing, saving, checkpoints, same-mount renames, copies, kernels, terminals, and live collaboration rooms work identically. Sitting at/, Launcher → New Notebook or upload sendsPOST /api/contents/and gets403 Forbiddenuntil a mount folder is opened, and renaming or deleting a mount directory itself returns403. Dragging a file between two mounts sends a cross-mountPATCHand gets400 BadRequest(cross-mount copy works).jupyterlab-lspis unavailable unless PR 3 adds per-instance.virtual_documentswith multi-workspace folders, and runtime mount additions/removals appear in JupyterLab on its next file-browser refresh. - VS Code ("Existing Jupyter Server") — connecting by URL and token (
/api/kernelspecs,/api/kernels,/api/sessions, channels, stdin, interrupt, restart) works unchanged (validation/vscode.cjs), because synthetic mountless session paths (*-jvsc-*.ipynb) fall back to the first active mount's disk directory when resolving kernelcwd. jpserver-<pid>.jsondiscovery — explicit URL + token clients (VS Code, JupyterLab,nb connect --server ... --token ...) are unaffected. External tools that auto-discover viajupyter server listexpect a stringroot_dirfield, so omittingroot_dirin multi-rootServerInfointentionally keeps legacy single-root auto-discovery from attaching with a wrong root whileganymede mcpreadsmounts.
Running multiple Ganymede instances concurrently
Multi-root support introduces no singleton lock or fixed port: multiple Ganymede instances (single-root, multi-root, or mixed) can run side by side on the same machine by passing a unique --port (or --port 0 in tests):
- Per-instance runtime files —
jpserver-<pid>.json,jpserver-<pid>-open.html,ganymede-kernels-<pid>.sock, and any per-instance LSP.virtual_documentsor future local control socket are PID- or temp-scoped and never collide across instances. - Per-instance overlap check and cross-instance safety — the non-overlapping mount check is enforced within one server instance, not globally across processes. Two separate instances on different ports may independently mount the same or overlapping folders:
ganymede_file_ids.dbkeys rows by(canonical_root, rel_api_path), androom_lock.rstakes OS file locks keyed by the notebook's canonical disk path, so a second instance opening an already-locked notebook seesAcquire::Elsewhereand opens its room read-only instead of racing on autosaves. Tests needing complete isolation can also set separateJUPYTER_RUNTIME_DIRandGANYMEDE_DATA_DIRalongside unique--portvalues.
Implementation sequence
Each step below can land and pass CI independently on main without breaking single-root behavior:
- PR 1 (
tlockney/ganymede): VirtualContentsrouter and config/CLI schema — mount validation (naming rules, case-insensitive uniqueness, canonical non-overlapping check),MultiRootContentswrapping per-mountFsContentswith read-only"", cross-mountcopy,400cross-mountrename, per-mount canonical-hash--checkpoint-dirisolation, explicit vs defaultedroot_dirhandling (config.rs,config_file.rs,serve.rs),Config::mounts,--mount/--multi-rootflags, andServerInfo::mounts. - PR 2 (
tlockney/ganymede): Per-mountCollab,FileIds, recovery,.ganymede.toml,HostApi, andWriteObserver— generalizeCollab(includingdelete_if_unchanged,room_in_use,open_notebook,fileid_id) andStampingto a mount table with sharedrooms, sharedWatcher, UUID room/file-id index, cross-mountrecovery::Storeclaiming & unfiltered list aggregation, mount-scopedfolder::default_kernel,<mount>/runs/...run copies, all-mountserver_redactions/publish_redactions,GrantPathmount-relative vs leading-/storage + HTTP translation +HostApi::resolved/may_enter, and dual OS/virtual paths inWriteObserver. - PR 3 (
tlockney/ganymede): Kernels, terminals, LSP/Lab, and MCP across mounts — dynamic root resolver inKernelManagerConfigandTerminalConfig,Lab::page_config/LspManagermulti-root handling (andknown-gaps.mdentry if deferred),McpStatemount lookups (open_checked,notebook_paths,cell_snapshot,notebook_publish,folder_kernel), andganymede mcpfind_servermount discovery. - PR 4 (
tlockney/ganymede): Runtime mount lifecycle andganymede-ffi— thread-safeMountRegistrywith draining state, gracefulremove_mountflushing dirty rooms, drainingStamping/run_notebookwrites, closing mount rooms/watchers/kernels (path_under) without disturbing other mounts, updatingServerInfofiles when present, multiplexingadd_mount/remove_mountevents on/api/events/subscribe, read-onlyGET /api/mounts, andganymede_server_add_mount/remove_mount/mounts(int0/nonzero return) inganymede-ffi. - PR 5+ (
tlockney/ganymede-ui#465): UI, bookmarks,ganymede://links, andAppKernels— bump bundledganymede/ganymede-ffi; updateSidebar.tsx(writable: falseroot behavior and section presentation),src/App.tsx/src/lib/examples.tsandAppModel.swift(addExamplesIfNeededcopying examples into"Ganymede"),AppModel.swift/ServerHost.swift/IPadChrome.swift(start in multi-root mode withGanymedeplus security-scoped folder bookmarks managed viaganymede-ffi), andAppKernels.swift/KernelHost.swift/LinkOpener.swift/AppURLHandler.swift/WebView.swift/ContentView.swift/NotebookIntents.swift(replace singleserverRootFolder/notebookRootassumptions with mount-aware folder resolution).