File size: 3,155 Bytes
f24bcdf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/LucioLiu/handoff-protocol/contracts/return-packet.schema.json",
  "title": "Return packet",
  "type": "object",
  "additionalProperties": false,
  "required": ["conclusion", "evidence", "gaps", "artifact_paths"],
  "properties": {
    "conclusion": {"type": "string", "minLength": 1},
    "evidence": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
    "gaps": {"type": "array", "items": {"type": "string", "minLength": 1}},
    "artifact_paths": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
    "handoff_id": {"type": "string", "minLength": 1},
    "contract_id": {"type": "string", "minLength": 1},
    "dispatch_id": {"type": "string", "minLength": 1},
    "execution_mode": {
      "description": "Actual host execution container; persistence is represented separately by closure_receipts.",
      "enum": ["bounded_subagent", "independent_task"]
    },
    "closure_receipts": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "uniqueItems": true,
      "items": {"$ref": "closure-receipt.schema.json"}
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {"execution_mode": {"const": "independent_task"}},
        "required": ["execution_mode"]
      },
      "then": {
        "required": [
          "handoff_id",
          "contract_id",
          "dispatch_id",
          "closure_receipts"
        ]
      }
    },
    {
      "if": {"required": ["closure_receipts"]},
      "then": {
        "required": ["handoff_id", "contract_id", "dispatch_id"],
        "properties": {
          "closure_receipts": {
            "allOf": [
              {
                "contains": {
                  "properties": {"target": {"const": "employee_memory"}},
                  "required": ["target"]
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {"target": {"const": "employee_worklog"}},
                  "required": ["target"]
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {"target": {"const": "team_journal"}},
                  "required": ["target"]
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "properties": {"target": {"const": "central_board"}},
                  "required": ["target"]
                },
                "minContains": 1,
                "maxContains": 1
              }
            ]
          }
        }
      }
    },
    {
      "if": {"required": ["contract_id"]},
      "then": {
        "required": [
          "handoff_id",
          "contract_id",
          "dispatch_id",
          "closure_receipts"
        ]
      }
    }
  ]
}