# ID Scheme

Use uppercase prefixes and zero-padded numbers.

| Prefix | Meaning |
| --- | --- |
| `BR-REQ-001` | Brainstorm requirement or user need |
| `BR-DEC-001` | Brainstorm decision |
| `BR-Q-001` | Open brainstorm question |
| `BR-RISK-001` | Brainstorm risk |
| `PRD-REQ-001` | Product requirement |
| `PRD-NFR-001` | Non-functional requirement |
| `PRD-ACC-001` | PRD acceptance criterion |
| `ARCH-COMP-001` | Architecture component |
| `ARCH-DEC-001` | Architecture decision |
| `ARCH-IF-001` | Interface or integration boundary |
| `ARCH-RISK-001` | Architecture risk |
| `IMP-PHASE-001` | Implementation phase |
| `IMP-TASK-001` | Implementation task |
| `IMP-VAL-001` | Implementation validation |
| `DEC-001` | Standalone decision record |
| `EV-001` | Evidence record |
| `AGENT-001` | Agent identity or profile |
| `SES-001` | Agent session |
| `MEM-001` | Promoted agent memory record |
| `OBS-001` | Session observation |
| `TRK-001` | Tracking record |
| `CHG-001` | Changelog record |
| `REQ-001` | Request intake record |
| `MSG-001` | Request-thread message or reply |
| `HLT-001` | Project health finding |
| `BLK-001` | Blocker resolution record |
| `DBR-001` | Document branch |
| `DBR-DELTA-001` | Proposed document delta |
| `DBR-MERGE-001` | Document branch merge or promotion decision |
| `DBR-REG-001` | Document branch regression record |
| `RFQ-001` | Configured reflection question |
| `WFR-001` | Persistent deterministic workflow run |

## Mapping Rules

- Every `PRD-*` item should reference at least one `BR-*` source.
- Every `ARCH-*` item should reference at least one `PRD-*` item or decision.
- Every `IMP-*` task should reference `PRD-*` and `ARCH-*` items.
- Every completion claim should reference `EV-*`.
- Every `SES-*` item should reference one `AGENT-*`.
- Every promoted `MEM-*` item should reference source files, artifact IDs, or
  session summaries, and should identify the originating `AGENT-*` and `SES-*`.
- Every committed `TRK-*` or `CHG-*` record should identify the agent/session
  that created it when applicable using `AGENT-*` and `SES-*`.
- Every `REQ-*` item should identify requester provenance, affected areas or
  IDs, risk, and review outcome before it becomes accepted work.
- Every `MSG-*` item should belong to a single `REQ-*` thread, identify the
  author agent/session, and avoid raw local session state.
- Every `HLT-*` finding should cite affected IDs or source files and identify
  the health check session that produced it.
- Every promoted `DBR-*` branch should reference evidence and merge criteria.
- Every parallel tracking `DBR-*` is allocated by the lead before fan-out;
  workers update assigned branches without allocating IDs, and promotion owns
  the resulting `TRK-*` and `DBR-MERGE-*` allocation.
- Mainline docs should reference promoted document branches, not unproven ones.
- Every `RFQ-*` belongs to exactly one configured reflection category; creation
  uses `prd_reflections.py` or `prd_reflection_create`, never manual next-ID
  calculation.
- Every `WFR-*` owns one workflow definition/input pair and its transitions,
  checkpoints, receipts, attempts, and terminal outcome in
  `.prd_plugin/state/workflow-runs.json`.

## Local Registry

Projects may keep a local registry at:

```text
.prd_plugin/ids/registry.json
```

The registry is the monotonic allocation cursor, while committed records and
canonical planning artifacts are the identity source of truth. Agents should
not inspect the registry to calculate numbers. Use `prd_create` for record-backed
TRK/REQ/HLT IDs and the specialised evidence/decision/change tools for their
records; allocation happens inside the locked write. Use `prd_next_id` only for
IDs embedded in canonical planning artifacts.

`RFQ-*` IDs are embedded in `.prd_plugin/config.json#reflection` rather than a
state collection, but use the same registry cursor and state lock. Reflection
CRUD scans existing questions, rejects duplicate IDs/text, and advances a stale
cursor before allocation.

Before allocating, the MCP server scans canonical identity owners. For
record-backed prefixes, ownership comes only from that record type's canonical
collection; transported submissions, workflow receipts, and diagnostic
snapshots may reference or copy a record but do not own another ID. The server
still refuses duplicates inside the canonical collection and advances a stale
cursor beyond the highest owned ID, so concurrent tool writers cannot create the
same ID. Numeric gaps are valid and must not be reused.

For parallel worktrees, use `prd_open_tracking_branch` before fan-out,
`prd_update_tracking_branch` inside the assigned worker branch, and
`prd_promote_tracking_branch` after merge. Worktree-local registries are never
used for worker allocation.
