@ixo/topic-protocol 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +6 -2
  2. package/dist/profiles/job-card/profile.json +29 -0
  3. package/dist/schemas/approval-decision.schema.json +30 -0
  4. package/dist/schemas/claim-record.schema.json +30 -0
  5. package/dist/schemas/delivery-decision.schema.json +28 -0
  6. package/dist/schemas/delivery-packet.schema.json +58 -0
  7. package/dist/schemas/evaluation-assertion.schema.json +37 -0
  8. package/dist/schemas/external-work-binding.schema.json +83 -0
  9. package/dist/schemas/external-work-state-map.schema.json +29 -0
  10. package/dist/schemas/job-card.schema.json +46 -0
  11. package/dist/schemas/settlement-receipt.schema.json +53 -0
  12. package/dist/schemas/topic-contract-state.schema.json +26 -0
  13. package/dist/schemas/topic-kind-profile.schema.json +82 -0
  14. package/dist/schemas/topic-operation.schema.json +2 -2
  15. package/dist/schemas/topic-state.schema.json +14 -0
  16. package/dist/schemas/work-item-snapshot.schema.json +73 -0
  17. package/dist/src/contracts/schemas.d.ts +1656 -29
  18. package/dist/src/contracts/schemas.js +22 -0
  19. package/dist/src/contracts/schemas.js.map +1 -1
  20. package/dist/src/contracts/topic-contract.d.ts +3 -0
  21. package/dist/src/contracts/topic-contract.js.map +1 -1
  22. package/dist/src/contracts/topic-kind-profile.d.ts +81 -0
  23. package/dist/src/contracts/topic-kind-profile.js +76 -0
  24. package/dist/src/contracts/topic-kind-profile.js.map +1 -0
  25. package/dist/src/errors.d.ts +1 -1
  26. package/dist/src/errors.js.map +1 -1
  27. package/dist/src/index.d.ts +3 -0
  28. package/dist/src/index.js +3 -0
  29. package/dist/src/index.js.map +1 -1
  30. package/dist/src/projector/payload.d.ts +29 -0
  31. package/dist/src/projector/payload.js +83 -1
  32. package/dist/src/projector/payload.js.map +1 -1
  33. package/dist/src/projector/state.js +6 -0
  34. package/dist/src/projector/state.js.map +1 -1
  35. package/dist/src/projector/types.d.ts +3 -1
  36. package/dist/src/projector/types.js.map +1 -1
  37. package/dist/src/work-bridge/mapping.d.ts +2 -0
  38. package/dist/src/work-bridge/mapping.js +17 -0
  39. package/dist/src/work-bridge/mapping.js.map +1 -0
  40. package/dist/src/work-bridge/project.d.ts +7 -0
  41. package/dist/src/work-bridge/project.js +262 -0
  42. package/dist/src/work-bridge/project.js.map +1 -0
  43. package/dist/src/work-bridge/types.d.ts +232 -0
  44. package/dist/src/work-bridge/types.js +26 -0
  45. package/dist/src/work-bridge/types.js.map +1 -0
  46. package/package.json +4 -2
  47. package/profiles/job-card/README.md +11 -0
  48. package/profiles/job-card/profile.json +29 -0
package/README.md CHANGED
@@ -9,7 +9,7 @@ identity of a discussion.
9
9
 
10
10
  ## Status
11
11
 
12
- **Version:** 0.5.0
12
+ **Version:** 0.7.0
13
13
 
14
14
  **Maturity:** Draft implementation candidate
