JSON Schemas¶
This section contains the JSON schemas for the Kinetic Trust Protocol.
Draft schemas — contributors welcome
These schemas are in active draft. If you spot gaps or have suggestions, please open an issue or PR (see Contributing) to collaborate on the structure and fields.
Available Schemas¶
Context Tensor (context-tensor.json)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ktp.example.org/schemas/context-tensor.json",
"title": "KTP Context Tensor",
"description": "Seven-dimensional physics lens for the Kinetic Trust Protocol context tensor",
"type": "object",
"required": ["m", "p", "i", "h", "t", "o", "s"],
"properties": {
"m": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Mass - Volume and density of telemetry. RFC Tensor Mapping: Body + World. Example signals: packet rates, occupancy, RF absorption. Why it matters: establishes how heavy the environment is and sets baseline stability."
},
"p": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Momentum - Rate of change in trust. RFC Tensor Mapping: Time + Signal. Example signals: trust velocity, confidence deltas, surge patterns. Why it matters: captures acceleration of trust up/down to prevent whiplash."
},
"i": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Inertia - Resistance to trust fluctuation. RFC Tensor Mapping: Body + Relational. Example signals: service criticality, blast radius, dependency depth. Why it matters: dampens sudden shifts for high-impact systems and enforces stability."
},
"h": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Heat - Operational stress and anomaly detection. RFC Tensor Mapping: World + Signal. Example signals: error bursts, adversarial scans, resource contention. Why it matters: reveals pressure that should lower autonomy or trigger dormancy."
},
"t": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Time - Temporal patterns and decay. RFC Tensor Mapping: Time. Example signals: phase of event, freshness, decay curves. Why it matters: governs how long trust holds and when it should decay or refresh."
},
"o": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Observer - Perspective and vantage point. RFC Tensor Mapping: Relational + Signal. Example signals: audience, stakeholder expectations, locality. Why it matters: adjusts trust by who is impacted and from where it is measured."
},
"s": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Soul - Constitutional constraints that cannot be overridden. RFC Tensor Mapping: Soul. Example signals: sovereignty labels, TK/OCAP/CARE rules. Why it matters: hard vetoes enforced before any other calculation."
}
},
"additionalProperties": false,
"examples": [
{
"m": 0.875,
"p": 0.920,
"i": 0.100,
"h": 0.020,
"t": 1.000,
"o": 0.040,
"s": 0.900
},
{
"m": 0.100,
"p": 0.150,
"i": 0.050,
"h": 0.010,
"t": 0.200,
"o": 0.020,
"s": 0.700
}
]
}
Sensor Configuration (sensor-config.json)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ktp.example.org/schemas/sensor-config.json",
"title": "KTP Sensor Feed Configuration",
"description": "Configuration schema for Context Tensor sensor feeds",
"type": "object",
"required": ["dimension", "feeds"],
"properties": {
"dimension": {
"type": "string",
"enum": ["m", "p", "h", "t", "i", "o", "s"],
"description": "The tensor dimension this configuration applies to"
},
"feeds": {
"type": "array",
"items": {
"$ref": "#/$defs/feed"
},
"minItems": 1,
"description": "Array of sensor feeds for this dimension"
},
"aggregation": {
"type": "string",
"enum": ["weighted_average", "any_veto", "all_veto", "max", "min"],
"default": "weighted_average",
"description": "How to aggregate multiple feeds (Soul dimension must use any_veto)"
},
"default_on_failure": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Value to use if all feeds fail (conservative default)"
}
},
"$defs": {
"feed": {
"type": "object",
"required": ["id", "source", "enabled"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"description": "Unique identifier for this feed within the dimension"
},
"type": {
"type": "string",
"enum": ["physical", "network", "security", "application", "governance"],
"description": "Category of sensor"
},
"source": {
"type": "string",
"description": "URI of the data source (mqtt://, https://, local://)"
},
"enabled": {
"type": "boolean",
"description": "Whether this feed is active"
},
"weight": {
"type": "number",
"minimum": 0,
"default": 1.0,
"description": "Weight of this feed in aggregation (for weighted dimensions)"
},
"normalization": {
"$ref": "#/$defs/normalization"
},
"refresh_interval_ms": {
"type": "integer",
"minimum": 100,
"description": "How often to poll this source (milliseconds)"
},
"stale_threshold_ms": {
"type": "integer",
"minimum": 1000,
"description": "How long before data is considered stale"
},
"veto_on_match": {
"type": "boolean",
"default": false,
"description": "For Soul dimension: whether a match triggers veto"
},
"transform": {
"type": "string",
"description": "Optional JSONPath or transformation expression"
}
}
},
"normalization": {
"type": "object",
"properties": {
"min": {
"type": "number",
"description": "Raw value that maps to 0"
},
"max": {
"type": "number",
"description": "Raw value that maps to 1"
},
"invert": {
"type": "boolean",
"default": false,
"description": "Whether to invert the scale (1 becomes 0, 0 becomes 1)"
},
"clamp": {
"type": "boolean",
"default": true,
"description": "Whether to clamp values outside min/max to 0/1"
}
}
}
},
"examples": [
{
"dimension": "m",
"feeds": [
{
"id": "co2-sensor",
"type": "physical",
"source": "mqtt://sensors.local/building/co2",
"enabled": true,
"weight": 1.0,
"normalization": {
"min": 400,
"max": 2000,
"invert": false
},
"refresh_interval_ms": 30000,
"stale_threshold_ms": 120000
},
{
"id": "badge-count",
"type": "physical",
"source": "https://access.local/api/v1/count",
"enabled": true,
"weight": 1.5,
"normalization": {
"min": 0,
"max": 5000,
"invert": false
},
"refresh_interval_ms": 60000,
"stale_threshold_ms": 300000
}
],
"aggregation": "weighted_average",
"default_on_failure": 0.8
},
{
"dimension": "s",
"feeds": [
{
"id": "tk-labels",
"type": "governance",
"source": "https://api.localcontexts.org/v1/labels",
"enabled": true,
"veto_on_match": true,
"refresh_interval_ms": 0,
"stale_threshold_ms": 0
},
{
"id": "ocap-registry",
"type": "governance",
"source": "https://ocap.example.org/api/check",
"enabled": true,
"veto_on_match": true,
"refresh_interval_ms": 0,
"stale_threshold_ms": 0
},
{
"id": "sacred-geofence",
"type": "governance",
"source": "local://geofence-service",
"enabled": true,
"veto_on_match": true,
"refresh_interval_ms": 0,
"stale_threshold_ms": 0
}
],
"aggregation": "any_veto"
}
]
}
Soul Constraint (soul-constraint.json)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ktp.example.org/schemas/soul-constraint.json",
"title": "KTP Soul Constraint",
"description": "Sovereignty constraint evaluation for the Kinetic Trust Protocol",
"type": "object",
"required": ["s"],
"properties": {
"s": {
"type": "integer",
"enum": [0, 1],
"description": "Soul veto status: 0=clear (no constraint), 1=veto (action forbidden)"
},
"constraint_type": {
"type": ["string", "null"],
"enum": [
"tk_label",
"ocap",
"care",
"sacred_land",
"treaty",
"lineage",
"cultural_heritage",
null
],
"description": "Category of sovereignty constraint that triggered veto"
},
"constraint_id": {
"type": ["string", "null"],
"description": "Unique identifier of the specific constraint (e.g., TK-NC-001)"
},
"constraint_name": {
"type": ["string", "null"],
"description": "Human-readable name of the constraint"
},
"authority": {
"type": ["string", "null"],
"format": "uri",
"description": "URI of the sovereignty authority or framework"
},
"community": {
"type": ["string", "null"],
"description": "Name of the community asserting the constraint"
},
"remediation": {
"type": ["string", "null"],
"description": "Guidance on how to obtain permission if applicable"
}
},
"if": {
"properties": {
"s": { "const": 1 }
}
},
"then": {
"required": ["s", "constraint_type", "authority"],
"properties": {
"constraint_type": {
"type": "string"
},
"authority": {
"type": "string"
}
}
},
"additionalProperties": false,
"examples": [
{
"s": 0,
"constraint_type": null,
"constraint_id": null,
"authority": null
},
{
"s": 1,
"constraint_type": "tk_label",
"constraint_id": "TK-NC-001",
"constraint_name": "TK Non-Commercial",
"authority": "https://localcontexts.org/label/tk-nc/",
"community": "Example Indigenous Community",
"remediation": "Contact community data steward for commercial licensing"
},
{
"s": 1,
"constraint_type": "sacred_land",
"constraint_id": "geofence-001",
"constraint_name": "Sacred Site Boundary",
"authority": "https://tribal-lands.example.org/",
"community": "Example Tribe",
"remediation": "Activity not permitted within sacred site boundaries"
},
{
"s": 1,
"constraint_type": "ocap",
"constraint_id": "ocap-possession",
"constraint_name": "OCAP Possession Principle",
"authority": "https://fnigc.ca/ocap/",
"community": "First Nation Community",
"remediation": "Data must remain within community-controlled infrastructure"
}
]
}
Trust Proof (trust-proof.json)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://ktp.example.org/schemas/trust-proof.json",
"title": "KTP Trust Proof",
"description": "Signed token carrying Trust Score and environmental context for the Kinetic Trust Protocol",
"type": "object",
"required": ["iss", "sub", "iat", "exp", "jti", "ktp"],
"properties": {
"iss": {
"type": "string",
"format": "uri",
"description": "Trust Oracle identifier (issuer)"
},
"sub": {
"type": "string",
"format": "uri",
"description": "Agent identifier (subject)"
},
"iat": {
"type": "integer",
"description": "Issued at (Unix timestamp)"
},
"exp": {
"type": "integer",
"description": "Expiration time (Unix timestamp, max 10 seconds from iat)"
},
"jti": {
"type": "string",
"description": "Unique token identifier (JWT ID)"
},
"ktp": {
"$ref": "#/$defs/ktpClaims"
}
},
"$defs": {
"ktpClaims": {
"type": "object",
"required": ["e_base", "e_trust", "r", "context", "soul", "lineage"],
"properties": {
"e_base": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Base Trust score (intrinsic agent capability)"
},
"e_trust": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Effective Trust score after environmental deflation"
},
"r": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Risk Factor from weighted Context Tensor dimensions"
},
"de_dt": {
"type": "number",
"description": "Trust velocity (rate of change per second)"
},
"sigma": {
"type": "number",
"minimum": 0,
"description": "Trust volatility (standard deviation)"
},
"context": {
"$ref": "context-tensor.json",
"description": "The six weighted dimensions of environmental state"
},
"soul": {
"$ref": "soul-constraint.json",
"description": "Sovereignty constraint evaluation"
},
"lineage": {
"type": "string",
"enum": ["tethered", "divergent", "persistent"],
"description": "Agent evolutionary stage"
},
"generation": {
"type": "integer",
"minimum": 0,
"description": "Agent generation number"
},
"sponsor": {
"type": "string",
"format": "uri",
"description": "Sponsor agent identifier (for tethered agents)"
},
"resilience_hash": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$",
"description": "Hash of current Proof of Resilience ledger"
},
"zone": {
"type": "string",
"description": "Blue Zone identifier where proof was issued"
},
"oracle_quorum": {
"type": "string",
"pattern": "^[0-9]+-of-[0-9]+$",
"description": "Threshold signature quorum (e.g., '3-of-5')"
}
}
}
},
"examples": [
{
"iss": "https://oracle.example.com",
"sub": "agent:7gen:optimized:a1b2c3d4",
"iat": 1699900000,
"exp": 1699900010,
"jti": "tp-uuid-12345",
"ktp": {
"e_base": 87,
"e_trust": 42,
"r": 0.517,
"de_dt": -2.3,
"sigma": 0.15,
"context": {
"m": 0.875,
"p": 0.920,
"h": 0.020,
"t": 1.000,
"i": 0.100,
"o": 0.040
},
"soul": {
"s": 0,
"constraint_type": null,
"constraint_id": null,
"authority": null
},
"lineage": "persistent",
"generation": 7,
"resilience_hash": "sha256:abc123def456789012345678901234567890123456789012345678901234",
"zone": "zone-blue-prod-01",
"oracle_quorum": "3-of-5"
}
},
{
"iss": "https://oracle.example.com",
"sub": "agent:2gen:data-analyst:xyz789",
"iat": 1699900100,
"exp": 1699900110,
"jti": "tp-uuid-67890",
"ktp": {
"e_base": 45,
"e_trust": 40,
"r": 0.111,
"de_dt": 0.5,
"sigma": 0.08,
"context": {
"m": 0.100,
"p": 0.150,
"h": 0.050,
"t": 0.200,
"i": 0.080,
"o": 0.100
},
"soul": {
"s": 1,
"constraint_type": "tk_label",
"constraint_id": "TK-NC-001",
"constraint_name": "TK Non-Commercial",
"authority": "https://localcontexts.org/label/tk-nc/",
"community": "Example Indigenous Community",
"remediation": "Contact community data steward for commercial licensing"
},
"lineage": "tethered",
"generation": 2,
"sponsor": "agent:persistent:data-team:abc123",
"resilience_hash": "sha256:fedcba987654321098765432109876543210987654321098765432109876",
"zone": "zone-blue-research",
"oracle_quorum": "2-of-3"
}
}
]
}
Usage¶
These schemas define the data structures used throughout the KTP implementation. They can be used for validation, code generation, and documentation purposes.