Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions schemas/polycentric/Entity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Entity",
"type": "object",
"required": [
"schema_version",
"entity_id",
"entity_type",
"logical_identity",
"boundary",
"capabilities",
"policies",
"trust",
"resources"
],
"properties": {
"schema_version": { "const": "0.3" },
"entity_id": { "type": "string", "pattern": "^ent:[A-Za-z0-9._-]+$" },
"entity_type": {
"type": "string",
"enum": [
"person","agent","browser_session","terminal_session","ide_workspace","repo","pipeline","host","service","model_provider","cache","artifact_store","policy_engine","search_index","chart","queue","database","cluster","ci_runner","filesystem","other"
]
},
"logical_identity": { "type": "string" },
"execution_instance_id": { "type": ["string", "null"] },
"aliases": { "type": "array", "items": { "type": "string" } },
"owner_ref": { "type": ["string", "null"], "pattern": "^ent:[A-Za-z0-9._-]+$" },
"parent_ref": { "type": ["string", "null"], "pattern": "^ent:[A-Za-z0-9._-]+$" },
"tenant_ref": { "type": ["string", "null"] },
"boundary": {
"type": "object",
"required": ["senses","effectors","reachable_surfaces","ingress_modes","egress_modes"],
"properties": {
"senses": { "type": "array", "items": { "type": "string" } },
"effectors": { "type": "array", "items": { "type": "string" } },
"reachable_surfaces": { "type": "array", "items": { "type": "string" } },
"ingress_modes": { "type": "array", "items": { "type": "string" } },
"egress_modes": { "type": "array", "items": { "type": "string" } },
"touchpoints": { "type": "array", "items": { "type": "string" } }
},
"additionalProperties": false
},
"capabilities": { "type": "array", "items": { "type": "string" } },
"policies": {
"type": "array",
"items": {
"type": "string",
"pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$"
}
},
"trust": {
"type": "object",
"required": ["authn","authz","attestation_refs","delegation_chain"],
"properties": {
"authn": { "type": ["string", "null"] },
"authz": { "type": "array", "items": { "type": "string" } },
"attestation_refs": { "type": "array", "items": { "type": "string", "pattern": "^att:[A-Za-z0-9._-]+$" } },
"delegation_chain": { "type": "array", "items": { "type": "string", "pattern": "^ent:[A-Za-z0-9._-]+$" } },
"label_refs": { "type": "array", "items": { "type": "string", "pattern": "^lbl:[A-Za-z0-9._-]+$" } }
},
"additionalProperties": false
},
"resources": {
"type": "object",
"required": ["latency_budget_ms","compute_budget","storage_budget_bytes","spend_budget","capacity","health","blast_radius"],
"properties": {
"latency_budget_ms": { "type": ["number", "null"] },
"compute_budget": { "type": ["number", "null"] },
"storage_budget_bytes": { "type": ["integer", "null"] },
"spend_budget": { "type": ["number", "null"] },
"capacity": { "type": ["string", "number", "null"] },
"health": { "type": "string", "enum": ["healthy","degraded","failed","unknown"] },
"blast_radius": { "type": ["string", "null"] }
},
"additionalProperties": false
},
"hot_state_ref": { "type": ["string", "null"], "pattern": "^state:[A-Za-z0-9._-]+$" },
"memory_ref": { "type": ["string", "null"], "pattern": "^state:[A-Za-z0-9._-]+$" },
"artifact_refs": { "type": "array", "items": { "type": "string", "pattern": "^art:[A-Za-z0-9._-]+$" } },
"status": { "type": ["string", "null"], "enum": ["active","inactive","quarantined","deleted","unknown"] }
},
"additionalProperties": false
}
82 changes: 82 additions & 0 deletions schemas/polycentric/Interaction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Interaction",
"type": "object",
"required": ["schema_version","interaction_id","interaction_type","participants","intent","status","causality","time","provenance"],
"properties": {
"schema_version": { "const": "0.3" },
"interaction_id": { "type": "string", "pattern": "^int:[A-Za-z0-9._-]+$" },
"interaction_type": { "type": "string" },
"participants": {
"type": "array",
"minItems": 3,
"items": {
"type": "object",
"required": ["entity_id","role"],
"properties": {
"entity_id": { "type": "string", "pattern": "^ent:[A-Za-z0-9._-]+$" },
"role": { "type": "string", "enum": ["initiator","counterparty","substrate","witness_governor","delegate","resource_provider","beneficiary","reviewer","cache","artifact_store","policy_engine","sensor","actuator"] },
"cardinality": { "type": ["integer","null"], "minimum": 1 }
},
"additionalProperties": false
}
},
"intent": {
"type": "object",
"required": ["verb"],
"properties": {
"verb": { "type": "string" },
"target_ref": { "type": ["string","null"], "pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$" },
"description": { "type": ["string","null"] }
},
"additionalProperties": false
},
"observation_refs": { "type": "array", "items": { "type": "string", "pattern": "^obs:[A-Za-z0-9._-]+$" } },
"claim_refs": { "type": "array", "items": { "type": "string", "pattern": "^clm:[A-Za-z0-9._-]+$" } },
"action_refs": { "type": "array", "items": { "type": "string", "pattern": "^act:[A-Za-z0-9._-]+$" } },
"effect_refs": { "type": "array", "items": { "type": "string", "pattern": "^eff:[A-Za-z0-9._-]+$" } },
"boundary_crossing_refs": { "type": "array", "items": { "type": "string", "pattern": "^bcx:[A-Za-z0-9._-]+$" } },
"policy_decision_refs": { "type": "array", "items": { "type": "string", "pattern": "^pdec:[A-Za-z0-9._-]+$" } },
"artifact_refs": { "type": "array", "items": { "type": "string", "pattern": "^art:[A-Za-z0-9._-]+$" } },
"outcome": { "type": ["string","null"] },
"status": { "type": "string", "enum": ["planned","running","succeeded","failed","compensated","cancelled","unknown"] },
"causality": {
"type": "object",
"required": ["correlation_id"],
"properties": {
"parent_interaction_ref": { "type": ["string","null"], "pattern": "^int:[A-Za-z0-9._-]+$" },
"previous_interaction_ref": { "type": ["string","null"], "pattern": "^int:[A-Za-z0-9._-]+$" },
"correlation_id": { "type": "string" },
"idempotency_key": { "type": ["string","null"] }
},
"additionalProperties": false
},
"time": {
"type": "object",
"required": ["event_time"],
"properties": {
"event_time": { "type": "string", "format": "date-time" },
"observed_time": { "type": ["string","null"], "format": "date-time" },
"processed_time": { "type": ["string","null"], "format": "date-time" },
"decided_time": { "type": ["string","null"], "format": "date-time" },
"committed_time": { "type": ["string","null"], "format": "date-time" }
},
"additionalProperties": false
},
"provenance": {
"type": "object",
"required": ["source_refs","confidence"],
"properties": {
"source_refs": {
"type": "array",
"items": { "type": "string", "pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$" },
"minItems": 1
},
"confidence": { "type": ["number","null"], "minimum": 0, "maximum": 1 },
"witness_refs": { "type": "array", "items": { "type": "string", "pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$" } }
},
"additionalProperties": false
}
},
"additionalProperties": false
}
44 changes: 44 additions & 0 deletions schemas/polycentric/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Polycentric Observer-Control Schema Lane

