aien-protocols-mv
Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem
Brought by drakestapleton
aien-protocols-mv / crates / aien-probe / README.md
| 1 | # aien-probe |
| 2 | |
| 3 | Probe evaluation engine, one of the reference crates in [aien-protocols](../../README.md). |
| 4 | |
| 5 | ## What it is |
| 6 | |
| 7 | `aien-probe` asks questions about a piece of state without generating text. A caller supplies a JSON state and a set of typed probes. Each probe asks one question about that state: |
| 8 | |
| 9 | - `Noul`: a yes or no question, answered by a probability. |
| 10 | - `Score`: a judgment on an ordered scale with a description for each level. |
| 11 | - `Choice`: a pick of one option out of a set. |
| 12 | |
| 13 | Every probe is evaluated against the same state. A backend produces the answers. |
| 14 | |
| 15 | ## Backends |
| 16 | |
| 17 | | Backend | Network | Model | Use | |
| 18 | | --- | --- | --- | --- | |
| 19 | | `DeterministicReferenceBackend` | No | No | Fixed answers for tests | |
| 20 | | `HttpProbeBackend` | Yes | Whatever serves the endpoint | Judgments from a model server | |
| 21 | |
| 22 | `DeterministicReferenceBackend` turns a SHA-256 hash of the canonical state and the question label into a logit (a raw score before it is turned into a probability), then applies the same calibration math as the HTTP path. The same state and probes always give the same answers. It is a test oracle, not a trained model. |
| 23 | |
| 24 | `HttpProbeBackend` sends `POST <endpoint>/v1/probe` with `{ "state": ..., "probes": ... }` and reads the answers back. The server side is not in this repository. On 2026-10-19 a search of [aien-sovereign-core-mv](https://github.com/aien-dev/aien-sovereign-core-mv) `main` found the `/v1/probe` route only in a client test (`crates/aien-localhttp/tests/behavior.rs`), so no AIEN server for this route was found. |
| 25 | |
| 26 | ## Usage |
| 27 | |
| 28 | A complete program. It needs `aien-probe`, `serde_json` and `tokio` (with the `macros` and `rt-multi-thread` features) as dependencies. |
| 29 | |
| 30 | ```rust |
| 31 | use aien_probe::{DeterministicReferenceBackend, Noul, Probe, ProbeEngine, ProbeSet, Score}; |
| 32 | use serde_json::json; |
| 33 | |
| 34 | #[tokio::main] |
| 35 | async fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 36 | let engine = ProbeEngine::new(DeterministicReferenceBackend::new()); |
| 37 | let probes = ProbeSet::new() |
| 38 | .with( |
| 39 | "telemetry", |
| 40 | Probe::Noul(Noul::new("Does this patch add network telemetry?")), |
| 41 | ) |
| 42 | .with( |
| 43 | "quality", |
| 44 | Probe::Score(Score::new( |
| 45 | "Rate the architectural quality.", |
| 46 | ["unacceptable", "needs_rework", "acceptable", "exemplary"], |
| 47 | )), |
| 48 | ); |
| 49 | |
| 50 | let response = engine.evaluate(&json!({"diff": "..."}), &probes).await?; |
| 51 | println!( |
| 52 | "telemetry probability {:.4}", |
| 53 | response.noul("telemetry").unwrap().noul |
| 54 | ); |
| 55 | println!("quality score {:.2}", response.score("quality").unwrap().score); |
| 56 | Ok(()) |
| 57 | } |
| 58 | ``` |
| 59 | |
| 60 | On 2026-10-19 this program, built against `main` at `fb5fca9` on the Spark, printed: |
| 61 | |
| 62 | ```text |
| 63 | telemetry probability 0.1005 |
| 64 | quality score 1.97 |
| 65 | ``` |
| 66 | |
| 67 | ## Evaluator protocol |
| 68 | |
| 69 | `ProbeEvaluator` implements the `Evaluator` trait from `aien-evaluation-protocol`, so a probe set with gates (`ProbeGate`) can run inside the `CanaryRollbackHarness` from that crate. A gate says which answers must hold for a subject to pass. A violated gate becomes a fatal finding and, in the harness, triggers rollback. `tests/probe_engine_tests.rs` covers this path. |
| 70 | |
| 71 | ## Test |
| 72 | |
| 73 | From the repository root: |
| 74 | |
| 75 | ```bash |
| 76 | cargo test -p aien-probe |
| 77 | ``` |
| 78 | |
| 79 | ## License |
| 80 | |
| 81 | Apache-2.0 (from `Cargo.toml`; full text in [LICENSE-CODE](../../LICENSE-CODE)). |
| 82 | |
| 83 | ## Human-Directed Agentic Engineering |
| 84 | |
| 85 | Development follows Human-Directed Agentic Engineering (HDAE): humans define goals, |
| 86 | architecture, constraints, acceptance criteria, and stopping points; agents implement, |
| 87 | execute checks, diagnose failures, and revise within those boundaries. Human review |
| 88 | retains responsibility for claims, acceptance, and release decisions. This describes |
| 89 | the development method, not a change to runtime autonomy or historical evidence. |
| 90 | |
| 91 | For the documented method and a systems-software case study, see Gregory M. Kurtzer |
| 92 | (2026), *Ginux: Building an Independent Kernel That Runs Linux Userspace through |
| 93 | Human-Directed Agentic Engineering*, technical report, v1, Zenodo, |
| 94 | <https://doi.org/10.5281/zenodo.23682548>. |