Instructions for AI coding agents working on this repository.
This repository is Rust-first under the vllm-project GitHub organization.
- Rust -- primary and active implementation language at the repo root.
- Docs -- MkDocs documentation in
docs/. - Python gateway code has been removed as part of the migration plan.
- Read and follow
TERMINOLOGY.mdwhen naming API, state, tool, streaming, MCP, or reasoning concepts in code, documentation, issues, and pull requests. - Treat
TERMINOLOGY.mdas normative for preferred prose. Preserve exact field names and item types when discussing a wire protocol. - When local wording conflicts with current OpenAI documentation, prefer the OpenAI term unless this repository has a
distinct implementation concept documented in
TERMINOLOGY.md.
.
├── TERMINOLOGY.md # Normative project vocabulary
├── crates/agentic-server/ # Axum binary, transport handlers, and configuration
├── crates/agentic-server-core/ # Protocol types, execution, tools, and persistence
├── crates/agentic-praxis/ # Praxis integration
├── Cargo.toml # Workspace manifest and shared dependencies/lints
└── docs/ # Documentation (MkDocs)
Install pre-commit hooks and build the project:
pre-commit install
cargo buildcargo test- Before adding or updating replay cassettes, read
crates/agentic-server-core/tests/cassettes/README.mdand use its recorder workflow and existing scenario scripts; do not hand-author captured request/response YAML.
cargo clippy --all-targets -- -D warnings # lint
cargo fmt # format
cargo fmt -- --check # check formatting onlyTo run all pre-commit hooks manually:
pre-commit run --all-filesInstall docs dependencies and run docs locally:
uv venv
uv pip install -r docs/requirements.txt
uv run mkdocs serve- Rust edition: 2024.
- Maximum line length: 120 characters (configured in
rustfmt.toml). unsafecode is forbidden (unsafe_code = "forbid"inCargo.toml).- Clippy
alllints are denied;pedanticlints are warnings. - Minimum supported Rust version (MSRV): 1.85.
types/owns wire/domain data;events/parses and normalizes upstream events;tool/owns tool discovery, routing, and execution;executor/orchestrates requests across inference, tools, and persistence;storage/owns database models and operations;utils/contains genuinely shared, domain-neutral helpers.- Respect this dependency direction: handlers call core APIs; executor coordinates
events,tool, andstorage; those modules share contracts throughtypes. Do not introduce transport concerns into core types or business logic. - In
src/code, reuseutils::commonfor JSON serialization/deserialization and fallback behavior. Do not callserde_jsondirectly when an existing strict, optional, or defaulting helper expresses the required policy; add a focused helper there when the policy is reused. Directserde_jsonuse is fine in tests, fixtures, and cassette tooling. Keep Serde wire-format attributes on the owning type.
- Prefer borrowing (
&T,&str,&[T]) and avoid.clone()unless ownership or lifetime requirements make it necessary. Move values when ownership is transferred; useArconly for genuinely shared thread-safe state, and keep required clones explicit and close to task spawn. - Return
Resultfor recoverable failures and propagate with?. Use typedthiserrorerrors in library/core code, preserve sources during conversion, add useful boundary context, and avoidunwrap/expectin production paths except for documented, impossible invariants. - Never hold a
Mutex/RwLockguard across.await. Use Tokio async I/O,spawn_blockingfor blocking or CPU-heavy work, bounded channels for backpressure, andtry_join!for independent fallible work. Spawned tasks must have clear cancellation, shutdown, and join/error handling. - Encode invariants with enums, newtypes,
Option, and validated constructors. Prefer exhaustive matches and safe conversions (From/TryFrom) over stringly typed state, unchecked casts, or panics. - Avoid speculative optimization: minimize allocations in hot paths with borrowing, slices,
Bytes, and known capacities, then validate non-obvious optimizations with measurements.unsaferemains forbidden.
- Always sign off commits with the
-sflag (git commit -s). - Use conventional commit prefixes:
feat:-- new featurefix:-- bug fixci:-- CI/CD changeschore:-- maintenance tasks (deps, config)docs:-- documentation only
- Target the
mainbranch. - Include two sections in the PR description:
- Summary -- what the PR does and why.
- Test Plan -- how the changes were verified.
- Ensure all pre-commit hooks pass before opening the PR.