From 583bafc335130392a820f218cdf1a568b2fff0f0 Mon Sep 17 00:00:00 2001 From: POWERFULMOVES <142271328+POWERFULMOVES@users.noreply.github.com> Date: Sat, 20 Sep 2025 01:32:35 -0400 Subject: [PATCH] feat(contracts): expand CGP schema coverage --- .../schemas/geometry/cgp.v1.schema.json | 191 ++++++++++++------ 1 file changed, 128 insertions(+), 63 deletions(-) diff --git a/pmoves/contracts/schemas/geometry/cgp.v1.schema.json b/pmoves/contracts/schemas/geometry/cgp.v1.schema.json index b993811c79..317d22bf70 100644 --- a/pmoves/contracts/schemas/geometry/cgp.v1.schema.json +++ b/pmoves/contracts/schemas/geometry/cgp.v1.schema.json @@ -6,6 +6,7 @@ "spec", "super_nodes" ], + "additionalProperties": true, "properties": { "spec": { "type": "string", @@ -15,7 +16,11 @@ "type": "string" }, "meta": { - "type": "object" + "type": [ + "object", + "null" + ], + "additionalProperties": true }, "created_at": { "type": "string", @@ -27,40 +32,9 @@ }, "super_nodes": { "type": "array", + "minItems": 1, "items": { - "type": "object", - "required": [ - "constellations" - ], - "properties": { - "id": { - "type": "string" - }, - "label": { - "type": "string" - }, - "summary": { - "type": "string" - }, - "x": { - "type": "number" - }, - "y": { - "type": "number" - }, - "r": { - "type": "number" - }, - "meta": { - "type": "object" - }, - "constellations": { - "type": "array", - "items": { - "$ref": "#/$defs/constellation" - } - } - } + "$ref": "#/$defs/super_node" } }, "constellations": { @@ -78,24 +52,65 @@ "sig": { "oneOf": [ { - "type": "string" + "type": "null" }, { - "type": "object" + "type": "string" }, { - "type": "null" + "$ref": "#/$defs/signature" } ] } }, "$defs": { + "super_node": { + "type": "object", + "required": [ + "constellations" + ], + "additionalProperties": true, + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "r": { + "type": "number" + }, + "meta": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "constellations": { + "type": "array", + "items": { + "$ref": "#/$defs/constellation" + } + } + } + }, "constellation": { "type": "object", "required": [ "id", "points" ], + "additionalProperties": true, "properties": { "id": { "type": "string" @@ -116,30 +131,7 @@ "type": "null" }, { - "type": "object", - "properties": { - "alg": { - "type": "string" - }, - "iv": { - "type": "string" - }, - "salt": { - "type": "string" - }, - "ct": { - "type": "string" - }, - "tag": { - "type": "string" - } - }, - "required": [ - "alg", - "iv", - "salt", - "ct" - ] + "$ref": "#/$defs/encrypted_anchor" } ] }, @@ -168,7 +160,11 @@ } }, "meta": { - "type": "object" + "type": [ + "object", + "null" + ], + "additionalProperties": true }, "created_at": { "type": "string", @@ -185,6 +181,7 @@ "required": [ "id" ], + "additionalProperties": true, "properties": { "id": { "type": "string" @@ -192,9 +189,15 @@ "modality": { "type": "string" }, + "mod": { + "type": "string" + }, "ref_id": { "type": "string" }, + "source_ref": { + "type": "string" + }, "video_id": { "type": "string" }, @@ -255,7 +258,69 @@ "type": "string" }, "meta": { - "type": "object" + "type": [ + "object", + "null" + ], + "additionalProperties": true + } + } + }, + "encrypted_anchor": { + "type": "object", + "additionalProperties": false, + "properties": { + "alg": { + "type": "string" + }, + "iv": { + "type": "string" + }, + "salt": { + "type": "string" + }, + "ct": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "required": [ + "iv", + "salt", + "ct" + ] + }, + "signature": { + "type": "object", + "additionalProperties": true, + "required": [ + "alg", + "hmac" + ], + "properties": { + "alg": { + "type": "string" + }, + "kid": { + "type": "string" + }, + "ts": { + "type": [ + "integer", + "string" + ] + }, + "hmac": { + "type": "string" + }, + "meta": { + "type": [ + "object", + "null" + ], + "additionalProperties": true } } }