tpt-primitives

Rust

Shared canonical primitives (identity, capability, intent, computation, execution, evidence, claim) underpinning the Fabric, Repro and Concord ecosystem — dual-licensed MIT/Apache-2.0.

0 stars0 forks0 watchers8 open issuesApache License 2.0

Languages

Rust99.3%Python0.7%
README

TPT Primitives

Foundational shared-primitives library for the Fabric / Repro / Concord ecosystem.

TPT Primitives defines the small, composable semantic core that the three ecosystem projects share:

ProjectQuestion it answersPrimitives it owns
Concord"Why trust it?"specification, evidence, claim
Repro"What happened?"computation, derivation, artifact identity
Fabric"Where/how did it run?"intent, reservation, execution world

The central chain this library models is:

SPECIFICATION → COMPUTATION → INTENT → RESERVATION → EXECUTION
             → ARTIFACT → EVIDENCE → CLAIM

Scope

This crate contains primitives only: the canonical identity types, the canonical-object framework, and the semantic types built on them (capability, lease/epoch, intent, reservation, computation, derivation, execution, trace, evidence, claim, counterexample, deterministic world, reproduction).

No Fabric, Repro or Concord implementation lives here. No adapters (Kubernetes, OCI, Git, cloud storage, CI, AI providers) live here — per the design rule primitives before adapters (spec §21).

The authoritative cross-project design specification is spec.txt.

Canonical identity

Every important object has a stable canonical identity:

  • Canonical representation with an explicit schema version.
  • Deterministic CBOR encoding (see docs/decisions/0001-canonical-encoding-and-identity.md).
  • Identity derived as SHA-256 over the canonical bytes — never from filenames, auto-increment IDs, memory addresses, mutable labels or wall-clock timestamps (spec §3).

The fifteen shared identity classes (spec §3) are exposed as SpecificationId, ModelId, ImplementationId, ComputationId, IntentId, ReservationId, ExecutionId, ArtifactId, TraceId, EvidenceId, ClaimId, CapabilityId, EpochId, CounterexampleId and ProvenanceId, all instances of the generic Id<T> newtype.

Try it

cargo run -p tpt-primitives --example quickstart             # computation -> artifact -> claim
cargo run -p tpt-primitives --example capability_delegation  # attenuate, revoke, lease, epoch
cargo run -p tpt-primitives --example assurance_graph        # dependencies and refutation

New here? Start with docs/getting-started.md: a "which type do I need?" table, per-project entry points and a glossary.

Layout

  • crates/tpt-primitives — the core library.
  • crates/tpt-cli — the tpt command: inspect, id and diff for canonical objects.
  • crates/tpt-sign — optional Ed25519 signatures over object identities (Signed<T>).
  • testvectors/ — golden bytes and identities, plus an independent Python verifier.
  • crates/schema-gen — tool that generates JSON Schema / CDDL from the canonical types into schemas/ (CI fails if the checked-in schemas drift).
  • docs/decisions/ — architecture decision records (encoding, hashing, time model).
  • docs/ — architecture mapping, trust boundaries, design rules, evolution policy.

Success criterion (spec §26)

The architecture succeeds if an arbitrary important TPT operation can answer, mechanically — tests/interop.rs demonstrates each answer:

QuestionAnswered by
What did we intend to compute?Intent::computation → ComputationId
What exact computation was defined?Computation::identity() (canonical bytes)
Where and under what authority did it execute?Execution::world + Intent::capabilities + valid_authority
What exactly did it produce?Execution::outcome → ArtifactIds
How was the result derived?Provenance { artifact, derivation, execution }
What evidence do we have about correctness?Claim::assess per-property AssuranceLevel
What remains unknown?Properties without evidence read unknown — per spec §24

License

Dual-licensed under MIT OR Apache-2.0, at your option. Copyright © 2026 TPT Solutions.