## Why BooCode has no structured way to enforce agent behavior rules. The `boocontext-audit` package (already TypeScript, zero external deps) provides a complete behavioral compliance engine ported from Parlant: Guideline condition/action model, multi-batch LLM matcher, relational resolver, audit middleware, and graded context recovery. Adding this gives BooCode structured rule enforcement far beyond simple CLAUDE.md guidelines. ## What Changes - Import boocontext-audit as a dependency in apps/coder/ - Add Guideline model: natural language condition/action rules with criticality - Add multi-batch matcher: observational, actionable, previously-applied, disambiguation, response analysis batches - Add RelationalResolver: DEPENDS_ON, PRIORITIZES, ENTAILS, TAG_ALL relationship resolution - Add audit middleware: PostToolUse/Stop/UserPromptSubmit hooks with JSONL buffer - Add graded context recovery: L0-L4 recovery levels - Wire guideline evaluation into agent's inference loop ## Capabilities ### New Capabilities - `guideline-model`: Natural language condition/action rules with criticality and priority - `multi-batch-matcher`: 6-batch LLM evaluation for context-relevant rule matching - `relational-resolver`: Dependency/priority/entailment resolution with iterative convergence - `audit-middleware`: PostToolUse/Stop/UserPromptSubmit hooks with JSONL trail - `graded-recovery`: L0-L4 context recovery for session continuity