Flatten model-divergence subtasks into 3 independent tasks
CI / build (push) Has been cancelled

Replaced parent+subtask structure with 3 standalone tasks:
- mde-manifest-detection (foundational: models.json schema, detect_models.py)
- mde-interactive-enforcement (conflict matrix, --model args, audit, badges)
- mde-loop-enforcement (loop.json per-role model, {model} substitution, check-gate)

Parent archived to tasks/complete/ for history. Each task has its own
SPEC.md and is at research:awaiting_approval.

Rationale: subtasks are independently actionable with their own lifecycle.
Parent container added complexity without benefit.
This commit is contained in:
Lap Tran
2026-06-25 07:25:10 -04:00
parent 7336db282d
commit d325963644
20 changed files with 170 additions and 100 deletions
+56
View File
@@ -0,0 +1,56 @@
# SPEC — mde-loop-enforcement
## Problem
Loops have no model-divergence enforcement. A loop could use the same model for
both implementation and verification, defeating the purpose of the loop verifier
gate. Loop runners need per-role model binding and `{model}` substitution in
harness commands.
## Design
Full design in `design/framework/functional.md` §4 and `design/framework/technical.md` §§10, §13.
### Key decisions
- **Per-role model**: `loop.json` roles section with optional `model` field per role.
Defaults to `models.json` `default` model if not specified.
- **Substitution**: `{model}` placeholder in `loop.json` `harness.command` gets
replaced with the assigned model for that role.
- **Check-gate**: New model-divergence brake gate: loop-verify model must differ from
loop-implement model in multi-LLM mode. Single-LLM mode: advisory only.
## Scope
1. `scripts/loop-runner.py`:
- `_invoke_harness` (line 366-404): `{model}` placeholder substitution from `loop.json` role config
2. `scripts/status.py`:
- `--check-gate`: model-divergence brake gate (loop-verify ≠ loop-implement in multi-LLM mode)
- `cmd_create_loop` / `cmd_install_schedule`: validate `loop.json` per-role `model` fields
3. `templates/loops/`: update loop templates with `roles` schema example
4. `design/loops/technical.md`: document `{model}` substitution
5. `tests/test_model_divergence.py`: loop model binding, `{model}` substitution, check-gate halt
## Dependencies
- Depends on `mde-interactive-enforcement` (needs `CONFLICT_MATRIX` and `_check_conflict`)
## Out of scope
- Interactive `--transition --model` / `--claim --model` (already done in `mde-interactive-enforcement`)
- Rule agents (FW-2, FW-3)
- Agent tab redesign (FW-1)
## Success criteria
1. `loop.json` with `roles.implementer.model` → `_invoke_harness` substitutes `{model}` in harness command
2. `loop.json` without per-role `model` → defaults to `models.json` `default` model
3. `--check-gate` in multi-LLM mode halts if loop-verify model = loop-implement model
4. `--check-gate` in single-LLM mode does NOT halt (advisory only)
5. `pytest tests/ -q` green
## References
- `design/framework/functional.md` §4 (Model-Divergence Enforcement)
- `design/framework/technical.md` §§10 (harness invocation), §13 (loop integration)
- `design/loops/technical.md` (loop runner architecture)