Skip to content

ContextCore

ContextCore is the kernel of the ContextUnity ecosystem. It contains zero business logic — only shared types, protocols, and infrastructure used by every other service.

ContextUnit SDK

Atomic data exchange format with provenance tracking, Pydantic validation, and gRPC serialization.

ContextToken

Capability-based authorization tokens with Ed25519 signing, tenant isolation, and permission scoping.

gRPC Contracts

Protocol Buffer definitions for Brain, Router, Worker, Commerce, Shield, and View services.

SharedConfig

Pydantic-based configuration with .env support ensuring consistency across all services.

Architecture

contextcore/
├── sdk/ # ContextUnit, BrainClient, WorkerClient
│ └── context_unit.py # ContextUnit model and serialization
├── security/ # Token signing backends
├── permissions/ # Permission definitions
├── tokens.py # ContextToken, TokenBuilder
├── config.py # SharedConfig, LogLevel
├── logging.py # Structured logging with secret redaction
├── interfaces.py # IRead, IWrite abstract interfaces
├── discovery.py # Service discovery
├── grpc_utils.py # gRPC channel helpers
├── exceptions.py # Shared exception types
├── signing.py # Ed25519 signing utilities
├── token_utils.py # Token serialization helpers
├── *_pb2.py # Generated gRPC stubs (DO NOT EDIT)
└── *_pb2_grpc.py # Generated gRPC stubs (DO NOT EDIT)

Installation

Terminal window
pip install contextcore

Dependencies (kept intentionally minimal):

  • grpcio — gRPC runtime
  • protobuf — Protocol Buffer serialization
  • pydantic — validation and settings

Key Principle

Zero business logic. ContextCore provides only infrastructure: types, protocols, contracts, configuration, and logging.