deepdebug-local-agent 1.2.0 → 1.4.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 (123) hide show
  1. package/.github/workflows/deploy-gcp.yml +58 -26
  2. package/CHANGELOG.md +13 -0
  3. package/docs/la-protocol-v2.md +68 -0
  4. package/docs/ws-metadata-only.md +44 -0
  5. package/env.example +7 -0
  6. package/package.json +2 -1
  7. package/scripts/sync-la-protocol-v2-contract.mjs +58 -0
  8. package/src/la-protocol-v2/chunks.js +45 -0
  9. package/src/la-protocol-v2/config.js +27 -0
  10. package/src/la-protocol-v2/content.js +57 -0
  11. package/src/la-protocol-v2/contract/CONTRACT_SOURCE.json +81 -0
  12. package/src/la-protocol-v2/contract/README.md +103 -0
  13. package/src/la-protocol-v2/contract/ack.schema.json +51 -0
  14. package/src/la-protocol-v2/contract/alert.schema.json +62 -0
  15. package/src/la-protocol-v2/contract/approval.decision.schema.json +57 -0
  16. package/src/la-protocol-v2/contract/audit.event.schema.json +86 -0
  17. package/src/la-protocol-v2/contract/config.update.schema.json +73 -0
  18. package/src/la-protocol-v2/contract/content.request.schema.json +110 -0
  19. package/src/la-protocol-v2/contract/content.response.schema.json +90 -0
  20. package/src/la-protocol-v2/contract/defs.schema.json +191 -0
  21. package/src/la-protocol-v2/contract/envelope.schema.json +89 -0
  22. package/src/la-protocol-v2/contract/error.schema.json +59 -0
  23. package/src/la-protocol-v2/contract/heartbeat.schema.json +100 -0
  24. package/src/la-protocol-v2/contract/hello.schema.json +111 -0
  25. package/src/la-protocol-v2/contract/incident.candidate.schema.json +102 -0
  26. package/src/la-protocol-v2/contract/index.json +166 -0
  27. package/src/la-protocol-v2/contract/job.assign.schema.json +212 -0
  28. package/src/la-protocol-v2/contract/job.cancel.schema.json +52 -0
  29. package/src/la-protocol-v2/contract/job.event.schema.json +115 -0
  30. package/src/la-protocol-v2/contract/job.result.schema.json +100 -0
  31. package/src/la-protocol-v2/contract/log.stats.schema.json +79 -0
  32. package/src/la-protocol-v2/contract/ready.schema.json +106 -0
  33. package/src/la-protocol-v2/contract/register.schema.json +92 -0
  34. package/src/la-protocol-v2/contract/scan.upload.schema.json +59 -0
  35. package/src/la-protocol-v2/contract/scan.uploaded.schema.json +51 -0
  36. package/src/la-protocol-v2/contract/webhook.forward.schema.json +69 -0
  37. package/src/la-protocol-v2/contract.js +90 -0
  38. package/src/la-protocol-v2/errors.js +34 -0
  39. package/src/la-protocol-v2/index.js +8 -0
  40. package/src/la-protocol-v2/link.js +93 -0
  41. package/src/la-protocol-v2/runtime.js +72 -0
  42. package/src/la-protocol-v2/session.js +650 -0
  43. package/src/la-protocol-v2/strict-json.js +47 -0
  44. package/src/mcp-http-server.js +5 -3
  45. package/src/server.js +70 -9
  46. package/src/utils/exec-policy.js +8 -1
  47. package/src/ws-channel/allowlist.js +143 -0
  48. package/src/ws-channel/config.js +22 -0
  49. package/src/ws-channel/connection-state.js +18 -0
  50. package/src/ws-channel/index.js +6 -0
  51. package/src/ws-channel/metadata-guard.js +78 -0
  52. package/src/ws-channel/policy-offline.js +40 -0
  53. package/src/ws-channel/transit-guard.js +55 -0
  54. package/test/contract/la-protocol-v2/vectors/ack.vectors.json +149 -0
  55. package/test/contract/la-protocol-v2/vectors/alert.vectors.json +101 -0
  56. package/test/contract/la-protocol-v2/vectors/approval.decision.vectors.json +165 -0
  57. package/test/contract/la-protocol-v2/vectors/audit.event.vectors.json +156 -0
  58. package/test/contract/la-protocol-v2/vectors/config.update.vectors.json +189 -0
  59. package/test/contract/la-protocol-v2/vectors/content.request.vectors.json +325 -0
  60. package/test/contract/la-protocol-v2/vectors/content.response.vectors.json +413 -0
  61. package/test/contract/la-protocol-v2/vectors/cross-type.vectors.json +260 -0
  62. package/test/contract/la-protocol-v2/vectors/error.vectors.json +179 -0
  63. package/test/contract/la-protocol-v2/vectors/heartbeat.vectors.json +109 -0
  64. package/test/contract/la-protocol-v2/vectors/hello.vectors.json +224 -0
  65. package/test/contract/la-protocol-v2/vectors/incident.candidate.vectors.json +186 -0
  66. package/test/contract/la-protocol-v2/vectors/job.assign.vectors.json +631 -0
  67. package/test/contract/la-protocol-v2/vectors/job.cancel.vectors.json +133 -0
  68. package/test/contract/la-protocol-v2/vectors/job.event.vectors.json +233 -0
  69. package/test/contract/la-protocol-v2/vectors/job.result.vectors.json +137 -0
  70. package/test/contract/la-protocol-v2/vectors/log.stats.vectors.json +137 -0
  71. package/test/contract/la-protocol-v2/vectors/ready.vectors.json +177 -0
  72. package/test/contract/la-protocol-v2/vectors/register.vectors.json +399 -0
  73. package/test/contract/la-protocol-v2/vectors/scan.upload.vectors.json +137 -0
  74. package/test/contract/la-protocol-v2/vectors/scan.uploaded.vectors.json +101 -0
  75. package/test/contract/la-protocol-v2/vectors/traces/invalid-agent-mismatch.json +140 -0
  76. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-after-last.json +200 -0
  77. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-byte-length-mismatch.json +174 -0
  78. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-last-flag.json +200 -0
  79. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-out-of-order.json +200 -0
  80. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-total-changes.json +200 -0
  81. package/test/contract/la-protocol-v2/vectors/traces/invalid-clock-skew.json +46 -0
  82. package/test/contract/la-protocol-v2/vectors/traces/invalid-event-before-ready.json +72 -0
  83. package/test/contract/la-protocol-v2/vectors/traces/invalid-first-frame-not-register.json +48 -0
  84. package/test/contract/la-protocol-v2/vectors/traces/invalid-frame-over-48kib.json +141 -0
  85. package/test/contract/la-protocol-v2/vectors/traces/invalid-la-sends-job-assign.json +173 -0
  86. package/test/contract/la-protocol-v2/vectors/traces/invalid-params-raw-differs-from-payload.json +172 -0
  87. package/test/contract/la-protocol-v2/vectors/traces/invalid-payload-above-limit.json +174 -0
  88. package/test/contract/la-protocol-v2/vectors/traces/invalid-resume-restarts-seq.json +144 -0
  89. package/test/contract/la-protocol-v2/vectors/traces/invalid-seq-gap.json +166 -0
  90. package/test/contract/la-protocol-v2/vectors/traces/invalid-seq-repeated.json +166 -0
  91. package/test/contract/la-protocol-v2/vectors/traces/invalid-sig-tenant-mismatch.json +172 -0
  92. package/test/contract/la-protocol-v2/vectors/traces/invalid-signature-warn-with-enforce-required.json +77 -0
  93. package/test/contract/la-protocol-v2/vectors/traces/invalid-tenant-mismatch.json +140 -0
  94. package/test/contract/la-protocol-v2/vectors/traces/invalid-type-outside-allowlist.json +140 -0
  95. package/test/contract/la-protocol-v2/vectors/traces/valid-content-chunks-in-order.json +224 -0
  96. package/test/contract/la-protocol-v2/vectors/traces/valid-handshake-and-job.json +266 -0
  97. package/test/contract/la-protocol-v2/vectors/traces/valid-resume-continues-seq.json +168 -0
  98. package/test/contract/la-protocol-v2/vectors/traces/valid-retransmit-is-idempotent.json +193 -0
  99. package/test/contract/la-protocol-v2/vectors/webhook.forward.vectors.json +170 -0
  100. package/test/la-protocol-v2/contract.test.js +131 -0
  101. package/test/la-protocol-v2/helpers/la-rig.js +83 -0
  102. package/test/la-protocol-v2/helpers/reference-cp.js +349 -0
  103. package/test/la-protocol-v2/helpers/spawn-agent.js +35 -0
  104. package/test/la-protocol-v2/link.test.js +141 -0
  105. package/test/la-protocol-v2/session-inbound.test.js +279 -0
  106. package/test/la-protocol-v2/session-outbound.test.js +382 -0
  107. package/test/la-protocol-v2/traces.test.js +270 -0
  108. package/test/la-protocol-v2/tunnel-e2e.test.js +124 -0
  109. package/test/ws-channel/allowlist.test.js +67 -0
  110. package/test/ws-channel/metadata-guard.test.js +104 -0
  111. package/test/ws-channel/policy-offline.test.js +99 -0
  112. package/test/ws-channel/tunnel-e2e.test.js +88 -0
  113. package/tools/graphify-validation/extras/README.md +19 -0
  114. package/tools/graphify-validation/extras/bymethod.py +35 -0
  115. package/tools/graphify-validation/extras/docker/Dockerfile +16 -0
  116. package/tools/graphify-validation/extras/docker/inner.sh +7 -0
  117. package/tools/graphify-validation/extras/g10.py +59 -0
  118. package/tools/graphify-validation/extras/g3aug.py +49 -0
  119. package/tools/graphify-validation/extras/hybrid.py +34 -0
  120. package/tools/graphify-validation/extras/truth2.py +44 -0
  121. package/tools/interop/LaV2NodeInteropTest.java +266 -0
  122. package/tools/interop/README.md +21 -0
  123. package/tools/interop/la-interop-client.mjs +97 -0
