The connector kit for GameCult minds: the contract every model turn goes through, and connector daemons.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens ec9722a2d8 Long request ids: the Malformed refusal echoes the id; the client refuses locally (long-id-refusal-unreadable)
Naming a request by the SHA-256 of its id is a wire meaning v2 does not have: no v2
client could read that reply. begin now seals Refused(Malformed) with the request's own
id and drops the connection (FrameBound) only when that sealed refusal cannot fit the
frame. ConnectorClient refuses an id past MAX_IDENTITY_BYTES before connecting, with
the typed RequestIdTooLong error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 06:40:18 +01:00
crates/model-connector Long request ids: the Malformed refusal echoes the id; the client refuses locally (long-id-refusal-unreadable) 2026-10-28 06:40:18 +01:00
.gitignore Lift the connector contract, envelope and client from CodexConnector fd7cec4 2026-10-28 04:39:58 +01:00
Cargo.lock Golden v2 wire fixtures replace the CodexConnector dev-dependency; pin envelope validation and frame bounds 2026-10-28 05:09:03 +01:00
Cargo.toml Lift the connector contract, envelope and client from CodexConnector fd7cec4 2026-10-28 04:39:58 +01:00
LICENSE Initial commit: LICENSE and README front door 2026-10-28 03:49:49 +01:00
README.md Fix pass 4: long request ids are refused on the wire, frame rule is public, a FrameBound completion frees its slot, replays are re-measured against the frame 2026-10-28 06:05:09 +01:00

ModelConnector

The connector kit for GameCult minds: one typed, encrypted, replay-safe contract between a caller that needs a model turn and a daemon that holds the provider credential, so no project wires its own provider calls.

Status: the model-connector crate is live. No connector binary exists yet (the Claude connector is first, then an OpenAI-compatible one).

Entry points

Crate crates/model-connector:

  • src/contract.rs - the v2 wire contract: ProviderRequest, TransportInvocation, TransportResult, TransportReceipt, Refusal, and the canonical byte and digest functions that bind a result to its request.
  • src/envelope.rs - the AES-256-GCM TransportEnvelope, its identity-binding AAD, and the length-prefixed framing.
  • src/client.rs - ConnectorClient, the one-request caller side.
  • src/service.rs (feature daemon) - TransportService: caller admission, durable replay (a retried request is answered byte-identically and the provider runs once), in-flight and capacity refusals.
  • src/serve.rs (feature daemon) - serve(), the loopback accept loop, over the ProviderBackend trait. A connector binary implements ProviderBackend for its provider and calls serve; the kit names no provider.

Frame arithmetic is public in src/envelope.rs: frame_bytes_for_payload(n) is the frame a caller payload bound of n needs, payload_bytes_for_frame(frame) is the largest payload bound a frame allows, and MAX_IDENTITY_BYTES (256) bounds caller ids, request ids and model names. serve refuses a frame/payload pair that violates them (ServeError::FrameBound states the frame needed); the smallest legal frame is frame_bytes_for_payload(MIN_PAYLOAD_BYTES). A request id past the bound is refused on the wire as Refusal::Malformed, the reply naming it by its SHA-256.

The default feature set compiles contract, envelope and client only. Schema ids are still gamecult.codex.*.v2; renaming them changes the wire and belongs to a later contract version.

Verify

cargo test --locked --workspace
cargo test --locked --workspace --features model-connector/daemon

tests/wire_parity_v2.rs pins the kit byte-for-byte to CodexConnector fd7cec4 in both directions (it fetches that revision as a dev-dependency).

Provenance and license

AGPL-3.0-only. See LICENSE.

The contract, envelope, client, replay service and serve loop were lifted from CodexConnector at fd7cec4, formerly PolyForm Noncommercial. Its sole copyright holder relicensed the lifted material as AGPL-3.0-only for this repository.