This directory is the machine-readable contract lane for the **polycentric observer-control** model.

## Upstream ownership

- **Normative doctrine / invariants / ADRs:** `SocioProphet/socioprophet-standards-storage`
- **This repository:** machine-readable realization of the schema family

## Scope of this lane

The schema family covers:

- `Entity`
- `Interaction`
- `StateRecord`
- `View`
- `Observation`
- `Evidence`
- `Claim`
- `Inference`
- `Action`
- `Effect`
- `Artifact`
- `PolicyDecision`
- `ResourceAccount`
- `TrustLabel`
- `Attestation`
- `FlowRule`
- `BoundaryCrossing`
- `RetentionPolicy`
- compile-target schemas for CI/CD and NixOS ops
- machine-readable surface profiles

## Staging rule

This lane is intentionally namespaced under `schemas/polycentric/` so it can mature without colliding with existing contract families already present in the repository.

## Downstream consumption

- `SocioProphet/TriTRPC` consumes transport bindings only.
- `SocioProphet/agentplane` consumes execution/evidence bindings only.
- `SocioProphet/prophet-platform-standards` consumes operational profile bindings only.
- `SocioProphet/prophet-platform` consumes the canon by reference during runtime adoption.
34 changes: 34 additions & 0 deletions schemas/polycentric/StateRecord.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "StateRecord",
"type": "object",
"required": ["schema_version","state_id","subject_entity_id","state_class","scope","authority_ref","provenance_refs"],
"properties": {
"schema_version": { "const": "0.3" },
"state_id": { "type": "string", "pattern": "^state:[A-Za-z0-9._-]+$" },
"subject_entity_id": { "type": "string", "pattern": "^ent:[A-Za-z0-9._-]+$" },
"state_class": { "type": "string", "enum": ["authoritative","desired","observed","believed","planned","effected","cached","projected","redacted","tombstoned"] },
"scope": { "type": "string", "enum": ["thread","user","app","workspace","environment","pipeline","fleet","artifact","global","other"] },
"authority_ref": { "type": "string", "pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$" },
"value_ref": { "type": ["string","null"], "pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$" },
"value_inline": { "type": ["object","array","string","number","boolean","null"] },
"provenance_refs": { "type": "array", "items": { "type": "string", "pattern": "^(ent|int|state|view|obs|ev|clm|inf|act|eff|art|pdec|racc|bcx|lbl|att|flow|ct|ret):[A-Za-z0-9._-]+$" } },
"time": {
"type": "object",
"properties": {
"event_time": { "type": ["string","null"], "format": "date-time" },
"observed_time": { "type": ["string","null"], "format": "date-time" },
"decided_time": { "type": ["string","null"], "format": "date-time" },
"processed_time": { "type": ["string","null"], "format": "date-time" },
"valid_from": { "type": ["string","null"], "format": "date-time" },
"valid_to": { "type": ["string","null"], "format": "date-time" },
"committed_time": { "type": ["string","null"], "format": "date-time" },
"fresh_until": { "type": ["string","null"], "format": "date-time" }
},
"additionalProperties": false
},
"policy_label_refs": { "type": "array", "items": { "type": "string", "pattern": "^lbl:[A-Za-z0-9._-]+$" } },
"retention_policy_ref": { "type": ["string","null"], "pattern": "^ret:[A-Za-z0-9._-]+$" }
},
"additionalProperties": false
}
Loading