# runifold-model Agent guide
Read ../../AGENTS.md first. This guide adds local boundaries.
## Purpose
Owns: Provider-neutral content, model invocation, streams, routing and retry contracts.
Does not own: Vendor wire types and Agent tool loops.
## Key files and execution path
Start at `src/invocation.rs` and follow its module declarations and calls.
- `src/invocation.rs`
## Extension points
Extend provider-neutral content, model invocation, streams, routing and retry contracts within this crate; consult current public exports before adding another abstraction.
Public exports are in the crate entry point. Consult
[the architecture map](../../docs/ai/architecture.md) before crossing a crate boundary.
Tests next to implementation exercise local invariants; `tests/` (where present)
exercises public or protocol boundaries. Keep extensions within this ownership.
## Dependencies
- `runifold-core`: normal
## Invariants and common mistakes
Preserve the root architectural laws. Do not introduce a second execution path,
ambient authority, hidden retry, or vendor wire types into neutral contracts.
Do not infer a public API from historical RFC examples; verify current exports.
Changes to a public contract need a regression test and release documentation.
## Tests to run
```sh
cargo test -p runifold-model --locked
cargo clippy -p runifold-model --all-targets --all-features --locked -- -D warnings
```
Database tests may require Docker; see [testing](../../docs/ai/testing.md).
After changing features, dependencies, entry points or recipes, run
`python3 scripts/ai-knowledge.py --write` and `--check` at the workspace root.