| name | workspace-init |
| description | Initialize a missing research Workspace from the repository template without overwriting existing Run state; use before Pipeline binding when the target under `workspaces/` has no valid core artifacts. |
Workspace Init
Initialization is a boundary: it creates Workspace-owned state and leaves
existing state untouched unless overwrite is an explicit operator decision.
It does not select a Workflow or execute a Unit.
Inputs
- Target directory under
workspaces/<name>/.
- Optional explicit overwrite decision.
Outputs
STATUS.md, CHECKPOINTS.md, UNITS.csv, and DECISIONS.md.
GOAL.md and queries.md.
papers/, outline/, citations/, and output/ directories.
Steps
1. Validate the destination
Resolve the target path and reject the repository root. Inspect existing files
before deciding whether initialization is missing, partial, or already
complete. Never infer overwrite permission from a partial Workspace.
Completion criterion: the destination is a Workspace path and every existing
file that could be replaced is known.
2. Materialize the base template
Copy the repository-owned template into the target. Default to create-missing;
use --overwrite only after an explicit replacement decision.
Completion criterion: all missing base files and directories are materialized,
and no pre-existing file was replaced without explicit permission.
3. Verify the core contract
Confirm that STATUS.md, UNITS.csv, , and
exist. Parse the header and reject malformed CSV rather than
leaving a superficially initialized Workspace.