Skip to content

feat(workspace): auto-materialise static workspace when path is empty or missing - #517

Merged
christso merged 2 commits into
mainfrom
feat/516-auto-materialise-static-workspace
Mar 10, 2026
Merged

feat(workspace): auto-materialise static workspace when path is empty or missing#517
christso merged 2 commits into
mainfrom
feat/516-auto-materialise-static-workspace

Conversation

@christso

Copy link
Copy Markdown
Collaborator

Summary

Closes #516

  • When workspace.mode=static with workspace.path, the orchestrator now auto-materialises the workspace (copies template, clones repos) at the defined path if the directory doesn't exist or is empty. Existing populated directories are reused as-is.
  • Adds workspace.hooks.enabled option (default: true) to allow skipping all workspace hooks for static workspaces.
  • Auto-materialisation only applies to YAML-configured paths (workspace.path), not CLI flags (--workspace / --workspace-path), which always reuse the directory as-is for backward compatibility.

Three cases handled

  1. Path exists and has content -- reuse as-is, hooks still run by default
  2. Path does not exist -- mkdir -p, then materialise (copy template, clone repos, run setup hooks)
  3. Path exists but is empty -- materialise in place

Files changed

  • packages/core/src/evaluation/orchestrator.ts -- static workspace auto-materialisation logic + hooksEnabled guard on all hook callsites
  • packages/core/src/evaluation/types.ts -- enabled?: boolean on WorkspaceHooksConfig
  • packages/core/src/evaluation/yaml-parser.ts -- parse hooks.enabled, merge in workspace config
  • packages/core/src/evaluation/validation/eval-file.schema.ts -- enabled in WorkspaceHooksSchema
  • packages/core/src/evaluation/workspace/manager.ts -- export copyDirectoryRecursive
  • plugins/agentv-dev/.../eval-schema.json -- regenerated
  • Tests for static materialisation and hooks.enabled parsing

Test plan

  • bun run build passes
  • bun run test passes (962 + 52 + 163 tests, 0 failures)
  • bun run lint passes
  • Pre-push hooks pass (Build, Typecheck, Lint, Test)
  • New tests: workspace-config-parsing hooks.enabled (3 tests)
  • New tests: static-materialise (7 tests covering copyDirectoryRecursive export, missing/empty/populated dir detection, materialisation, skip)
  • Existing orchestrator test skips template copy and repo materialization when workspace provided still passes (backward compat for --workspace flag)

… or missing (#516)

When workspace.mode=static with workspace.path, the orchestrator now
auto-materialises the workspace (copies template, clones repos) at the
defined path if the directory doesn't exist or is empty. Existing
populated directories are reused as-is.

Also adds workspace.hooks.enabled option (default: true) to allow
skipping all workspace hooks for static workspaces.

Changes:
- orchestrator.ts: detect empty/missing static path, mkdir + copy
  template + clone repos; add hooksEnabled guard to all hook callsites
- types.ts: add enabled?: boolean to WorkspaceHooksConfig
- yaml-parser.ts: parse hooks.enabled, merge in workspace config
- eval-file.schema.ts: add enabled to WorkspaceHooksSchema
- manager.ts: export copyDirectoryRecursive for reuse
- Regenerated eval-schema.json
- Added tests for static materialisation and hooks.enabled parsing
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 36c0089
Status: ✅  Deploy successful!
Preview URL: https://f846ee83.agentv.pages.dev
Branch Preview URL: https://feat-516-auto-materialise-st.agentv.pages.dev

View logs

@christso
christso merged commit 3d2cc47 into main Mar 10, 2026
1 check passed
@christso
christso deleted the feat/516-auto-materialise-static-workspace branch March 10, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: auto-materialise static workspace when path is empty or missing

1 participant