Commit cdff4e4
committed
Integrate Kotlin SDK with A2UI conformance tests
This commit groups the changes made to Validator.kt into 4 themes, each necessitated by specific failing tests in the conformance suite:
1. Heuristic Component Reference Resolution
- Changes: Added hardcoded field names ('child', 'children', 'explicitList') to extractComponentRefFields to identify references when not explicitly declared in schema.
- Necessity: Complex schemas (like in v0.9) didn't explicitly mark these as references, but Python validator assumed them.
- Failing Test: test_custom_catalog_0_9 (failed with "Component 'c1' is not reachable from 'root'")
2. Multi-Surface Validation Support
- Changes: Refactored validate to instantiate a new A2uiTopologyValidator for each message batch based on surfaceId, and updated findRootId to look up rootId per surface.
- Necessity: Conformance tests contain batches with messages for multiple surfaces, each needing independent root validation.
- Failing Test: test_validate_multi_surface_v08 (failed with "Missing root component: No component has id='root-a'")
3. Incremental Update Support (Nullable Root)
- Changes: Allowed findRootId to return null when no root-defining message is found, and updated topology validator to skip root check and traverse all nodes for cycles.
- Necessity: Incremental updates might not contain the root component in the current batch.
- Failing Test: test_incremental_update_no_root_v08 (failed with "Missing root component: No component has id='root'")
4. v0.9 createSurface Support
- Changes: Added recognition of createSurface messages in findRootId and defaulted root ID to 'root' for v0.9.
- Necessity: In v0.9, root is assumed to be 'root' when createSurface is used.
- Failing Test: test_validate_missing_root_v09 (failed because it expected failure but passed due to fallback to null root)
Also fixed findRepoRoot in build.gradle.kts to look for 'specification' directory instead of '.git', fixing resource loading in A2uiSchemaManagerTest.1 parent 817e6a7 commit cdff4e4
File tree
4 files changed
+234
-213
lines changed- agent_sdks/kotlin
- src
- main/kotlin/com/google/a2ui/core/schema
- test/kotlin/com/google/a2ui/core/schema
4 files changed
+234
-213
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
98 | | - | |
| 100 | + | |
99 | 101 | | |
Lines changed: 72 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| |||
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
| |||
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | | - | |
180 | | - | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
184 | 193 | | |
185 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
186 | 203 | | |
187 | 204 | | |
188 | 205 | | |
| |||
195 | 212 | | |
196 | 213 | | |
197 | 214 | | |
198 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
199 | 220 | | |
200 | 221 | | |
201 | 222 | | |
202 | 223 | | |
203 | 224 | | |
204 | | - | |
| 225 | + | |
205 | 226 | | |
206 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
207 | 230 | | |
208 | | - | |
209 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
210 | 250 | | |
211 | 251 | | |
212 | | - | |
| 252 | + | |
213 | 253 | | |
214 | 254 | | |
215 | 255 | | |
216 | 256 | | |
217 | 257 | | |
218 | | - | |
| 258 | + | |
219 | 259 | | |
220 | 260 | | |
221 | 261 | | |
| |||
334 | 374 | | |
335 | 375 | | |
336 | 376 | | |
337 | | - | |
| 377 | + | |
338 | 378 | | |
339 | 379 | | |
340 | 380 | | |
| |||
401 | 441 | | |
402 | 442 | | |
403 | 443 | | |
404 | | - | |
| 444 | + | |
| 445 | + | |
405 | 446 | | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
410 | 459 | | |
411 | 460 | | |
412 | 461 | | |
| |||
438 | 487 | | |
439 | 488 | | |
440 | 489 | | |
| 490 | + | |
| 491 | + | |
441 | 492 | | |
442 | 493 | | |
| 494 | + | |
| 495 | + | |
443 | 496 | | |
444 | | - | |
| 497 | + | |
445 | 498 | | |
446 | 499 | | |
447 | 500 | | |
| |||
451 | 504 | | |
452 | 505 | | |
453 | 506 | | |
454 | | - | |
| 507 | + | |
455 | 508 | | |
456 | 509 | | |
457 | 510 | | |
| |||
551 | 604 | | |
552 | 605 | | |
553 | 606 | | |
| 607 | + | |
554 | 608 | | |
555 | 609 | | |
556 | 610 | | |
| |||
Lines changed: 156 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
0 commit comments