15
15
  **Execution source of truth:** [Linear Topic Protocol project](https://linear.app/ixo-world/project/topic-protocol-4ea58bc7910d)
@@ -23,6 +23,7 @@ and external action execution require their dedicated conformance evidence.
23
23
 
24
24
  - [Architecture decisions](docs/adr/README.md)
25
25
  - [Why Topics matter](docs/topics-feature-guide.md) — a non-technical feature guide
26
+ - [Extending Topic Kinds](docs/extending-topic-kinds.md) — third-party custom Kind and Kind Profile guide
26
27
  - [Protocol chapters](docs/protocol/README.md)
27
28
  - [Machine-readable contracts](contracts/README.md)
28
29
  - [Reference implementation](docs/reference-implementation.md)
@@ -39,7 +40,8 @@ key-value adapter at its integration boundary.
39
40
 
40
41
  The package includes:
41
42
 
42
- - strict Draft 2020-12 validation for all 18 contracts;
43
+ - strict Draft 2020-12 validation for all 29 contracts, including Kind Profiles, Job Cards, external work, delivery, evaluation, claims, and settlement receipts;
44
+ - pinned, declarative Kind Profiles with safe standard-Kind fallback;
43
45
  - deterministic Topic-index reconciliation, structured search, and personal ranking;
44
46
  - deterministic Topic projection from a root and authorised operations;
45
47
  - singular accepted Overview projection with deterministic conflict handling;
@@ -48,6 +50,8 @@ The package includes:
48
50
  - restart-safe two-event Topic creation with duplicate suppression;
49
51
  - append-only Matrix operation parsing and room-upgrade anchor selection;
50
52
  - explicit conflict, duplicate-delivery, unauthorised, and unreachable handling;
53
+ - governed external-work bindings and immutable Delivery Packet handoff with separate evaluation, approval, claim, and settlement axes;
54
+ - fail-closed settlement projection that cannot promote tracker completion into approval or payment;
51
55
  - immutable caller inputs and typed protocol errors.
52
56
 
53
57
  Topics retain a singular conversational `kind` while linking any number of
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 1,
3
+ "id": "https://topic-protocol.ixo.world/profiles/job-card",
4
+ "profileVersion": "1.0.0",
5
+ "label": "Job",
6
+ "description": "A portable digital job card coordinated through a Task-based Topic.",
7
+ "kind": {
8
+ "customId": "org.ixo.job-card",
9
+ "baseKind": "task",
10
+ "recipe": "project"
11
+ },
12
+ "resource": {
13
+ "type": "org.ixo.job-card",
14
+ "version": 1,
15
+ "schema": "https://topic-protocol.ixo.world/schemas/job-card.schema.json"
16
+ },
17
+ "acceptance": {
18
+ "requiredResourcePaths": ["/jobNumber", "/phase"]
19
+ },
20
+ "projection": {
21
+ "key": "org.ixo.topic-kind/job-card/v1",
22
+ "roomVisibleFields": ["/jobNumber", "/phase", "/priority", "/scheduled/start"]
23
+ },
24
+ "presentation": {
25
+ "fallbackLabel": "Job",
26
+ "primaryFields": ["/jobNumber", "/phase", "/priority", "/scheduled/start", "/site", "/asset"]
27
+ },
28
+ "capabilities": ["topic/write", "topic/change-status", "topic/confirm-completion"]
29
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/approval-decision.schema.json",
4
+ "title": "Outcome approval decision v1",
5
+ "type": "object",
6
+ "required": ["version", "approvalId", "topicId", "deliveryPacketId", "deliveryPacketDigest", "evaluationIds", "decision", "policy", "decidedBy", "decidedAt", "capability", "digest"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "approvalId": { "$ref": "#/$defs/uuidV7" },
10
+ "topicId": { "$ref": "#/$defs/topicId" },
11
+ "deliveryPacketId": { "$ref": "#/$defs/uuidV7" },
12
+ "deliveryPacketDigest": { "$ref": "#/$defs/digest" },
13
+ "evaluationIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/uuidV7" } },
14
+ "decision": { "enum": ["approved", "rejected", "changes_requested", "superseded"] },
15
+ "reasons": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "maxLength": 2000 } },
16
+ "policy": { "type": "object", "required": ["ref", "version", "digest"], "properties": { "ref": { "type": "string", "format": "uri" }, "version": { "type": "string", "minLength": 1 }, "digest": { "$ref": "#/$defs/digest" } }, "additionalProperties": false },
17
+ "decidedBy": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" } },
18
+ "decidedAt": { "type": "string", "format": "date-time" },
19
+ "capability": { "type": "string", "minLength": 1 },
20
+ "digest": { "$ref": "#/$defs/digest" },
21
+ "extensions": { "type": "object" }
22
+ },
23
+ "$defs": {
24
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
25
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
26
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
27
+ },
28
+ "additionalProperties": false,
29
+ "allOf": [{ "if": { "properties": { "decision": { "enum": ["rejected", "changes_requested"] } }, "required": ["decision"] }, "then": { "properties": { "reasons": { "type": "array", "minItems": 1 } }, "required": ["reasons"] } }]
30
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/claim-record.schema.json",
4
+ "title": "Outcome claim record v1",
5
+ "type": "object",
6
+ "required": ["version", "claimId", "topicId", "deliveryPacketId", "deliveryPacketDigest", "evaluationIds", "approvalId", "claimantDid", "requested", "status", "replayKey", "source", "recordedAt", "digest"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "claimId": { "type": "string", "minLength": 1, "maxLength": 256 },
10
+ "topicId": { "$ref": "#/$defs/topicId" },
11
+ "deliveryPacketId": { "$ref": "#/$defs/uuidV7" },
12
+ "deliveryPacketDigest": { "$ref": "#/$defs/digest" },
13
+ "evaluationIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/uuidV7" } },
14
+ "approvalId": { "$ref": "#/$defs/uuidV7" },
15
+ "claimantDid": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" },
16
+ "requested": { "type": "object", "required": ["amount", "asset", "recipient"], "properties": { "amount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$" }, "asset": { "type": "string", "minLength": 1, "maxLength": 128 }, "recipient": { "type": "string", "minLength": 1, "maxLength": 256 } }, "additionalProperties": false },
17
+ "status": { "enum": ["pending", "approved", "rejected", "disputed", "invalidated", "flagged"] },
18
+ "replayKey": { "type": "string", "minLength": 1, "maxLength": 256 },
19
+ "source": { "type": "object", "required": ["provider", "ref"], "properties": { "provider": { "type": "string", "pattern": "^[a-z][a-z0-9.-]{0,63}$" }, "ref": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
20
+ "recordedAt": { "type": "string", "format": "date-time" },
21
+ "digest": { "$ref": "#/$defs/digest" },
22
+ "extensions": { "type": "object" }
23
+ },
24
+ "$defs": {
25
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
26
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
27
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
28
+ },
29
+ "additionalProperties": false
30
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/delivery-decision.schema.json",
4
+ "title": "Delivery handoff decision v1",
5
+ "type": "object",
6
+ "required": ["version", "decisionId", "topicId", "deliveryPacketId", "deliveryPacketDigest", "decision", "decidedBy", "decidedAt", "capability", "digest"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "decisionId": { "$ref": "#/$defs/uuidV7" },
10
+ "topicId": { "$ref": "#/$defs/topicId" },
11
+ "deliveryPacketId": { "$ref": "#/$defs/uuidV7" },
12
+ "deliveryPacketDigest": { "$ref": "#/$defs/digest" },
13
+ "decision": { "enum": ["accepted", "returned", "rejected"] },
14
+ "reasons": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1, "maxLength": 2000 } },
15
+ "decidedBy": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" },
16
+ "decidedAt": { "type": "string", "format": "date-time" },
17
+ "capability": { "type": "string", "minLength": 1 },
18
+ "digest": { "$ref": "#/$defs/digest" },
19
+ "extensions": { "type": "object" }
20
+ },
21
+ "$defs": {
22
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
23
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
24
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
25
+ },
26
+ "additionalProperties": false,
27
+ "allOf": [{ "if": { "properties": { "decision": { "enum": ["returned", "rejected"] } }, "required": ["decision"] }, "then": { "properties": { "reasons": { "type": "array", "minItems": 1 } }, "required": ["reasons"] } }]
28
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/delivery-packet.schema.json",
4
+ "title": "Delivery Packet v1",
5
+ "type": "object",
6
+ "required": ["version", "deliveryPacketId", "sequence", "topicId", "bindingId", "contract", "workItemSnapshot", "deliverables", "evidence", "traces", "submittedBy", "submittedAt", "capability", "status", "digest"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "deliveryPacketId": { "$ref": "#/$defs/uuidV7" },
10
+ "sequence": { "type": "integer", "minimum": 1 },
11
+ "topicId": { "$ref": "#/$defs/topicId" },
12
+ "bindingId": { "$ref": "#/$defs/uuidV7" },
13
+ "supersedes": { "$ref": "#/$defs/uuidV7" },
14
+ "contract": {
15
+ "type": "object",
16
+ "required": ["revision", "digest", "status"],
17
+ "properties": {
18
+ "revision": { "type": "string", "minLength": 1 },
19
+ "digest": { "$ref": "#/$defs/digest" },
20
+ "status": { "const": "accepted" }
21
+ },
22
+ "additionalProperties": false
23
+ },
24
+ "workItemSnapshot": {
25
+ "type": "object",
26
+ "required": ["snapshotId", "ref", "digest"],
27
+ "properties": {
28
+ "snapshotId": { "$ref": "#/$defs/uuidV7" },
29
+ "ref": { "type": "string", "format": "uri" },
30
+ "digest": { "$ref": "#/$defs/digest" }
31
+ },
32
+ "additionalProperties": false
33
+ },
34
+ "deliverables": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/artifact" } },
35
+ "evidence": { "type": "array", "items": { "$ref": "#/$defs/evidence" } },
36
+ "traces": { "type": "array", "items": { "$ref": "#/$defs/artifact" } },
37
+ "paymentTerms": {
38
+ "type": "object",
39
+ "required": ["ref", "digest"],
40
+ "properties": { "ref": { "type": "string", "format": "uri" }, "digest": { "$ref": "#/$defs/digest" } },
41
+ "additionalProperties": false
42
+ },
43
+ "submittedBy": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" },
44
+ "submittedAt": { "type": "string", "format": "date-time" },
45
+ "capability": { "type": "string", "minLength": 1 },
46
+ "status": { "const": "submitted" },
47
+ "digest": { "$ref": "#/$defs/digest" },
48
+ "extensions": { "type": "object" }
49
+ },
50
+ "$defs": {
51
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
52
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
53
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
54
+ "artifact": { "type": "object", "required": ["type", "uri", "digest"], "properties": { "type": { "type": "string", "minLength": 1 }, "uri": { "type": "string", "format": "uri" }, "digest": { "$ref": "#/$defs/digest" }, "label": { "type": "string", "minLength": 1 }, "mediaType": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
55
+ "evidence": { "type": "object", "required": ["type", "uri", "digest", "provenanceClass"], "properties": { "type": { "type": "string", "minLength": 1 }, "uri": { "type": "string", "format": "uri" }, "digest": { "$ref": "#/$defs/digest" }, "provenanceClass": { "enum": ["claimant_provided", "client_assisted", "server_verified", "third_party_attested"] }, "label": { "type": "string", "minLength": 1 } }, "additionalProperties": false }
56
+ },
57
+ "additionalProperties": false
58
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/evaluation-assertion.schema.json",
4
+ "title": "Evaluation assertion v1",
5
+ "type": "object",
6
+ "required": ["version", "evaluationId", "topicId", "deliveryPacketId", "deliveryPacketDigest", "rubric", "evidenceDigests", "traceDigests", "outcome", "result", "evaluatorDid", "evaluatedAt", "capability", "signature", "digest"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "evaluationId": { "$ref": "#/$defs/uuidV7" },
10
+ "topicId": { "$ref": "#/$defs/topicId" },
11
+ "deliveryPacketId": { "$ref": "#/$defs/uuidV7" },
12
+ "deliveryPacketDigest": { "$ref": "#/$defs/digest" },
13
+ "rubric": {
14
+ "type": "object",
15
+ "required": ["id", "version", "ref", "digest", "governanceStatus"],
16
+ "properties": { "id": { "type": "string", "minLength": 1 }, "version": { "type": "string", "minLength": 1 }, "ref": { "type": "string", "format": "uri" }, "digest": { "$ref": "#/$defs/digest" }, "governanceStatus": { "const": "approved" } },
17
+ "additionalProperties": false
18
+ },
19
+ "evidenceDigests": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/digest" } },
20
+ "traceDigests": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/digest" } },
21
+ "outcome": { "enum": ["supported", "refuted", "insufficient_evidence", "human_review", "disputed", "superseded"] },
22
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
23
+ "result": { "type": "object" },
24
+ "evaluatorDid": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" },
25
+ "evaluatedAt": { "type": "string", "format": "date-time" },
26
+ "capability": { "type": "string", "minLength": 1 },
27
+ "signature": { "type": "object", "required": ["type", "verificationMethod", "value"], "properties": { "type": { "type": "string", "minLength": 1 }, "verificationMethod": { "type": "string", "format": "uri" }, "value": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
28
+ "digest": { "$ref": "#/$defs/digest" },
29
+ "extensions": { "type": "object" }
30
+ },
31
+ "$defs": {
32
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
33
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
34
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
35
+ },
36
+ "additionalProperties": false
37
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/external-work-binding.schema.json",
4
+ "title": "External work binding v1",
5
+ "type": "object",
6
+ "required": ["version", "bindingId", "topicId", "role", "createdFrom", "external", "syncPolicy", "workState", "checkpoint", "identity", "health", "createdBy", "createdAt"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "bindingId": { "$ref": "#/$defs/uuidV7" },
10
+ "topicId": { "$ref": "#/$defs/topicId" },
11
+ "role": { "enum": ["primary", "child", "related", "verification", "delivery"] },
12
+ "createdFrom": { "enum": ["topic", "external"] },
13
+ "external": {
14
+ "type": "object",
15
+ "required": ["provider", "resourceType", "organizationId", "resourceId", "identifier", "url"],
16
+ "properties": {
17
+ "provider": { "type": "string", "pattern": "^[a-z][a-z0-9.-]{0,63}$" },
18
+ "resourceType": { "type": "string", "minLength": 1, "maxLength": 80 },
19
+ "organizationId": { "type": "string", "minLength": 1, "maxLength": 256 },
20
+ "teamId": { "type": "string", "minLength": 1, "maxLength": 256 },
21
+ "resourceId": { "type": "string", "minLength": 1, "maxLength": 256 },
22
+ "identifier": { "type": "string", "minLength": 1, "maxLength": 128 },
23
+ "url": { "type": "string", "format": "uri" }
24
+ },
25
+ "additionalProperties": false
26
+ },
27
+ "syncPolicy": {
28
+ "type": "object",
29
+ "required": ["mode", "direction", "comments", "files", "delete", "fieldPolicy"],
30
+ "properties": {
31
+ "mode": { "enum": ["link_only", "governed_projection"] },
32
+ "direction": { "enum": ["external_to_topic", "topic_to_external", "bidirectional"] },
33
+ "comments": { "enum": ["none", "explicit_promote"] },
34
+ "files": { "enum": ["none", "reference_only", "explicit_ingest"] },
35
+ "delete": { "const": "tombstone" },
36
+ "fieldPolicy": {
37
+ "type": "object",
38
+ "required": ["id", "version", "digest"],
39
+ "properties": {
40
+ "id": { "type": "string", "format": "uri" },
41
+ "version": { "type": "integer", "minimum": 1 },
42
+ "digest": { "$ref": "#/$defs/digest" }
43
+ },
44
+ "additionalProperties": false
45
+ }
46
+ },
47
+ "additionalProperties": false
48
+ },
49
+ "workState": { "enum": ["planned", "ready", "in_progress", "blocked", "handoff_ready", "handed_off", "cancelled"] },
50
+ "checkpoint": {
51
+ "type": "object",
52
+ "required": ["topicRevision", "syncedAt"],
53
+ "properties": {
54
+ "topicRevision": { "type": "string", "minLength": 1 },
55
+ "effectiveContractDigest": { "$ref": "#/$defs/digest" },
56
+ "externalUpdatedAt": { "type": "string", "format": "date-time" },
57
+ "externalSnapshotDigest": { "$ref": "#/$defs/digest" },
58
+ "lastEventId": { "type": "string", "minLength": 1, "maxLength": 256 },
59
+ "syncedAt": { "type": "string", "format": "date-time" }
60
+ },
61
+ "additionalProperties": false
62
+ },
63
+ "identity": {
64
+ "type": "object",
65
+ "required": ["bridgeDid"],
66
+ "properties": {
67
+ "bridgeDid": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" },
68
+ "externalAppActorId": { "type": "string", "minLength": 1, "maxLength": 256 }
69
+ },
70
+ "additionalProperties": false
71
+ },
72
+ "health": { "enum": ["up_to_date", "changes_pending", "degraded", "disconnected", "conflicted", "permission_lost"] },
73
+ "createdBy": { "type": "string", "minLength": 1 },
74
+ "createdAt": { "type": "string", "format": "date-time" },
75
+ "extensions": { "type": "object" }
76
+ },
77
+ "$defs": {
78
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
79
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
80
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
81
+ },
82
+ "additionalProperties": false
83
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/external-work-state-map.schema.json",
4
+ "title": "External work state mapping profile v1",
5
+ "type": "object",
6
+ "required": ["version", "profileId", "provider", "organizationId", "teamId", "mappings"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "profileId": { "type": "string", "format": "uri" },
10
+ "provider": { "type": "string", "pattern": "^[a-z][a-z0-9.-]{0,63}$" },
11
+ "organizationId": { "type": "string", "minLength": 1, "maxLength": 256 },
12
+ "teamId": { "type": "string", "minLength": 1, "maxLength": 256 },
13
+ "mappings": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "items": {
17
+ "type": "object",
18
+ "required": ["workflowStateId", "category", "workState"],
19
+ "properties": {
20
+ "workflowStateId": { "type": "string", "minLength": 1, "maxLength": 256 },
21
+ "category": { "enum": ["triage", "backlog", "unstarted", "started", "completed", "canceled"] },
22
+ "workState": { "enum": ["planned", "ready", "in_progress", "blocked", "handoff_ready", "handed_off", "cancelled"] }
23
+ },
24
+ "additionalProperties": false
25
+ }
26
+ }
27
+ },
28
+ "additionalProperties": false
29
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/job-card.schema.json",
4
+ "title": "IXO Job Card resource v1",
5
+ "type": "object",
6
+ "required": ["version", "type", "id"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "type": { "const": "org.ixo.job-card" },
10
+ "id": { "type": "string", "pattern": "^urn:ixo:job:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
11
+ "jobNumber": { "type": "string", "minLength": 1, "maxLength": 80 },
12
+ "phase": { "type": "string", "enum": ["requested", "scheduled", "dispatched", "in_progress", "ready_for_review", "completed", "cancelled"] },
13
+ "priority": { "type": "string", "enum": ["low", "normal", "high", "urgent"] },
14
+ "instructions": { "type": "string", "minLength": 1, "maxLength": 10000 },
15
+ "scheduled": {
16
+ "type": "object",
17
+ "properties": {
18
+ "start": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json#/$defs/temporalTarget" },
19
+ "end": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json#/$defs/temporalTarget" }
20
+ },
21
+ "additionalProperties": false
22
+ },
23
+ "site": { "$ref": "#/$defs/resourceTarget" },
24
+ "asset": { "$ref": "#/$defs/resourceTarget" },
25
+ "requestedBy": { "type": "string", "minLength": 1, "maxLength": 256 },
26
+ "assignedTo": {
27
+ "type": "array",
28
+ "uniqueItems": true,
29
+ "maxItems": 100,
30
+ "items": { "type": "string", "minLength": 1, "maxLength": 256 }
31
+ },
32
+ "extensions": { "type": "object" }
33
+ },
34
+ "additionalProperties": false,
35
+ "$defs": {
36
+ "resourceTarget": {
37
+ "type": "object",
38
+ "required": ["label"],
39
+ "properties": {
40
+ "label": { "type": "string", "minLength": 1, "maxLength": 280 },
41
+ "id": { "type": "string", "minLength": 1, "maxLength": 512 }
42
+ },
43
+ "additionalProperties": false
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/settlement-receipt.schema.json",
4
+ "title": "Settlement receipt v1",
5
+ "type": "object",
6
+ "required": ["version", "settlementId", "topicId", "claimId", "deliveryPacketId", "deliveryPacketDigest", "evaluationIds", "approvalId", "policy", "idempotencyKey", "amount", "asset", "recipient", "paymentRail", "state", "finality", "signerDid", "recordedAt", "capability", "digest"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "settlementId": { "$ref": "#/$defs/uuidV7" },
10
+ "topicId": { "$ref": "#/$defs/topicId" },
11
+ "claimId": { "type": "string", "minLength": 1, "maxLength": 256 },
12
+ "deliveryPacketId": { "$ref": "#/$defs/uuidV7" },
13
+ "deliveryPacketDigest": { "$ref": "#/$defs/digest" },
14
+ "evaluationIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/uuidV7" } },
15
+ "approvalId": { "$ref": "#/$defs/uuidV7" },
16
+ "policy": { "type": "object", "required": ["ref", "digest"], "properties": { "ref": { "type": "string", "format": "uri" }, "digest": { "$ref": "#/$defs/digest" } }, "additionalProperties": false },
17
+ "idempotencyKey": { "type": "string", "minLength": 1, "maxLength": 512 },
18
+ "amount": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$" },
19
+ "asset": { "type": "string", "minLength": 1, "maxLength": 128 },
20
+ "recipient": { "type": "string", "minLength": 1, "maxLength": 256 },
21
+ "paymentRail": { "type": "string", "minLength": 1, "maxLength": 128 },
22
+ "transactionReference": { "type": "string", "minLength": 1, "maxLength": 512 },
23
+ "state": { "enum": ["unfunded", "funded", "held", "authorised", "submitted", "confirmed", "failed", "refunded"] },
24
+ "finality": { "type": "object", "required": ["state"], "properties": { "state": { "enum": ["pending", "confirmed", "failed"] }, "confirmations": { "type": "integer", "minimum": 0 }, "confirmedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false },
25
+ "signerDid": { "type": "string", "pattern": "^did:[a-z0-9]+:.+" },
26
+ "recordedAt": { "type": "string", "format": "date-time" },
27
+ "capability": { "type": "string", "minLength": 1 },
28
+ "digest": { "$ref": "#/$defs/digest" },
29
+ "extensions": { "type": "object" }
30
+ },
31
+ "$defs": {
32
+ "uuidV7": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
33
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
34
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
35
+ },
36
+ "additionalProperties": false,
37
+ "allOf": [
38
+ {
39
+ "if": { "properties": { "state": { "const": "confirmed" } }, "required": ["state"] },
40
+ "then": {
41
+ "required": ["transactionReference"],
42
+ "properties": {
43
+ "transactionReference": { "type": "string", "minLength": 1, "maxLength": 512 },
44
+ "finality": {
45
+ "type": "object",
46
+ "properties": { "state": { "const": "confirmed" }, "confirmedAt": { "type": "string", "format": "date-time" } },
47
+ "required": ["state", "confirmedAt"]
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ]
53
+ }
@@ -47,6 +47,29 @@
47
47
  }
48
48
  ]
49
49
  },
50
+ "kindProfileRef": {
51
+ "type": "object",
52
+ "required": ["id", "version", "schema", "digest"],
53
+ "properties": {
54
+ "id": { "type": "string", "format": "uri" },
55
+ "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
56
+ "schema": { "type": "string", "format": "uri" },
57
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
58
+ },
59
+ "additionalProperties": false
60
+ },
61
+ "kindResource": {
62
+ "type": "object",
63
+ "required": ["profile", "type", "id", "version", "value"],
64
+ "properties": {
65
+ "profile": { "$ref": "#/$defs/kindProfileRef" },
66
+ "type": { "type": "string", "minLength": 1, "maxLength": 128 },
67
+ "id": { "type": "string", "minLength": 1, "maxLength": 512 },
68
+ "version": { "type": "integer", "minimum": 1 },
69
+ "value": { "type": "object" }
70
+ },
71
+ "additionalProperties": false
72
+ },
50
73
  "anchor": {
51
74
  "oneOf": [
52
75
  {
@@ -189,6 +212,8 @@
189
212
  "revision": { "type": "string", "minLength": 1 },
190
213
  "status": { "type": "string", "enum": ["draft", "accepted", "superseded"] },
191
214
  "kindRef": { "$ref": "#/$defs/kindRef" },
215
+ "kindProfile": { "$ref": "#/$defs/kindProfileRef" },
216
+ "kindResource": { "$ref": "#/$defs/kindResource" },
192
217
  "authoredBy": { "type": "string", "minLength": 1 },
193
218
  "authoredAt": { "type": "string", "format": "date-time" },
194
219
  "workingMode": { "type": "string", "enum": ["solo", "team", "client"] },
@@ -253,6 +278,7 @@
253
278
  "title": { "type": "string", "minLength": 1, "maxLength": 280 },
254
279
  "status": { "type": "string", "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] },
255
280
  "kindRef": { "$ref": "#/$defs/kindRef" },
281
+ "kindProfile": { "$ref": "#/$defs/kindProfileRef" },
256
282
  "appearance": { "$ref": "#/$defs/appearance" },
257
283
  "attachmentCount": { "type": "integer", "minimum": 0 },
258
284
  "operationCount": { "type": "integer", "minimum": 0 }
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/topic-kind-profile.schema.json",
4
+ "title": "Topic Kind Profile v1",
5
+ "type": "object",
6
+ "required": ["version", "id", "profileVersion", "label", "kind", "resource", "acceptance", "projection", "presentation"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "id": { "type": "string", "format": "uri" },
10
+ "profileVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
11
+ "label": { "type": "string", "minLength": 1, "maxLength": 80 },
12
+ "description": { "type": "string", "minLength": 1, "maxLength": 1000 },
13
+ "kind": {
14
+ "type": "object",
15
+ "required": ["customId", "baseKind", "recipe"],
16
+ "properties": {
17
+ "customId": { "type": "string", "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)+$", "maxLength": 128 },
18
+ "baseKind": { "type": "string", "enum": ["task", "agent_task", "proposal", "evaluation", "claims", "question", "discussion", "incident"] },
19
+ "recipe": { "type": "string", "enum": ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"] }
20
+ },
21
+ "additionalProperties": false
22
+ },
23
+ "resource": {
24
+ "type": "object",
25
+ "required": ["type", "version", "schema"],
26
+ "properties": {
27
+ "type": { "type": "string", "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)+$", "maxLength": 128 },
28
+ "version": { "type": "integer", "minimum": 1 },
29
+ "schema": { "type": "string", "format": "uri" }
30
+ },
31
+ "additionalProperties": false
32
+ },
33
+ "acceptance": {
34
+ "type": "object",
35
+ "required": ["requiredResourcePaths"],
36
+ "properties": {
37
+ "requiredResourcePaths": {
38
+ "type": "array",
39
+ "uniqueItems": true,
40
+ "maxItems": 50,
41
+ "items": { "type": "string", "pattern": "^/" }
42
+ }
43
+ },
44
+ "additionalProperties": false
45
+ },
46
+ "projection": {
47
+ "type": "object",
48
+ "required": ["key", "roomVisibleFields"],
49
+ "properties": {
50
+ "key": { "type": "string", "pattern": "^[a-z0-9]+(?:[._/-][a-z0-9]+)+$", "maxLength": 160 },
51
+ "roomVisibleFields": {
52
+ "type": "array",
53
+ "uniqueItems": true,
54
+ "maxItems": 20,
55
+ "items": { "type": "string", "pattern": "^/" }
56
+ }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ "presentation": {
61
+ "type": "object",
62
+ "required": ["fallbackLabel", "primaryFields"],
63
+ "properties": {
64
+ "fallbackLabel": { "type": "string", "minLength": 1, "maxLength": 80 },
65
+ "primaryFields": {
66
+ "type": "array",
67
+ "uniqueItems": true,
68
+ "maxItems": 20,
69
+ "items": { "type": "string", "pattern": "^/" }
70
+ }
71
+ },
72
+ "additionalProperties": false
73
+ },
74
+ "capabilities": {
75
+ "type": "array",
76
+ "uniqueItems": true,
77
+ "maxItems": 20,
78
+ "items": { "type": "string", "minLength": 1, "maxLength": 128 }
79
+ }
80
+ },
81
+ "additionalProperties": false
82
+ }