Use independent CodexConnector transport

This commit is contained in:
Meta Vens 2026-08-24 20:08:36 +02:00
commit b3388e0c3b
7 changed files with 518 additions and 532 deletions

35
Cargo.lock generated
View file

@ -196,6 +196,12 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "base64"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
[[package]]
name = "base64ct"
version = "1.8.3"
@ -313,6 +319,22 @@ dependencies = [
"inout",
]
[[package]]
name = "codex-connector"
version = "0.1.0"
source = "git+https://github.com/GameCult/CodexConnector.git?rev=548ee73b01c0c99d4e613677cf6d5ce63c63a240#548ee73b01c0c99d4e613677cf6d5ce63c63a240"
dependencies = [
"aes-gcm",
"base64 0.23.1",
"rand_core 0.6.4",
"rmp-serde",
"serde",
"serde_json",
"sha2",
"thiserror",
"zeroize",
]
[[package]]
name = "const-oid"
version = "0.9.6"
@ -436,7 +458,7 @@ version = "0.1.0"
dependencies = [
"aes-gcm",
"anyhow",
"base64",
"base64 0.22.1",
"chrono",
"cultcache-rs 0.1.0",
"ed25519-dalek",
@ -792,8 +814,9 @@ dependencies = [
"async-stream",
"async-trait",
"axum",
"base64",
"base64 0.22.1",
"chrono",
"codex-connector",
"cultcache-rs 0.1.0",
"cultcache-rs 0.1.0 (git+https://github.com/GameCult/cultcache-rs.git?rev=0ba87453115e3d44e8fcb7419866cd7dd70fb096)",
"cultmesh-rs",
@ -950,7 +973,7 @@ version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0"
dependencies = [
"base64",
"base64 0.22.1",
"bytes",
"futures-channel",
"futures-util",
@ -1185,7 +1208,7 @@ version = "9.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde"
dependencies = [
"base64",
"base64 0.22.1",
"js-sys",
"pem",
"ring",
@ -1433,7 +1456,7 @@ version = "3.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be"
dependencies = [
"base64",
"base64 0.22.1",
"serde_core",
]
@ -1745,7 +1768,7 @@ version = "0.12.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
dependencies = [
"base64",
"base64 0.22.1",
"bytes",
"futures-core",
"futures-util",

View file

@ -22,6 +22,7 @@ async-stream = "0.3"
axum = { version = "0.8", features = ["macros"] }
chrono = { version = "0.4", features = ["serde"] }
base64 = "0.22"
codex-connector = { git = "https://github.com/GameCult/CodexConnector.git", rev = "548ee73b01c0c99d4e613677cf6d5ce63c63a240" }
cultcache-legacy = { package = "cultcache-rs", git = "https://github.com/GameCult/cultcache-rs.git", rev = "0ba87453115e3d44e8fcb7419866cd7dd70fb096" }
cultcache-rs = { path = "vendor/cultcache-rs" }
cultnet-rs = { path = "vendor/cultnet-rs" }

View file

@ -100,8 +100,9 @@ current acceptance surface covers:
exact component versions and mutation proof receipts;
- provider, token, cache, latency, validation, state-version, and build receipts;
- provider-neutral inference through either direct DeepSeek/OpenRouter
boundaries or Epiphany's encrypted loopback CultMesh connector, while every
prompt, schema, retry, interpretation, and world commit remains Ghostlight's;
boundaries or the independent CodexConnector daemon's encrypted loopback
CultNet boundary, while every prompt, schema, retry, interpretation, and world
commit remains Ghostlight's;
- exact-build deployment, state migration, public cutover, and restart
verification on Yggdrasil.

View file

@ -12,6 +12,7 @@ async-stream.workspace = true
axum.workspace = true
chrono.workspace = true
base64.workspace = true
codex-connector.workspace = true
cultcache-legacy.workspace = true
cultcache-rs.workspace = true
cultnet-rs.workspace = true

View file

@ -30,7 +30,7 @@ use ghostlight_dungeon::{
model::{
DeepSeekPort, MODEL_CAPABLE, MODEL_FAST, ModelPort, ModelRuntimeStatus, OpenRouterPort,
},
model_connector::CultMeshModelPort,
model_connector::CodexConnectorModelPort,
persistence::CampaignStore,
persona::PersonaProjectionEngine,
registry::{CampaignRegistry, CampaignRuntime},
@ -297,7 +297,7 @@ async fn main() -> anyhow::Result<()> {
match provider_name.as_str() {
"deepseek" => ("deepseek-v4-flash", "deepseek-v4-pro", "deepseek.dpapi"),
"openrouter" => ("stealth/ox-alpha", "stealth/ox-alpha", "openrouter.key"),
"epiphany-codex" => ("gpt-5.4", "gpt-5.4", "epiphany-model-connector.key"),
"codex-connector" => ("gpt-5.4", "gpt-5.4", "codex-connector.key"),
unsupported => anyhow::bail!("unsupported model provider {unsupported}"),
};
let fast_model =
@ -325,7 +325,7 @@ async fn main() -> anyhow::Result<()> {
fast_model.clone(),
capable_model.clone(),
)?),
"epiphany-codex" => Arc::new(CultMeshModelPort::from_runtime_secret(
"codex-connector" => Arc::new(CodexConnectorModelPort::from_runtime_secret(
std::env::var("GHOSTLIGHT_MODEL_CONNECTOR")
.unwrap_or_else(|_| "127.0.0.1:4103".to_string())
.parse()?,

File diff suppressed because it is too large Load diff

View file

@ -203,15 +203,19 @@ the planner already owns. Stable prompt prefixes are deliberately placed before
dynamic state, and provider receipts expose per-attempt token/cache usage plus
bounded local validation failures.
`ModelPort` remains Ghostlight's single inference seam. The
`epiphany-codex` implementation is an ordinary typed consumer of Epiphany's
loopback model-provider connector: it emits an encrypted, expiring MessagePack
request over bounded TCP-framed CultNet and accepts only a correlated ordered
text stream plus terminal receipt. A stable cache key is derived from stage,
logical model class, and output schema rather than mutable campaign content.
Epiphany owns Codex credential custody and physical calls; Ghostlight still
owns stage projection, schemas, retries, semantic validation, receipts, and all
kernel admission. Neither side can borrow the other's state authority.
`ModelPort` remains Ghostlight's single inference seam. The Codex-backed
implementation is an ordinary typed consumer of the independent CodexConnector
daemon: it emits an encrypted, expiring MessagePack request over bounded
TCP-framed CultNet and accepts only a correlated ordered text stream plus
terminal receipt. A stable cache key is derived from stage, logical model class,
and output schema rather than mutable campaign content. CodexConnector owns
credential custody, caller admission, bounded provider transport, replay, and
transport receipts. Ghostlight owns provider-request derivation, stage
projection, schemas, retry between passes, semantic validation, model-stage
receipts, and every kernel admission. Epiphany is a separate consumer and owns
neither side. The currently installed Yggdrasil connector remains the legacy
Epiphany-built release `7d384a6277c74fb35b8e51297ffbccda59746ce9` until
Idunn admits and selects the independent CodexConnector release.
Canonical actor cell slices include that actor's exact goals, obligations,
relationships, and bounded memories. Named Gestalt-member exceptions receive