# Package map and error reference

> Look up all 16 Arah subpackages, 12 top-level modules, lazy off-POSIX exports, and the structured ArahError hierarchy with stable dotted codes.

Source: https://kucinglabs.com/docs/api-errors
Markdown: https://kucinglabs.com/docs/api-errors.md

## Subpackage map and lazy import contract

Arah organizes its codebase into 16 subpackages (`arch`, `bench`, `cap`, `claim`, `compress`, `donor`, `edit`, `eval`, `fb`, `history`, `recipe`, `run`, `src_comp`, `store`, `tgt`, `xfer`) and 12 top-level modules (`basis`, `checkpoint`, `claims`, `cli`, `drift`, `errors`, `meter`, `module`, `reach`, `region`, `tensor_id`, `training_free`). The top-level `arah` package exposes 115 public symbols in `arah.__all__` using PEP 562 lazy loading, registers zero global PyTorch hooks on import, and defers POSIX-only `arah.store` (`fcntl`) imports so non-store modules run on off-POSIX platforms.

| Subpackages and modules | Responsibility |
| --- | --- |
| `arah.recipe`, `arah.region`, `arah.tensor_id`, `arah.basis` | Deterministic float64 recipe algebra, regions, streamed SHA-256 digests, basis checks |
| `arah.module`, `arah.drift`, `arah.checkpoint`, `arah.claims`, `arah.errors` | Module authoring, audit, drift checks, round-to-odd cast, self-verifying checkpoints, base `Claim` types, structured `ArahError` classes |
| `arah.store`, `arah.edit`, `arah.history`, `arah.cli` | Content-addressed `.arah/` store, atomic transactions, typed edit algebra, patch composition, history, CLI |
| `arah.donor`, `arah.compress` | Pickle-free lazy loading, certified compression, out-of-core streaming dissection, transplants, float-exact growth, merges |
| `arah.meter`, `arah.reach`, `arah.training_free` | Forward-pass budgets, dataset role isolation, `ExposureLedger`, `DoFLedger`, reach tracing, training-free checks |
| `arah.eval`, `arah.claim` | Contracts, oracle gates, e-processes, isolated tiers, `HoldoutGuard`, shift guards, two-layer claims, Lean/TorchLean adapters, Protocol Compiler, interop, `ReportGuard` |
| `arah.fb`, `arah.cap`, `arah.run` | Forward-only causal ablation, closed-form and exact-Q solves, capacity and 3-axis SNR diagnosis, `AuthoringRun`, leak-free `EpochBrief`, bisect |
| `arah.bench`, `arah.tgt` | Pre-registered `arah-bench` scorecards, hardware target presets and profiling, roofline bounds, exact DAG memory and precision schedules |
| `arah.arch`, `arah.xfer`, `arah.src_comp` | Multimodal `ArchSpec` DAGs and shootouts, Procrustes/`CausalInterface`/imprinting/dark folding, exact circuits, inverse compiler, CEGIS, `ProcedureLibrary`, `run_authoring_loop`, `ArahMCPServer` |

## Structured ArahError hierarchy

All Arah exceptions subclass `ArahError`. Each exception attaches optional structured fields for tools and LLM harnesses: `code` (a dotted ID like `budget.exceeded` or `run.leak`), `path` (tensor or manifest path), and `hint` (fix guidance).

| Domain | Exception classes and default codes |
| --- | --- |
| Core and recipes | `ArahError`, `RecipeError`, `BudgetError` (`budget.exceeded`), `RegionError`, `AuthoringError`, `DriftError`, `CheckpointError`, `CheckpointBudgetError`, `CanonicalFormError`, `CanonicalTypeError`, `UnsupportedPlatformError` |
| Store and transactions | `StoreError` (`store.error`), `StoreConflictError` (`store.conflict`), `StoreCorruptError` (`store.corrupt`), `TransactionError` (`edit.*`), `RollbackError` (`edit.rollback`) |
| Donor and compression | `DonorError` (`donor.error`), `UnsafeFormatError` (`donor.unsafe_format`), `DonorDigestError` (`donor.digest`), `ResidentBudgetError` (`donor.resident_budget`), `CompressionError` (`compress.error`), `CertificateError` (`compress.certificate`) |
| Metering and checks | `ForwardBudgetError` (`budget.forward`), `ReachError` (`reach.*`), `CertificationError` (`training_free.invalid`), `RoleError` (`role.error`) |
| Evaluation and claims | `EvalError` (`eval.error`), `OracleError` (`eval.oracle`), `HoldoutError` (`eval.holdout`), `ShiftError` (`eval.shift`), `ComparisonError` (`eval.compare`), `ClaimError` |
| Feedback, cap, runner | `FeedbackError` (`fb.error`), `CapacityError` (`cap.error`), `RunnerError` (`run.error`, `run.leak`, `run.budget`) |
| Benchmarks and targets | `BenchError` (`bench.error`), `TargetError` (`tgt.error`) |
| Arch, transfer, sources | `ArchError` (`arch.error`), `XferError` (`xfer.error`, `xfer.non_orthogonal`), `SourceError` (`src.error`, `src.protocol_violation`, `src.mcp_*`) |
