Expand description
Binary Rule Format (.drv - Driven Rule)
Zero-copy binary format for AI coding rules, achieving 75% size reduction and 50-150x faster parsing compared to text-based formats.
§Format Structure
DrivenRule (.drv)
├── Header (16 bytes)
│ ├── Magic: "DRV\0" (4 bytes)
│ ├── Version: u16 (2 bytes)
│ ├── Flags: u16 (2 bytes)
│ ├── Section Count: u32 (4 bytes)
│ └── Checksum: u32 (4 bytes - Blake3 truncated)
│
├── String Table (variable)
│ ├── Count: u32
│ └── Strings: [length: u16, bytes: [u8; length]]...
│
├── Persona Section (optional)
├── Standards Section (optional)
├── Context Section (optional)
└── Workflow Section (optional)Structs§
- Context
Section - Context section for project-specific settings
- DrvDecoder
- Decoder for reading .drv binary files
- DrvEncoder
- Encoder for creating .drv binary files
- DrvHeader
- Header for .drv files (16 bytes, aligned)
- Format
Version - Format version information
- Persona
Section - Persona section defining AI agent behavior
- Rule
Entry - A single rule entry in the standards section
- Standards
Section - Standards section containing coding rules
- Version
Migrator - Version migration handler
- Workflow
Section - Workflow section defining development processes
- Workflow
Step - A single step in a workflow
Enums§
- Rule
Category - Rule category enumeration
- Section
Type - Section type identifiers
Constants§
- DRV_
MAGIC - Magic bytes for .drv files
- DRV_
VERSION - Current format version