@@ -0,0 +1,166 @@
1
+ {
2
+ "protocol": 2,
3
+ "baseId": "https://schemas.visionhammer.io/la-protocol-v2/",
4
+ "limits": {
5
+ "maxFrameBytes": 49152,
6
+ "chunkRawBytes": 32768,
7
+ "maxChunks": 64,
8
+ "maxContentBytes": 2097152,
9
+ "maxRetries": 3,
10
+ "ackTimeoutMs": 5000,
11
+ "handshakeTimeoutMs": 10000,
12
+ "heartbeatSeconds": 30,
13
+ "sessionDeadSeconds": 90,
14
+ "dedupeWindowSeconds": 600,
15
+ "clockSkewSeconds": 60
16
+ },
17
+ "types": {
18
+ "register": {
19
+ "schema": "register.schema.json",
20
+ "direction": "la->cp",
21
+ "control": true,
22
+ "signed": false,
23
+ "contentClass": "none"
24
+ },
25
+ "hello": {
26
+ "schema": "hello.schema.json",
27
+ "direction": "la->cp",
28
+ "control": true,
29
+ "signed": false,
30
+ "contentClass": "none"
31
+ },
32
+ "heartbeat": {
33
+ "schema": "heartbeat.schema.json",
34
+ "direction": "la->cp",
35
+ "control": false,
36
+ "signed": false,
37
+ "contentClass": "none"
38
+ },
39
+ "ready": {
40
+ "schema": "ready.schema.json",
41
+ "direction": "cp->la",
42
+ "control": true,
43
+ "signed": true,
44
+ "contentClass": "none"
45
+ },
46
+ "ack": {
47
+ "schema": "ack.schema.json",
48
+ "direction": "both",
49
+ "control": true,
50
+ "signed": false,
51
+ "contentClass": "none"
52
+ },
53
+ "error": {
54
+ "schema": "error.schema.json",
55
+ "direction": "both",
56
+ "control": true,
57
+ "signed": false,
58
+ "contentClass": "none"
59
+ },
60
+ "job.assign": {
61
+ "schema": "job.assign.schema.json",
62
+ "direction": "cp->la",
63
+ "control": false,
64
+ "signed": true,
65
+ "contentClass": "transit"
66
+ },
67
+ "job.cancel": {
68
+ "schema": "job.cancel.schema.json",
69
+ "direction": "cp->la",
70
+ "control": false,
71
+ "signed": true,
72
+ "contentClass": "none"
73
+ },
74
+ "job.event": {
75
+ "schema": "job.event.schema.json",
76
+ "direction": "la->cp",
77
+ "control": false,
78
+ "signed": false,
79
+ "contentClass": "none"
80
+ },
81
+ "job.result": {
82
+ "schema": "job.result.schema.json",
83
+ "direction": "la->cp",
84
+ "control": false,
85
+ "signed": false,
86
+ "contentClass": "none"
87
+ },
88
+ "content.request": {
89
+ "schema": "content.request.schema.json",
90
+ "direction": "cp->la",
91
+ "control": false,
92
+ "signed": true,
93
+ "contentClass": "none"
94
+ },
95
+ "content.response": {
96
+ "schema": "content.response.schema.json",
97
+ "direction": "la->cp",
98
+ "control": false,
99
+ "signed": false,
100
+ "contentClass": "relay"
101
+ },
102
+ "approval.decision": {
103
+ "schema": "approval.decision.schema.json",
104
+ "direction": "cp->la",
105
+ "control": false,
106
+ "signed": true,
107
+ "contentClass": "none"
108
+ },
109
+ "config.update": {
110
+ "schema": "config.update.schema.json",
111
+ "direction": "cp->la",
112
+ "control": false,
113
+ "signed": true,
114
+ "contentClass": "none"
115
+ },
116
+ "scan.upload": {
117
+ "schema": "scan.upload.schema.json",
118
+ "direction": "cp->la",
119
+ "control": false,
120
+ "signed": true,
121
+ "contentClass": "none"
122
+ },
123
+ "scan.uploaded": {
124
+ "schema": "scan.uploaded.schema.json",
125
+ "direction": "la->cp",
126
+ "control": false,
127
+ "signed": false,
128
+ "contentClass": "none"
129
+ },
130
+ "webhook.forward": {
131
+ "schema": "webhook.forward.schema.json",
132
+ "direction": "cp->la",
133
+ "control": false,
134
+ "signed": true,
135
+ "contentClass": "transit"
136
+ },
137
+ "incident.candidate": {
138
+ "schema": "incident.candidate.schema.json",
139
+ "direction": "la->cp",
140
+ "control": false,
141
+ "signed": false,
142
+ "contentClass": "none"
143
+ },
144
+ "log.stats": {
145
+ "schema": "log.stats.schema.json",
146
+ "direction": "la->cp",
147
+ "control": false,
148
+ "signed": false,
149
+ "contentClass": "none"
150
+ },
151
+ "audit.event": {
152
+ "schema": "audit.event.schema.json",
153
+ "direction": "la->cp",
154
+ "control": false,
155
+ "signed": false,
156
+ "contentClass": "none"
157
+ },
158
+ "alert": {
159
+ "schema": "alert.schema.json",
160
+ "direction": "la->cp",
161
+ "control": false,
162
+ "signed": false,
163
+ "contentClass": "none"
164
+ }
165
+ }
166
+ }
@@ -0,0 +1,212 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.visionhammer.io/la-protocol-v2/job.assign.schema.json",
4
+ "title": "LA protocol v2: job.assign (cp->la)",
5
+ "type": "object",
6
+ "allOf": [
7
+ {
8
+ "$ref": "envelope.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "type": {
13
+ "const": "job.assign"
14
+ },
15
+ "payload": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "jobId": {
20
+ "$ref": "defs.schema.json#/$defs/uuid"
21
+ },
22
+ "kind": {
23
+ "type": "string",
24
+ "enum": [
25
+ "fix",
26
+ "implement",
27
+ "quality"
28
+ ]
29
+ },
30
+ "incidentRef": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "properties": {
34
+ "id": {
35
+ "$ref": "defs.schema.json#/$defs/shortId"
36
+ },
37
+ "fingerprint": {
38
+ "type": "string",
39
+ "minLength": 8,
40
+ "maxLength": 64,
41
+ "pattern": "^[0-9a-f]{8,64}$"
42
+ }
43
+ },
44
+ "required": [
45
+ "id"
46
+ ]
47
+ },
48
+ "repoRef": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "provider": {
53
+ "type": "string",
54
+ "enum": [
55
+ "github",
56
+ "gitlab",
57
+ "bitbucket",
58
+ "azure",
59
+ "other"
60
+ ]
61
+ },
62
+ "org": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "maxLength": 100,
66
+ "pattern": "^[A-Za-z0-9_.-]{1,100}$"
67
+ },
68
+ "repo": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "maxLength": 100,
72
+ "pattern": "^[A-Za-z0-9_.-]{1,100}$"
73
+ },
74
+ "branch": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "maxLength": 255,
78
+ "pattern": "^[A-Za-z0-9_./-]{1,255}$"
79
+ }
80
+ },
81
+ "required": [
82
+ "provider",
83
+ "org",
84
+ "repo",
85
+ "branch"
86
+ ]
87
+ },
88
+ "policy": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "properties": {
92
+ "operationMode": {
93
+ "$ref": "defs.schema.json#/$defs/operationMode"
94
+ },
95
+ "automationLevel": {
96
+ "type": "integer",
97
+ "minimum": 0,
98
+ "maximum": 5
99
+ },
100
+ "ceiling": {
101
+ "$ref": "defs.schema.json#/$defs/operationMode"
102
+ }
103
+ },
104
+ "required": [
105
+ "operationMode",
106
+ "automationLevel",
107
+ "ceiling"
108
+ ]
109
+ },
110
+ "budget": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "properties": {
114
+ "tokens": {
115
+ "type": "integer",
116
+ "minimum": 1,
117
+ "maximum": 10000000
118
+ },
119
+ "seconds": {
120
+ "type": "integer",
121
+ "minimum": 1,
122
+ "maximum": 86400
123
+ }
124
+ },
125
+ "required": [
126
+ "tokens",
127
+ "seconds"
128
+ ]
129
+ },
130
+ "llm": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "properties": {
134
+ "alias": {
135
+ "$ref": "defs.schema.json#/$defs/shortId"
136
+ },
137
+ "keyRef": {
138
+ "$ref": "defs.schema.json#/$defs/shortId"
139
+ }
140
+ },
141
+ "required": [
142
+ "alias",
143
+ "keyRef"
144
+ ]
145
+ },
146
+ "inputs": {
147
+ "type": "array",
148
+ "maxItems": 4,
149
+ "items": {
150
+ "oneOf": [
151
+ {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "properties": {
155
+ "ref": {
156
+ "type": "string",
157
+ "minLength": 1,
158
+ "maxLength": 512,
159
+ "pattern": "^[^\\u0000-\\u001f]{1,512}$"
160
+ }
161
+ },
162
+ "required": [
163
+ "ref"
164
+ ]
165
+ },
166
+ {
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "properties": {
170
+ "inline": {
171
+ "type": "string",
172
+ "minLength": 1,
173
+ "maxLength": 4096,
174
+ "x-content-class": "transit"
175
+ },
176
+ "transient": {
177
+ "const": true
178
+ }
179
+ },
180
+ "required": [
181
+ "inline",
182
+ "transient"
183
+ ]
184
+ }
185
+ ]
186
+ }
187
+ }
188
+ },
189
+ "required": [
190
+ "jobId",
191
+ "kind",
192
+ "repoRef",
193
+ "policy",
194
+ "budget",
195
+ "llm"
196
+ ]
197
+ },
198
+ "seq": {
199
+ "type": "integer",
200
+ "minimum": 1,
201
+ "maximum": 9007199254740991
202
+ },
203
+ "chunk": false,
204
+ "sig": true,
205
+ "paramsRaw": true
206
+ },
207
+ "required": [
208
+ "payload",
209
+ "sig",
210
+ "paramsRaw"
211
+ ]
212
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.visionhammer.io/la-protocol-v2/job.cancel.schema.json",
4
+ "title": "LA protocol v2: job.cancel (cp->la)",
5
+ "type": "object",
6
+ "allOf": [
7
+ {
8
+ "$ref": "envelope.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "type": {
13
+ "const": "job.cancel"
14
+ },
15
+ "payload": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "jobId": {
20
+ "$ref": "defs.schema.json#/$defs/uuid"
21
+ },
22
+ "reason": {
23
+ "type": "string",
24
+ "enum": [
25
+ "user",
26
+ "timeout",
27
+ "killswitch",
28
+ "policy",
29
+ "superseded"
30
+ ]
31
+ }
32
+ },
33
+ "required": [
34
+ "jobId",
35
+ "reason"
36
+ ]
37
+ },
38
+ "seq": {
39
+ "type": "integer",
40
+ "minimum": 1,
41
+ "maximum": 9007199254740991
42
+ },
43
+ "chunk": false,
44
+ "sig": true,
45
+ "paramsRaw": true
46
+ },
47
+ "required": [
48
+ "payload",
49
+ "sig",
50
+ "paramsRaw"
51
+ ]
52
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.visionhammer.io/la-protocol-v2/job.event.schema.json",
4
+ "title": "LA protocol v2: job.event (la->cp)",
5
+ "type": "object",
6
+ "allOf": [
7
+ {
8
+ "$ref": "envelope.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "type": {
13
+ "const": "job.event"
14
+ },
15
+ "payload": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "jobId": {
20
+ "$ref": "defs.schema.json#/$defs/uuid"
21
+ },
22
+ "state": {
23
+ "type": "string",
24
+ "enum": [
25
+ "queued",
26
+ "running",
27
+ "waiting_approval",
28
+ "succeeded",
29
+ "failed",
30
+ "cancelled"
31
+ ]
32
+ },
33
+ "phase": {
34
+ "type": "string",
35
+ "enum": [
36
+ "init",
37
+ "context",
38
+ "plan",
39
+ "edit",
40
+ "validate",
41
+ "pr",
42
+ "done"
43
+ ]
44
+ },
45
+ "iteration": {
46
+ "type": "integer",
47
+ "minimum": 0,
48
+ "maximum": 1000
49
+ },
50
+ "filesRead": {
51
+ "type": "integer",
52
+ "minimum": 0,
53
+ "maximum": 9007199254740991
54
+ },
55
+ "filesChanged": {
56
+ "type": "integer",
57
+ "minimum": 0,
58
+ "maximum": 9007199254740991
59
+ },
60
+ "tokensIn": {
61
+ "type": "integer",
62
+ "minimum": 0,
63
+ "maximum": 9007199254740991
64
+ },
65
+ "tokensOut": {
66
+ "type": "integer",
67
+ "minimum": 0,
68
+ "maximum": 9007199254740991
69
+ },
70
+ "costUsd": {
71
+ "type": "number",
72
+ "minimum": 0,
73
+ "maximum": 100000
74
+ },
75
+ "durationMs": {
76
+ "type": "integer",
77
+ "minimum": 0,
78
+ "maximum": 9007199254740991
79
+ },
80
+ "errorCode": {
81
+ "type": "string",
82
+ "enum": [
83
+ "none",
84
+ "llm_error",
85
+ "policy_denied",
86
+ "build_failed",
87
+ "tests_failed",
88
+ "timeout",
89
+ "cancelled",
90
+ "budget_exceeded",
91
+ "infra",
92
+ "unknown"
93
+ ]
94
+ }
95
+ },
96
+ "required": [
97
+ "jobId",
98
+ "state"
99
+ ]
100
+ },
101
+ "seq": {
102
+ "type": "integer",
103
+ "minimum": 1,
104
+ "maximum": 9007199254740991
105
+ },
106
+ "chunk": false,
107
+ "sig": false,
108
+ "paramsRaw": false,
109
+ "agentId": true
110
+ },
111
+ "required": [
112
+ "payload",
113
+ "agentId"
114
+ ]
115
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.visionhammer.io/la-protocol-v2/job.result.schema.json",
4
+ "title": "LA protocol v2: job.result (la->cp)",
5
+ "type": "object",
6
+ "allOf": [
7
+ {
8
+ "$ref": "envelope.schema.json"
9
+ }
10
+ ],
11
+ "properties": {
12
+ "type": {
13
+ "const": "job.result"
14
+ },
15
+ "payload": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "jobId": {
20
+ "$ref": "defs.schema.json#/$defs/uuid"
21
+ },
22
+ "outcome": {
23
+ "type": "string",
24
+ "enum": [
25
+ "pr_opened",
26
+ "no_change",
27
+ "failed",
28
+ "cancelled"
29
+ ]
30
+ },
31
+ "prUrl": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 512,
35
+ "pattern": "^https://[^\\s]{1,500}$"
36
+ },
37
+ "branch": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "maxLength": 255,
41
+ "pattern": "^[A-Za-z0-9_./-]{1,255}$"
42
+ },
43
+ "commitSha": {
44
+ "$ref": "defs.schema.json#/$defs/gitSha"
45
+ },
46
+ "filesChangedCount": {
47
+ "type": "integer",
48
+ "minimum": 0,
49
+ "maximum": 9007199254740991
50
+ },
51
+ "diffSha256": {
52
+ "$ref": "defs.schema.json#/$defs/sha256"
53
+ },
54
+ "tests": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "properties": {
58
+ "pass": {
59
+ "type": "integer",
60
+ "minimum": 0,
61
+ "maximum": 9007199254740991
62
+ },
63
+ "fail": {
64
+ "type": "integer",
65
+ "minimum": 0,
66
+ "maximum": 9007199254740991
67
+ },
68
+ "skip": {
69
+ "type": "integer",
70
+ "minimum": 0,
71
+ "maximum": 9007199254740991
72
+ }
73
+ },
74
+ "required": [
75
+ "pass",
76
+ "fail",
77
+ "skip"
78
+ ]
79
+ }
80
+ },
81
+ "required": [
82
+ "jobId",
83
+ "outcome"
84
+ ]
85
+ },
86
+ "seq": {
87
+ "type": "integer",
88
+ "minimum": 1,
89
+ "maximum": 9007199254740991
90
+ },
91
+ "chunk": false,
92
+ "sig": false,
93
+ "paramsRaw": false,
94
+ "agentId": true
95
+ },
96
+ "required": [
97
+ "payload",
98
+ "agentId"
99
+ ]
100
+ }