11# Decision Record Protocol (DRP)
22
33DRP is a lightweight, machine-readable protocol for recording decisions as
4- immutable, linkable records. A DRP record captures * what* was decided,
5- * why* , * what was considered* , and * how* it relates to earlier or later
6- decisions. Records form a directed acyclic graph via explicit causal links
7- and an explicit supersession relation.
4+ immutable, linkable records with causal links, validation rules, and explicit
5+ supersession.
6+
7+ It helps teams and AI systems answer a simple question:
8+
9+ > What was decided, why was it decided, what did it depend on, and what replaced
10+ > it later?
811
912This repository is the ** canonical specification and reference tooling** for
1013DRP. It is intentionally not an application; it defines the data format,
1114the invariants, and the validator that any DRP-compatible system should
1215honor.
1316
17+ ## At a glance
18+
19+ DRP gives you:
20+
21+ - structured decision records instead of scattered notes;
22+ - stable ` record_id ` values for linking and audit;
23+ - explicit causal links through ` parent_record_ids ` and ` child_record_ids ` ;
24+ - append-only evolution through ` supersedes_record_id ` ;
25+ - schema checks plus validator-backed graph invariants;
26+ - runnable examples, fixtures, tests, and benchmark material.
27+
28+ ## The problem DRP solves
29+
30+ Many important decisions start as chat messages, tickets, meeting notes, or
31+ incident comments. Over time, the original context disappears:
32+
33+ - the reason for the decision becomes unclear;
34+ - the alternatives considered are lost;
35+ - later changes silently overwrite earlier intent;
36+ - decision chains become hard to audit or replay;
37+ - free-form prose cannot reliably enforce graph-level consistency.
38+
39+ DRP turns those decisions into small, structured records that can be validated,
40+ linked, superseded, tested, and inspected over time.
41+
42+ ## Core flow
43+
44+ ``` mermaid
45+ flowchart LR
46+ A[Decision context] --> B[DRP record]
47+ B --> C[Causal links]
48+ B --> D[Schema checks]
49+ B --> E[Semantic validation]
50+ C --> F[Auditable decision history]
51+ D --> F
52+ E --> F
53+ G[Newer decision] --> H[Supersession]
54+ H --> F
55+ ```
56+
57+ ## When to use DRP
58+
59+ DRP is useful when decisions need to survive beyond a single conversation,
60+ meeting, or tool run.
61+
62+ Common use cases:
63+
64+ 1 . ** AI agent decision trails** - record why an agent chose a route, which
65+ prior records it depended on, and whether the decision was later superseded.
66+ 2 . ** Incident response and rollback** - preserve emergency decisions,
67+ mitigations, follow-up actions, and the causal chain between them.
68+ 3 . ** Architecture or product decisions** - keep decision history structured
69+ while still allowing ADR-style narrative documents around it.
70+ 4 . ** Policy and governance changes** - represent policy updates without
71+ silently rewriting prior records.
72+
73+ ## Why not just ADR?
74+
75+ Architecture Decision Records are excellent for human-readable design history.
76+ DRP is narrower and more mechanical: it defines machine-readable records,
77+ validation rules, causal graph checks, and supersession semantics.
78+
79+ In practice, DRP can complement ADR:
80+
81+ - ADR explains the narrative.
82+ - DRP preserves the structured decision state and validation contract.
83+
1484## Why DRP
1585
1686Most decision logs degrade into free-form prose that cannot be audited,
@@ -23,6 +93,37 @@ queried, or diffed. DRP fixes this by:
2393 graph-level invariants (bidirectional links, timestamp ordering,
2494 supersession resolution, etc.).
2595
96+ ## Try DRP in 60 seconds
97+
98+ Validate a known-good example:
99+
100+ ``` sh
101+ python3 tools/drp_validator.py examples/minimal_valid.json
102+ ```
103+
104+ Or use the wrapper:
105+
106+ ``` sh
107+ ./scripts/drp-validate examples/minimal_valid.json
108+ ```
109+
110+ For CI jobs and tool integrations, use ` --json ` for machine-readable output:
111+
112+ ``` sh
113+ ./scripts/drp-validate examples/minimal_valid.json --json
114+ # {"status": "OK", "record_count": 1, "errors": []}
115+ ```
116+
117+ Run the test suite:
118+
119+ ``` sh
120+ python3 -m pytest tests/
121+ ```
122+
123+ Exit code is ` 0 ` on success, ` 1 ` on validation failure, ` 2 ` on unreadable
124+ input. See [ docs/VALIDATION.md] ( docs/VALIDATION.md ) for the full CLI
125+ contract.
126+
26127## Status
27128
28129| Item | Value |
@@ -66,34 +167,6 @@ queried, or diffed. DRP fixes this by:
66167\-- tests/ - automated tests for schema + validator
67168```
68169
69- ## Quick start
70-
71- Validate a file using the reference validator:
72-
73- ``` sh
74- python3 tools/drp_validator.py examples/minimal_valid.json
75- # or
76- ./scripts/drp-validate examples/minimal_valid.json
77- ```
78-
79- For CI jobs and tool integrations, use ` --json ` for a machine-readable
80- result on stdout:
81-
82- ``` sh
83- ./scripts/drp-validate examples/minimal_valid.json --json
84- # {"status": "OK", "record_count": 1, "errors": []}
85- ```
86-
87- Exit code is ` 0 ` on success, ` 1 ` on validation failure, ` 2 ` on unreadable
88- input. See [ docs/VALIDATION.md] ( docs/VALIDATION.md ) for the full CLI
89- contract.
90-
91- Run the test suite:
92-
93- ``` sh
94- python3 -m pytest tests/
95- ```
96-
97170## Key documents
98171
99172- [ Grant Evidence Package] ( docs/GRANT_EVIDENCE.md ) - reviewer-facing evidence matrix, reproducible commands, limitations, and research roadmap.
0 commit comments