Skip to content

Feature Request: first-class Projects with repo-bound sessions, project environment images, and multi-project management in Studio #2091

Open

Description

@karlkfi

Kubernetes context

Applies to mecak8s and mecated, with the client surface in Studio and mecatui. Today a server places every session in its own configured --workspace (ADR 0291, server-owned placement), and mecak8s sessions are file-less unless the draft execution provider gives each one a workspace PVC. Neither path has a unit above the session that says which repository a session works on.

Problem or feature request

I want to manage several projects, each with several sessions, from one place. Claude Desktop does this for Claude Code sessions, and it's the workflow I'd like to move to Mecatl.

With Mecatl today:

  1. One mecated serves one project directory, so N projects means N servers on N ports.
  2. On Kubernetes, N projects means N Helm releases of the mecak8s chart, and even then a session has no way to get the project's code. feat(mecak8s): explicitly seed and synchronize local workspaces #1383 covers pushing a local checkout up, not starting from a repo.
  3. mecatui shows one server at a time (/connect switches). Studio is configured for one deployment via MECATL_BASE_URL.

So the per-project install is the only lever, and it's an install, not a click.

Expected behavior

A first-class Project resource, owned by the server:

  1. Lifecycle. Create, list, configure, and delete projects through the API, with ownership tied to the verified caller when OIDC is on. Delete states what happens to the project's sessions and retained workspaces rather than leaving it implicit.

  2. Repository binding. A project binds to an existing repository (URL plus a credential reference the agent never sees) or creates a new empty one.

  3. Project environment. A project names a versioned environment image with the toolchain baked in. A repo clone rarely brings the compilers, linters, and CLIs the project needs, and installing them at runtime in every session is slow and flaky once you're running many sessions in parallel. A project that already has a make target checking for its required tools is a good sign those tools belong in the image. Today the execution provider takes digest-pinned workload images per operator profile at Helm install time, and each image has to contain /mecatl-executor and /bin/sh. That leaves two gaps: images are chosen per install rather than per project, and every image has to be built from (or extend) one that carries the executor. Options for the second, any of:

    1. Publish an official executor base image to build FROM.
    2. Inject /mecatl-executor into an arbitrary image with an init container copying it into a shared volume, so a project's existing dev image works unmodified.
    3. Run the executor as a sidecar next to the project's container.

    I'm not sure which is best. 2 and 3 avoid making every project rebase its image on ours, but I haven't looked at what either does to the executor's security posture.

  4. Per-session starting point. Sessions in a project don't share a filesystem. Each one starts from the project image plus one of: a git worktree of an existing local checkout (the cheap default for a local mecated), a fresh clone of the default branch head, or a named workspace snapshot that someone built and versioned deliberately (warm build caches, generated code, vendored dependencies). The server resolves this into placement, so clients still never send a path.

  5. Session grouping. Every session belongs to at most one project, and session inventory can filter by project.

  6. Clients. Studio gets a project list with sessions nested under each, create/delete by clicking, and a new-session button that asks clone-head vs snapshot. mecatui gets the same operations for keyboard users. I'd rather click, but plenty of users won't want a browser.

Actual behavior

None of the above exists. No resource groups sessions, and no workspace is filled from a repository.

Environment

  • Kubernetes version: N/A (feature request)
  • mecatl version or commit: 0.0.44 / 3222c2fb8
  • Deployment method: N/A
  • Redis and other relevant dependencies: N/A

Additional context

Prior work. #732 (closed, unmerged) built a local Project MVP: revisioned lifecycle, project-session binding, a /projects surface in mecatui, non-cascading delete, mecated --store-dir only. Its review listed blockers (incomplete durability and rollback proofs, an external Studio dependency, an unmerged plan) rather than rejecting the concept, and the plan docs/acceptance/project-working-mvp.md never landed. I'd rather build on that design than start a second one. If it was closed for a reason beyond those blockers, that's worth writing down here.

Related. #2058 asks for the single-project slice of this: several named sessions in one window, a session list, a worktree per session, and archive/delete. It doesn't need the Project resource, so it could land first. #1383 (seed and sync a local checkout into a mecak8s workspace) is the local-to-remote half of the same gap. #1856 already plans a mock Projects list for the Studio tour, so the UI direction seems to exist.

Projects live in Mecatl, not Kubernetes. Sessions are already Mecatl API resources rather than Kubernetes objects, and projects should be too. If a project were a CRD, only someone with cluster access could create one, which rules out the Studio flow above. Kubernetes RBAC is namespace- and resource-type-scoped and can't express per-caller ownership, which Mecatl already enforces for sessions under OIDC. And mecated has no cluster at all. On Kubernetes the server would create what a project needs underneath (volumes, executor pods, image references, clone jobs), the same way the execution provider manages ExecutionEnvironment on a session's behalf without users ever writing one. For teams that want projects in git, the API stays the source of truth and something else syncs into it: an operator-defined project file loaded at startup, a CLI or Terraform provider calling the API, or later an optional Project CRD that only mirrors into the API.

Hard parts I can see:

  1. Clone credentials have to reach the clone step and never the agent's tools or transcript, which runs into the existing scrubbing and runner-authority rules.
  2. Snapshot storage and retention, given workspace PVCs are already retained by default. Also whether a snapshot is a volume snapshot, a layer in the project image, or both, since baking the repo into the image and cloning on top would cover the common case without new storage.
  3. Who may register a project image. Today only the operator picks workload images, and a per-project image lets a project owner choose what runs next to the executor.
  4. Whether project config (model defaults, permissions, trust) lives on the project or stays per-server.

Alternatives considered:

  1. Keep one Helm release per project and add a multi-server view to Studio. Cheaper, but it still needs an install per project and doesn't solve getting code into a session.
  2. Do feat(mecak8s): explicitly seed and synchronize local workspaces #1383 alone. That covers a developer with a local checkout, not starting a session from a repo in the browser.
  3. A Kubernetes operator with a Project CRD as the source of truth. It works on Kubernetes, but mecated users get nothing, project management needs cluster access, and it moves lifecycle out of the API that both clients already use. A CRD that syncs into the API is still on the table, as above.

Happy to help shape an acceptance plan if this direction is acceptable.

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