Skip to main content

paladin_ports/
lib.rs

1//! # paladin-ports
2//!
3//! Port trait definitions for the Paladin multi-agent orchestration framework.
4//!
5//! This crate sits at the **application boundary** of the hexagonal architecture,
6//! defining the abstract contracts (ports) that connect the core domain to external
7//! infrastructure. It depends only on [`paladin-core`] and standard utility crates —
8//! never on infrastructure SDKs, database drivers, or LLM provider libraries.
9//!
10//! ## Hexagonal Architecture Position
11//!
12//! ```text
13//! ┌─────────────────────────────────────────────────────────┐
14//! │                  Infrastructure Layer                    │
15//! │   (adapters: OpenAI, SQLite, Redis, MinIO, MCP, …)      │
16//! │              implements ↓ these ports                    │
17//! ├─────────────────────────────────────────────────────────┤
18//! │                  paladin-ports  ◄── YOU ARE HERE         │
19//! │   output/: LlmPort, GarrisonPort, CitadelPort, …        │
20//! │   input/:  ContentInputPort, DocumentPort, …            │
21//! │              depends on ↓                               │
22//! ├─────────────────────────────────────────────────────────┤
23//! │                  paladin-core                            │
24//! │   (domain entities, value objects, aggregates)          │
25//! └─────────────────────────────────────────────────────────┘
26//! ```
27//!
28//! ## Modules
29//!
30//! - [`output`] — Port traits implemented by infrastructure adapters (LLM providers,
31//!   storage backends, queue brokers, tool registries, etc.)
32//! - [`input`] — Port traits representing API boundaries into the application
33//!   (content ingestion, RPC services, document processing, etc.)
34//!
35//! ## Dependency Policy
36//!
37//! `paladin-ports` must **never** introduce dependencies on:
38//! - LLM provider SDKs (`openai`, `anthropic`, etc.)
39//! - Database drivers (`sqlx`, `redis`, etc.)
40//! - Storage clients (`aws-sdk-s3`, `minio`, etc.)
41//! - HTTP clients (`reqwest`) in an infrastructure capacity
42//!
43//! All such dependencies belong exclusively in the infrastructure adapters that
44//! implement these port traits.
45
46#![warn(missing_docs)]
47// Some port files contain cross-crate doc links (e.g. `crate::infrastructure::…`)
48// that resolved in the original `paladin` crate but are unavailable in this
49// isolated crate.  Downgrade from deny → warn so `cargo doc` still succeeds.
50#![warn(rustdoc::broken_intra_doc_links)]
51#![allow(rustdoc::broken_intra_doc_links)]
52#![allow(rustdoc::redundant_explicit_links)]
53
54/// Input port traits — defines how external stimuli enter the application.
55pub mod input;
56/// Output port traits — defines how the application reaches external systems.
57pub mod output;