Skip to content

Define the local Workspace host topology #346

Description

@taras

Story

As an Executable.md maintainer, I want one evidence-backed local workflow topology, so implementation of #218 does not depend on unresolved choices between Deno, workerd, FUSE and Cloudflare-hosted Durable Objects.

Decision

The first local xmd workflow host uses this topology:

xmd CLI and lifecycle (Deno)
└── WorkflowRun SQLite
    ├── filtered journal
    ├── versioned Workspace filesystem through Cloudflare DOFS
    ├── Repository and Worktree metadata
    └── Agent-session mappings
  • Deno owns SQLite directly. The local host reuses Cloudflare's DOFS filesystem layer behind a provider-neutral Workspace capability.
  • The journal and Workspace share the run database so one Workspace-local mutation and its journal result can commit in one SQLite transaction. They remain logically separate retention domains.
  • Native Agent processes inspect disposable read-only materializations of a logical Workspace root. There is no writable FUSE or write-back synchronization path.
  • The default local binary does not bundle workerd. A Cloudflare-hosted or later workerd provider may implement the same contextual contracts without changing documents.
  • Worker JavaScript is deferred from the first local capability set.
  • Worker Shell is included. It is the Cloudflare Workspace Shell capability implemented by just-bash, Cloudflare's Workspace filesystem adapter and a Deno Worker boundary—not native Bash or arbitrary native commands.

The CLI reserves a host-neutral lifecycle surface but exposes no remote-host selector initially.

Why this topology

The three spikes removed the topology uncertainty:

Production #363 preserves that proof: one authoritative host-owned DOFS connection per workflow database, serialized local effect transactions and forceful Worker termination for CPU-bound programs.

Ownership boundaries

  • WorkflowRun and expansion identity are established before Workspace attachment.
  • The Deno workflow adapter owns SQLite, DOFS attachment and local effect transactions.
  • One authoritative host-owned DOFS connection serves each workflow database and serializes its Workspace-local effects.
  • Shared production modules use contextual filesystem, cwd, process, Git, forge and Agent APIs; they contain no Cloudflare types or runtime detection.
  • A completed replay returns from retained history without attaching DOFS, Agents or external providers.
  • A partial replay attaches the same run database and continues from its retained Workspace frontier.
  • Missing or corrupt authoritative Workspace state is an explicit unrecoverable failure; the host never substitutes an empty Workspace while claiming continuation.

Acceptance

  • architecture.md records this topology and its invariants.
  • specs/workflow-workspace-spec.md records the observable workflow contract that consumes it.
  • Implement retained Workflow Workspace restoration #218 uses the implicit, run-owned Workspace and one local SQLite retention boundary.
  • The local provider can atomically commit a Workspace mutation, resulting logical root and filtered journal result.
  • The topology needs neither writable FUSE, native subprocess access nor bundled workerd.
  • Worker Shell preserves Spike: make Worker Shell effects transactional with the workflow journal #357's transaction fencing, rollback, crash recovery and forceful cancellation boundaries.
  • The provider seam remains capable of hosting the same contract on Cloudflare later.

This story closes when the architecture/specification PR merges. It selects the topology; #218 and its child implementation stories build it.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions