# State Validation (shared)

Authoritative procedure for validating PRD Plugin state, referenced by the
skills that touch `.prd_plugin/state`.

## When to run

Before claiming that evidence, memory, tracking, changelog, session summaries,
registry counters, or timestamped records are complete or consistent.

## How

If the optional helper is installed, run:

```bash
python scripts/state_consistency_check.py --repo-root .
```

(downstream: `.prd_plugin/scripts/state_consistency_check.py`). It checks that
claimed `MEM-*`/`TRK-*`/`CHG-*`/`OBS-*`/`SES-*` IDs exist, registry counters do
not skip absent records, and timestamps are not in the future.

For commit/CI-time enforcement, `prd_gate.py check` runs this plus duplicate-ID,
version-marker, implemented-without-`graduated_to`, and stranded-outbox checks
and fails on any error.

## Rule

Do not record that a state update "landed" unless the canonical record exists.
Evidence text is not a substitute for the canonical state record.
