Step 20 of v4.1 — implements drift detection in plan-validator.mjs per
brief Assumptions block 7: "Mismatch (e.g. korrupt manuell endring)
emitterer MANIFEST_PROFILE_DRIFT-warning fra plan-validator i --strict-modus."
Logic (after validateAllManifests in validatePlanContent):
1. Strict-mode only — soft mode never emits drift warnings.
2. Plan frontmatter must declare 'profile: <name>' to establish baseline.
3. For each step manifest, if profile_used is set AND differs from plan
profile, emit warning (NOT error) with code MANIFEST_PROFILE_DRIFT
and location 'step N: profile_used = X, plan profile = Y'.
Forward-compat preserved: drift is a warning, plan remains valid:true.
Operators see the drift in --strict mode without parsing breaking.
New files:
tests/validators/plan-validator-profile-drift.test.mjs — 4 tests
tests/fixtures/plan-profile-drift.md — drift fixture
Tests verify:
1. drift detected in strict mode → MANIFEST_PROFILE_DRIFT in warnings
2. drift NOT detected in soft mode → strict gate honored
3. matching profile → no drift warning
4. no plan-level profile → drift detection silent (no baseline)
Tests: 479 pass + 2 skipped (Docker not installed).
57 lines
1.1 KiB
Markdown
57 lines
1.1 KiB
Markdown
---
|
|
plan_version: "1.7"
|
|
profile: economy
|
|
phase_models:
|
|
- phase: brief
|
|
model: sonnet
|
|
- phase: research
|
|
model: sonnet
|
|
- phase: plan
|
|
model: sonnet
|
|
- phase: execute
|
|
model: sonnet
|
|
- phase: review
|
|
model: sonnet
|
|
- phase: continue
|
|
model: sonnet
|
|
---
|
|
|
|
# Test plan — profile drift fixture
|
|
|
|
Frontmatter declares `profile: economy`. Step 1 manifest has matching
|
|
profile_used. Step 2 manifest declares `profile_used: premium` — the
|
|
drift case Step 20 of v4.1 plan-validator must catch in --strict mode.
|
|
|
|
## Implementation Plan
|
|
|
|
### Step 1: matching profile
|
|
|
|
- Files: a.ts
|
|
- Manifest:
|
|
```yaml
|
|
manifest:
|
|
expected_paths:
|
|
- a.ts
|
|
min_file_count: 1
|
|
commit_message_pattern: "^feat:"
|
|
bash_syntax_check: []
|
|
forbidden_paths: []
|
|
must_contain: []
|
|
profile_used: economy
|
|
```
|
|
|
|
### Step 2: drift to premium
|
|
|
|
- Files: b.ts
|
|
- Manifest:
|
|
```yaml
|
|
manifest:
|
|
expected_paths:
|
|
- b.ts
|
|
min_file_count: 1
|
|
commit_message_pattern: "^feat:"
|
|
bash_syntax_check: []
|
|
forbidden_paths: []
|
|
must_contain: []
|
|
profile_used: premium
|
|
```
|