Skip to content

feat: workspace.static soft override with env-var fallback #514

@christso

Description

@christso

Problem

Workspace configuration has accumulated overlapping controls across YAML and CLI, which makes behavior hard to predict.

Current confusion points:

  1. Multiple ways to express static workspaces (mode/static_path, CLI path flags, legacy forms).
  2. Mode and path interactions are implicit in places and strict in others.
  3. Legacy pooling and retention flags add extra precedence branches.

We want a single, obvious configuration model for workspace behavior.

Proposal: canonical workspace.mode + workspace.path

Adopt one workspace shape in YAML:

workspace:
  mode: pooled | temp | static
  path: /abs/path              # required only when mode=static
  template: ./template         # for pooled/temp flows
  repos: [...]                 # for pooled/temp flows
  hooks: {...}

Semantics

  • mode=pooled → use pooled workspace lifecycle.
  • mode=temp → materialize fresh workspace per run (no pooling).
  • mode=static → use an existing user-managed workspace at workspace.path.

Defaults and implied mode

  • If no mode/path is provided, default to pooled.
  • In YAML, non-empty workspace.path with missing workspace.mode implies static.
  • In CLI, --workspace-path implies --workspace-mode static.

Validation rules

  • If mode=static and path is missing/empty → hard error.
  • If --workspace-path is set and --workspace-mode is provided with non-static value → hard error.

Precedence (highest first)

  1. CLI --workspace-path (implies static)
  2. CLI --workspace-mode
  3. YAML workspace.path / workspace.mode
  4. Default mode=pooled

CLI surface simplification

Keep only mode/path workspace controls in CLI:

  • Keep --workspace-mode pooled|temp|static
  • Keep --workspace-path

Remove these flags entirely (hard remove, no warnings/transition period):

  • --keep-workspaces
  • --cleanup-workspaces
  • --retain-on-success
  • --retain-on-failure
  • --pool-workspaces
  • --no-pool

Cleanup/retention behavior remains hook/config-driven (before_each / after_each / after_all), not CLI-driven.

Schema cleanup (hard remove)

Remove legacy/duplicate workspace fields and aliases:

  • Remove workspace.static (if introduced in prior drafts)
  • Remove workspace.static_path
  • Remove workspace.pool boolean
  • Remove target-level workspace_template

Use only eval-level workspace.template / workspace.mode / workspace.path.

Acceptance signals

  • YAML supports canonical workspace.mode + workspace.path
  • Default is mode=pooled when neither mode nor path is set
  • YAML workspace.path without mode implies static
  • CLI --workspace-path implies static without requiring --workspace-mode
  • CLI rejects --workspace-path with non-static --workspace-mode
  • mode=static without path is rejected
  • Removed CLI flags are no longer accepted
  • Removed legacy YAML/target fields are rejected (static_path, pool, target workspace_template)
  • CLI help/docs reflect only mode/path workspace controls and precedence

Non-goals

  • No backward-compat aliases for removed fields/flags
  • No warning-based transition period
  • No changes to core hook execution semantics

Related

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