Skip to main content

Module format

Module format 

Source
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§

ContextSection
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)
FormatVersion
Format version information
PersonaSection
Persona section defining AI agent behavior
RuleEntry
A single rule entry in the standards section
StandardsSection
Standards section containing coding rules
VersionMigrator
Version migration handler
WorkflowSection
Workflow section defining development processes
WorkflowStep
A single step in a workflow

Enums§

RuleCategory
Rule category enumeration
SectionType
Section type identifiers

Constants§

DRV_MAGIC
Magic bytes for .drv files
DRV_VERSION
Current format version