Ship OpenFleet contracts and the OpenWall draft proposal (#177)

* feat: add OpenFleet membership and CoinPay rental contracts

* Propose OpenWall broadcasts and direct messaging contracts

* release: prepare OpenFleet and OpenWall public contracts

* fix: use tested npm for compatible CLI installs
This commit is contained in:
Anthony Ettinger 2026-09-13 00:57:45 -07:00 • committed by GitHub
parent a333726a1e
commit 45c7629953
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 2021 additions and 12 deletions

View file

@ -0,0 +1,323 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-openfleet.schema.json",
"title": "OpenFleet",
"description": "A fleet of OpenAgent profiles and/or OpenSwarm swarms with explicit CoinPay rental offers.",
"type": "object",
"additionalProperties": false,
"required": [
"type",
"version",
"id",
"name",
"owner_did",
"members"
],
"properties": {
"type": {
"const": "logicsrc.openfleet"
},
"version": {
"const": "0.1"
},
"id": {
"$ref": "#/$defs/httpsUrl"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"description": {
"type": "string"
},
"owner_did": {
"$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"availability": {
"enum": [
"available",
"busy",
"offline",
"unknown"
]
},
"tags": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"capabilities": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"metadata": {
"type": "object"
},
"members": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/member"
}
},
"rentals": {
"type": "array",
"items": {
"$ref": "#/$defs/rental"
}
}
},
"$defs": {
"httpsUrl": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"memberReference": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"id"
],
"properties": {
"kind": {
"const": "openagent"
},
"id": {
"$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"id"
],
"properties": {
"kind": {
"const": "openswarm"
},
"id": {
"type": "string",
"pattern": "^ed25519:[0-9a-f]{64}$"
}
}
}
]
},
"member": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"id",
"url"
],
"properties": {
"kind": {
"const": "openagent"
},
"id": {
"$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
},
"url": {
"$ref": "#/$defs/httpsUrl"
},
"name": {
"type": "string",
"minLength": 1
},
"role": {
"type": "string",
"minLength": 1
},
"metadata": {
"type": "object"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"id",
"url"
],
"properties": {
"kind": {
"const": "openswarm"
},
"id": {
"type": "string",
"pattern": "^ed25519:[0-9a-f]{64}$"
},
"url": {
"$ref": "#/$defs/httpsUrl"
},
"name": {
"type": "string",
"minLength": 1
},
"role": {
"type": "string",
"minLength": 1
},
"metadata": {
"type": "object"
}
}
}
]
},
"scope": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"kind"
],
"properties": {
"kind": {
"const": "fleet"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"kind",
"members"
],
"properties": {
"kind": {
"const": "members"
},
"members": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/memberReference"
}
}
}
}
]
},
"rental": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"scope",
"rate",
"payment"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string",
"minLength": 1
},
"scope": {
"$ref": "#/$defs/scope"
},
"rate": {
"type": "object",
"additionalProperties": false,
"required": [
"amount",
"currency",
"unit"
],
"properties": {
"amount": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)\\.[0-9]{6}$",
"description": "Non-negative USD decimal string with exactly six fractional digits; never a JSON number."
},
"currency": {
"const": "USD"
},
"unit": {
"enum": [
"hour",
"day",
"month",
"task"
]
}
}
},
"minimum_units": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"maximum_units": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"valid_from": {
"type": "string",
"format": "date-time"
},
"valid_until": {
"type": "string",
"format": "date-time"
},
"terms_url": {
"$ref": "#/$defs/httpsUrl"
},
"payment": {
"type": "object",
"additionalProperties": false,
"required": [
"provider",
"payee_did",
"checkout_url"
],
"properties": {
"provider": {
"const": "coinpay"
},
"payee_did": {
"$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
},
"checkout_url": {
"$ref": "#/$defs/httpsUrl"
}
}
},
"metadata": {
"type": "object"
}
}
}
}
}

View file

