deepdebug-local-agent 1.3.0 → 1.5.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 +6 -0
  3. package/docs/la-protocol-v2.md +102 -0
  4. package/package.json +2 -1
  5. package/scripts/sync-la-protocol-v2-contract.mjs +58 -0
  6. package/src/la-protocol-v2/chunks.js +45 -0
  7. package/src/la-protocol-v2/config.js +27 -0
  8. package/src/la-protocol-v2/content-handlers/audit.js +36 -0
  9. package/src/la-protocol-v2/content-handlers/config.js +48 -0
  10. package/src/la-protocol-v2/content-handlers/egress.js +65 -0
  11. package/src/la-protocol-v2/content-handlers/git-diff.js +92 -0
  12. package/src/la-protocol-v2/content-handlers/handler.js +170 -0
  13. package/src/la-protocol-v2/content-handlers/index.js +6 -0
  14. package/src/la-protocol-v2/content-handlers/install.js +50 -0
  15. package/src/la-protocol-v2/content-handlers/path-guard.js +142 -0
  16. package/src/la-protocol-v2/content-handlers/ref-registry.js +87 -0
  17. package/src/la-protocol-v2/content.js +63 -0
  18. package/src/la-protocol-v2/contract/CONTRACT_SOURCE.json +81 -0
  19. package/src/la-protocol-v2/contract/README.md +103 -0
  20. package/src/la-protocol-v2/contract/ack.schema.json +51 -0
  21. package/src/la-protocol-v2/contract/alert.schema.json +62 -0
  22. package/src/la-protocol-v2/contract/approval.decision.schema.json +57 -0
  23. package/src/la-protocol-v2/contract/audit.event.schema.json +86 -0
  24. package/src/la-protocol-v2/contract/config.update.schema.json +73 -0
  25. package/src/la-protocol-v2/contract/content.request.schema.json +110 -0
  26. package/src/la-protocol-v2/contract/content.response.schema.json +90 -0
  27. package/src/la-protocol-v2/contract/defs.schema.json +191 -0
  28. package/src/la-protocol-v2/contract/envelope.schema.json +89 -0
  29. package/src/la-protocol-v2/contract/error.schema.json +59 -0
  30. package/src/la-protocol-v2/contract/heartbeat.schema.json +100 -0
  31. package/src/la-protocol-v2/contract/hello.schema.json +111 -0
  32. package/src/la-protocol-v2/contract/incident.candidate.schema.json +102 -0
  33. package/src/la-protocol-v2/contract/index.json +166 -0
  34. package/src/la-protocol-v2/contract/job.assign.schema.json +212 -0
  35. package/src/la-protocol-v2/contract/job.cancel.schema.json +52 -0
  36. package/src/la-protocol-v2/contract/job.event.schema.json +115 -0
  37. package/src/la-protocol-v2/contract/job.result.schema.json +100 -0
  38. package/src/la-protocol-v2/contract/log.stats.schema.json +79 -0
  39. package/src/la-protocol-v2/contract/ready.schema.json +106 -0
  40. package/src/la-protocol-v2/contract/register.schema.json +92 -0
  41. package/src/la-protocol-v2/contract/scan.upload.schema.json +59 -0
  42. package/src/la-protocol-v2/contract/scan.uploaded.schema.json +51 -0
  43. package/src/la-protocol-v2/contract/webhook.forward.schema.json +69 -0
  44. package/src/la-protocol-v2/contract.js +90 -0
  45. package/src/la-protocol-v2/errors.js +34 -0
  46. package/src/la-protocol-v2/index.js +8 -0
  47. package/src/la-protocol-v2/link.js +93 -0
  48. package/src/la-protocol-v2/runtime.js +81 -0
  49. package/src/la-protocol-v2/session.js +650 -0
  50. package/src/la-protocol-v2/strict-json.js +47 -0
  51. package/src/server.js +25 -4
  52. package/test/contract/la-protocol-v2/vectors/ack.vectors.json +149 -0
  53. package/test/contract/la-protocol-v2/vectors/alert.vectors.json +101 -0
  54. package/test/contract/la-protocol-v2/vectors/approval.decision.vectors.json +165 -0
  55. package/test/contract/la-protocol-v2/vectors/audit.event.vectors.json +156 -0
  56. package/test/contract/la-protocol-v2/vectors/config.update.vectors.json +189 -0
  57. package/test/contract/la-protocol-v2/vectors/content.request.vectors.json +325 -0
  58. package/test/contract/la-protocol-v2/vectors/content.response.vectors.json +413 -0
  59. package/test/contract/la-protocol-v2/vectors/cross-type.vectors.json +260 -0
  60. package/test/contract/la-protocol-v2/vectors/error.vectors.json +179 -0
  61. package/test/contract/la-protocol-v2/vectors/heartbeat.vectors.json +109 -0
  62. package/test/contract/la-protocol-v2/vectors/hello.vectors.json +224 -0
  63. package/test/contract/la-protocol-v2/vectors/incident.candidate.vectors.json +186 -0
  64. package/test/contract/la-protocol-v2/vectors/job.assign.vectors.json +631 -0
  65. package/test/contract/la-protocol-v2/vectors/job.cancel.vectors.json +133 -0
  66. package/test/contract/la-protocol-v2/vectors/job.event.vectors.json +233 -0
  67. package/test/contract/la-protocol-v2/vectors/job.result.vectors.json +137 -0
  68. package/test/contract/la-protocol-v2/vectors/log.stats.vectors.json +137 -0
  69. package/test/contract/la-protocol-v2/vectors/ready.vectors.json +177 -0
  70. package/test/contract/la-protocol-v2/vectors/register.vectors.json +399 -0
  71. package/test/contract/la-protocol-v2/vectors/scan.upload.vectors.json +137 -0
  72. package/test/contract/la-protocol-v2/vectors/scan.uploaded.vectors.json +101 -0
  73. package/test/contract/la-protocol-v2/vectors/traces/invalid-agent-mismatch.json +140 -0
  74. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-after-last.json +200 -0
  75. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-byte-length-mismatch.json +174 -0
  76. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-last-flag.json +200 -0
  77. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-out-of-order.json +200 -0
  78. package/test/contract/la-protocol-v2/vectors/traces/invalid-chunk-total-changes.json +200 -0
  79. package/test/contract/la-protocol-v2/vectors/traces/invalid-clock-skew.json +46 -0
  80. package/test/contract/la-protocol-v2/vectors/traces/invalid-event-before-ready.json +72 -0
  81. package/test/contract/la-protocol-v2/vectors/traces/invalid-first-frame-not-register.json +48 -0
  82. package/test/contract/la-protocol-v2/vectors/traces/invalid-frame-over-48kib.json +141 -0
  83. package/test/contract/la-protocol-v2/vectors/traces/invalid-la-sends-job-assign.json +173 -0
  84. package/test/contract/la-protocol-v2/vectors/traces/invalid-params-raw-differs-from-payload.json +172 -0
  85. package/test/contract/la-protocol-v2/vectors/traces/invalid-payload-above-limit.json +174 -0
  86. package/test/contract/la-protocol-v2/vectors/traces/invalid-resume-restarts-seq.json +144 -0
  87. package/test/contract/la-protocol-v2/vectors/traces/invalid-seq-gap.json +166 -0
  88. package/test/contract/la-protocol-v2/vectors/traces/invalid-seq-repeated.json +166 -0
  89. package/test/contract/la-protocol-v2/vectors/traces/invalid-sig-tenant-mismatch.json +172 -0
  90. package/test/contract/la-protocol-v2/vectors/traces/invalid-signature-warn-with-enforce-required.json +77 -0
  91. package/test/contract/la-protocol-v2/vectors/traces/invalid-tenant-mismatch.json +140 -0
  92. package/test/contract/la-protocol-v2/vectors/traces/invalid-type-outside-allowlist.json +140 -0
  93. package/test/contract/la-protocol-v2/vectors/traces/valid-content-chunks-in-order.json +224 -0
  94. package/test/contract/la-protocol-v2/vectors/traces/valid-handshake-and-job.json +266 -0
  95. package/test/contract/la-protocol-v2/vectors/traces/valid-resume-continues-seq.json +168 -0
  96. package/test/contract/la-protocol-v2/vectors/traces/valid-retransmit-is-idempotent.json +193 -0
  97. package/test/contract/la-protocol-v2/vectors/webhook.forward.vectors.json +170 -0
  98. package/test/la-protocol-v2/content-handlers.test.js +633 -0
  99. package/test/la-protocol-v2/content-path-guard.test.js +214 -0
  100. package/test/la-protocol-v2/content-wiring.test.js +225 -0
  101. package/test/la-protocol-v2/contract.test.js +131 -0
  102. package/test/la-protocol-v2/helpers/content-rig.js +94 -0
  103. package/test/la-protocol-v2/helpers/la-rig.js +83 -0
  104. package/test/la-protocol-v2/helpers/reference-cp.js +349 -0
  105. package/test/la-protocol-v2/helpers/spawn-agent.js +36 -0
  106. package/test/la-protocol-v2/link.test.js +141 -0
  107. package/test/la-protocol-v2/session-inbound.test.js +279 -0
  108. package/test/la-protocol-v2/session-outbound.test.js +382 -0
  109. package/test/la-protocol-v2/traces.test.js +270 -0
  110. package/test/la-protocol-v2/tunnel-e2e.test.js +124 -0
  111. package/tools/graphify-validation/extras/README.md +19 -0
  112. package/tools/graphify-validation/extras/bymethod.py +35 -0
  113. package/tools/graphify-validation/extras/docker/Dockerfile +16 -0
  114. package/tools/graphify-validation/extras/docker/inner.sh +7 -0
  115. package/tools/graphify-validation/extras/g10.py +59 -0
  116. package/tools/graphify-validation/extras/g3aug.py +49 -0
  117. package/tools/graphify-validation/extras/hybrid.py +34 -0
  118. package/tools/graphify-validation/extras/truth2.py +44 -0
  119. package/tools/interop/LaV2NodeContentInteropTest.java +248 -0
  120. package/tools/interop/LaV2NodeInteropTest.java +266 -0
  121. package/tools/interop/README.md +38 -0
  122. package/tools/interop/la-interop-client.mjs +97 -0
  123. package/tools/interop/la-interop-content-client.mjs +91 -0
