Open, verifiable, Byzantine-resilient trusted-time framework with deterministic event orchestration, append-only audit trails, and bridge services for REST, WebSocket, gRPC, and NTP consumers.
- What This Project Is
- Core Architecture
- Security Model
- Repository Layout
- Prerequisites
- Build
- Test
- Run
- Bridge Sidecar
- APIs And Contracts
- Operations
- Troubleshooting
- Development Workflow
- License
Quorum Time provides:
- Byzantine fault tolerant (BFT) time convergence from multi-source observations.
- Deterministic event processing through a single orchestration pipeline.
- Fail-closed validation for critical signatures and shared-state transitions.
- Append-only vault logging with Merkle-aware integrity paths.
- Runtime control-plane stages for mode handling, HITL gates, recovery, circuit breaking, and quarantine.
- A Python bridge sidecar exposing normalized consumption interfaces.
EventOrchestratoris the single execution spine.- All runtime mutations must flow through
EventOrchestrator::ingest(...). - Pipeline stages enforce policy and safety (passport validation, vault write, gossip handling, Merkle updates, convergence, quorum/state apply, control-plane stages).
SignedStateprotobuf envelopes carry event payload, gossip metadata, and optional anchor proof.- Shared-state and sync payloads are encoded/decoded through
pipeline_event_codec. - Signature verification uses registered authority key material (
crypto_verify).
ColdVaultpersists append-only logs and operational security events.- Shared-state snapshots and authority sequence state are persisted and recoverable on startup.
Design principles:
- Fail-closed first: invalid/missing signatures, decode failures, stale versions, and policy violations reject state mutation.
- Determinism over convenience: canonical payload forms and strict decode behavior reduce ambiguity.
- No silent errors: security-relevant failures emit audit events.
- Control-plane authorization: runtime mode transitions happen via signed control events, not free-form payload markers.
Current posture:
- Suitable for internal environments with normal risk assumptions.
- For high-threat production environments, keep TLS/mTLS, listener readiness gates, strict config validation, and full smoke tests mandatory.
include/uml001/: public headers.src/core/: core runtime, clock, orchestrator, pipeline stages.src/gossip/: dedup and convergence support.src/rest/andrest/: REST server/handlers.proto/: protobuf definitions (signed_state.proto,clock_service.proto).bridge/: Python bridge runtime, tests, containerization.sdks/python/: Python SDK modules.spec/schemas/: JSON Schema contracts.spec/examples/canonical/: canonical examples validated against schemas.tests/: C++ and Python validation/regression tests.tools/: helper and analysis tools.
Minimum recommended toolchain:
- C++17 compiler
- CMake 3.20+
- OpenSSL 3.x
- Protobuf + gRPC toolchain
- Python 3.14
Bridge Python minimums (aligned with generated stubs):
grpcio>=1.78.0grpcio-tools>=1.78.0protobuf>=6.31.1fastapi>=0.111.0uvicorn[standard]>=0.29.0
./build.shOr directly:
cmake -S . -B build
cmake --build build./build_python.sh
./build_sdk.shThis repo primarily produces executable test targets in build/.
Typical pass:
./build/test_pipeline_wiring
./build/test_shared_state_internal_event
./build/test_service_ingress_pipeline
./build/test_shared_state_route_contract
./build/test_default_gossip_provider
./build/test_bft_shared_state_schema_contract
./build/test_control_plane_stages
./build/test_schema_catalog_consistency
./build/test_gossip_security_regressions
./build/test_pipeline_codec_decode_hardeningpython3 -m pytest tests/test_schema_validator.py -q
python3 -m pytest bridge/tests/test_config_tls_validation.py -q
python3 -m pytest bridge/tests/test_server_main_startup_invariants.py -q
python3 -m pytest bridge/tests/test_grpc_startup_smoke.py -q./build/aegis_clock_serverpython3 -m bridge.server_mainBridge process hosts:
- REST (
:8080by default) - WebSocket (
:8081by default) - gRPC (
:9090by default) - NTP UDP (
:1123by default)
./bridge/build_bridge.shOptional image build:
./bridge/build_bridge.sh --dockerdocker build -t yourorg/aegis-bridge:latest -f bridge/Dockerfile .Notes:
- Docker image/tooling versions are pinned to satisfy generated gRPC stub/runtime requirements.
- Healthcheck uses TCP-connect style probing to avoid TLS/plaintext mismatch assumptions.
- Protos:
proto/clock_service.proto,bridge/bridge/proto/bridge.proto. - Canonical server implementation:
src/core/clock_service_impl.cpp.
- Handler entrypoint:
src/rest/rest_handlers.cpp. - Shared-state route enforces strict required fields and rejects unknown fields to match schema
additionalProperties: false.
- Catalog:
spec/schemas/catalog.json. - Key contracts include:
signed_state_envelope.schema.jsonevent_context.schema.jsonbft_shared_state.schema.json
- Under
spec/examples/canonical/. - Intended to validate machine-readable contract and runtime expectations together.
Recommended deployment checks:
- Build succeeds (
cmake --build build). - C++ regression tests pass.
- Bridge startup invariants pass.
- gRPC bridge smoke test passes.
- Runtime startup logs show listeners healthy in intended mode.
Production-leaning posture:
- Use TLS/mTLS where applicable.
- Enforce bearer token and mTLS CA requirements in bridge config.
- Keep fail-closed behavior enabled for unsafe uncertain states.
- Persist vault data on durable storage.
-
ModuleNotFoundError: uvicornin bridge tests- Install bridge deps in active environment:
python3 -m pip install "uvicorn[standard]>=0.29.0" fastapi grpcio grpcio-tools protobuf websockets pytest pytest-asyncio httpx
-
gRPC runtime mismatch with generated stubs
- Ensure
grpcio,grpcio-tools, andprotobufmeet minimums inbridge/pyproject.toml.
- Ensure
-
Bridge listener readiness failures in production mode
- Validate cert/key/CA paths, bearer token config, and port availability.
-
Shared-state rejected
- Check signature payload inputs, version monotonicity, and drift policy inputs (
warp_scoreis signature-bound).
- Check signature payload inputs, version monotonicity, and drift policy inputs (
- Keep all behavioral changes routed through orchestrator pipeline semantics.
- Add/adjust tests with each security or contract change.
- Keep schema and canonical examples in sync with runtime behavior.
- Prefer fail-closed handling for parse/validation edges.
- Use focused regression tests before broad scans.
Source files carry a consistent Apache-2.0 / copyright notice:
- C/C++: block comment (
/* ... */). - Python, shell, CMake, Dockerfile, YAML:
#lines (after shebang when present). - Protobuf:
//lines. - Markdown: HTML comment at the top of the file.
- JSON: root-level
"$comment"string (schemas allow optional"$comment"on instances whereadditionalPropertieswould otherwise reject it). LICENSE.md: plain-text notice followed by the unmodified Apache 2.0 license text.
To apply or refresh headers after adding files, run:
python3 tools/apply_spdx_headers.py --dry-run # preview
python3 tools/apply_spdx_headers.py # writeThe tool skips files that already contain SPDX-License-Identifier: Apache-2.0 or the project copyright line, and skips generated protobuf outputs (*_pb2.py, *.pb.h, …) and build/.
Apache License 2.0. See LICENSE.md.