@ -0,0 +1,246 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-openwall-message.schema.json",
"title": "OpenWall Message (0.1 draft)",
"description": "Private sender-side job document. Structural validation does not authorize delivery or enforce the semantic rules in docs/openwall.md.",
"type": "object",
"required": [
"openwall",
"id",
"sender",
"createdAt",
"expiresAt",
"visibility",
"topic",
"audience",
"content"
],
"additionalProperties": false,
"properties": {
"openwall": {
"const": "0.1-draft"
},
"id": {
"type": "string",
"format": "uri",
"pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"sender": {
"$ref": "#/$defs/identity"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"notBefore": {
"type": "string",
"format": "date-time"
},
"expiresAt": {
"type": "string",
"format": "date-time"
},
"visibility": {
"enum": [
"private",
"public"
]
},
"topic": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[a-z0-9][a-z0-9._-]*$"
},
"audience": {
"oneOf": [
{
"$ref": "#/$defs/relationships"
},
{
"$ref": "#/$defs/direct"
},
{
"$ref": "#/$defs/public"
}
]
},
"content": {
"type": "object",
"required": [
"mediaType",
"text"
],
"additionalProperties": false,
"properties": {
"mediaType": {
"const": "text/plain"
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 4000
}
}
}
},
"allOf": [
{
"if": {
"properties": {
"visibility": {
"const": "public"
}
}
},
"then": {
"properties": {
"audience": {
"$ref": "#/$defs/public"
}
}
},
"else": {
"properties": {
"audience": {
"oneOf": [
{
"$ref": "#/$defs/relationships"
},
{
"$ref": "#/$defs/direct"
}
]
}
}
}
}
],
"$defs": {
"identity": {
"type": "string",
"format": "uri",
"pattern": "^(did:|https://)",
"maxLength": 2048
},
"selector": {
"type": "object",
"required": [
"source",
"actor",
"groups"
],
"additionalProperties": false,
"properties": {
"source": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 2048
},
"actor": {
"$ref": "#/$defs/identity"
},
"groups": {
"type": "array",
"minItems": 1,
"maxItems": 4,
"uniqueItems": true,
"items": {
"enum": [
"connections",
"followers",
"following",
"users"
]
}
},
"scope": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 2048
}
},
"allOf": [
{
"if": {
"properties": {
"groups": {
"contains": {
"const": "users"
},
"type": "array"
}
}
},
"then": {
"required": [
"scope"
],
"properties": {
"scope": {}
}
}
}
]
},
"relationships": {
"type": "object",
"required": [
"kind",
"selectors"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "relationships"
},
"selectors": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"uniqueItems": true,
"items": {
"$ref": "#/$defs/selector"
}
},
"exclude": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/identity"
}
}
}
},
"direct": {
"type": "object",
"required": [
"kind",
"recipient"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "direct"
},
"recipient": {
"$ref": "#/$defs/identity"
}
}
},
"public": {
"type": "object",
"required": [
"kind"
],
"additionalProperties": false,
"properties": {
"kind": {
"const": "public"
}
}
}
}
}

View file

@ -0,0 +1,229 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.logicsrc.com/logicsrc-openwall-receipt.schema.json",
"title": "OpenWall Receipt (0.1 draft)",
"description": "Private coordinator event. Authenticity, event ordering and valid state transitions require runtime checks.",
"type": "object",
"required": [
"openwall",
"id",
"messageId",
"deliveryId",
"recipient",
"sequence",
"state",
"at",
"attempt"
],
"additionalProperties": false,
"properties": {
"openwall": {
"const": "0.1-draft"
},
"id": {
"type": "string",
"format": "uri",
"pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"messageId": {
"type": "string",
"format": "uri",
"pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"recipient": {
"type": "string",
"format": "uri",
"pattern": "^(did:|https://)",
"maxLength": 2048
},
"sequence": {
"type": "integer",
"minimum": 1
},
"state": {
"enum": [
"queued",
"sending",
"retrying",
"accepted",
"delivered",
"read",
"unknown",
"failed",
"expired",
"cancelled"
]
},
"at": {
"type": "string",
"format": "date-time"
},
"attempt": {
"type": "integer",
"minimum": 0,
"maximum": 8
},
"route": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 2048
},
"providerMessageId": {
"type": "string",
"minLength": 1,
"maxLength": 2048
},
"reason": {
"enum": [
"not-permitted",
"identity-unverified",
"unsupported",
"rate-limited",
"provider-failure",
"acceptance-unknown",
"retry-exhausted",
"deadline-passed",
"sender-cancelled"
]
},
"nextAttemptAt": {
"type": "string",
"format": "date-time"
},
"deliveryId": {
"type": "string",
"format": "uri",
"pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
},
"allOf": [
{
"if": {
"properties": {
"state": {
"const": "retrying"
}
}
},
"then": {
"required": [
"nextAttemptAt",
"reason"
],
"properties": {
"nextAttemptAt": {},
"reason": {}
}
},
"else": {
"not": {
"required": [
"nextAttemptAt"
],
"properties": {
"nextAttemptAt": {}
}
}
}
},
{
"if": {
"properties": {
"state": {
"enum": [
"failed",
"unknown",
"expired",
"cancelled"
]
}
}
},
"then": {
"required": [
"reason"
],
"properties": {
"reason": {}
}
}
},
{
"if": {
"properties": {
"state": {
"enum": [
"sending",
"retrying",
"accepted",
"delivered",
"read",
"unknown"
]
}
}
},
"then": {
"required": [
"route"
],
"properties": {
"attempt": {
"minimum": 1,
"type": "integer"
},
"route": {}
}
}
},
{
"if": {
"properties": {
"state": {
"const": "unknown"
}
}
},
"then": {
"properties": {
"reason": {
"const": "acceptance-unknown"
}
}
}
},
{
"if": {
"properties": {
"state": {
"const": "expired"
}
}
},
"then": {
"properties": {
"reason": {
"const": "deadline-passed"
}
}
}
},
{
"if": {
"properties": {
"state": {
"const": "cancelled"
}
}
},
"then": {
"properties": {
"reason": {
"const": "sender-cancelled"
}
}
}
}
]
}