# MixerSystem Framework Testing

## Goal

Test MixerSystem itself:

- workflow behavior
- agent behavior
- context passing
- logging and failure handling

Use fixture projects as realistic input for MixerSystem workflows.

## Fixture Model

Fixture project path:

- `projects/project-a`

Never run tests directly in the template copy. Always duplicate it per run.

## Standard Test Flow

### 1) Create an isolated run copy

```bash
cp -R ./projects/project-a /tmp/mixer-run
```

### 2) Sync runtime settings + skill

```bash
python3 -m mixersystem sync --project_root=/tmp/mixer-run
```

### 3) Execute workflows against the run copy

Plan test:

```bash
python3 -m mixersystem run plan \
  --project_root=/tmp/mixer-run \
  --work_folder=./tasks/test-001 \
  --size=S \
  --plan_builder_provider=claude \
  --branch_count=1 \
  --max_revisions=2
```

Module test (using task with starter plan draft):

```bash
cp /tmp/mixer-run/tasks/test-003/plan-1-claude.md /tmp/mixer-run/tasks/test-003/plan.md

python3 -m mixersystem run module \
  --project_root=/tmp/mixer-run \
  --work_folder=./tasks/test-003 \
  --size=S \
  --max_test_iterations=5 \
  --auto_commit=false \
  --auto_merge=false
```

Task workflow smoke test (local task mode):

```bash
python3 -m mixersystem run task \
  --project_root=/tmp/mixer-run \
  --work_folder=./tasks/test-run \
  --task_id=local-001 \
  --description="Framework smoke task" \
  --modules=all \
  --sync=false \
  --size=S
```

### 4) Monitor and inspect

- live monitor: `tail -f /tmp/mixer-run/tasks/test-001/logs/trace.log`
- primary debugging source: `raw.log`
- quick status: `trace.log`, `trace.md`

## Pass Criteria

A run is passing when:

1. Workflow exits without crash (or fails for expected negative-path reason).
2. Expected artifact exists in work folder (`task.md`, `plan.md`, `module.md` depending on workflow).
3. `raw.log` shows no unresolved malformed-output loop.
4. Output is consistent with task intent and current workflow contract.
