# Sruja Architecture Context

This file is auto-generated by `sruja ai-context -r . -f cursor-rules`

## Architecture Overview

- Crates: 14
- Databases: 1

## Layers

### CORE ENGINE (6 crates)
No external dependencies allowed.

### EXTRACTION (2 crates)
No external dependencies allowed.

### DELIVERY (2 crates)
No external dependencies allowed.

### SECONDARY (4 crates)
No external dependencies allowed.

## Boundary Rules

- Lower-tier crates must not depend on higher-tier crates
- sruja-cli is the top-level aggregator — no other crate should depend on it
- WASM-only crates must not use native-only APIs (tree-sitter, fastembed)

## When suggesting code

1. Respect layer boundaries - check imports before suggesting
2. Use existing patterns in the codebase
3. If adding a new dependency, verify it does not violate boundaries
4. Run `sruja drift -r .` after changes to verify architecture health

## Agentic Optimization Loop

When making architectural changes, you MUST follow this loop:
1. Run `sruja_evaluate_proposal` to validate the health of your changes.
2. If it fails, run `sruja_record_learning` to document the failed hypothesis and update your approach.
3. Only present the final code to the user after achieving a successful evaluation.


# Global AI Agent Guidelines
You MUST read and strictly adhere to the instructions located in `AGENTS.md` before proceeding with any task.
