Expand description
contextgraph-types — the Context Graph Protocol (CGP) wire types.
This crate is the industry-facing artifact: MIT licensed, zero
dependencies beyond serde, publishable to crates.io on its own so a
third party can implement a CGP host or provider without pulling in any
other code. The normative shape these types bind to is SPEC.md at the
repository root; every doc comment below cites a section of it.
Protocol version: contextgraph/1.0.
Re-exports§
pub use attest::ALGORITHM_ED25519;pub use attest::AttestationVerdict;pub use attest::FrameAttestation;pub use attest::InclusionProof;pub use attest::InclusionStep;pub use attest::MAX_INCLUSION_PATH_STEPS;pub use attest::ProvenanceAttestation;pub use attest::digest_string;pub use attest::encode_provenance_link;pub use attest::frame_commitment;pub use attest::inclusion_proof;pub use attest::merkle_root;pub use attest::provenance_chain_head;pub use attest::public_key_for;pub use attest::result_set_commitments;pub use attest::result_set_root;pub use attest::root_from_proof;pub use attest::sign_commitment;pub use attest::sign_frame_attestation;pub use attest::verify_commitment;pub use attest::verify_frame_attestation;pub use attest::verify_frame_inclusion;pub use attribution::AttributionReport;pub use attribution::ContextUse;pub use capability::Capabilities;pub use capability::DataFlow;pub use capability::ProviderInfo;pub use capability::QueryCapability;pub use capability::embedding_fingerprints_match;pub use capability::fingerprint_dimensions;pub use consent::ConsentReceipt;pub use consent::Grantor;pub use error_code::ErrorCode;pub use error_code::HostReaction;pub use extension::ExtensionValue;pub use frame::ContentFidelity;pub use frame::ContentRef;pub use frame::ContextFrame;pub use frame::FrameEmbedding;pub use frame::FrameKind;pub use frame::InlineContentRequirement;pub use frame::Provenance;pub use frame::Relation;pub use frame::Representation;pub use frame::Transform;pub use frame::rel;pub use identity::FrameId;pub use identity::canonical_order;pub use query::ContextQuery;pub use query::ContextQueryResult;pub use record::ConstraintEffect;pub use record::ContextRecord;pub use record::ContractRequirement;pub use record::DirectiveKind;pub use record::Enforcement;pub use record::KnowledgeKind;pub use record::LIFECYCLE_SCHEMA_VERSION;pub use record::OriginClass;pub use record::RESERVED_RECORD_MEMBERS;pub use record::RecordAttestation;pub use record::RecordBody;pub use record::RecordLink;pub use record::RecordProvenance;pub use record::RecordScope;pub use record::RecordStatus;pub use record::RequirementResult;pub use record::SharingScope;pub use record::ValidationOutcome;pub use record::is_reserved_record_member;pub use record_attest::RECORD_ATTESTATION_DOMAIN;pub use record_attest::RECORD_HASH_MEMBER;pub use record_attest::RecordHashError;pub use record_attest::record_attestation_message;pub use record_attest::record_hash;pub use record_attest::record_hash_is_current;pub use record_attest::record_hash_of;pub use record_attest::record_hash_preimage;pub use record_attest::sign_record;pub use record_attest::sign_record_attestation;pub use record_attest::verify_record_attestation;pub use record_attest::verify_signed_record_hash;pub use scope::EgressScope;pub use token::BYTES_PER_BUDGET_TOKEN;pub use token::SUGGESTED_HOST_SAFETY_FACTOR;pub use token::budget_from_model_tokens;pub use token::budget_tokens;pub use usage::ProviderUsage;pub use usage::ServedFrame;pub use usage::UsageReport;pub use validate::DIGEST_ALGORITHMS;pub use validate::format_protocol_timestamp;pub use validate::is_protocol_timestamp;pub use validate::is_well_formed_digest;pub use verify::FrameVerdict;pub use verify::Verdict;pub use verify::VerifyRequest;pub use verify::VerifyResponse;
Modules§
- attest
- Provenance attestation — turning “we have a trace” into “we have evidence”
(
SPEC.md§6.5, ADR 0010). - attribution
- Retrieval attribution: closing the loop from a served frame to what it did
(
SPEC.md§14; issue #31). - capability
- Handshake and capability negotiation types
(
SPEC.md§3).DataFlowis the security-critical field: hosts surface it at install/consent time, andegress: trueproviders must never be auto-enabled (SPEC.md §4). - consent
- Consent receipts — the durable, audit-grade record of a granted egress
permission (
docs/context-reuse.md§3). - error_
code - Structured error codes (
SPEC.md§Errors, issue #9). - extension
ExtensionValue— this crate’s own JSON value model, for the parts of the wire the reference types deliberately leave open.- frame
ContextFrame— the unit of exchange between a CGP host and a provider.SPEC.md§6 fixes this exact shape; frames, never blobs, carry relevance, cost, and provenance so a budgeting, citing host can compose sources honestly.- identity
- Stable frame identity and the canonical composition order
(
docs/context-reuse.md§1). - query
context/queryrequest/response shapes (SPEC.md§5). Budget-aware by contract: every query carriesmax_tokens; a conforming provider never returns more than the budget and never lies about cost.- record
ContextRecord— the immutable, provenance-bearing unit of the Context Exchange Provider lifecycle profile (contextgraph/lifecycle/1.0-draft, issue #28).- record_
attest - Record content addressing and record attestation — the lifecycle profile’s
record_hashandRecordAttestation, implemented (docs/profiles/context-exchange-provider.md§3 and §7, ADR 0017). - scope
- Egress-scope vocabulary — a closed, extensible classification of where
a provider’s content goes (
docs/context-reuse.md§3). - token
- Canonical token accounting — the rule that makes budget honesty checkable
(
SPEC.md§B3, ADR 0003). - usage
- Usage reports — a per-request roll-up of context cost
(
docs/context-reuse.md§2). - validate
- Format validators for fields the protocol declares but could not previously
check (
SPEC.md§F4, §F5; issues #10 and #12). - verify
context/verify— pull-based revalidation of frames a host already holds (docs/context-reuse.md§4).
Constants§
- PROTOCOL_
VERSION - The stable protocol version string this crate implements (
SPEC.md§3.1).