@@ -0,0 +1,200 @@
1
+ {
2
+ "name": "invalid-chunk-total-changes",
3
+ "why": "total changes from 3 to 4 mid-stream",
4
+ "session": {
5
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
6
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
7
+ "requireEnforce": true,
8
+ "now": "2026-10-29T10:00:00Z"
9
+ },
10
+ "frames": [
11
+ {
12
+ "dir": "la->cp",
13
+ "frame": {
14
+ "schemaVersion": 2,
15
+ "type": "register",
16
+ "msgId": "00000000-0000-4000-8000-000000009000",
17
+ "seq": 0,
18
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
19
+ "workspaceId": "ws-1",
20
+ "ts": "2026-10-29T10:00:00Z",
21
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
22
+ "payload": {
23
+ "protocol": 2,
24
+ "laVersion": "2.4.0",
25
+ "capabilities": [
26
+ "content.request",
27
+ "job.assign",
28
+ "incident.detect"
29
+ ],
30
+ "signatureMode": "enforce",
31
+ "workspaces": [
32
+ {
33
+ "workspaceId": "ws-1",
34
+ "pathSha256": "abababababababababababababababababababababababababababababababab"
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "dir": "la->cp",
42
+ "frame": {
43
+ "schemaVersion": 2,
44
+ "type": "hello",
45
+ "msgId": "00000000-0000-4000-8000-000000009000",
46
+ "seq": 0,
47
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
48
+ "workspaceId": "ws-1",
49
+ "ts": "2026-10-29T10:00:00Z",
50
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
51
+ "payload": {
52
+ "laVersion": "2.4.0",
53
+ "capabilities": [
54
+ "content.request",
55
+ "job.assign"
56
+ ],
57
+ "signatureMode": "enforce",
58
+ "graphify": {
59
+ "state": "ready",
60
+ "nodes": 12840,
61
+ "edges": 40211,
62
+ "commit": "9fceb02d",
63
+ "ageSeconds": 300
64
+ },
65
+ "diskFreeBytes": 52428800000,
66
+ "queueDepth": 0,
67
+ "clockEpochMs": 1793268000000
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "dir": "cp->la",
73
+ "frame": {
74
+ "schemaVersion": 2,
75
+ "type": "ready",
76
+ "msgId": "00000000-0000-4000-8000-000000009000",
77
+ "seq": 0,
78
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
79
+ "workspaceId": "ws-1",
80
+ "ts": "2026-10-29T10:00:00Z",
81
+ "paramsRaw": "{\"protocol\":2,\"sessionId\":\"e5f6a7b8-c9d0-4e1f-8a2b-4c5d6e7f8091\",\"resumed\":false,\"peerLastSeq\":0,\"limits\":{\"maxFrameBytes\":49152,\"chunkRawBytes\":32768,\"maxChunks\":64,\"ackTimeoutMs\":5000,\"maxRetries\":3,\"heartbeatSeconds\":30,\"contentFirstByteMs\":10000,\"contentTotalMs\":30000}}",
82
+ "sig": {
83
+ "keyId": "vh-cp-2026-10",
84
+ "timestamp": "1793268000",
85
+ "nonce": "Zm9vYmFyYmF6cXV4MTIzNDU2",
86
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
87
+ "workspaceId": "ws-1",
88
+ "signature": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
89
+ },
90
+ "payload": {
91
+ "protocol": 2,
92
+ "sessionId": "e5f6a7b8-c9d0-4e1f-8a2b-4c5d6e7f8091",
93
+ "resumed": false,
94
+ "peerLastSeq": 0,
95
+ "limits": {
96
+ "maxFrameBytes": 49152,
97
+ "chunkRawBytes": 32768,
98
+ "maxChunks": 64,
99
+ "ackTimeoutMs": 5000,
100
+ "maxRetries": 3,
101
+ "heartbeatSeconds": 30,
102
+ "contentFirstByteMs": 10000,
103
+ "contentTotalMs": 30000
104
+ }
105
+ }
106
+ }
107
+ },
108
+ {
109
+ "dir": "cp->la",
110
+ "frame": {
111
+ "schemaVersion": 2,
112
+ "type": "content.request",
113
+ "msgId": "00000000-0000-4000-8000-000000000001",
114
+ "seq": 1,
115
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
116
+ "workspaceId": "ws-1",
117
+ "ts": "2026-10-29T10:00:00Z",
118
+ "paramsRaw": "{\"kind\":\"file\",\"ref\":\"src/main/java/acme/PaymentService.java\",\"range\":{\"offset\":0,\"length\":65536},\"actor\":{\"userId\":\"usr-42\",\"role\":\"member\"}}",
119
+ "sig": {
120
+ "keyId": "vh-cp-2026-10",
121
+ "timestamp": "1793268000",
122
+ "nonce": "Zm9vYmFyYmF6cXV4MTIzNDU2",
123
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
124
+ "workspaceId": "ws-1",
125
+ "signature": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
126
+ },
127
+ "requestId": "d4e5f6a7-b8c9-4d0e-9f1a-3b4c5d6e7f80",
128
+ "payload": {
129
+ "kind": "file",
130
+ "ref": "src/main/java/acme/PaymentService.java",
131
+ "range": {
132
+ "offset": 0,
133
+ "length": 65536
134
+ },
135
+ "actor": {
136
+ "userId": "usr-42",
137
+ "role": "member"
138
+ }
139
+ }
140
+ }
141
+ },
142
+ {
143
+ "dir": "la->cp",
144
+ "frame": {
145
+ "schemaVersion": 2,
146
+ "type": "content.response",
147
+ "msgId": "00000000-0000-4000-8000-000000000001",
148
+ "seq": 1,
149
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
150
+ "workspaceId": "ws-1",
151
+ "ts": "2026-10-29T10:00:00Z",
152
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
153
+ "requestId": "d4e5f6a7-b8c9-4d0e-9f1a-3b4c5d6e7f80",
154
+ "chunk": {
155
+ "index": 0,
156
+ "total": 3,
157
+ "last": false
158
+ },
159
+ "payload": {
160
+ "status": "ok",
161
+ "contentType": "text/plain",
162
+ "encoding": "base64",
163
+ "data": "SGVsbG8gZnJvbSB0aGUgTG9jYWwgQWdlbnQ=",
164
+ "byteLength": 26
165
+ }
166
+ }
167
+ },
168
+ {
169
+ "dir": "la->cp",
170
+ "frame": {
171
+ "schemaVersion": 2,
172
+ "type": "content.response",
173
+ "msgId": "00000000-0000-4000-8000-000000000002",
174
+ "seq": 2,
175
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
176
+ "workspaceId": "ws-1",
177
+ "ts": "2026-10-29T10:00:00Z",
178
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
179
+ "requestId": "d4e5f6a7-b8c9-4d0e-9f1a-3b4c5d6e7f80",
180
+ "chunk": {
181
+ "index": 1,
182
+ "total": 4,
183
+ "last": false
184
+ },
185
+ "payload": {
186
+ "status": "ok",
187
+ "contentType": "text/plain",
188
+ "encoding": "base64",
189
+ "data": "SGVsbG8gZnJvbSB0aGUgTG9jYWwgQWdlbnQ=",
190
+ "byteLength": 26
191
+ }
192
+ }
193
+ }
194
+ ],
195
+ "expect": {
196
+ "ok": false,
197
+ "error": "chunk_inconsistent",
198
+ "atFrame": 5
199
+ }
200
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "invalid-clock-skew",
3
+ "why": "register ts 5 minutes off the CP clock",
4
+ "session": {
5
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
6
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
7
+ "requireEnforce": true,
8
+ "now": "2026-10-29T10:00:00Z"
9
+ },
10
+ "frames": [
11
+ {
12
+ "dir": "la->cp",
13
+ "frame": {
14
+ "schemaVersion": 2,
15
+ "type": "register",
16
+ "msgId": "00000000-0000-4000-8000-000000009000",
17
+ "seq": 0,
18
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
19
+ "workspaceId": "ws-1",
20
+ "ts": "2026-10-29T10:05:00Z",
21
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
22
+ "payload": {
23
+ "protocol": 2,
24
+ "laVersion": "2.4.0",
25
+ "capabilities": [
26
+ "content.request",
27
+ "job.assign",
28
+ "incident.detect"
29
+ ],
30
+ "signatureMode": "enforce",
31
+ "workspaces": [
32
+ {
33
+ "workspaceId": "ws-1",
34
+ "pathSha256": "abababababababababababababababababababababababababababababababab"
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ ],
41
+ "expect": {
42
+ "ok": false,
43
+ "error": "clock_skew",
44
+ "atFrame": 0
45
+ }
46
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "invalid-event-before-ready",
3
+ "why": "job.event before hello/ready",
4
+ "session": {
5
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
6
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
7
+ "requireEnforce": true,
8
+ "now": "2026-10-29T10:00:00Z"
9
+ },
10
+ "frames": [
11
+ {
12
+ "dir": "la->cp",
13
+ "frame": {
14
+ "schemaVersion": 2,
15
+ "type": "register",
16
+ "msgId": "00000000-0000-4000-8000-000000009000",
17
+ "seq": 0,
18
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
19
+ "workspaceId": "ws-1",
20
+ "ts": "2026-10-29T10:00:00Z",
21
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
22
+ "payload": {
23
+ "protocol": 2,
24
+ "laVersion": "2.4.0",
25
+ "capabilities": [
26
+ "content.request",
27
+ "job.assign",
28
+ "incident.detect"
29
+ ],
30
+ "signatureMode": "enforce",
31
+ "workspaces": [
32
+ {
33
+ "workspaceId": "ws-1",
34
+ "pathSha256": "abababababababababababababababababababababababababababababababab"
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "dir": "la->cp",
42
+ "frame": {
43
+ "schemaVersion": 2,
44
+ "type": "job.event",
45
+ "msgId": "00000000-0000-4000-8000-000000000001",
46
+ "seq": 1,
47
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
48
+ "workspaceId": "ws-1",
49
+ "ts": "2026-10-29T10:00:00Z",
50
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
51
+ "payload": {
52
+ "jobId": "c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
53
+ "state": "running",
54
+ "phase": "edit",
55
+ "iteration": 2,
56
+ "filesRead": 14,
57
+ "filesChanged": 1,
58
+ "tokensIn": 8200,
59
+ "tokensOut": 1300,
60
+ "costUsd": 0.042,
61
+ "durationMs": 61000,
62
+ "errorCode": "none"
63
+ }
64
+ }
65
+ }
66
+ ],
67
+ "expect": {
68
+ "ok": false,
69
+ "error": "not_ready",
70
+ "atFrame": 1
71
+ }
72
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "invalid-first-frame-not-register",
3
+ "why": "first LA frame must be register",
4
+ "session": {
5
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
6
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
7
+ "requireEnforce": true,
8
+ "now": "2026-10-29T10:00:00Z"
9
+ },
10
+ "frames": [
11
+ {
12
+ "dir": "la->cp",
13
+ "frame": {
14
+ "schemaVersion": 2,
15
+ "type": "hello",
16
+ "msgId": "00000000-0000-4000-8000-000000009000",
17
+ "seq": 0,
18
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
19
+ "workspaceId": "ws-1",
20
+ "ts": "2026-10-29T10:00:00Z",
21
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
22
+ "payload": {
23
+ "laVersion": "2.4.0",
24
+ "capabilities": [
25
+ "content.request",
26
+ "job.assign"
27
+ ],
28
+ "signatureMode": "enforce",
29
+ "graphify": {
30
+ "state": "ready",
31
+ "nodes": 12840,
32
+ "edges": 40211,
33
+ "commit": "9fceb02d",
34
+ "ageSeconds": 300
35
+ },
36
+ "diskFreeBytes": 52428800000,
37
+ "queueDepth": 0,
38
+ "clockEpochMs": 1793268000000
39
+ }
40
+ }
41
+ }
42
+ ],
43
+ "expect": {
44
+ "ok": false,
45
+ "error": "handshake_violation",
46
+ "atFrame": 0
47
+ }
48
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "name": "invalid-frame-over-48kib",
3
+ "why": "valid frame padded with whitespace to 50000 bytes",
4
+ "session": {
5
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
6
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
7
+ "requireEnforce": true,
8
+ "now": "2026-10-29T10:00:00Z"
9
+ },
10
+ "frames": [
11
+ {
12
+ "dir": "la->cp",
13
+ "frame": {
14
+ "schemaVersion": 2,
15
+ "type": "register",
16
+ "msgId": "00000000-0000-4000-8000-000000009000",
17
+ "seq": 0,
18
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
19
+ "workspaceId": "ws-1",
20
+ "ts": "2026-10-29T10:00:00Z",
21
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
22
+ "payload": {
23
+ "protocol": 2,
24
+ "laVersion": "2.4.0",
25
+ "capabilities": [
26
+ "content.request",
27
+ "job.assign",
28
+ "incident.detect"
29
+ ],
30
+ "signatureMode": "enforce",
31
+ "workspaces": [
32
+ {
33
+ "workspaceId": "ws-1",
34
+ "pathSha256": "abababababababababababababababababababababababababababababababab"
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "dir": "la->cp",
42
+ "frame": {
43
+ "schemaVersion": 2,
44
+ "type": "hello",
45
+ "msgId": "00000000-0000-4000-8000-000000009000",
46
+ "seq": 0,
47
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
48
+ "workspaceId": "ws-1",
49
+ "ts": "2026-10-29T10:00:00Z",
50
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
51
+ "payload": {
52
+ "laVersion": "2.4.0",
53
+ "capabilities": [
54
+ "content.request",
55
+ "job.assign"
56
+ ],
57
+ "signatureMode": "enforce",
58
+ "graphify": {
59
+ "state": "ready",
60
+ "nodes": 12840,
61
+ "edges": 40211,
62
+ "commit": "9fceb02d",
63
+ "ageSeconds": 300
64
+ },
65
+ "diskFreeBytes": 52428800000,
66
+ "queueDepth": 0,
67
+ "clockEpochMs": 1793268000000
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "dir": "cp->la",
73
+ "frame": {
74
+ "schemaVersion": 2,
75
+ "type": "ready",
76
+ "msgId": "00000000-0000-4000-8000-000000009000",
77
+ "seq": 0,
78
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
79
+ "workspaceId": "ws-1",
80
+ "ts": "2026-10-29T10:00:00Z",
81
+ "paramsRaw": "{\"protocol\":2,\"sessionId\":\"e5f6a7b8-c9d0-4e1f-8a2b-4c5d6e7f8091\",\"resumed\":false,\"peerLastSeq\":0,\"limits\":{\"maxFrameBytes\":49152,\"chunkRawBytes\":32768,\"maxChunks\":64,\"ackTimeoutMs\":5000,\"maxRetries\":3,\"heartbeatSeconds\":30,\"contentFirstByteMs\":10000,\"contentTotalMs\":30000}}",
82
+ "sig": {
83
+ "keyId": "vh-cp-2026-10",
84
+ "timestamp": "1793268000",
85
+ "nonce": "Zm9vYmFyYmF6cXV4MTIzNDU2",
86
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
87
+ "workspaceId": "ws-1",
88
+ "signature": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
89
+ },
90
+ "payload": {
91
+ "protocol": 2,
92
+ "sessionId": "e5f6a7b8-c9d0-4e1f-8a2b-4c5d6e7f8091",
93
+ "resumed": false,
94
+ "peerLastSeq": 0,
95
+ "limits": {
96
+ "maxFrameBytes": 49152,
97
+ "chunkRawBytes": 32768,
98
+ "maxChunks": 64,
99
+ "ackTimeoutMs": 5000,
100
+ "maxRetries": 3,
101
+ "heartbeatSeconds": 30,
102
+ "contentFirstByteMs": 10000,
103
+ "contentTotalMs": 30000
104
+ }
105
+ }
106
+ }
107
+ },
108
+ {
109
+ "dir": "la->cp",
110
+ "frame": {
111
+ "schemaVersion": 2,
112
+ "type": "job.event",
113
+ "msgId": "00000000-0000-4000-8000-000000000001",
114
+ "seq": 1,
115
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
116
+ "workspaceId": "ws-1",
117
+ "ts": "2026-10-29T10:00:00Z",
118
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
119
+ "payload": {
120
+ "jobId": "c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
121
+ "state": "running",
122
+ "phase": "edit",
123
+ "iteration": 2,
124
+ "filesRead": 14,
125
+ "filesChanged": 1,
126
+ "tokensIn": 8200,
127
+ "tokensOut": 1300,
128
+ "costUsd": 0.042,
129
+ "durationMs": 61000,
130
+ "errorCode": "none"
131
+ }
132
+ },
133
+ "inflateBytesTo": 50000
134
+ }
135
+ ],
136
+ "expect": {
137
+ "ok": false,
138
+ "error": "frame_too_large",
139
+ "atFrame": 3
140
+ }
141
+ }
@@ -0,0 +1,173 @@
1
+ {
2
+ "name": "invalid-la-sends-job-assign",
3
+ "why": "job.assign is CP->LA only",
4
+ "session": {
5
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
6
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
7
+ "requireEnforce": true,
8
+ "now": "2026-10-29T10:00:00Z"
9
+ },
10
+ "frames": [
11
+ {
12
+ "dir": "la->cp",
13
+ "frame": {
14
+ "schemaVersion": 2,
15
+ "type": "register",
16
+ "msgId": "00000000-0000-4000-8000-000000009000",
17
+ "seq": 0,
18
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
19
+ "workspaceId": "ws-1",
20
+ "ts": "2026-10-29T10:00:00Z",
21
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
22
+ "payload": {
23
+ "protocol": 2,
24
+ "laVersion": "2.4.0",
25
+ "capabilities": [
26
+ "content.request",
27
+ "job.assign",
28
+ "incident.detect"
29
+ ],
30
+ "signatureMode": "enforce",
31
+ "workspaces": [
32
+ {
33
+ "workspaceId": "ws-1",
34
+ "pathSha256": "abababababababababababababababababababababababababababababababab"
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "dir": "la->cp",
42
+ "frame": {
43
+ "schemaVersion": 2,
44
+ "type": "hello",
45
+ "msgId": "00000000-0000-4000-8000-000000009000",
46
+ "seq": 0,
47
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
48
+ "workspaceId": "ws-1",
49
+ "ts": "2026-10-29T10:00:00Z",
50
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
51
+ "payload": {
52
+ "laVersion": "2.4.0",
53
+ "capabilities": [
54
+ "content.request",
55
+ "job.assign"
56
+ ],
57
+ "signatureMode": "enforce",
58
+ "graphify": {
59
+ "state": "ready",
60
+ "nodes": 12840,
61
+ "edges": 40211,
62
+ "commit": "9fceb02d",
63
+ "ageSeconds": 300
64
+ },
65
+ "diskFreeBytes": 52428800000,
66
+ "queueDepth": 0,
67
+ "clockEpochMs": 1793268000000
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "dir": "cp->la",
73
+ "frame": {
74
+ "schemaVersion": 2,
75
+ "type": "ready",
76
+ "msgId": "00000000-0000-4000-8000-000000009000",
77
+ "seq": 0,
78
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
79
+ "workspaceId": "ws-1",
80
+ "ts": "2026-10-29T10:00:00Z",
81
+ "paramsRaw": "{\"protocol\":2,\"sessionId\":\"e5f6a7b8-c9d0-4e1f-8a2b-4c5d6e7f8091\",\"resumed\":false,\"peerLastSeq\":0,\"limits\":{\"maxFrameBytes\":49152,\"chunkRawBytes\":32768,\"maxChunks\":64,\"ackTimeoutMs\":5000,\"maxRetries\":3,\"heartbeatSeconds\":30,\"contentFirstByteMs\":10000,\"contentTotalMs\":30000}}",
82
+ "sig": {
83
+ "keyId": "vh-cp-2026-10",
84
+ "timestamp": "1793268000",
85
+ "nonce": "Zm9vYmFyYmF6cXV4MTIzNDU2",
86
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
87
+ "workspaceId": "ws-1",
88
+ "signature": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
89
+ },
90
+ "payload": {
91
+ "protocol": 2,
92
+ "sessionId": "e5f6a7b8-c9d0-4e1f-8a2b-4c5d6e7f8091",
93
+ "resumed": false,
94
+ "peerLastSeq": 0,
95
+ "limits": {
96
+ "maxFrameBytes": 49152,
97
+ "chunkRawBytes": 32768,
98
+ "maxChunks": 64,
99
+ "ackTimeoutMs": 5000,
100
+ "maxRetries": 3,
101
+ "heartbeatSeconds": 30,
102
+ "contentFirstByteMs": 10000,
103
+ "contentTotalMs": 30000
104
+ }
105
+ }
106
+ }
107
+ },
108
+ {
109
+ "dir": "la->cp",
110
+ "frame": {
111
+ "schemaVersion": 2,
112
+ "type": "job.assign",
113
+ "msgId": "00000000-0000-4000-8000-000000000001",
114
+ "seq": 1,
115
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
116
+ "workspaceId": "ws-1",
117
+ "ts": "2026-10-29T10:00:00Z",
118
+ "paramsRaw": "{\"jobId\":\"c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f\",\"kind\":\"fix\",\"incidentRef\":{\"id\":\"inc-8c8deab3\",\"fingerprint\":\"5a1f09c2d7e8b3a4\"},\"repoRef\":{\"provider\":\"github\",\"org\":\"acme\",\"repo\":\"billing\",\"branch\":\"main\"},\"policy\":{\"operationMode\":\"assist\",\"automationLevel\":2,\"ceiling\":\"autonomous\"},\"budget\":{\"tokens\":200000,\"seconds\":900},\"llm\":{\"alias\":\"vh-coder\",\"keyRef\":\"key-la-1\"},\"inputs\":[{\"ref\":\"incident:inc-8c8deab3\"},{\"inline\":\"Fix the NPE in PaymentService\",\"transient\":true}]}",
119
+ "sig": {
120
+ "keyId": "vh-cp-2026-10",
121
+ "timestamp": "1793268000",
122
+ "nonce": "Zm9vYmFyYmF6cXV4MTIzNDU2",
123
+ "tenantId": "3f2b8c1e-5a4d-4e7b-9c21-0a1b2c3d4e5f",
124
+ "workspaceId": "ws-1",
125
+ "signature": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
126
+ },
127
+ "requestId": "d4e5f6a7-b8c9-4d0e-9f1a-3b4c5d6e7f80",
128
+ "payload": {
129
+ "jobId": "c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
130
+ "kind": "fix",
131
+ "incidentRef": {
132
+ "id": "inc-8c8deab3",
133
+ "fingerprint": "5a1f09c2d7e8b3a4"
134
+ },
135
+ "repoRef": {
136
+ "provider": "github",
137
+ "org": "acme",
138
+ "repo": "billing",
139
+ "branch": "main"
140
+ },
141
+ "policy": {
142
+ "operationMode": "assist",
143
+ "automationLevel": 2,
144
+ "ceiling": "autonomous"
145
+ },
146
+ "budget": {
147
+ "tokens": 200000,
148
+ "seconds": 900
149
+ },
150
+ "llm": {
151
+ "alias": "vh-coder",
152
+ "keyRef": "key-la-1"
153
+ },
154
+ "inputs": [
155
+ {
156
+ "ref": "incident:inc-8c8deab3"
157
+ },
158
+ {
159
+ "inline": "Fix the NPE in PaymentService",
160
+ "transient": true
161
+ }
162
+ ]
163
+ },
164
+ "agentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
165
+ }
166
+ }
167
+ ],
168
+ "expect": {
169
+ "ok": false,
170
+ "error": "wrong_direction",
171
+ "atFrame": 3
172
+ }
173
+ }