---
name: peffers-phase-check
description: >
  Phase-gate prerequisite enforcement. Verifies that Phase N-1's
  gate-evaluator emitted PROMOTE before any Phase N agent operates.
  Special handling for the wait period between Phase 4 (T0 baseline)
  and Phase 5 (T1 + analysis): Phase 5 cannot begin before the
  pre-registered wait window has elapsed.
---

# Peffers phase check (mat-uplift-study)

**Source of truth.** [`references/peffers-dsrm-stages.md`](../bootstrap-guardrail/references/peffers-dsrm-stages.md)
+ [`references/study-rigor-framework.md`](../bootstrap-guardrail/references/study-rigor-framework.md)
(active matrix).

## What this skill does

Standard phase-gate prerequisite check, analog of cep-researcher and
cep-tester versions. Plus one template-specific addition: **wait-
period enforcement** between Phase 4 close and Phase 5 start.

## Procedure

Input: `phase` integer.

For Phase 1: always passes.

For Phase N > 1:

1. **Locate Phase N-1 gate packet.**
2. **Check decision field.** PROMOTE → proceed. HUMAN_REQUIRED →
   check for human_override. BLOCKED_PER_FLOOR → halt.
   BLOCKED_DEGRADED → check for proceed_under_degraded override.
3. **Check active-dim scores.** Each active dimension >=
   `<REPLACE: minimum dim score for promotion, default 3.0>`.
4. **Check prerequisite artifacts.**

   | Phase | Required artifact(s) |
   |---|---|
   | 2 | `phase_1_packet.yaml` (locked intervention + outcome + hypothesis) |
   | 3 | `phase_2_packet.yaml` (research protocol + pre-registration draft) |
   | 4 | `phase_3_packet.yaml` (instrument + recruitment + tracking specs) |
   | 5 | `phase_4_packet.yaml` (T0 baseline data + pre-registration submission receipt) AND wait period elapsed |
   | 6 | `phase_5_packet.yaml` (T1 measurement + DiD analysis + sensitivity analyses) |

5. **Wait-period enforcement (Phase 5 only).** From Phase 4 packet,
   read the T0 measurement closure timestamp and the pre-registered
   wait window (`<REPLACE: wait period months, default 9 months>`).

   Required: `now - T0_closure_timestamp >= wait_window`.

   If shorter: halt with `WAIT_PERIOD_INCOMPLETE: <elapsed_months>
   of <required_months>`. Surface to human; human can override with
   explicit `human_override: shorter_wait_period_accepted` and a
   protocol-deviation note (this will be logged in Study-04 audit).

6. **Iteration cap check.** Same as cep-researcher / cep-tester.

## Hard rules

- HR1-HR4 identical to sibling templates.
- HR5 (template-specific). **Wait period is enforced.** Shorter wait
  requires explicit human override and is logged as a Study-04
  deviation. The pre-registration committed to a wait window; honoring
  it is part of pre-registration adherence.

## Output format

Same shape as cep-researcher / cep-tester peffers-phase-check, with
additional `wait_period_check` block for Phase 5.

```yaml
phase: <N>
prerequisite_check: <pass | <error>>
previous_phase_decision: <PROMOTE | ...>
human_override:
  present: <true | false>
  value: <proceed | proceed_under_degraded | shorter_wait_period_accepted | n.a.>
  timestamp: <iso>
wait_period_check:  # only for phase 5
  T0_closure: <iso>
  required_wait_months: <int>
  elapsed_months: <int>
  result: <pass | WAIT_PERIOD_INCOMPLETE>
active_dim_floor_check: <list>
prerequisite_artifacts: <list>
iteration_history: <int>
```

## When consumed

Every non-Phase-1 agent's Operating loop, Step 0.5.
