aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / API_STABILITY.md
| 1 | # AIEN Sovereign Systems API Stability Policy |
| 2 | |
| 3 | This document defines the interface stability guarantees, deprecation lifecycles, and semantic versioning commitments for the AIEN Sovereign Native Systems Architecture. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## 1. Versioning Commitment |
| 8 | |
| 9 | AIEN adheres to Semantic Versioning 2.0.0 (`MAJOR.MINOR.PATCH`): |
| 10 | - **MAJOR**: Incompatible API modifications to Tier 1 contracts. |
| 11 | - **MINOR**: Backward-compatible feature additions, new crate modules, or evolving modifications to Tier 2 interfaces. |
| 12 | - **PATCH**: Backward-compatible bug fixes, performance optimizations, and security patches. |
| 13 | |
| 14 | Prior to `v1.0.0`, minor releases (`v0.2.0`, `v0.3.0`) may introduce changes to Tier 2 interfaces as documented below. Tier 1 interfaces maintain stability guarantees across all `v0.x` minor releases. |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## 2. Interface Stability Tiers |
| 19 | |
| 20 | All public APIs, protocols, traits, and RPC routes across AIEN crates belong to one of three tiers: |
| 21 | |
| 22 | ### Tier 1: Stable Contracts |
| 23 | |
| 24 | Tier 1 interfaces define the core interoperability contracts of the ecosystem. External integrations, third-party agents, and downstream tooling may depend on these interfaces with long-term stability guarantees. |
| 25 | |
| 26 | **Covered Interfaces:** |
| 27 | 1. **Inference Abstraction (`crates/aien-inference-abi`)**: |
| 28 | - `AienInferenceBackend` async trait: `initialize`, `generate`, `step`, `health_check`. |
| 29 | - Hardware detection types: `ExecutionSurface`, `CpuTopology`. |
| 30 | - Structured request and response models: `GenerationRequest`, `GenerationOutput`, `InferenceMetadata`. |
| 31 | 2. **Cortex Memory Engine (`crates/cortex-rs`)**: |
| 32 | - HTTP routes: `POST /api/cortex/write`, `POST /api/cortex/search`, `POST /api/cortex/recall`, `GET /health`. |
| 33 | - JSON payload contracts: `WritePayload`, `EntityWriteInput`, `ClaimWriteInput`, `CortexReceipt`. |
| 34 | 3. **Telemetry & Watchdog Gateways**: |
| 35 | - `spark-cockpit-rs`: `GET /api/pulse`, `GET /health`. |
| 36 | - `aegis-runtime`: WebSocket gateway packet frames and auth handshake. |
| 37 | 4. **Command Line Interfaces**: |
| 38 | - `aien`: `--version`, `status`, `eval`. |
| 39 | - `atlas-vault`: `add`, `get`, `list`, `purge`. |
| 40 | |
| 41 | **Guarantee:** |
| 42 | - Breaking changes require a major version increment (`v1.0.0`) or an explicit two-minor-version deprecation window. |
| 43 | - Deprecated items must emit compiler warnings (`#[deprecated]`) stating the migration path and removal target. |
| 44 | |
| 45 | --- |
| 46 | |
| 47 | ### Tier 2: Evolving Contracts |
| 48 | |
| 49 | Tier 2 interfaces cover internal systems engines that are functional, tested, and benchmarked, but whose exact parameters may be tuned to optimize memory layouts or scheduling efficiency. |
| 50 | |
| 51 | **Covered Interfaces:** |
| 52 | 1. **Paged KV Cache Engine (`crates/aien-kv-cache`)**: |
| 53 | - `UnifiedKvTensorPool`: Memory configuration and allocation interfaces. |
| 54 | - `RadixTree`: Prefix cache lookup and node eviction parameters. |
| 55 | - `KvBlock`: Internal block representation and reference counting semantics. |
| 56 | 2. **Continuous Batching Scheduler (`crates/aien-scheduler`)**: |
| 57 | - `ContinuousBatchingScheduler`: Step iteration and queue management. |
| 58 | - `SchedulerConfig`: Prefill chunk size, max batch size, and memory watermark thresholds. |
| 59 | 3. **Supervisor and Crash Recovery (`crates/spark-supervisor`)**: |
| 60 | - Service manifest format and crash backoff calculation curves. |
| 61 | |
| 62 | **Guarantee:** |
| 63 | - Patch releases (`v0.1.x`) maintain strict backward compatibility. |
| 64 | - Minor releases (`v0.2.0`, `v0.3.0`) may modify method signatures or configuration fields. |
| 65 | - All breaking changes between minor versions must be accompanied by explicit upgrade notes in `CHANGELOG.md`. |
| 66 | |
| 67 | --- |
| 68 | |
| 69 | ### Tier 3: Internal and Experimental Interfaces |
| 70 | |
| 71 | Tier 3 interfaces represent private implementation details, dynamic shared library bridges, or emerging hardware adapters. |
| 72 | |
| 73 | **Covered Interfaces:** |
| 74 | 1. **Direct Hardware Bindings**: |
| 75 | - Low-level ModelOpt quantization loaders and custom NVFP4 kernel bindings. |
| 76 | |
| 77 | **Guarantee:** |
| 78 | - Zero stability guarantees. |
| 79 | - Signatures and symbol names may change across patch releases to align with Omega kernel or GPU driver updates. |
| 80 | - External code should never link directly to Tier 3 FFI symbols; rely instead on Tier 1 `AienInferenceBackend`. |
| 81 | |
| 82 | --- |
| 83 | |
| 84 | ## 3. Deprecation and Removal Process |
| 85 | |
| 86 | When an interface in Tier 1 or Tier 2 must be replaced: |
| 87 | 1. **Deprecation Notice**: The item is marked with `#[deprecated(since = "X.Y.Z", note = "Use NewInterface instead")]`. |
| 88 | 2. **Documentation**: Release notes and `docs/API_STABILITY.md` document the recommended replacement. |
| 89 | 3. **Grace Period**: The deprecated item remains functional for a minimum of two minor releases (e.g. deprecated in `v0.2.0`, removed no earlier than `v0.4.0`). |
| 90 | 4. **Removal**: The code is cleanly removed in the scheduled release. |
| 91 | |
| 92 | --- |
| 93 | |
| 94 | ## 4. Hardware and ABI Compatibility Matrix |
| 95 | |
| 96 | | Operating System | Target Triple | Tier 1 Support | Tier 2 Support | Tier 3 Support (GPU) | |
| 97 | | :--- | :--- | :--- | :--- | :--- | |
| 98 | | **Linux (NVIDIA DGX Spark)** | `aarch64-unknown-linux-gnu` | Verified | Verified | Active (Omega native kernels) | |
| 99 | | **Linux (Generic x86_64)** | `x86_64-unknown-linux-gnu` | Verified | Verified | Fallback (CPU Kernel) | |
| 100 | | **Linux (Generic aarch64)** | `aarch64-unknown-linux-gnu` | Verified | Verified | Fallback (CPU Kernel) | |
| 101 | | **macOS (Apple Silicon)** | `aarch64-apple-darwin` | Verified | Verified | Fallback (CPU Kernel) | |
| 102 | | **macOS (Intel)** | `x86_64-apple-darwin` | Verified | Verified | Fallback (CPU Kernel) | |
| 103 | | **Windows** | `x86_64-pc-windows-msvc` | Verified | Verified | Fallback (Aligned Heap) | |