Skip to main content

Web4 trust primitives (Rust core with Python bindings)

Project description

web4-trust-core

Core trust primitives for the Web4 ecosystem, implemented in Rust with Python bindings.

Features

  • T3 Trust Tensor — 3 root dimensions (Talent / Training / Temperament), each itself an open-ended RDF sub-graph of context-specific sub-dimensions via web4:subDimensionOf. Fractally extensible.
  • V3 Value Tensor — 3 root dimensions (Valuation / Veracity / Validity), same fractal RDF pattern.
  • EntityTrust — Combines T3 + V3 with witnessing relationships, role-binding, and decay.
  • TrustStore — Persistent storage with JSON format compatibility. Includes from_legacy_6d migration helper for prior 6-flat-dimension data.

T3 Root Dimensions

  • Talent — Natural aptitude and capability for a specific role
  • Training — Acquired expertise, certifications, and experience
  • Temperament — Behavioral consistency, reliability, ethical disposition

V3 Root Dimensions

  • Valuation — Worth ascribed to the contribution
  • Veracity — Truthfulness and reliability of the claim
  • Validity — Soundness and applicability in context

Each root dimension is fractally extensible via web4:subDimensionOf — sub-dimensions form an RDF sub-graph that aggregates back into the root scalar. T3 and V3 are not fixed-size 6-vectors; they are typed multidimensional ontologies with 3 anchor roots.

Formal ontology: web4-standard/ontology/t3v3-ontology.ttl

Installation

pip install web4-trust

Or build from source:

pip install maturin
maturin develop

Usage

from web4_trust import TrustStore, EntityTrust

# Open the default store (~/.web4/governance/entities)
store = TrustStore()

# Get or create entity trust
trust = store.get("mcp:filesystem")
print(f"T3 average: {trust.t3_average():.3f}")
print(f"Trust level: {trust.trust_level()}")

# Update from action outcome
store.update("mcp:filesystem", success=True, magnitude=0.1)

# Witness event: session observes MCP server
witness_trust, target_trust = store.witness(
    "session:abc",
    "mcp:filesystem",
    success=True,
    magnitude=0.1
)
print(f"MCP trust after witnessing: {target_trust.t3_average():.3f}")

Architecture

┌─────────────────────────────────────────┐
│  web4-trust-core (Rust)                 │
│  - T3/V3 tensor math (3 roots, fractal) │
│  - EntityTrust with witnessing          │
│  - Decay calculations                   │
│  - Storage backends                     │
│  - from_legacy_6d migration helper      │
└─────────────────────────────────────────┘
              │
    ┌─────────┴─────────┐
    │  PyO3 Bindings    │
    └─────────┬─────────┘
              │
    ┌─────────┴─────────┐
    │  Python Package   │
    │  (web4_trust)     │
    └───────────────────┘

Patent Notice

This software implements technology covered by US Patents 11,477,027 and 12,278,913, and pending application 19/178,619. See the repo-root PATENTS.md for the patent grant terms.

License

AGPL-3.0-or-later. See repo-root LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web4_trust-0.1.1.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web4_trust-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (439.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file web4_trust-0.1.1.tar.gz.

File metadata

  • Download URL: web4_trust-0.1.1.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for web4_trust-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ab259b3018e562222029b2e6f28fea3ef56242b7581c042585ff2cd8c7dfd56
MD5 c6cbe35ea7cf1daa62611c573f88a405
BLAKE2b-256 dab8062590fc4d66b497dee8fcb7a5e6f1faf67a03a723c0b423aea144dbffd9

See more details on using hashes here.

File details

Details for the file web4_trust-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for web4_trust-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 436ddf804d20fda0b6b81752efce7174d6748551cb251f588e182bdb371ac9c7
MD5 9ce45637e25a9c652bf6325cf9cd567f
BLAKE2b-256 9a3810feeea64201df7515d6c31180b73bf4bd3e27e3bbafdc217c91b428d7d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page