{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oshun.dev/schemas/audit/eve-sota-hermes-fusion-scope.v1.json",
  "title": "Eve / Hermes construction and fusion boundary",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "initiativeId",
    "taskId",
    "evaluatedOn",
    "sourceEvidence",
    "hermesChecklist",
    "construction",
    "fusionScope",
    "outcome",
    "limitations",
    "recordDigestSha256"
  ],
  "properties": {
    "schemaVersion": { "const": "eve-sota-hermes-fusion-scope.v1" },
    "initiativeId": { "const": "eve-sota-gap-closure-2026-09-01" },
    "taskId": { "const": "7.1" },
    "evaluatedOn": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
    "sourceEvidence": {
      "type": "array",
      "minItems": 12,
      "items": { "$ref": "#/$defs/sourceEvidence" }
    },
    "hermesChecklist": { "$ref": "#/$defs/hermesChecklist" },
    "construction": { "$ref": "#/$defs/construction" },
    "fusionScope": { "$ref": "#/$defs/fusionScope" },
    "outcome": { "$ref": "#/$defs/outcome" },
    "limitations": {
      "type": "array",
      "minItems": 5,
      "items": { "type": "string", "minLength": 1 }
    },
    "recordDigestSha256": { "$ref": "#/$defs/sha256" }
  },
  "$defs": {
    "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "taskId": { "type": "string", "pattern": "^(?:0|[1-9][0-9]*)\\.[1-9][0-9]*$" },
    "stringArray": { "type": "array", "items": { "type": "string" } },
    "taskIds": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/taskId" } },
    "sourceEvidence": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "digestOf", "sha256", "bytes"],
      "properties": {
        "path": { "type": "string", "minLength": 1 },
        "digestOf": { "enum": ["file-bytes", "task-requirement", "tracked-source-set"] },
        "sha256": { "$ref": "#/$defs/sha256" },
        "bytes": { "type": "integer", "minimum": 1 }
      }
    },
    "hermesChecklist": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source",
        "itemIds",
        "checkedItemIds",
        "openItemIds",
        "checkedCount",
        "openCount",
        "complete"
      ],
      "properties": {
        "source": { "const": "docs/audits/HERMES_PARITY_TODOS.md" },
        "itemIds": {
          "type": "array",
          "minItems": 23,
          "maxItems": 23,
          "items": { "type": "string" }
        },
        "checkedItemIds": {
          "type": "array",
          "minItems": 23,
          "maxItems": 23,
          "items": { "type": "string" }
        },
        "openItemIds": { "type": "array", "maxItems": 0 },
        "checkedCount": { "const": 23 },
        "openCount": { "const": 0 },
        "complete": { "const": true }
      }
    },
    "constructionCapability": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "present"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "present": { "const": true }
      }
    },
    "sourceFileCounts": {
      "type": "object",
      "additionalProperties": false,
      "required": ["scheduling", "voyagerSkills", "channels", "executionBackends", "subagents"],
      "properties": {
        "scheduling": { "type": "integer", "minimum": 7 },
        "voyagerSkills": { "type": "integer", "minimum": 8 },
        "channels": { "type": "integer", "minimum": 10 },
        "executionBackends": { "type": "integer", "minimum": 4 },
        "subagents": { "type": "integer", "minimum": 5 }
      }
    },
    "construction": {
      "type": "object",
      "additionalProperties": false,
      "required": ["status", "package", "assemblyEntrypoint", "capabilities", "sourceFileCounts"],
      "properties": {
        "status": { "const": "complete-as-recorded" },
        "package": { "const": "@oshun/assistant" },
        "assemblyEntrypoint": {
          "const": "libs/oshun/assistant/src/create-assistant.ts#createAssistant"
        },
        "capabilities": {
          "type": "array",
          "minItems": 7,
          "maxItems": 7,
          "items": { "$ref": "#/$defs/constructionCapability" }
        },
        "sourceFileCounts": { "$ref": "#/$defs/sourceFileCounts" }
      }
    },
    "importer": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "importedSymbols"],
      "properties": {
        "path": { "type": "string", "minLength": 1 },
        "importedSymbols": { "$ref": "#/$defs/stringArray" }
      }
    },
    "symbolReference": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "symbol"],
      "properties": {
        "path": { "type": "string", "minLength": 1 },
        "symbol": { "type": "string", "minLength": 1 }
      }
    },
    "productWiring": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "roots",
        "productionSourceFileCount",
        "assistantPackageImporters",
        "assembledAssistantConsumers",
        "providerFactoryConsumers",
        "conclusion"
      ],
      "properties": {
        "roots": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": "string" } },
        "productionSourceFileCount": { "type": "integer", "minimum": 1 },
        "assistantPackageImporters": {
          "type": "array",
          "minItems": 1,
          "items": { "$ref": "#/$defs/importer" }
        },
        "assembledAssistantConsumers": { "type": "array", "maxItems": 0 },
        "providerFactoryConsumers": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string" }
        },
        "conclusion": { "const": "provider-factory-reuse-only-is-not-assembled-assistant-fusion" }
      }
    },
    "measurement": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sourceRoot",
        "sourceFileCount",
        "assistantPackageImporters",
        "hermesRuntimeSymbolReferences",
        "status",
        "ownerTaskIds"
      ],
      "properties": {
        "sourceRoot": { "const": "apps/oshun/bff/src/assistant/evals" },
        "sourceFileCount": { "type": "integer", "minimum": 1 },
        "assistantPackageImporters": { "type": "array", "maxItems": 0 },
        "hermesRuntimeSymbolReferences": { "type": "array", "maxItems": 0 },
        "status": { "const": "not-wired" },
        "ownerTaskIds": { "$ref": "#/$defs/taskIds" }
      }
    },
    "watchers": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schedulerSubstrateSourceFileCount",
        "productSchedulingConsumers",
        "watcherToolDefinitions",
        "status",
        "ownerTaskIds"
      ],
      "properties": {
        "schedulerSubstrateSourceFileCount": { "type": "integer", "minimum": 7 },
        "productSchedulingConsumers": { "type": "array", "maxItems": 0 },
        "watcherToolDefinitions": { "type": "array", "maxItems": 0 },
        "status": { "const": "not-wired" },
        "ownerTaskIds": { "$ref": "#/$defs/taskIds" }
      }
    },
    "skillSystem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["package", "role", "root", "productionSourceFileCount"],
      "properties": {
        "package": { "type": "string", "minLength": 1 },
        "role": { "type": "string", "minLength": 1 },
        "root": { "type": "string", "minLength": 1 },
        "productionSourceFileCount": { "type": "integer", "minimum": 1 }
      }
    },
    "skillDoctrine": {
      "type": "object",
      "additionalProperties": false,
      "required": ["systems", "reconciliationAdrs", "status", "ownerTaskIds"],
      "properties": {
        "systems": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": { "$ref": "#/$defs/skillSystem" }
        },
        "reconciliationAdrs": { "type": "array", "maxItems": 0 },
        "status": { "const": "unreconciled" },
        "ownerTaskIds": { "$ref": "#/$defs/taskIds" }
      }
    },
    "semanticRecall": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "conversationMemoryMethods",
        "memorySourceFileCount",
        "semanticBackendImporters",
        "checklistDisposition",
        "status",
        "ownerTaskIds"
      ],
      "properties": {
        "conversationMemoryMethods": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": { "enum": ["appendTurn", "loadHistory"] }
        },
        "memorySourceFileCount": { "type": "integer", "minimum": 2 },
        "semanticBackendImporters": { "type": "array", "maxItems": 0 },
        "checklistDisposition": { "const": "explicitly-deferred-at-hermes-task-0.3" },
        "status": { "const": "not-present-behind-conversation-memory" },
        "ownerTaskIds": { "$ref": "#/$defs/taskIds" }
      }
    },
    "liveChannels": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "adaptersPresent",
        "productRunnerConsumers",
        "operatorSelection",
        "admission",
        "securityGateAdmissionTask",
        "ownerTaskIds"
      ],
      "properties": {
        "adaptersPresent": {
          "type": "array",
          "minItems": 5,
          "maxItems": 5,
          "items": { "enum": ["discord", "email", "signal", "slack", "telegram"] }
        },
        "productRunnerConsumers": { "type": "array", "maxItems": 0 },
        "operatorSelection": { "const": "not-recorded" },
        "admission": { "const": "not-admitted" },
        "securityGateAdmissionTask": { "const": "7.8" },
        "ownerTaskIds": { "$ref": "#/$defs/taskIds" }
      }
    },
    "blocker": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "status", "implementation", "blocker", "exactUnblockCondition", "source"],
      "properties": {
        "id": { "enum": ["signal-live-channel", "singularity-live-exec"] },
        "status": { "const": "blocked-as-recorded" },
        "implementation": { "type": "string", "minLength": 1 },
        "blocker": { "type": "string", "minLength": 1 },
        "exactUnblockCondition": { "type": "string", "minLength": 1 },
        "source": { "type": "string", "minLength": 1 }
      }
    },
    "admission": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "taskId"],
      "properties": {
        "id": { "enum": ["background-watchers", "external-channels"] },
        "taskId": { "enum": ["7.4", "7.8"] }
      }
    },
    "scopeOwner": {
      "type": "object",
      "additionalProperties": false,
      "required": ["ownerTaskIds"],
      "properties": { "ownerTaskIds": { "$ref": "#/$defs/taskIds" } }
    },
    "scopeOwners": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "measurement",
        "watchers",
        "skillDoctrine",
        "semanticRecall",
        "liveChannels",
        "evaluationAdmission",
        "securityAdmission",
        "operationsAdmission",
        "privacyAdmission",
        "protocolIntegration"
      ],
      "properties": {
        "measurement": { "$ref": "#/$defs/scopeOwner" },
        "watchers": { "$ref": "#/$defs/scopeOwner" },
        "skillDoctrine": { "$ref": "#/$defs/scopeOwner" },
        "semanticRecall": { "$ref": "#/$defs/scopeOwner" },
        "liveChannels": { "$ref": "#/$defs/scopeOwner" },
        "evaluationAdmission": { "$ref": "#/$defs/scopeOwner" },
        "securityAdmission": { "$ref": "#/$defs/scopeOwner" },
        "operationsAdmission": { "$ref": "#/$defs/scopeOwner" },
        "privacyAdmission": { "$ref": "#/$defs/scopeOwner" },
        "protocolIntegration": { "$ref": "#/$defs/scopeOwner" }
      }
    },
    "integration": {
      "type": "object",
      "additionalProperties": false,
      "required": ["securityGateAdmissions", "scopeOwners", "status"],
      "properties": {
        "securityGateAdmissions": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": { "$ref": "#/$defs/admission" }
        },
        "scopeOwners": { "$ref": "#/$defs/scopeOwners" },
        "status": { "const": "remaining" }
      }
    },
    "fusionScope": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "productWiring",
        "measurement",
        "watchers",
        "skillDoctrine",
        "semanticRecall",
        "liveChannels",
        "infrastructureBlockers",
        "integration"
      ],
      "properties": {
        "status": { "const": "unfused" },
        "productWiring": { "$ref": "#/$defs/productWiring" },
        "measurement": { "$ref": "#/$defs/measurement" },
        "watchers": { "$ref": "#/$defs/watchers" },
        "skillDoctrine": { "$ref": "#/$defs/skillDoctrine" },
        "semanticRecall": { "$ref": "#/$defs/semanticRecall" },
        "liveChannels": { "$ref": "#/$defs/liveChannels" },
        "infrastructureBlockers": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": { "$ref": "#/$defs/blocker" }
        },
        "integration": { "$ref": "#/$defs/integration" }
      }
    },
    "outcome": {
      "type": "object",
      "additionalProperties": false,
      "required": ["taskClosed", "phaseClosed", "gapRefs", "gapStatus", "nextTaskIds"],
      "properties": {
        "taskClosed": { "const": true },
        "phaseClosed": { "const": false },
        "gapRefs": {
          "type": "array",
          "minItems": 9,
          "maxItems": 9,
          "items": { "pattern": "^G(?:3|1[1-8])$" }
        },
        "gapStatus": { "const": "open" },
        "nextTaskIds": {
          "type": "array",
          "minItems": 7,
          "maxItems": 7,
          "items": { "$ref": "#/$defs/taskId" }
        }
      }
    }
  }
}
