# cordance-cortex
> Cortex adapter. Emits `cordance-cortex-receipt-v1-candidate` JSON only;
> never writes to the cortex repo or runtime.
[](https://crates.io/crates/cordance-cortex)
[](https://docs.rs/cordance-cortex)
[](#license)
Part of the [Cordance](https://github.com/0ryant/cordance) workspace.
## Discoverability
Search terms: Cordance Cortex, Cortex receipt, candidate memory receipt,
authority boundary, candidate-only evidence, AI memory intake, context pack
provenance.
## What it does
`cordance-cortex` builds a candidate receipt that Cortex's own
`cortex_memory_accept` flow can ingest. The receipt's `AuthorityBoundary`
is constructed only via `AuthorityBoundary::candidate_only()`, which sets
every authority-grant flag to `false`:
- `cortex_truth_allowed: false`
- `cortex_admission_allowed: false`
- `durable_promotion_allowed: false`
- `memory_promotion_allowed: false`
- `doctrine_promotion_allowed: false`
- `trusted_history_allowed: false`
- `release_acceptance_allowed: false`
- `runtime_authority_allowed: false`
Receipts deserialise back through `validate_invariants()`, so a tampered
JSON that flips any flag fails the post-parse check even if `serde` accepts
it. Every nested struct carries `#[non_exhaustive]` + `#[serde(deny_unknown_fields)]`.
Cordance never modifies cortex storage. The operator hands the emitted
receipt JSON to Cortex; Cortex decides what (if anything) to promote.
## Install
```toml
[dependencies]
cordance-cortex = "0.1"
cordance-core = "0.1"
```
## Quick start
```rust,no_run
use cordance_core::pack::{CordancePack, PackTargets, ProjectIdentity};
use cordance_core::lock::SourceLock;
use cordance_core::advise::AdviseReport;
use cordance_core::schema;
let pack = CordancePack {
schema: schema::CORDANCE_PACK_V1.into(),
project: ProjectIdentity {
name: "my-project".into(),
repo_root: ".".into(),
kind: "rust-workspace".into(),
host_os: "linux".into(),
axiom_pin: Some("v3.1.1-axiom".into()),
},
sources: vec![],
doctrine_pins: vec![],
targets: PackTargets::all(),
outputs: vec![],
source_lock: SourceLock::empty(),
advise: AdviseReport::empty(),
residual_risk: vec!["claim_ceiling=candidate".into()],
};
let receipt = cordance_cortex::build_receipt(&pack).expect("build receipt");
receipt.validate_invariants().expect("invariants hold");
let json = serde_json::to_string_pretty(&receipt).expect("serialise");
println!("{json}");
```
## See also
- [Cordance project README](https://github.com/0ryant/cordance#readme)
- [`cordance-core`](https://crates.io/crates/cordance-core) — defines the
receipt structs + `AuthorityBoundary`.
- The CLI subcommand `cordance cortex push` wraps this crate; it is the
intended end-user entry point.
## License
Dual-licensed under MIT OR Apache-2.0.