Skip to content

Make the filesystem truly optional: a no-FS session profile #55

Closed

Description

@JAORMX

Out of the cloud-native discussion (PR #54): a general harness session (chat + MCP tools + memory + delegation + web fetch) doesn't need a filesystem at all. We already run shell-less via --no-bash, but the FS itself is still load-bearing everywhere. For cloud-native deployments we want sessions that run with no workspace and no worktree... not good for a coding agent, but sufficient for a general harness. The FS then comes back later as an optional capability, not as a baked-in assumption.

Current state (verified against main)

The toggle half-exists today:

  • The core FS tools are unconditional. registerCoreTools always registers tools.All() (Read/Edit/Write/Grep/Glob/WebFetch) with no config gate (internal/app/build.go). Only Bash is optional.
  • The workspace is mandatory at the wire level: CreateSessionRequest.workspace carries min_len = 1 (contracts/proto/mecatl/v1/harness.proto) and the server hard-rejects an empty one before session.New is ever called (internal/adapter/server/service.go).

The good news is that everything else already degrades gracefully, so the blast radius is small:

  • Workspace trust fails safe to untrusted on an empty workspace (internal/app/trust.go).
  • The permission-config resolver fail-softs to no project scopes; only Managed/CLI/User apply.
  • Prompt discovery just finds no AGENTS.md/CLAUDE.md and returns nothing.
  • The memory, soul, user-model, and skill stores are opened at build time and are not keyed on the workspace.
  • The nil-forker no-op path already exists (engine/agent/subagent.go, forkChildWorkspace).

So the real coupling is the tool catalog and fork-based delegation isolation. Nothing else.

Proposed shape

A no-FS session profile, not a nil workspace and not a memfs scratch:

  • Nil workspace panics in any tool that touches ws and breaks the API contract.
  • A memfs-backed scratch sounds tempting (memfs already implements the full Workspace interface) but it's a footgun for the disposability story: the model accumulates scratch state that silently dies on process eviction, which undermines the exact evict/rehydrate guarantee this posture exists for. The honest version is that nothing exists that can be lost.

Work items:

  • Make the core FS tool set a catalog profile instead of unconditional. The per-session catalog drift guard (TestPerSessionCatalogMatchesSharedCatalog) grows a profile dimension so it keeps guarding.
  • A deliberate wire-contract decision: an explicit session mode/profile field, or relaxing the workspace requirement gated on that mode. No magic empty-string sentinel.
  • An honest note in the assembled system prompt about the posture, same precedent as the trust-gate's shell note, so the model doesn't flail trying to read files that can't exist.
  • Delegation semantics without forking: Subagent/Team children inherit the no-FS posture (no worktree, no sandboxed shell); Parallel stays unavailable in this profile since it is fork-based and already optional.

Non-goals

  • A remote FS / workspace driver. DRIVERS.md records that sketch as deferred; when the FS returns for cloud it returns as a driver mounting into a harness that already treats it as optional, which is the point of this issue.
  • A memfs scratch profile. Maybe later, but it needs a snapshot story for the scratch contents first.
  • Any mount-table / composed-namespace work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions