Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

6.5 KB
Raw Blame
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://osmantic.com/pixel/schemas/work-goal-controller-environment-v1.schema.json",
  "title": "Pixel supervised goal controller environment v1",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "schemaVersion", "stateRoot", "policyPath", "objectStore", "workspaceRoot", "executorPath", "archiveLimits", "runtime", "boundary"],
  "properties": {
    "$schema": {"const": "https://osmantic.com/pixel/schemas/work-goal-controller-environment-v1.schema.json"},
    "schemaVersion": {"const": 1},
    "stateRoot": {"$ref": "#/$defs/path"},
    "policyPath": {"$ref": "#/$defs/path"},
    "objectStore": {"$ref": "#/$defs/path"},
    "workspaceRoot": {"$ref": "#/$defs/path"},
    "executorPath": {"$ref": "#/$defs/path"},
    "modelBackendLaunchPath": {"$ref": "#/$defs/path"},
    "archiveLimits": {
      "type": "object",
      "additionalProperties": false,
      "required": ["maxEntries", "maxFileBytes"],
      "properties": {
        "maxEntries": {"type": "integer", "minimum": 1, "maximum": 100000},
        "maxFileBytes": {"type": "integer", "minimum": 1, "maximum": 4294967296}
      }
    },
    "runtime": {
      "type": "object",
      "additionalProperties": false,
      "required": ["dockerPath", "backendNetworkName", "backendContainerName", "networkSubnet", "workerIp", "proxyIp", "uid", "gid"],
      "properties": {
        "dockerPath": {"$ref": "#/$defs/path"},
        "backendNetworkName": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,127}$"},
        "backendContainerName": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_.-]{0,127}$"},
        "networkSubnet": {"type": "string", "pattern": "^[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/(?:[0-9]|[12][0-9]|3[0-2])$"},
        "workerIp": {"$ref": "#/$defs/ipv4"},
        "proxyIp": {"$ref": "#/$defs/ipv4"},
        "uid": {"type": "integer", "minimum": 1, "maximum": 2147483647},
        "gid": {"type": "integer", "minimum": 1, "maximum": 2147483647}
      }
    },
    "researchRuntime": {
      "type": "object",
      "additionalProperties": false,
      "required": ["researchCourierQueueRoot", "researchEndpoint"],
      "properties": {
        "researchCourierQueueRoot": {"$ref": "#/$defs/path"},
        "researchEndpoint": {"type": "string", "minLength": 21, "maxLength": 22, "pattern": "^http://127\\.0\\.0\\.1:[0-9]{4,5}$"}
      }
    },
    "capabilityRuntime": {"$ref": "#/$defs/capabilityRuntime"},
    "knowledgeRuntime": {"$ref": "#/$defs/knowledgeRuntime"},
    "boundary": {"const": "Owner-reviewed local controller environment only. It names exact private storage, policy, pinned executor, and isolated runtime wiring but grants no execution, lease, scheduling, service activation, scope expansion, external effect, or completion authority."}
  },
  "$defs": {
    "path": {"type": "string", "minLength": 1, "maxLength": 4096, "pattern": "^[^\\u0000\\r\\n]+$"},
    "ipv4": {"type": "string", "pattern": "^[0-9]{1,3}(?:\\.[0-9]{1,3}){3}$"},
    "sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
    "limits": {
      "type": "object", "additionalProperties": false,
      "required": ["maxInputBytes", "maxOutputBytes", "maxRuntimeMs", "maxCalls", "maxMemoryMiB", "maxCpuCores", "maxPids", "maxWorkspaceBytes"],
      "properties": {
        "maxInputBytes": {"type": "integer", "minimum": 1, "maximum": 1048576},
        "maxOutputBytes": {"type": "integer", "minimum": 1, "maximum": 16777216},
        "maxRuntimeMs": {"type": "integer", "minimum": 100, "maximum": 3600000},
        "maxCalls": {"const": 1},
        "maxMemoryMiB": {"type": "integer", "minimum": 64, "maximum": 8192},
        "maxCpuCores": {"type": "number", "minimum": 0.1, "maximum": 8},
        "maxPids": {"type": "integer", "minimum": 16, "maximum": 512},
        "maxWorkspaceBytes": {"type": "integer", "minimum": 0, "maximum": 34359738368}
      }
    },
    "capabilityRuntime": {
      "type": "object", "additionalProperties": false,
      "required": ["controllerPolicyPath", "allowedSignersPath", "sshKeygenPath", "dockerConfigPath", "maxHealthAgeMs", "bindings"],
      "properties": {
        "controllerPolicyPath": {"$ref": "#/$defs/path"},
        "allowedSignersPath": {"$ref": "#/$defs/path"},
        "sshKeygenPath": {"$ref": "#/$defs/path"},
        "dockerConfigPath": {"$ref": "#/$defs/path"},
        "maxHealthAgeMs": {"type": "integer", "minimum": 1000, "maximum": 86400000},
        "bindings": {
          "type": "array", "minItems": 1, "maxItems": 256,
          "items": {
            "type": "object", "additionalProperties": false,
            "required": ["jobId", "pack", "tools", "maxSessions", "grantLifetimeMs", "limits"],
            "properties": {
              "jobId": {"type": "string", "pattern": "^work-[0-9]{13}-[a-f0-9]{12}$"},
              "pack": {
                "type": "object", "additionalProperties": false,
                "required": ["id", "version", "packSha256", "treeSha256"],
                "properties": {
                  "id": {"type": "string", "pattern": "^[a-z][a-z0-9-]{1,62}$"},
                  "version": {"type": "string", "pattern": "^(?:0|[1-9][0-9]{0,8})\\.(?:0|[1-9][0-9]{0,8})\\.(?:0|[1-9][0-9]{0,8})$"},
                  "packSha256": {"$ref": "#/$defs/sha256"},
                  "treeSha256": {"$ref": "#/$defs/sha256"}
                }
              },
              "tools": {"type": "array", "minItems": 1, "maxItems": 16, "uniqueItems": true, "items": {"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,127}$"}},
              "maxSessions": {"type": "integer", "minimum": 1, "maximum": 4096},
              "grantLifetimeMs": {"type": "integer", "minimum": 100, "maximum": 3600000},
              "limits": {"$ref": "#/$defs/limits"}
            }
          }
        }
      }
    },
    "knowledgeRuntime": {
      "type": "object", "additionalProperties": false,
      "required": ["vaultRoot", "vaultId", "credentialSourcePath", "credentialName", "ownerId", "clientId", "maxContextBytes"],
      "properties": {
        "vaultRoot": {"$ref": "#/$defs/path"},
        "vaultId": {"type": "string", "pattern": "^knowledgevault-[a-f0-9]{12}$"},
        "credentialSourcePath": {"$ref": "#/$defs/path"},
        "credentialName": {"const": "pixel-knowledge-vault-key"},
        "ownerId": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"},
        "clientId": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"},
        "maxContextBytes": {"type": "integer", "minimum": 1024, "maximum": 32768}
      }
    }
  }
}