Harbor format: 210 business_automation tasks (part 6)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/autom-supplier-invoice-match-007/tests/test.sh +4 -0
- tasks/autom-supplier-invoice-match-007/tests/world.json +446 -0
- tasks/autom-supplier-invoice-match-007/tests/world_check.py +26 -0
- tasks/autom-supplier-invoice-match-007/validation/openenv.json +28 -0
- tasks/autom-supplier-invoice-match-008/environment/inputs/apps.py +68 -0
- tasks/autom-supplier-invoice-match-008/environment/inputs/world.json +430 -0
- tasks/autom-supplier-invoice-match-008/instruction.md +17 -0
- tasks/autom-supplier-invoice-match-008/solution/files/actions.jsonl +28 -0
- tasks/autom-supplier-invoice-match-008/solution/solve.sh +4 -0
- tasks/autom-supplier-invoice-match-008/task.toml +46 -0
- tasks/autom-supplier-invoice-match-008/tests/expected.json +9 -0
- tasks/autom-supplier-invoice-match-008/tests/grade.py +330 -0
- tasks/autom-supplier-invoice-match-008/tests/replay.py +68 -0
- tasks/autom-supplier-invoice-match-008/tests/target.json +538 -0
- tasks/autom-supplier-invoice-match-008/tests/test.sh +4 -0
- tasks/autom-supplier-invoice-match-008/tests/world.json +430 -0
- tasks/autom-supplier-invoice-match-008/tests/world_check.py +26 -0
- tasks/autom-supplier-invoice-match-008/validation/openenv.json +28 -0
- tasks/autom-supplier-invoice-match-009/environment/inputs/apps.py +68 -0
- tasks/autom-supplier-invoice-match-009/environment/inputs/world.json +422 -0
- tasks/autom-supplier-invoice-match-009/instruction.md +17 -0
- tasks/autom-supplier-invoice-match-009/solution/files/actions.jsonl +26 -0
- tasks/autom-supplier-invoice-match-009/solution/solve.sh +4 -0
- tasks/autom-supplier-invoice-match-009/task.toml +46 -0
- tasks/autom-supplier-invoice-match-009/tests/expected.json +9 -0
- tasks/autom-supplier-invoice-match-009/tests/grade.py +330 -0
- tasks/autom-supplier-invoice-match-009/tests/replay.py +68 -0
- tasks/autom-supplier-invoice-match-009/tests/target.json +526 -0
- tasks/autom-supplier-invoice-match-009/tests/test.sh +4 -0
- tasks/autom-supplier-invoice-match-009/tests/world.json +422 -0
- tasks/autom-supplier-invoice-match-009/tests/world_check.py +26 -0
- tasks/autom-supplier-invoice-match-009/validation/openenv.json +28 -0
- tasks/autom-supplier-invoice-match-010/environment/inputs/apps.py +68 -0
- tasks/autom-supplier-invoice-match-010/environment/inputs/world.json +446 -0
- tasks/autom-supplier-invoice-match-010/instruction.md +17 -0
- tasks/autom-supplier-invoice-match-010/solution/files/actions.jsonl +20 -0
- tasks/autom-supplier-invoice-match-010/solution/solve.sh +4 -0
- tasks/autom-supplier-invoice-match-010/task.toml +46 -0
- tasks/autom-supplier-invoice-match-010/tests/expected.json +9 -0
- tasks/autom-supplier-invoice-match-010/tests/grade.py +330 -0
- tasks/autom-supplier-invoice-match-010/tests/replay.py +68 -0
- tasks/autom-supplier-invoice-match-010/tests/target.json +525 -0
- tasks/autom-supplier-invoice-match-010/tests/test.sh +4 -0
- tasks/autom-supplier-invoice-match-010/tests/world.json +446 -0
- tasks/autom-supplier-invoice-match-010/tests/world_check.py +26 -0
- tasks/autom-supplier-invoice-match-010/validation/openenv.json +28 -0
- tasks/autom-supplier-invoice-match-011/environment/inputs/apps.py +68 -0
- tasks/autom-supplier-invoice-match-011/environment/inputs/world.json +398 -0
- tasks/autom-supplier-invoice-match-011/instruction.md +17 -0
- tasks/autom-supplier-invoice-match-011/solution/files/actions.jsonl +18 -0
tasks/autom-supplier-invoice-match-007/tests/test.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /logs/verifier /workspace/outputs
|
| 4 |
+
exec python3 -B -I /tests/grade.py
|
tasks/autom-supplier-invoice-match-007/tests/world.json
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 3
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 1
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 1
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 6
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 7
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 5
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 8
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-07-07",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 20
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-07-05",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "accepted",
|
| 50 |
+
"units": 28
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-07-12",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "quarantine",
|
| 56 |
+
"units": 28
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-06-26",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 25
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-07-07",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 18
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-07-09",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "accepted",
|
| 74 |
+
"units": 14
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-06-28",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "accepted",
|
| 80 |
+
"units": 22
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-07-10",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 14
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-07-07",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 13
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-07-13",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "quarantine",
|
| 98 |
+
"units": 22
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-07-10",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "quarantine",
|
| 104 |
+
"units": 19
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-06-19",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "accepted",
|
| 110 |
+
"units": 16
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-07-07",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 20
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-07-02",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "accepted",
|
| 122 |
+
"units": 27
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-06-14",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "accepted",
|
| 128 |
+
"units": 14
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-06-17",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "accepted",
|
| 134 |
+
"units": 12
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-07-07",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 21
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-06-16",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "accepted",
|
| 146 |
+
"units": 14
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-06-24",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "quarantine",
|
| 152 |
+
"units": 13
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-07-09",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "accepted",
|
| 158 |
+
"units": 25
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-07-07",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 15
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-07-06",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "quarantine",
|
| 170 |
+
"units": 15
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-07-12",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "quarantine",
|
| 176 |
+
"units": 24
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-07-13",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "quarantine",
|
| 182 |
+
"units": 23
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-07-07",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 21
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-07-07",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 26
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-06-21",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 22
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-06-16",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 26
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-2655-0-1": {
|
| 211 |
+
"date": "2025-06-20",
|
| 212 |
+
"po": "PO0",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 20529,
|
| 215 |
+
"units": 10,
|
| 216 |
+
"vendor": "V3"
|
| 217 |
+
},
|
| 218 |
+
"IV-2809-6-2": {
|
| 219 |
+
"date": "2025-06-23",
|
| 220 |
+
"po": "PO6",
|
| 221 |
+
"state": "review",
|
| 222 |
+
"unit_price_cents": 4548,
|
| 223 |
+
"units": 7,
|
| 224 |
+
"vendor": "V2"
|
| 225 |
+
},
|
| 226 |
+
"IV-3227-2-0": {
|
| 227 |
+
"date": "2025-06-24",
|
| 228 |
+
"po": "PO2",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 18498,
|
| 231 |
+
"units": 5,
|
| 232 |
+
"vendor": "V4"
|
| 233 |
+
},
|
| 234 |
+
"IV-3392-5-0": {
|
| 235 |
+
"date": "2025-06-24",
|
| 236 |
+
"po": "PO5",
|
| 237 |
+
"state": "review",
|
| 238 |
+
"unit_price_cents": 15272,
|
| 239 |
+
"units": 13,
|
| 240 |
+
"vendor": "V3"
|
| 241 |
+
},
|
| 242 |
+
"IV-3483-2-1": {
|
| 243 |
+
"date": "2025-06-18",
|
| 244 |
+
"po": "PO2",
|
| 245 |
+
"state": "void",
|
| 246 |
+
"unit_price_cents": 18955,
|
| 247 |
+
"units": 9,
|
| 248 |
+
"vendor": "V4"
|
| 249 |
+
},
|
| 250 |
+
"IV-3518-4-1": {
|
| 251 |
+
"date": "2025-07-02",
|
| 252 |
+
"po": "PO4",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 4246,
|
| 255 |
+
"units": 13,
|
| 256 |
+
"vendor": "V1"
|
| 257 |
+
},
|
| 258 |
+
"IV-3522-4-2": {
|
| 259 |
+
"date": "2025-07-02",
|
| 260 |
+
"po": "PO4",
|
| 261 |
+
"state": "void",
|
| 262 |
+
"unit_price_cents": 2844,
|
| 263 |
+
"units": 13,
|
| 264 |
+
"vendor": "V1"
|
| 265 |
+
},
|
| 266 |
+
"IV-3568-3-1": {
|
| 267 |
+
"date": "2025-07-04",
|
| 268 |
+
"po": "PO3",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 11063,
|
| 271 |
+
"units": 9,
|
| 272 |
+
"vendor": "Unknown"
|
| 273 |
+
},
|
| 274 |
+
"IV-3822-3-0": {
|
| 275 |
+
"date": "2025-06-24",
|
| 276 |
+
"po": "PO3",
|
| 277 |
+
"state": "review",
|
| 278 |
+
"unit_price_cents": 10013,
|
| 279 |
+
"units": 24,
|
| 280 |
+
"vendor": "V1"
|
| 281 |
+
},
|
| 282 |
+
"IV-3847-3-2": {
|
| 283 |
+
"date": "2025-06-23",
|
| 284 |
+
"po": "PO3",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 11651,
|
| 287 |
+
"units": 22,
|
| 288 |
+
"vendor": "V1"
|
| 289 |
+
},
|
| 290 |
+
"IV-4156-2-2": {
|
| 291 |
+
"date": "2025-06-27",
|
| 292 |
+
"po": "PO2",
|
| 293 |
+
"state": "review",
|
| 294 |
+
"unit_price_cents": 19365,
|
| 295 |
+
"units": 4,
|
| 296 |
+
"vendor": "V4"
|
| 297 |
+
},
|
| 298 |
+
"IV-4193-1-3": {
|
| 299 |
+
"date": "2025-07-06",
|
| 300 |
+
"po": "PO1",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 18727,
|
| 303 |
+
"units": 21,
|
| 304 |
+
"vendor": "Unknown"
|
| 305 |
+
},
|
| 306 |
+
"IV-5034-1-0": {
|
| 307 |
+
"date": "2025-06-24",
|
| 308 |
+
"po": "PO1",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 17713,
|
| 311 |
+
"units": 21,
|
| 312 |
+
"vendor": "V3"
|
| 313 |
+
},
|
| 314 |
+
"IV-5385-5-1": {
|
| 315 |
+
"date": "2025-06-26",
|
| 316 |
+
"po": "PO5",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 15209,
|
| 319 |
+
"units": 10,
|
| 320 |
+
"vendor": "V3"
|
| 321 |
+
},
|
| 322 |
+
"IV-5419-6-1": {
|
| 323 |
+
"date": "2025-06-25",
|
| 324 |
+
"po": "PO6",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 4843,
|
| 327 |
+
"units": 13,
|
| 328 |
+
"vendor": "V2"
|
| 329 |
+
},
|
| 330 |
+
"IV-5742-3-3": {
|
| 331 |
+
"date": "2025-06-25",
|
| 332 |
+
"po": "PO3",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 10967,
|
| 335 |
+
"units": 5,
|
| 336 |
+
"vendor": "V1"
|
| 337 |
+
},
|
| 338 |
+
"IV-7082-4-0": {
|
| 339 |
+
"date": "2025-06-24",
|
| 340 |
+
"po": "PO4",
|
| 341 |
+
"state": "review",
|
| 342 |
+
"unit_price_cents": 2670,
|
| 343 |
+
"units": 17,
|
| 344 |
+
"vendor": "V1"
|
| 345 |
+
},
|
| 346 |
+
"IV-8006-6-0": {
|
| 347 |
+
"date": "2025-06-24",
|
| 348 |
+
"po": "PO6",
|
| 349 |
+
"state": "review",
|
| 350 |
+
"unit_price_cents": 3349,
|
| 351 |
+
"units": 6,
|
| 352 |
+
"vendor": "V2"
|
| 353 |
+
},
|
| 354 |
+
"IV-8060-6-3": {
|
| 355 |
+
"date": "2025-06-22",
|
| 356 |
+
"po": "PO6",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 3811,
|
| 359 |
+
"units": 8,
|
| 360 |
+
"vendor": "V2"
|
| 361 |
+
},
|
| 362 |
+
"IV-8204-1-2": {
|
| 363 |
+
"date": "2025-07-06",
|
| 364 |
+
"po": "PO1",
|
| 365 |
+
"state": "review",
|
| 366 |
+
"unit_price_cents": 19493,
|
| 367 |
+
"units": 8,
|
| 368 |
+
"vendor": "V3"
|
| 369 |
+
},
|
| 370 |
+
"IV-8321-0-0": {
|
| 371 |
+
"date": "2025-06-24",
|
| 372 |
+
"po": "PO0",
|
| 373 |
+
"state": "review",
|
| 374 |
+
"unit_price_cents": 18473,
|
| 375 |
+
"units": 1,
|
| 376 |
+
"vendor": "V3"
|
| 377 |
+
},
|
| 378 |
+
"IV-8848-1-1": {
|
| 379 |
+
"date": "2025-06-25",
|
| 380 |
+
"po": "PO1",
|
| 381 |
+
"state": "review",
|
| 382 |
+
"unit_price_cents": 19793,
|
| 383 |
+
"units": 20,
|
| 384 |
+
"vendor": "V3"
|
| 385 |
+
}
|
| 386 |
+
},
|
| 387 |
+
"purchase_orders": {
|
| 388 |
+
"PO0": {
|
| 389 |
+
"unit": "South",
|
| 390 |
+
"unit_price_cents": 18473,
|
| 391 |
+
"vendor": "V3"
|
| 392 |
+
},
|
| 393 |
+
"PO1": {
|
| 394 |
+
"unit": "South",
|
| 395 |
+
"unit_price_cents": 17713,
|
| 396 |
+
"vendor": "V3"
|
| 397 |
+
},
|
| 398 |
+
"PO2": {
|
| 399 |
+
"unit": "South",
|
| 400 |
+
"unit_price_cents": 18498,
|
| 401 |
+
"vendor": "V4"
|
| 402 |
+
},
|
| 403 |
+
"PO3": {
|
| 404 |
+
"unit": "South",
|
| 405 |
+
"unit_price_cents": 10013,
|
| 406 |
+
"vendor": "V1"
|
| 407 |
+
},
|
| 408 |
+
"PO4": {
|
| 409 |
+
"unit": "South",
|
| 410 |
+
"unit_price_cents": 2670,
|
| 411 |
+
"vendor": "V1"
|
| 412 |
+
},
|
| 413 |
+
"PO5": {
|
| 414 |
+
"unit": "South",
|
| 415 |
+
"unit_price_cents": 15272,
|
| 416 |
+
"vendor": "V3"
|
| 417 |
+
},
|
| 418 |
+
"PO6": {
|
| 419 |
+
"unit": "Other",
|
| 420 |
+
"unit_price_cents": 3349,
|
| 421 |
+
"vendor": "V2"
|
| 422 |
+
}
|
| 423 |
+
},
|
| 424 |
+
"supplier_cases": {
|
| 425 |
+
"PREEXISTING": {
|
| 426 |
+
"status": "investigating"
|
| 427 |
+
}
|
| 428 |
+
},
|
| 429 |
+
"vendors": {
|
| 430 |
+
"V0": {
|
| 431 |
+
"net_days": 21
|
| 432 |
+
},
|
| 433 |
+
"V1": {
|
| 434 |
+
"net_days": 45
|
| 435 |
+
},
|
| 436 |
+
"V2": {
|
| 437 |
+
"net_days": 45
|
| 438 |
+
},
|
| 439 |
+
"V3": {
|
| 440 |
+
"net_days": 45
|
| 441 |
+
},
|
| 442 |
+
"V4": {
|
| 443 |
+
"net_days": 45
|
| 444 |
+
}
|
| 445 |
+
}
|
| 446 |
+
}
|
tasks/autom-supplier-invoice-match-007/tests/world_check.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Replay submitted mutations from the private verifier's initial state."""
|
| 2 |
+
from types import ModuleType
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def check(spec, outputs, tests):
|
| 7 |
+
replay = ModuleType('workflow_replay')
|
| 8 |
+
exec(compile((tests/'replay.py').read_bytes(), 'replay.py', 'exec'), replay.__dict__)
|
| 9 |
+
world = json.loads((tests/'world.json').read_text())
|
| 10 |
+
target = json.loads((tests/'target.json').read_text())
|
| 11 |
+
# Only fields whose starting and expected values differ may be changed. Attempts
|
| 12 |
+
# to temporarily alter a protected field fail even when a later write restores it.
|
| 13 |
+
allowed = {
|
| 14 |
+
(app,key): {field for field,value in doc.items()
|
| 15 |
+
if field not in world[app].get(key,{}) or not replay.same(world[app][key][field],value)}
|
| 16 |
+
for app,records in target.items() for key,doc in records.items()
|
| 17 |
+
}
|
| 18 |
+
actions = replay.load_actions(outputs/'actions.jsonl')
|
| 19 |
+
for event in actions:
|
| 20 |
+
replay.apply(world,event)
|
| 21 |
+
touched = set(event['fields'])
|
| 22 |
+
if not touched <= allowed.get((event['app'],event['id']),set()):
|
| 23 |
+
return False,'protected field or record write'
|
| 24 |
+
if not replay.same(world,target):
|
| 25 |
+
return False,'required business outcomes incomplete'
|
| 26 |
+
return True,''
|
tasks/autom-supplier-invoice-match-007/validation/openenv.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"profile": "harbor-semantic-v1",
|
| 3 |
+
"reward_key": "reward",
|
| 4 |
+
"reward": {
|
| 5 |
+
"range": [
|
| 6 |
+
0,
|
| 7 |
+
1
|
| 8 |
+
],
|
| 9 |
+
"oracle_tolerance": 0,
|
| 10 |
+
"floor_margin": 0.1
|
| 11 |
+
},
|
| 12 |
+
"resources": {
|
| 13 |
+
"cpu": 1,
|
| 14 |
+
"memory_mb": 4096,
|
| 15 |
+
"disk_mb": 10240,
|
| 16 |
+
"episode_timeout_s": 1800
|
| 17 |
+
},
|
| 18 |
+
"types": {
|
| 19 |
+
"tags": [
|
| 20 |
+
"knowledge-work",
|
| 21 |
+
"cross-app-workflows",
|
| 22 |
+
"conditional-execution",
|
| 23 |
+
"protected-state",
|
| 24 |
+
"finance"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
"requires_credentials": false
|
| 28 |
+
}
|
tasks/autom-supplier-invoice-match-008/environment/inputs/apps.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-008/environment/inputs/world.json
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 3
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 2
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 2
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 2
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 7
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 5
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 6
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-07-30",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 20
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-07-14",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "quarantine",
|
| 50 |
+
"units": 27
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-07-27",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "quarantine",
|
| 56 |
+
"units": 22
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-08-01",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 15
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-07-30",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 15
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-08-01",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "accepted",
|
| 74 |
+
"units": 14
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-07-30",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "accepted",
|
| 80 |
+
"units": 23
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-07-31",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 27
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-07-30",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 22
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-07-19",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "accepted",
|
| 98 |
+
"units": 17
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-07-18",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "quarantine",
|
| 104 |
+
"units": 16
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-08-03",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "accepted",
|
| 110 |
+
"units": 19
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-07-30",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 18
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-07-20",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "quarantine",
|
| 122 |
+
"units": 22
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-07-31",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "quarantine",
|
| 128 |
+
"units": 21
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-07-19",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "accepted",
|
| 134 |
+
"units": 23
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-07-30",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 25
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-07-14",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "quarantine",
|
| 146 |
+
"units": 14
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-07-23",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "quarantine",
|
| 152 |
+
"units": 14
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-07-26",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "accepted",
|
| 158 |
+
"units": 21
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-07-30",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 13
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-07-07",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "quarantine",
|
| 170 |
+
"units": 20
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-07-21",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "quarantine",
|
| 176 |
+
"units": 18
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-07-08",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "accepted",
|
| 182 |
+
"units": 25
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-07-30",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 28
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-08-02",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 28
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-07-13",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 27
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-08-04",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 23
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-1042-6-1": {
|
| 211 |
+
"date": "2025-07-12",
|
| 212 |
+
"po": "PO6",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 23221,
|
| 215 |
+
"units": 24,
|
| 216 |
+
"vendor": "V2"
|
| 217 |
+
},
|
| 218 |
+
"IV-2441-2-0": {
|
| 219 |
+
"date": "2025-07-10",
|
| 220 |
+
"po": "PO2",
|
| 221 |
+
"state": "review",
|
| 222 |
+
"unit_price_cents": 3352,
|
| 223 |
+
"units": 24,
|
| 224 |
+
"vendor": "V0"
|
| 225 |
+
},
|
| 226 |
+
"IV-2499-2-2": {
|
| 227 |
+
"date": "2025-07-14",
|
| 228 |
+
"po": "PO2",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 3672,
|
| 231 |
+
"units": 24,
|
| 232 |
+
"vendor": "V0"
|
| 233 |
+
},
|
| 234 |
+
"IV-2842-1-3": {
|
| 235 |
+
"date": "2025-07-29",
|
| 236 |
+
"po": "PO1",
|
| 237 |
+
"state": "review",
|
| 238 |
+
"unit_price_cents": 14234,
|
| 239 |
+
"units": 15,
|
| 240 |
+
"vendor": "V2"
|
| 241 |
+
},
|
| 242 |
+
"IV-3512-2-1": {
|
| 243 |
+
"date": "2025-07-12",
|
| 244 |
+
"po": "PO2",
|
| 245 |
+
"state": "void",
|
| 246 |
+
"unit_price_cents": 5366,
|
| 247 |
+
"units": 7,
|
| 248 |
+
"vendor": "V0"
|
| 249 |
+
},
|
| 250 |
+
"IV-3645-2-3": {
|
| 251 |
+
"date": "2025-07-06",
|
| 252 |
+
"po": "PO2",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 4141,
|
| 255 |
+
"units": 14,
|
| 256 |
+
"vendor": "V0"
|
| 257 |
+
},
|
| 258 |
+
"IV-4781-1-1": {
|
| 259 |
+
"date": "2025-07-10",
|
| 260 |
+
"po": "PO1",
|
| 261 |
+
"state": "void",
|
| 262 |
+
"unit_price_cents": 14048,
|
| 263 |
+
"units": 12,
|
| 264 |
+
"vendor": "V2"
|
| 265 |
+
},
|
| 266 |
+
"IV-5355-0-3": {
|
| 267 |
+
"date": "2025-07-27",
|
| 268 |
+
"po": "PO0",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 22436,
|
| 271 |
+
"units": 9,
|
| 272 |
+
"vendor": "V1"
|
| 273 |
+
},
|
| 274 |
+
"IV-5362-5-1": {
|
| 275 |
+
"date": "2025-07-23",
|
| 276 |
+
"po": "PO5",
|
| 277 |
+
"state": "review",
|
| 278 |
+
"unit_price_cents": 19908,
|
| 279 |
+
"units": 6,
|
| 280 |
+
"vendor": "Unknown"
|
| 281 |
+
},
|
| 282 |
+
"IV-5898-1-2": {
|
| 283 |
+
"date": "2025-07-17",
|
| 284 |
+
"po": "PO1",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 12052,
|
| 287 |
+
"units": 11,
|
| 288 |
+
"vendor": "V2"
|
| 289 |
+
},
|
| 290 |
+
"IV-6039-3-0": {
|
| 291 |
+
"date": "2025-07-10",
|
| 292 |
+
"po": "PO3",
|
| 293 |
+
"state": "review",
|
| 294 |
+
"unit_price_cents": 11188,
|
| 295 |
+
"units": 24,
|
| 296 |
+
"vendor": "V4"
|
| 297 |
+
},
|
| 298 |
+
"IV-6192-4-1": {
|
| 299 |
+
"date": "2025-07-29",
|
| 300 |
+
"po": "PO4",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 12050,
|
| 303 |
+
"units": 9,
|
| 304 |
+
"vendor": "V0"
|
| 305 |
+
},
|
| 306 |
+
"IV-6195-1-0": {
|
| 307 |
+
"date": "2025-07-10",
|
| 308 |
+
"po": "PO1",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 12069,
|
| 311 |
+
"units": 4,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-6673-0-0": {
|
| 315 |
+
"date": "2025-07-10",
|
| 316 |
+
"po": "PO0",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 20814,
|
| 319 |
+
"units": 1,
|
| 320 |
+
"vendor": "V1"
|
| 321 |
+
},
|
| 322 |
+
"IV-7091-3-1": {
|
| 323 |
+
"date": "2025-07-21",
|
| 324 |
+
"po": "PO3",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 11644,
|
| 327 |
+
"units": 13,
|
| 328 |
+
"vendor": "V4"
|
| 329 |
+
},
|
| 330 |
+
"IV-7714-4-0": {
|
| 331 |
+
"date": "2025-07-10",
|
| 332 |
+
"po": "PO4",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 10466,
|
| 335 |
+
"units": 8,
|
| 336 |
+
"vendor": "V0"
|
| 337 |
+
},
|
| 338 |
+
"IV-8313-6-0": {
|
| 339 |
+
"date": "2025-07-10",
|
| 340 |
+
"po": "PO6",
|
| 341 |
+
"state": "review",
|
| 342 |
+
"unit_price_cents": 21349,
|
| 343 |
+
"units": 9,
|
| 344 |
+
"vendor": "V2"
|
| 345 |
+
},
|
| 346 |
+
"IV-8475-0-1": {
|
| 347 |
+
"date": "2025-07-11",
|
| 348 |
+
"po": "PO0",
|
| 349 |
+
"state": "void",
|
| 350 |
+
"unit_price_cents": 22241,
|
| 351 |
+
"units": 3,
|
| 352 |
+
"vendor": "Unknown"
|
| 353 |
+
},
|
| 354 |
+
"IV-8625-5-0": {
|
| 355 |
+
"date": "2025-07-10",
|
| 356 |
+
"po": "PO5",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 18133,
|
| 359 |
+
"units": 9,
|
| 360 |
+
"vendor": "V4"
|
| 361 |
+
},
|
| 362 |
+
"IV-8964-0-2": {
|
| 363 |
+
"date": "2025-07-14",
|
| 364 |
+
"po": "PO0",
|
| 365 |
+
"state": "review",
|
| 366 |
+
"unit_price_cents": 22581,
|
| 367 |
+
"units": 21,
|
| 368 |
+
"vendor": "V1"
|
| 369 |
+
}
|
| 370 |
+
},
|
| 371 |
+
"purchase_orders": {
|
| 372 |
+
"PO0": {
|
| 373 |
+
"unit": "South",
|
| 374 |
+
"unit_price_cents": 20814,
|
| 375 |
+
"vendor": "V1"
|
| 376 |
+
},
|
| 377 |
+
"PO1": {
|
| 378 |
+
"unit": "South",
|
| 379 |
+
"unit_price_cents": 12069,
|
| 380 |
+
"vendor": "V2"
|
| 381 |
+
},
|
| 382 |
+
"PO2": {
|
| 383 |
+
"unit": "South",
|
| 384 |
+
"unit_price_cents": 3352,
|
| 385 |
+
"vendor": "V0"
|
| 386 |
+
},
|
| 387 |
+
"PO3": {
|
| 388 |
+
"unit": "South",
|
| 389 |
+
"unit_price_cents": 11188,
|
| 390 |
+
"vendor": "V4"
|
| 391 |
+
},
|
| 392 |
+
"PO4": {
|
| 393 |
+
"unit": "South",
|
| 394 |
+
"unit_price_cents": 10466,
|
| 395 |
+
"vendor": "V0"
|
| 396 |
+
},
|
| 397 |
+
"PO5": {
|
| 398 |
+
"unit": "South",
|
| 399 |
+
"unit_price_cents": 18133,
|
| 400 |
+
"vendor": "V4"
|
| 401 |
+
},
|
| 402 |
+
"PO6": {
|
| 403 |
+
"unit": "Other",
|
| 404 |
+
"unit_price_cents": 21349,
|
| 405 |
+
"vendor": "V2"
|
| 406 |
+
}
|
| 407 |
+
},
|
| 408 |
+
"supplier_cases": {
|
| 409 |
+
"PREEXISTING": {
|
| 410 |
+
"status": "investigating"
|
| 411 |
+
}
|
| 412 |
+
},
|
| 413 |
+
"vendors": {
|
| 414 |
+
"V0": {
|
| 415 |
+
"net_days": 21
|
| 416 |
+
},
|
| 417 |
+
"V1": {
|
| 418 |
+
"net_days": 30
|
| 419 |
+
},
|
| 420 |
+
"V2": {
|
| 421 |
+
"net_days": 15
|
| 422 |
+
},
|
| 423 |
+
"V3": {
|
| 424 |
+
"net_days": 45
|
| 425 |
+
},
|
| 426 |
+
"V4": {
|
| 427 |
+
"net_days": 15
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
}
|
tasks/autom-supplier-invoice-match-008/instruction.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Close the invoice matching queue for purchasing unit South at 2025-07-31. Handle invoices in review attached to that unit's purchase orders, invoice dates 2025-07-10 through 2025-07-31 inclusive. Process by invoice date ascending, then invoice ID ascending. Available units per PO equal units on accepted goods receipts dated on or before cutoff, minus previously posted units and any units successfully matched earlier in this run.
|
| 2 |
+
|
| 3 |
+
Match the invoice vendor exactly against the purchase order. A unit price above PO price is acceptable only up to 100 basis points above PO price (10,000 basis points = 100%; compare exactly, before rounding). Lower prices are acceptable. The invoice quantity must fit the available units in full. If any tests fail, update the invoice state to `disputed`, consume zero units, and create supplier_cases record `case-<invoice ID>` with `invoice`, `po` and the list `issues` containing every failing check in vendor, price, units order; use those lowercase strings.
|
| 4 |
+
|
| 5 |
+
For a match update invoice state to `posted` and create ap_postings record `book-<invoice ID>` with `invoice`, `po`, `units`, `status=posted`, integer `amount_cents` equal to invoiced quantity times invoiced unit price, and ISO date `due`. Count the vendor's net_days calendar days from the invoice date, then roll Saturday or Sunday forward to Monday. Preserve all other fields and records.
|
| 6 |
+
|
| 7 |
+
Use the offline app client at `/workspace/inputs/apps.py`. Call it with python3. Run
|
| 8 |
+
`apps` to discover apps, `list APP` to see its records, or `get APP ID` for one record.
|
| 9 |
+
Write with `update APP ID '{"field":"value"}'` or `create APP ID '{"field":"value"}'`.
|
| 10 |
+
The client records successful writes in `/workspace/outputs/actions.jsonl`.
|
| 11 |
+
Apply exactly the required changes. Other records and fields must remain untouched,
|
| 12 |
+
including temporary changes. Actions take effect in the local simulation only.
|
| 13 |
+
|
| 14 |
+
## Deliverable
|
| 15 |
+
|
| 16 |
+
Work in `/workspace`. Input files are under `/workspace/inputs/`. Put every deliverable in
|
| 17 |
+
`/workspace/outputs/`; only that directory is graded. Leave the app action log in the outputs directory.
|
tasks/autom-supplier-invoice-match-008/solution/files/actions.jsonl
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-6673-0-0", "op": "update"}
|
| 2 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-8964-0-2", "op": "update"}
|
| 3 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-5355-0-3", "op": "update"}
|
| 4 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-6195-1-0", "op": "update"}
|
| 5 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-5898-1-2", "op": "update"}
|
| 6 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-2842-1-3", "op": "update"}
|
| 7 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-2441-2-0", "op": "update"}
|
| 8 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-2499-2-2", "op": "update"}
|
| 9 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-6039-3-0", "op": "update"}
|
| 10 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-7091-3-1", "op": "update"}
|
| 11 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-7714-4-0", "op": "update"}
|
| 12 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-6192-4-1", "op": "update"}
|
| 13 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-8625-5-0", "op": "update"}
|
| 14 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-5362-5-1", "op": "update"}
|
| 15 |
+
{"app": "ap_postings", "fields": {"amount_cents": 80448, "due": "2025-07-31", "invoice": "IV-2441-2-0", "po": "PO2", "status": "posted", "units": 24}, "id": "book-IV-2441-2-0", "op": "create"}
|
| 16 |
+
{"app": "ap_postings", "fields": {"amount_cents": 268512, "due": "2025-07-25", "invoice": "IV-6039-3-0", "po": "PO3", "status": "posted", "units": 24}, "id": "book-IV-6039-3-0", "op": "create"}
|
| 17 |
+
{"app": "ap_postings", "fields": {"amount_cents": 48276, "due": "2025-07-25", "invoice": "IV-6195-1-0", "po": "PO1", "status": "posted", "units": 4}, "id": "book-IV-6195-1-0", "op": "create"}
|
| 18 |
+
{"app": "ap_postings", "fields": {"amount_cents": 20814, "due": "2025-08-11", "invoice": "IV-6673-0-0", "po": "PO0", "status": "posted", "units": 1}, "id": "book-IV-6673-0-0", "op": "create"}
|
| 19 |
+
{"app": "ap_postings", "fields": {"amount_cents": 83728, "due": "2025-07-31", "invoice": "IV-7714-4-0", "po": "PO4", "status": "posted", "units": 8}, "id": "book-IV-7714-4-0", "op": "create"}
|
| 20 |
+
{"app": "ap_postings", "fields": {"amount_cents": 163197, "due": "2025-07-25", "invoice": "IV-8625-5-0", "po": "PO5", "status": "posted", "units": 9}, "id": "book-IV-8625-5-0", "op": "create"}
|
| 21 |
+
{"app": "ap_postings", "fields": {"amount_cents": 132572, "due": "2025-08-01", "invoice": "IV-5898-1-2", "po": "PO1", "status": "posted", "units": 11}, "id": "book-IV-5898-1-2", "op": "create"}
|
| 22 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-2499-2-2", "issues": ["price", "units"], "po": "PO2"}, "id": "case-IV-2499-2-2", "op": "create"}
|
| 23 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-8964-0-2", "issues": ["price", "units"], "po": "PO0"}, "id": "case-IV-8964-0-2", "op": "create"}
|
| 24 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-7091-3-1", "issues": ["price"], "po": "PO3"}, "id": "case-IV-7091-3-1", "op": "create"}
|
| 25 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-5362-5-1", "issues": ["vendor", "price"], "po": "PO5"}, "id": "case-IV-5362-5-1", "op": "create"}
|
| 26 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-5355-0-3", "issues": ["price"], "po": "PO0"}, "id": "case-IV-5355-0-3", "op": "create"}
|
| 27 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-2842-1-3", "issues": ["price"], "po": "PO1"}, "id": "case-IV-2842-1-3", "op": "create"}
|
| 28 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-6192-4-1", "issues": ["price"], "po": "PO4"}, "id": "case-IV-6192-4-1", "op": "create"}
|
tasks/autom-supplier-invoice-match-008/solution/solve.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /workspace/outputs
|
| 4 |
+
cp -R /solution/files/. /workspace/outputs/
|
tasks/autom-supplier-invoice-match-008/task.toml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.3"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "apex-gap/autom-supplier-invoice-match-008"
|
| 5 |
+
|
| 6 |
+
[metadata.apex_gap]
|
| 7 |
+
capability_tags = ["cross-app-workflows", "conditional-execution", "protected-state", "finance"]
|
| 8 |
+
dataset = "Original simulated workflows"
|
| 9 |
+
job = "finance"
|
| 10 |
+
seed = 8
|
| 11 |
+
source = "local/original-automation-workflows"
|
| 12 |
+
source_revision = "1"
|
| 13 |
+
source_split = "synthetic"
|
| 14 |
+
source_task_id = "autom-supplier-invoice-match-008"
|
| 15 |
+
template_family = "automation:supplier-invoice-match"
|
| 16 |
+
workflow_template = "supplier-invoice-match"
|
| 17 |
+
|
| 18 |
+
[metadata.openenv_hf_sandbox]
|
| 19 |
+
variant = "apex-gap-hfsandbox-v1"
|
| 20 |
+
task_modified_for_hf_sandbox = true
|
| 21 |
+
network_enabled = true
|
| 22 |
+
|
| 23 |
+
[environment]
|
| 24 |
+
docker_image = "ghcr.io/younesbelkada/apex@sha256:24969c952247033023872f87161a16e067003469506be63783bbaa5d96926bdf"
|
| 25 |
+
workdir = "/workspace"
|
| 26 |
+
cpus = 1
|
| 27 |
+
memory_mb = 4096
|
| 28 |
+
build_timeout_sec = 600
|
| 29 |
+
network_mode = "public"
|
| 30 |
+
|
| 31 |
+
[agent]
|
| 32 |
+
timeout_sec = 1800
|
| 33 |
+
network_mode = "public"
|
| 34 |
+
|
| 35 |
+
[verifier]
|
| 36 |
+
timeout_sec = 600
|
| 37 |
+
network_mode = "public"
|
| 38 |
+
environment_mode = "separate"
|
| 39 |
+
|
| 40 |
+
[verifier.environment]
|
| 41 |
+
network_mode = "public"
|
| 42 |
+
cpus = 1
|
| 43 |
+
memory_mb = 4096
|
| 44 |
+
|
| 45 |
+
[[artifacts]]
|
| 46 |
+
source = "/workspace/outputs"
|
tasks/autom-supplier-invoice-match-008/tests/expected.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"checks": [
|
| 3 |
+
{
|
| 4 |
+
"id": "business-outcomes",
|
| 5 |
+
"type": "custom",
|
| 6 |
+
"module": "world_check"
|
| 7 |
+
}
|
| 8 |
+
]
|
| 9 |
+
}
|
tasks/autom-supplier-invoice-match-008/tests/grade.py
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Deterministic grader shared by converted knowledge-work tasks.
|
| 2 |
+
|
| 3 |
+
Runs inside the separate verifier sandbox. Reads /tests/expected.json, inspects the
|
| 4 |
+
submitted /workspace/outputs tree and writes a binary reward plus per-check details.
|
| 5 |
+
No model calls and no network.
|
| 6 |
+
|
| 7 |
+
expected.json: {"checks": [{"id": ..., "type": ..., ...}, ...]}
|
| 8 |
+
Check types:
|
| 9 |
+
answer field of outputs/answer.json; kind = number|text|choice|date|bool|list
|
| 10 |
+
xlsx_range recalculated outputs/<file> vs tests/<target> over sheet!range (SpreadsheetBench rules)
|
| 11 |
+
xlsx_cell recalculated outputs/<file> sheet!cell vs value with tolerance (optional alt_values)
|
| 12 |
+
file_contains outputs/<file> text (docx/pdf/ics/eml/txt) must contain every needle
|
| 13 |
+
custom tests/<module>.py defines check(spec, outputs_dir, tests_dir) -> (bool, str)
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
import datetime as dt
|
| 17 |
+
import json
|
| 18 |
+
import re
|
| 19 |
+
import shutil
|
| 20 |
+
import subprocess
|
| 21 |
+
import sys
|
| 22 |
+
import tempfile
|
| 23 |
+
import unicodedata
|
| 24 |
+
from pathlib import Path
|
| 25 |
+
|
| 26 |
+
OUT = Path("/workspace/outputs")
|
| 27 |
+
TESTS = Path("/tests")
|
| 28 |
+
LOGS = Path("/logs/verifier")
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def norm_text(v):
|
| 32 |
+
v = unicodedata.normalize("NFKC", str(v)).casefold()
|
| 33 |
+
v = re.sub(r"[‘’“”]", "'", v)
|
| 34 |
+
v = re.sub(r"[^\w%.$/-]+", " ", v)
|
| 35 |
+
return " ".join(v.split()).strip(" .")
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def to_number(v):
|
| 39 |
+
if isinstance(v, bool):
|
| 40 |
+
raise ValueError("bool")
|
| 41 |
+
if isinstance(v, (int, float)):
|
| 42 |
+
return float(v)
|
| 43 |
+
s = str(v).strip().replace(",", "").replace("$", "").replace("−", "-")
|
| 44 |
+
neg = s.startswith("(") and s.endswith(")")
|
| 45 |
+
s = s.strip("()").strip()
|
| 46 |
+
pct = s.endswith("%")
|
| 47 |
+
s = s.rstrip("%").strip()
|
| 48 |
+
s = re.sub(r"\s*(usd|dollars|million|billion|thousand|m|bn|k)$", "", s, flags=re.I)
|
| 49 |
+
x = float(s)
|
| 50 |
+
x = -x if neg else x
|
| 51 |
+
return x / 100 if pct else x
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def number_ok(got, want, rel, abs_):
|
| 55 |
+
try:
|
| 56 |
+
g = to_number(got)
|
| 57 |
+
except (TypeError, ValueError):
|
| 58 |
+
return False
|
| 59 |
+
w = float(want)
|
| 60 |
+
tol = max(abs_, rel * abs(w))
|
| 61 |
+
# "12.5%" may mean the ratio 0.125 or the percent number 12.5; the gold fixes which.
|
| 62 |
+
candidates = [g, g * 100] if isinstance(got, str) and got.strip().endswith("%") else [g]
|
| 63 |
+
return any(abs(c - w) <= tol for c in candidates)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def parse_date(v):
|
| 67 |
+
if isinstance(v, (dt.date, dt.datetime)):
|
| 68 |
+
return v if isinstance(v, dt.date) else v.date()
|
| 69 |
+
s = str(v).strip()
|
| 70 |
+
for fmt in ("%Y-%m-%d", "%m/%d/%Y", "%m/%d/%y", "%d %B %Y", "%B %d, %Y", "%b %d, %Y", "%Y/%m/%d"):
|
| 71 |
+
try:
|
| 72 |
+
return dt.datetime.strptime(s, fmt).date()
|
| 73 |
+
except ValueError:
|
| 74 |
+
continue
|
| 75 |
+
raise ValueError(s)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def check_answer(check, answers):
|
| 79 |
+
key = check["field"]
|
| 80 |
+
if key not in answers:
|
| 81 |
+
return False, f"missing field {key!r}"
|
| 82 |
+
got, want, kind = answers[key], check["value"], check.get("kind", "text")
|
| 83 |
+
if kind == "number":
|
| 84 |
+
ok = number_ok(got, want, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01))
|
| 85 |
+
if not ok and check.get("percent_either"):
|
| 86 |
+
ok = number_ok(got, want * 100, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01) * 100) or (
|
| 87 |
+
number_ok(got, want / 100, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01) / 100)
|
| 88 |
+
)
|
| 89 |
+
elif kind == "date":
|
| 90 |
+
try:
|
| 91 |
+
ok = parse_date(got) == parse_date(want)
|
| 92 |
+
except ValueError:
|
| 93 |
+
ok = False
|
| 94 |
+
elif kind == "bool":
|
| 95 |
+
g = norm_text(got)
|
| 96 |
+
ok = g in {"yes", "true"} if want else g in {"no", "false"}
|
| 97 |
+
elif kind == "choice":
|
| 98 |
+
ok = norm_text(got) == norm_text(want)
|
| 99 |
+
elif kind == "list":
|
| 100 |
+
if not isinstance(got, list):
|
| 101 |
+
return False, f"{key}: expected a JSON list"
|
| 102 |
+
# Filenames may be given with a directory prefix; compare base names.
|
| 103 |
+
base = lambda x: norm_text(str(x).replace("\\", "/").rsplit("/", 1)[-1])
|
| 104 |
+
ok = sorted(base(x) for x in got) == sorted(base(x) for x in want)
|
| 105 |
+
else:
|
| 106 |
+
accepted = check.get("accept", [want])
|
| 107 |
+
ok = norm_text(got) in {norm_text(a) for a in accepted}
|
| 108 |
+
return ok, "" if ok else f"{key}: got {got!r}"
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
# LibreOffice keeps cached formula values on load unless told otherwise; force a full recalculation.
|
| 112 |
+
RECALC_PROFILE = """<?xml version="1.0" encoding="UTF-8"?>
|
| 113 |
+
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
| 114 |
+
<item oor:path="/org.openoffice.Office.Calc/Formula/Load"><prop oor:name="OOXMLRecalcMode" oor:op="fuse"><value>0</value></prop></item>
|
| 115 |
+
<item oor:path="/org.openoffice.Office.Calc/Formula/Load"><prop oor:name="ODFRecalcMode" oor:op="fuse"><value>0</value></prop></item>
|
| 116 |
+
</oor:items>
|
| 117 |
+
"""
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def recalc(path, tmp):
|
| 121 |
+
dest = Path(tmp) / f"recalc-{len(list(Path(tmp).glob('recalc-*')))}"
|
| 122 |
+
dest.mkdir()
|
| 123 |
+
profile = Path(tmp) / "lo-profile"
|
| 124 |
+
if not profile.exists():
|
| 125 |
+
(profile / "user").mkdir(parents=True)
|
| 126 |
+
(profile / "user" / "registrymodifications.xcu").write_text(RECALC_PROFILE)
|
| 127 |
+
subprocess.run(
|
| 128 |
+
["soffice", f"-env:UserInstallation=file://{profile}", "--headless", "--calc", "--convert-to",
|
| 129 |
+
"xlsx:Calc MS Excel 2007 XML", "--outdir", str(dest), str(path)],
|
| 130 |
+
stdout=subprocess.DEVNULL,
|
| 131 |
+
stderr=subprocess.DEVNULL,
|
| 132 |
+
timeout=180,
|
| 133 |
+
check=False,
|
| 134 |
+
)
|
| 135 |
+
out = dest / (Path(path).stem + ".xlsx")
|
| 136 |
+
return out if out.exists() else Path(path)
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
def cell_value(v):
|
| 140 |
+
if isinstance(v, (int, float)) and not isinstance(v, bool):
|
| 141 |
+
return round(float(v), 2)
|
| 142 |
+
if isinstance(v, dt.datetime):
|
| 143 |
+
return round((v - dt.datetime(1899, 12, 30)).total_seconds() / 86400.0, 0)
|
| 144 |
+
if isinstance(v, dt.time):
|
| 145 |
+
return v.strftime("%H:%M")
|
| 146 |
+
if isinstance(v, str):
|
| 147 |
+
try:
|
| 148 |
+
return round(float(v), 2)
|
| 149 |
+
except ValueError:
|
| 150 |
+
return v.strip()
|
| 151 |
+
return v
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def time_of(v):
|
| 155 |
+
"""A time or a day fraction in [0, 1) as HH:MM, rounded to the nearest second first. Calc and
|
| 156 |
+
Excel store a time as that fraction; openpyxl returns a time only for time-formatted cells."""
|
| 157 |
+
if isinstance(v, dt.time):
|
| 158 |
+
v = (v.hour * 3600 + v.minute * 60 + v.second + v.microsecond / 1e6) / 86400
|
| 159 |
+
if isinstance(v, (int, float)) and not isinstance(v, bool) and 0 <= v < 1:
|
| 160 |
+
return (dt.datetime(1899, 12, 30) + dt.timedelta(seconds=round(v * 86400))).strftime("%H:%M")
|
| 161 |
+
return None
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def same_cell(a, b):
|
| 165 |
+
if isinstance(a, dt.time) is not isinstance(b, dt.time):
|
| 166 |
+
n = b if isinstance(a, dt.time) else a
|
| 167 |
+
if time_of(n) is not None: # a time against a plain day fraction
|
| 168 |
+
return time_of(a) == time_of(b)
|
| 169 |
+
a, b = cell_value(a), cell_value(b)
|
| 170 |
+
if a in (None, "") and b in (None, ""):
|
| 171 |
+
return True
|
| 172 |
+
return type(a) is type(b) and a == b
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
ERRORS = {"#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"}
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
def is_error(v):
|
| 179 |
+
return isinstance(v, str) and (v in ERRORS or v.startswith("Err:"))
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def cells(rng):
|
| 183 |
+
if ":" not in rng:
|
| 184 |
+
return [rng]
|
| 185 |
+
from openpyxl.utils import range_boundaries, get_column_letter
|
| 186 |
+
|
| 187 |
+
c1, r1, c2, r2 = range_boundaries(rng)
|
| 188 |
+
return [f"{get_column_letter(c)}{r}" for r in range(r1, r2 + 1) for c in range(c1, c2 + 1)]
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def load(path, tmp):
|
| 192 |
+
import openpyxl
|
| 193 |
+
|
| 194 |
+
return openpyxl.load_workbook(recalc(path, tmp), data_only=True)
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
def check_xlsx_range(check, tmp, cache):
|
| 198 |
+
sub = OUT / check["file"]
|
| 199 |
+
if not sub.is_file():
|
| 200 |
+
return False, f"missing output {check['file']}"
|
| 201 |
+
if sub not in cache:
|
| 202 |
+
cache[sub] = load(sub, tmp)
|
| 203 |
+
tgt = TESTS / check["target"]
|
| 204 |
+
if tgt not in cache:
|
| 205 |
+
cache[tgt] = load(tgt, tmp)
|
| 206 |
+
got, want = cache[sub], cache[tgt]
|
| 207 |
+
cached = None # the target's stored (Excel-computed) values, read only when Calc errs
|
| 208 |
+
for sheet, rng in check["ranges"]:
|
| 209 |
+
sheet = sheet or want.sheetnames[0]
|
| 210 |
+
if sheet not in got.sheetnames:
|
| 211 |
+
return False, f"sheet {sheet!r} missing"
|
| 212 |
+
for name in cells(rng):
|
| 213 |
+
w = want[sheet][name].value
|
| 214 |
+
if is_error(w):
|
| 215 |
+
# LibreOffice could not evaluate the gold formula (e.g. XLOOKUP, FILTER in Calc 7.4).
|
| 216 |
+
# The value Excel stored is the intended answer.
|
| 217 |
+
if cached is None:
|
| 218 |
+
import openpyxl
|
| 219 |
+
|
| 220 |
+
cached = openpyxl.load_workbook(tgt, data_only=True)
|
| 221 |
+
c = cached[sheet][name].value if sheet in cached.sheetnames else None
|
| 222 |
+
if c is not None and not is_error(c):
|
| 223 |
+
w = c
|
| 224 |
+
if not same_cell(w, got[sheet][name].value):
|
| 225 |
+
return False, f"{sheet}!{name}: want {w!r} got {got[sheet][name].value!r}"
|
| 226 |
+
return True, ""
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
def check_xlsx_cell(check, tmp, cache):
|
| 230 |
+
sub = OUT / check["file"]
|
| 231 |
+
if not sub.is_file():
|
| 232 |
+
return False, f"missing output {check['file']}"
|
| 233 |
+
if sub not in cache:
|
| 234 |
+
cache[sub] = load(sub, tmp)
|
| 235 |
+
wb = cache[sub]
|
| 236 |
+
if check["sheet"] not in wb.sheetnames:
|
| 237 |
+
return False, f"sheet {check['sheet']!r} missing"
|
| 238 |
+
got = wb[check["sheet"]][check["cell"]].value
|
| 239 |
+
want = check["value"]
|
| 240 |
+
if isinstance(want, (int, float)):
|
| 241 |
+
# alt_values: other accepted golds where the source admits more than one reading.
|
| 242 |
+
ok = got is not None and any(number_ok(got, w, check.get("rel_tol", 0.0), check.get("abs_tol", 0.01))
|
| 243 |
+
for w in [want, *check.get("alt_values", [])])
|
| 244 |
+
else:
|
| 245 |
+
ok = norm_text(got) == norm_text(want)
|
| 246 |
+
return ok, "" if ok else f"{check['sheet']}!{check['cell']}: want {want!r} got {got!r}"
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def text_of(path):
|
| 250 |
+
suffix = path.suffix.lower()
|
| 251 |
+
if suffix == ".docx":
|
| 252 |
+
import docx
|
| 253 |
+
|
| 254 |
+
d = docx.Document(path)
|
| 255 |
+
parts = [p.text for p in d.paragraphs]
|
| 256 |
+
for t in d.tables:
|
| 257 |
+
parts += [c.text for row in t.rows for c in row.cells]
|
| 258 |
+
return "\n".join(parts)
|
| 259 |
+
if suffix == ".pdf":
|
| 260 |
+
import pdfplumber
|
| 261 |
+
|
| 262 |
+
with pdfplumber.open(path) as pdf:
|
| 263 |
+
return "\n".join(page.extract_text() or "" for page in pdf.pages)
|
| 264 |
+
return path.read_text(errors="replace")
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def check_file_contains(check, tmp, cache):
|
| 268 |
+
sub = OUT / check["file"]
|
| 269 |
+
if not sub.is_file():
|
| 270 |
+
return False, f"missing output {check['file']}"
|
| 271 |
+
text = text_of(sub)
|
| 272 |
+
hay = text if check.get("case_sensitive") else text.casefold()
|
| 273 |
+
for needle in check["needles"]:
|
| 274 |
+
n = needle if check.get("case_sensitive") else needle.casefold()
|
| 275 |
+
if n not in hay:
|
| 276 |
+
return False, f"{check['file']} lacks {needle!r}"
|
| 277 |
+
return True, ""
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
def main():
|
| 281 |
+
LOGS.mkdir(parents=True, exist_ok=True)
|
| 282 |
+
reward_path = LOGS / "reward.txt"
|
| 283 |
+
reward_path.write_text("0\n")
|
| 284 |
+
spec = json.loads((TESTS / "expected.json").read_text())
|
| 285 |
+
answers, details = {}, []
|
| 286 |
+
answer_file = OUT / "answer.json"
|
| 287 |
+
if answer_file.is_file():
|
| 288 |
+
try:
|
| 289 |
+
answers = json.loads(answer_file.read_text())
|
| 290 |
+
if not isinstance(answers, dict):
|
| 291 |
+
answers = {}
|
| 292 |
+
except json.JSONDecodeError:
|
| 293 |
+
answers = {}
|
| 294 |
+
tmp = tempfile.mkdtemp()
|
| 295 |
+
cache = {}
|
| 296 |
+
try:
|
| 297 |
+
for check in spec["checks"]:
|
| 298 |
+
try:
|
| 299 |
+
if check["type"] == "answer":
|
| 300 |
+
ok, why = check_answer(check, answers)
|
| 301 |
+
elif check["type"] == "xlsx_range":
|
| 302 |
+
ok, why = check_xlsx_range(check, tmp, cache)
|
| 303 |
+
elif check["type"] == "xlsx_cell":
|
| 304 |
+
ok, why = check_xlsx_cell(check, tmp, cache)
|
| 305 |
+
elif check["type"] == "file_contains":
|
| 306 |
+
ok, why = check_file_contains(check, tmp, cache)
|
| 307 |
+
elif check["type"] == "custom":
|
| 308 |
+
import importlib.util
|
| 309 |
+
|
| 310 |
+
spec_ = importlib.util.spec_from_file_location("custom_check", TESTS / f"{check['module']}.py")
|
| 311 |
+
mod = importlib.util.module_from_spec(spec_)
|
| 312 |
+
spec_.loader.exec_module(mod)
|
| 313 |
+
ok, why = mod.check(check, OUT, TESTS)
|
| 314 |
+
else:
|
| 315 |
+
ok, why = False, f"unknown check type {check['type']}"
|
| 316 |
+
except Exception as exc: # a malformed submission fails the check, not the grader
|
| 317 |
+
ok, why = False, f"{type(exc).__name__}: {exc}"
|
| 318 |
+
details.append({"id": check["id"], "passed": ok, "detail": why})
|
| 319 |
+
finally:
|
| 320 |
+
shutil.rmtree(tmp, ignore_errors=True)
|
| 321 |
+
passed = sum(d["passed"] for d in details)
|
| 322 |
+
total = len(details)
|
| 323 |
+
reward = 1 if total and passed == total else 0
|
| 324 |
+
(LOGS / "details.json").write_text(json.dumps({"passed": passed, "total": total, "checks": details}, indent=1))
|
| 325 |
+
reward_path.write_text(f"{reward}\n")
|
| 326 |
+
print(f"{passed}/{total} checks passed; reward {reward}")
|
| 327 |
+
|
| 328 |
+
|
| 329 |
+
if __name__ == "__main__":
|
| 330 |
+
sys.exit(main())
|
tasks/autom-supplier-invoice-match-008/tests/replay.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-008/tests/target.json
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
"invoice": "IV-2441-2-0",
|
| 7 |
+
"po": "PO2",
|
| 8 |
+
"status": "posted",
|
| 9 |
+
"units": 24
|
| 10 |
+
},
|
| 11 |
+
"book-IV-5898-1-2": {
|
| 12 |
+
"amount_cents": 132572,
|
| 13 |
+
"due": "2025-08-01",
|
| 14 |
+
"invoice": "IV-5898-1-2",
|
| 15 |
+
"po": "PO1",
|
| 16 |
+
"status": "posted",
|
| 17 |
+
"units": 11
|
| 18 |
+
},
|
| 19 |
+
"book-IV-6039-3-0": {
|
| 20 |
+
"amount_cents": 268512,
|
| 21 |
+
"due": "2025-07-25",
|
| 22 |
+
"invoice": "IV-6039-3-0",
|
| 23 |
+
"po": "PO3",
|
| 24 |
+
"status": "posted",
|
| 25 |
+
"units": 24
|
| 26 |
+
},
|
| 27 |
+
"book-IV-6195-1-0": {
|
| 28 |
+
"amount_cents": 48276,
|
| 29 |
+
"due": "2025-07-25",
|
| 30 |
+
"invoice": "IV-6195-1-0",
|
| 31 |
+
"po": "PO1",
|
| 32 |
+
"status": "posted",
|
| 33 |
+
"units": 4
|
| 34 |
+
},
|
| 35 |
+
"book-IV-6673-0-0": {
|
| 36 |
+
"amount_cents": 20814,
|
| 37 |
+
"due": "2025-08-11",
|
| 38 |
+
"invoice": "IV-6673-0-0",
|
| 39 |
+
"po": "PO0",
|
| 40 |
+
"status": "posted",
|
| 41 |
+
"units": 1
|
| 42 |
+
},
|
| 43 |
+
"book-IV-7714-4-0": {
|
| 44 |
+
"amount_cents": 83728,
|
| 45 |
+
"due": "2025-07-31",
|
| 46 |
+
"invoice": "IV-7714-4-0",
|
| 47 |
+
"po": "PO4",
|
| 48 |
+
"status": "posted",
|
| 49 |
+
"units": 8
|
| 50 |
+
},
|
| 51 |
+
"book-IV-8625-5-0": {
|
| 52 |
+
"amount_cents": 163197,
|
| 53 |
+
"due": "2025-07-25",
|
| 54 |
+
"invoice": "IV-8625-5-0",
|
| 55 |
+
"po": "PO5",
|
| 56 |
+
"status": "posted",
|
| 57 |
+
"units": 9
|
| 58 |
+
},
|
| 59 |
+
"booked-PO0": {
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"status": "posted",
|
| 62 |
+
"units": 3
|
| 63 |
+
},
|
| 64 |
+
"booked-PO1": {
|
| 65 |
+
"po": "PO1",
|
| 66 |
+
"status": "posted",
|
| 67 |
+
"units": 2
|
| 68 |
+
},
|
| 69 |
+
"booked-PO2": {
|
| 70 |
+
"po": "PO2",
|
| 71 |
+
"status": "posted",
|
| 72 |
+
"units": 2
|
| 73 |
+
},
|
| 74 |
+
"booked-PO3": {
|
| 75 |
+
"po": "PO3",
|
| 76 |
+
"status": "posted",
|
| 77 |
+
"units": 2
|
| 78 |
+
},
|
| 79 |
+
"booked-PO4": {
|
| 80 |
+
"po": "PO4",
|
| 81 |
+
"status": "posted",
|
| 82 |
+
"units": 7
|
| 83 |
+
},
|
| 84 |
+
"booked-PO5": {
|
| 85 |
+
"po": "PO5",
|
| 86 |
+
"status": "posted",
|
| 87 |
+
"units": 5
|
| 88 |
+
},
|
| 89 |
+
"booked-PO6": {
|
| 90 |
+
"po": "PO6",
|
| 91 |
+
"status": "posted",
|
| 92 |
+
"units": 6
|
| 93 |
+
}
|
| 94 |
+
},
|
| 95 |
+
"goods_receipts": {
|
| 96 |
+
"GI-0-0": {
|
| 97 |
+
"date": "2025-07-30",
|
| 98 |
+
"po": "PO0",
|
| 99 |
+
"state": "accepted",
|
| 100 |
+
"units": 20
|
| 101 |
+
},
|
| 102 |
+
"GI-0-1": {
|
| 103 |
+
"date": "2025-07-14",
|
| 104 |
+
"po": "PO0",
|
| 105 |
+
"state": "quarantine",
|
| 106 |
+
"units": 27
|
| 107 |
+
},
|
| 108 |
+
"GI-0-2": {
|
| 109 |
+
"date": "2025-07-27",
|
| 110 |
+
"po": "PO0",
|
| 111 |
+
"state": "quarantine",
|
| 112 |
+
"units": 22
|
| 113 |
+
},
|
| 114 |
+
"GI-0-3": {
|
| 115 |
+
"date": "2025-08-01",
|
| 116 |
+
"po": "PO0",
|
| 117 |
+
"state": "accepted",
|
| 118 |
+
"units": 15
|
| 119 |
+
},
|
| 120 |
+
"GI-1-0": {
|
| 121 |
+
"date": "2025-07-30",
|
| 122 |
+
"po": "PO1",
|
| 123 |
+
"state": "accepted",
|
| 124 |
+
"units": 15
|
| 125 |
+
},
|
| 126 |
+
"GI-1-1": {
|
| 127 |
+
"date": "2025-08-01",
|
| 128 |
+
"po": "PO1",
|
| 129 |
+
"state": "accepted",
|
| 130 |
+
"units": 14
|
| 131 |
+
},
|
| 132 |
+
"GI-1-2": {
|
| 133 |
+
"date": "2025-07-30",
|
| 134 |
+
"po": "PO1",
|
| 135 |
+
"state": "accepted",
|
| 136 |
+
"units": 23
|
| 137 |
+
},
|
| 138 |
+
"GI-1-3": {
|
| 139 |
+
"date": "2025-07-31",
|
| 140 |
+
"po": "PO1",
|
| 141 |
+
"state": "accepted",
|
| 142 |
+
"units": 27
|
| 143 |
+
},
|
| 144 |
+
"GI-2-0": {
|
| 145 |
+
"date": "2025-07-30",
|
| 146 |
+
"po": "PO2",
|
| 147 |
+
"state": "accepted",
|
| 148 |
+
"units": 22
|
| 149 |
+
},
|
| 150 |
+
"GI-2-1": {
|
| 151 |
+
"date": "2025-07-19",
|
| 152 |
+
"po": "PO2",
|
| 153 |
+
"state": "accepted",
|
| 154 |
+
"units": 17
|
| 155 |
+
},
|
| 156 |
+
"GI-2-2": {
|
| 157 |
+
"date": "2025-07-18",
|
| 158 |
+
"po": "PO2",
|
| 159 |
+
"state": "quarantine",
|
| 160 |
+
"units": 16
|
| 161 |
+
},
|
| 162 |
+
"GI-2-3": {
|
| 163 |
+
"date": "2025-08-03",
|
| 164 |
+
"po": "PO2",
|
| 165 |
+
"state": "accepted",
|
| 166 |
+
"units": 19
|
| 167 |
+
},
|
| 168 |
+
"GI-3-0": {
|
| 169 |
+
"date": "2025-07-30",
|
| 170 |
+
"po": "PO3",
|
| 171 |
+
"state": "accepted",
|
| 172 |
+
"units": 18
|
| 173 |
+
},
|
| 174 |
+
"GI-3-1": {
|
| 175 |
+
"date": "2025-07-20",
|
| 176 |
+
"po": "PO3",
|
| 177 |
+
"state": "quarantine",
|
| 178 |
+
"units": 22
|
| 179 |
+
},
|
| 180 |
+
"GI-3-2": {
|
| 181 |
+
"date": "2025-07-31",
|
| 182 |
+
"po": "PO3",
|
| 183 |
+
"state": "quarantine",
|
| 184 |
+
"units": 21
|
| 185 |
+
},
|
| 186 |
+
"GI-3-3": {
|
| 187 |
+
"date": "2025-07-19",
|
| 188 |
+
"po": "PO3",
|
| 189 |
+
"state": "accepted",
|
| 190 |
+
"units": 23
|
| 191 |
+
},
|
| 192 |
+
"GI-4-0": {
|
| 193 |
+
"date": "2025-07-30",
|
| 194 |
+
"po": "PO4",
|
| 195 |
+
"state": "accepted",
|
| 196 |
+
"units": 25
|
| 197 |
+
},
|
| 198 |
+
"GI-4-1": {
|
| 199 |
+
"date": "2025-07-14",
|
| 200 |
+
"po": "PO4",
|
| 201 |
+
"state": "quarantine",
|
| 202 |
+
"units": 14
|
| 203 |
+
},
|
| 204 |
+
"GI-4-2": {
|
| 205 |
+
"date": "2025-07-23",
|
| 206 |
+
"po": "PO4",
|
| 207 |
+
"state": "quarantine",
|
| 208 |
+
"units": 14
|
| 209 |
+
},
|
| 210 |
+
"GI-4-3": {
|
| 211 |
+
"date": "2025-07-26",
|
| 212 |
+
"po": "PO4",
|
| 213 |
+
"state": "accepted",
|
| 214 |
+
"units": 21
|
| 215 |
+
},
|
| 216 |
+
"GI-5-0": {
|
| 217 |
+
"date": "2025-07-30",
|
| 218 |
+
"po": "PO5",
|
| 219 |
+
"state": "accepted",
|
| 220 |
+
"units": 13
|
| 221 |
+
},
|
| 222 |
+
"GI-5-1": {
|
| 223 |
+
"date": "2025-07-07",
|
| 224 |
+
"po": "PO5",
|
| 225 |
+
"state": "quarantine",
|
| 226 |
+
"units": 20
|
| 227 |
+
},
|
| 228 |
+
"GI-5-2": {
|
| 229 |
+
"date": "2025-07-21",
|
| 230 |
+
"po": "PO5",
|
| 231 |
+
"state": "quarantine",
|
| 232 |
+
"units": 18
|
| 233 |
+
},
|
| 234 |
+
"GI-5-3": {
|
| 235 |
+
"date": "2025-07-08",
|
| 236 |
+
"po": "PO5",
|
| 237 |
+
"state": "accepted",
|
| 238 |
+
"units": 25
|
| 239 |
+
},
|
| 240 |
+
"GI-6-0": {
|
| 241 |
+
"date": "2025-07-30",
|
| 242 |
+
"po": "PO6",
|
| 243 |
+
"state": "accepted",
|
| 244 |
+
"units": 28
|
| 245 |
+
},
|
| 246 |
+
"GI-6-1": {
|
| 247 |
+
"date": "2025-08-02",
|
| 248 |
+
"po": "PO6",
|
| 249 |
+
"state": "accepted",
|
| 250 |
+
"units": 28
|
| 251 |
+
},
|
| 252 |
+
"GI-6-2": {
|
| 253 |
+
"date": "2025-07-13",
|
| 254 |
+
"po": "PO6",
|
| 255 |
+
"state": "accepted",
|
| 256 |
+
"units": 27
|
| 257 |
+
},
|
| 258 |
+
"GI-6-3": {
|
| 259 |
+
"date": "2025-08-04",
|
| 260 |
+
"po": "PO6",
|
| 261 |
+
"state": "quarantine",
|
| 262 |
+
"units": 23
|
| 263 |
+
}
|
| 264 |
+
},
|
| 265 |
+
"invoice_inbox": {
|
| 266 |
+
"IV-1042-6-1": {
|
| 267 |
+
"date": "2025-07-12",
|
| 268 |
+
"po": "PO6",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 23221,
|
| 271 |
+
"units": 24,
|
| 272 |
+
"vendor": "V2"
|
| 273 |
+
},
|
| 274 |
+
"IV-2441-2-0": {
|
| 275 |
+
"date": "2025-07-10",
|
| 276 |
+
"po": "PO2",
|
| 277 |
+
"state": "posted",
|
| 278 |
+
"unit_price_cents": 3352,
|
| 279 |
+
"units": 24,
|
| 280 |
+
"vendor": "V0"
|
| 281 |
+
},
|
| 282 |
+
"IV-2499-2-2": {
|
| 283 |
+
"date": "2025-07-14",
|
| 284 |
+
"po": "PO2",
|
| 285 |
+
"state": "disputed",
|
| 286 |
+
"unit_price_cents": 3672,
|
| 287 |
+
"units": 24,
|
| 288 |
+
"vendor": "V0"
|
| 289 |
+
},
|
| 290 |
+
"IV-2842-1-3": {
|
| 291 |
+
"date": "2025-07-29",
|
| 292 |
+
"po": "PO1",
|
| 293 |
+
"state": "disputed",
|
| 294 |
+
"unit_price_cents": 14234,
|
| 295 |
+
"units": 15,
|
| 296 |
+
"vendor": "V2"
|
| 297 |
+
},
|
| 298 |
+
"IV-3512-2-1": {
|
| 299 |
+
"date": "2025-07-12",
|
| 300 |
+
"po": "PO2",
|
| 301 |
+
"state": "void",
|
| 302 |
+
"unit_price_cents": 5366,
|
| 303 |
+
"units": 7,
|
| 304 |
+
"vendor": "V0"
|
| 305 |
+
},
|
| 306 |
+
"IV-3645-2-3": {
|
| 307 |
+
"date": "2025-07-06",
|
| 308 |
+
"po": "PO2",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 4141,
|
| 311 |
+
"units": 14,
|
| 312 |
+
"vendor": "V0"
|
| 313 |
+
},
|
| 314 |
+
"IV-4781-1-1": {
|
| 315 |
+
"date": "2025-07-10",
|
| 316 |
+
"po": "PO1",
|
| 317 |
+
"state": "void",
|
| 318 |
+
"unit_price_cents": 14048,
|
| 319 |
+
"units": 12,
|
| 320 |
+
"vendor": "V2"
|
| 321 |
+
},
|
| 322 |
+
"IV-5355-0-3": {
|
| 323 |
+
"date": "2025-07-27",
|
| 324 |
+
"po": "PO0",
|
| 325 |
+
"state": "disputed",
|
| 326 |
+
"unit_price_cents": 22436,
|
| 327 |
+
"units": 9,
|
| 328 |
+
"vendor": "V1"
|
| 329 |
+
},
|
| 330 |
+
"IV-5362-5-1": {
|
| 331 |
+
"date": "2025-07-23",
|
| 332 |
+
"po": "PO5",
|
| 333 |
+
"state": "disputed",
|
| 334 |
+
"unit_price_cents": 19908,
|
| 335 |
+
"units": 6,
|
| 336 |
+
"vendor": "Unknown"
|
| 337 |
+
},
|
| 338 |
+
"IV-5898-1-2": {
|
| 339 |
+
"date": "2025-07-17",
|
| 340 |
+
"po": "PO1",
|
| 341 |
+
"state": "posted",
|
| 342 |
+
"unit_price_cents": 12052,
|
| 343 |
+
"units": 11,
|
| 344 |
+
"vendor": "V2"
|
| 345 |
+
},
|
| 346 |
+
"IV-6039-3-0": {
|
| 347 |
+
"date": "2025-07-10",
|
| 348 |
+
"po": "PO3",
|
| 349 |
+
"state": "posted",
|
| 350 |
+
"unit_price_cents": 11188,
|
| 351 |
+
"units": 24,
|
| 352 |
+
"vendor": "V4"
|
| 353 |
+
},
|
| 354 |
+
"IV-6192-4-1": {
|
| 355 |
+
"date": "2025-07-29",
|
| 356 |
+
"po": "PO4",
|
| 357 |
+
"state": "disputed",
|
| 358 |
+
"unit_price_cents": 12050,
|
| 359 |
+
"units": 9,
|
| 360 |
+
"vendor": "V0"
|
| 361 |
+
},
|
| 362 |
+
"IV-6195-1-0": {
|
| 363 |
+
"date": "2025-07-10",
|
| 364 |
+
"po": "PO1",
|
| 365 |
+
"state": "posted",
|
| 366 |
+
"unit_price_cents": 12069,
|
| 367 |
+
"units": 4,
|
| 368 |
+
"vendor": "V2"
|
| 369 |
+
},
|
| 370 |
+
"IV-6673-0-0": {
|
| 371 |
+
"date": "2025-07-10",
|
| 372 |
+
"po": "PO0",
|
| 373 |
+
"state": "posted",
|
| 374 |
+
"unit_price_cents": 20814,
|
| 375 |
+
"units": 1,
|
| 376 |
+
"vendor": "V1"
|
| 377 |
+
},
|
| 378 |
+
"IV-7091-3-1": {
|
| 379 |
+
"date": "2025-07-21",
|
| 380 |
+
"po": "PO3",
|
| 381 |
+
"state": "disputed",
|
| 382 |
+
"unit_price_cents": 11644,
|
| 383 |
+
"units": 13,
|
| 384 |
+
"vendor": "V4"
|
| 385 |
+
},
|
| 386 |
+
"IV-7714-4-0": {
|
| 387 |
+
"date": "2025-07-10",
|
| 388 |
+
"po": "PO4",
|
| 389 |
+
"state": "posted",
|
| 390 |
+
"unit_price_cents": 10466,
|
| 391 |
+
"units": 8,
|
| 392 |
+
"vendor": "V0"
|
| 393 |
+
},
|
| 394 |
+
"IV-8313-6-0": {
|
| 395 |
+
"date": "2025-07-10",
|
| 396 |
+
"po": "PO6",
|
| 397 |
+
"state": "review",
|
| 398 |
+
"unit_price_cents": 21349,
|
| 399 |
+
"units": 9,
|
| 400 |
+
"vendor": "V2"
|
| 401 |
+
},
|
| 402 |
+
"IV-8475-0-1": {
|
| 403 |
+
"date": "2025-07-11",
|
| 404 |
+
"po": "PO0",
|
| 405 |
+
"state": "void",
|
| 406 |
+
"unit_price_cents": 22241,
|
| 407 |
+
"units": 3,
|
| 408 |
+
"vendor": "Unknown"
|
| 409 |
+
},
|
| 410 |
+
"IV-8625-5-0": {
|
| 411 |
+
"date": "2025-07-10",
|
| 412 |
+
"po": "PO5",
|
| 413 |
+
"state": "posted",
|
| 414 |
+
"unit_price_cents": 18133,
|
| 415 |
+
"units": 9,
|
| 416 |
+
"vendor": "V4"
|
| 417 |
+
},
|
| 418 |
+
"IV-8964-0-2": {
|
| 419 |
+
"date": "2025-07-14",
|
| 420 |
+
"po": "PO0",
|
| 421 |
+
"state": "disputed",
|
| 422 |
+
"unit_price_cents": 22581,
|
| 423 |
+
"units": 21,
|
| 424 |
+
"vendor": "V1"
|
| 425 |
+
}
|
| 426 |
+
},
|
| 427 |
+
"purchase_orders": {
|
| 428 |
+
"PO0": {
|
| 429 |
+
"unit": "South",
|
| 430 |
+
"unit_price_cents": 20814,
|
| 431 |
+
"vendor": "V1"
|
| 432 |
+
},
|
| 433 |
+
"PO1": {
|
| 434 |
+
"unit": "South",
|
| 435 |
+
"unit_price_cents": 12069,
|
| 436 |
+
"vendor": "V2"
|
| 437 |
+
},
|
| 438 |
+
"PO2": {
|
| 439 |
+
"unit": "South",
|
| 440 |
+
"unit_price_cents": 3352,
|
| 441 |
+
"vendor": "V0"
|
| 442 |
+
},
|
| 443 |
+
"PO3": {
|
| 444 |
+
"unit": "South",
|
| 445 |
+
"unit_price_cents": 11188,
|
| 446 |
+
"vendor": "V4"
|
| 447 |
+
},
|
| 448 |
+
"PO4": {
|
| 449 |
+
"unit": "South",
|
| 450 |
+
"unit_price_cents": 10466,
|
| 451 |
+
"vendor": "V0"
|
| 452 |
+
},
|
| 453 |
+
"PO5": {
|
| 454 |
+
"unit": "South",
|
| 455 |
+
"unit_price_cents": 18133,
|
| 456 |
+
"vendor": "V4"
|
| 457 |
+
},
|
| 458 |
+
"PO6": {
|
| 459 |
+
"unit": "Other",
|
| 460 |
+
"unit_price_cents": 21349,
|
| 461 |
+
"vendor": "V2"
|
| 462 |
+
}
|
| 463 |
+
},
|
| 464 |
+
"supplier_cases": {
|
| 465 |
+
"PREEXISTING": {
|
| 466 |
+
"status": "investigating"
|
| 467 |
+
},
|
| 468 |
+
"case-IV-2499-2-2": {
|
| 469 |
+
"invoice": "IV-2499-2-2",
|
| 470 |
+
"issues": [
|
| 471 |
+
"price",
|
| 472 |
+
"units"
|
| 473 |
+
],
|
| 474 |
+
"po": "PO2"
|
| 475 |
+
},
|
| 476 |
+
"case-IV-2842-1-3": {
|
| 477 |
+
"invoice": "IV-2842-1-3",
|
| 478 |
+
"issues": [
|
| 479 |
+
"price"
|
| 480 |
+
],
|
| 481 |
+
"po": "PO1"
|
| 482 |
+
},
|
| 483 |
+
"case-IV-5355-0-3": {
|
| 484 |
+
"invoice": "IV-5355-0-3",
|
| 485 |
+
"issues": [
|
| 486 |
+
"price"
|
| 487 |
+
],
|
| 488 |
+
"po": "PO0"
|
| 489 |
+
},
|
| 490 |
+
"case-IV-5362-5-1": {
|
| 491 |
+
"invoice": "IV-5362-5-1",
|
| 492 |
+
"issues": [
|
| 493 |
+
"vendor",
|
| 494 |
+
"price"
|
| 495 |
+
],
|
| 496 |
+
"po": "PO5"
|
| 497 |
+
},
|
| 498 |
+
"case-IV-6192-4-1": {
|
| 499 |
+
"invoice": "IV-6192-4-1",
|
| 500 |
+
"issues": [
|
| 501 |
+
"price"
|
| 502 |
+
],
|
| 503 |
+
"po": "PO4"
|
| 504 |
+
},
|
| 505 |
+
"case-IV-7091-3-1": {
|
| 506 |
+
"invoice": "IV-7091-3-1",
|
| 507 |
+
"issues": [
|
| 508 |
+
"price"
|
| 509 |
+
],
|
| 510 |
+
"po": "PO3"
|
| 511 |
+
},
|
| 512 |
+
"case-IV-8964-0-2": {
|
| 513 |
+
"invoice": "IV-8964-0-2",
|
| 514 |
+
"issues": [
|
| 515 |
+
"price",
|
| 516 |
+
"units"
|
| 517 |
+
],
|
| 518 |
+
"po": "PO0"
|
| 519 |
+
}
|
| 520 |
+
},
|
| 521 |
+
"vendors": {
|
| 522 |
+
"V0": {
|
| 523 |
+
"net_days": 21
|
| 524 |
+
},
|
| 525 |
+
"V1": {
|
| 526 |
+
"net_days": 30
|
| 527 |
+
},
|
| 528 |
+
"V2": {
|
| 529 |
+
"net_days": 15
|
| 530 |
+
},
|
| 531 |
+
"V3": {
|
| 532 |
+
"net_days": 45
|
| 533 |
+
},
|
| 534 |
+
"V4": {
|
| 535 |
+
"net_days": 15
|
| 536 |
+
}
|
| 537 |
+
}
|
| 538 |
+
}
|
tasks/autom-supplier-invoice-match-008/tests/test.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /logs/verifier /workspace/outputs
|
| 4 |
+
exec python3 -B -I /tests/grade.py
|
tasks/autom-supplier-invoice-match-008/tests/world.json
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 3
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 2
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 2
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 2
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 7
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 5
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 6
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-07-30",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 20
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-07-14",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "quarantine",
|
| 50 |
+
"units": 27
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-07-27",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "quarantine",
|
| 56 |
+
"units": 22
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-08-01",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 15
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-07-30",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 15
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-08-01",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "accepted",
|
| 74 |
+
"units": 14
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-07-30",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "accepted",
|
| 80 |
+
"units": 23
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-07-31",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 27
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-07-30",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 22
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-07-19",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "accepted",
|
| 98 |
+
"units": 17
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-07-18",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "quarantine",
|
| 104 |
+
"units": 16
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-08-03",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "accepted",
|
| 110 |
+
"units": 19
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-07-30",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 18
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-07-20",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "quarantine",
|
| 122 |
+
"units": 22
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-07-31",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "quarantine",
|
| 128 |
+
"units": 21
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-07-19",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "accepted",
|
| 134 |
+
"units": 23
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-07-30",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 25
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-07-14",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "quarantine",
|
| 146 |
+
"units": 14
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-07-23",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "quarantine",
|
| 152 |
+
"units": 14
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-07-26",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "accepted",
|
| 158 |
+
"units": 21
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-07-30",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 13
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-07-07",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "quarantine",
|
| 170 |
+
"units": 20
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-07-21",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "quarantine",
|
| 176 |
+
"units": 18
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-07-08",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "accepted",
|
| 182 |
+
"units": 25
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-07-30",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 28
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-08-02",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 28
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-07-13",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 27
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-08-04",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 23
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-1042-6-1": {
|
| 211 |
+
"date": "2025-07-12",
|
| 212 |
+
"po": "PO6",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 23221,
|
| 215 |
+
"units": 24,
|
| 216 |
+
"vendor": "V2"
|
| 217 |
+
},
|
| 218 |
+
"IV-2441-2-0": {
|
| 219 |
+
"date": "2025-07-10",
|
| 220 |
+
"po": "PO2",
|
| 221 |
+
"state": "review",
|
| 222 |
+
"unit_price_cents": 3352,
|
| 223 |
+
"units": 24,
|
| 224 |
+
"vendor": "V0"
|
| 225 |
+
},
|
| 226 |
+
"IV-2499-2-2": {
|
| 227 |
+
"date": "2025-07-14",
|
| 228 |
+
"po": "PO2",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 3672,
|
| 231 |
+
"units": 24,
|
| 232 |
+
"vendor": "V0"
|
| 233 |
+
},
|
| 234 |
+
"IV-2842-1-3": {
|
| 235 |
+
"date": "2025-07-29",
|
| 236 |
+
"po": "PO1",
|
| 237 |
+
"state": "review",
|
| 238 |
+
"unit_price_cents": 14234,
|
| 239 |
+
"units": 15,
|
| 240 |
+
"vendor": "V2"
|
| 241 |
+
},
|
| 242 |
+
"IV-3512-2-1": {
|
| 243 |
+
"date": "2025-07-12",
|
| 244 |
+
"po": "PO2",
|
| 245 |
+
"state": "void",
|
| 246 |
+
"unit_price_cents": 5366,
|
| 247 |
+
"units": 7,
|
| 248 |
+
"vendor": "V0"
|
| 249 |
+
},
|
| 250 |
+
"IV-3645-2-3": {
|
| 251 |
+
"date": "2025-07-06",
|
| 252 |
+
"po": "PO2",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 4141,
|
| 255 |
+
"units": 14,
|
| 256 |
+
"vendor": "V0"
|
| 257 |
+
},
|
| 258 |
+
"IV-4781-1-1": {
|
| 259 |
+
"date": "2025-07-10",
|
| 260 |
+
"po": "PO1",
|
| 261 |
+
"state": "void",
|
| 262 |
+
"unit_price_cents": 14048,
|
| 263 |
+
"units": 12,
|
| 264 |
+
"vendor": "V2"
|
| 265 |
+
},
|
| 266 |
+
"IV-5355-0-3": {
|
| 267 |
+
"date": "2025-07-27",
|
| 268 |
+
"po": "PO0",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 22436,
|
| 271 |
+
"units": 9,
|
| 272 |
+
"vendor": "V1"
|
| 273 |
+
},
|
| 274 |
+
"IV-5362-5-1": {
|
| 275 |
+
"date": "2025-07-23",
|
| 276 |
+
"po": "PO5",
|
| 277 |
+
"state": "review",
|
| 278 |
+
"unit_price_cents": 19908,
|
| 279 |
+
"units": 6,
|
| 280 |
+
"vendor": "Unknown"
|
| 281 |
+
},
|
| 282 |
+
"IV-5898-1-2": {
|
| 283 |
+
"date": "2025-07-17",
|
| 284 |
+
"po": "PO1",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 12052,
|
| 287 |
+
"units": 11,
|
| 288 |
+
"vendor": "V2"
|
| 289 |
+
},
|
| 290 |
+
"IV-6039-3-0": {
|
| 291 |
+
"date": "2025-07-10",
|
| 292 |
+
"po": "PO3",
|
| 293 |
+
"state": "review",
|
| 294 |
+
"unit_price_cents": 11188,
|
| 295 |
+
"units": 24,
|
| 296 |
+
"vendor": "V4"
|
| 297 |
+
},
|
| 298 |
+
"IV-6192-4-1": {
|
| 299 |
+
"date": "2025-07-29",
|
| 300 |
+
"po": "PO4",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 12050,
|
| 303 |
+
"units": 9,
|
| 304 |
+
"vendor": "V0"
|
| 305 |
+
},
|
| 306 |
+
"IV-6195-1-0": {
|
| 307 |
+
"date": "2025-07-10",
|
| 308 |
+
"po": "PO1",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 12069,
|
| 311 |
+
"units": 4,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-6673-0-0": {
|
| 315 |
+
"date": "2025-07-10",
|
| 316 |
+
"po": "PO0",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 20814,
|
| 319 |
+
"units": 1,
|
| 320 |
+
"vendor": "V1"
|
| 321 |
+
},
|
| 322 |
+
"IV-7091-3-1": {
|
| 323 |
+
"date": "2025-07-21",
|
| 324 |
+
"po": "PO3",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 11644,
|
| 327 |
+
"units": 13,
|
| 328 |
+
"vendor": "V4"
|
| 329 |
+
},
|
| 330 |
+
"IV-7714-4-0": {
|
| 331 |
+
"date": "2025-07-10",
|
| 332 |
+
"po": "PO4",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 10466,
|
| 335 |
+
"units": 8,
|
| 336 |
+
"vendor": "V0"
|
| 337 |
+
},
|
| 338 |
+
"IV-8313-6-0": {
|
| 339 |
+
"date": "2025-07-10",
|
| 340 |
+
"po": "PO6",
|
| 341 |
+
"state": "review",
|
| 342 |
+
"unit_price_cents": 21349,
|
| 343 |
+
"units": 9,
|
| 344 |
+
"vendor": "V2"
|
| 345 |
+
},
|
| 346 |
+
"IV-8475-0-1": {
|
| 347 |
+
"date": "2025-07-11",
|
| 348 |
+
"po": "PO0",
|
| 349 |
+
"state": "void",
|
| 350 |
+
"unit_price_cents": 22241,
|
| 351 |
+
"units": 3,
|
| 352 |
+
"vendor": "Unknown"
|
| 353 |
+
},
|
| 354 |
+
"IV-8625-5-0": {
|
| 355 |
+
"date": "2025-07-10",
|
| 356 |
+
"po": "PO5",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 18133,
|
| 359 |
+
"units": 9,
|
| 360 |
+
"vendor": "V4"
|
| 361 |
+
},
|
| 362 |
+
"IV-8964-0-2": {
|
| 363 |
+
"date": "2025-07-14",
|
| 364 |
+
"po": "PO0",
|
| 365 |
+
"state": "review",
|
| 366 |
+
"unit_price_cents": 22581,
|
| 367 |
+
"units": 21,
|
| 368 |
+
"vendor": "V1"
|
| 369 |
+
}
|
| 370 |
+
},
|
| 371 |
+
"purchase_orders": {
|
| 372 |
+
"PO0": {
|
| 373 |
+
"unit": "South",
|
| 374 |
+
"unit_price_cents": 20814,
|
| 375 |
+
"vendor": "V1"
|
| 376 |
+
},
|
| 377 |
+
"PO1": {
|
| 378 |
+
"unit": "South",
|
| 379 |
+
"unit_price_cents": 12069,
|
| 380 |
+
"vendor": "V2"
|
| 381 |
+
},
|
| 382 |
+
"PO2": {
|
| 383 |
+
"unit": "South",
|
| 384 |
+
"unit_price_cents": 3352,
|
| 385 |
+
"vendor": "V0"
|
| 386 |
+
},
|
| 387 |
+
"PO3": {
|
| 388 |
+
"unit": "South",
|
| 389 |
+
"unit_price_cents": 11188,
|
| 390 |
+
"vendor": "V4"
|
| 391 |
+
},
|
| 392 |
+
"PO4": {
|
| 393 |
+
"unit": "South",
|
| 394 |
+
"unit_price_cents": 10466,
|
| 395 |
+
"vendor": "V0"
|
| 396 |
+
},
|
| 397 |
+
"PO5": {
|
| 398 |
+
"unit": "South",
|
| 399 |
+
"unit_price_cents": 18133,
|
| 400 |
+
"vendor": "V4"
|
| 401 |
+
},
|
| 402 |
+
"PO6": {
|
| 403 |
+
"unit": "Other",
|
| 404 |
+
"unit_price_cents": 21349,
|
| 405 |
+
"vendor": "V2"
|
| 406 |
+
}
|
| 407 |
+
},
|
| 408 |
+
"supplier_cases": {
|
| 409 |
+
"PREEXISTING": {
|
| 410 |
+
"status": "investigating"
|
| 411 |
+
}
|
| 412 |
+
},
|
| 413 |
+
"vendors": {
|
| 414 |
+
"V0": {
|
| 415 |
+
"net_days": 21
|
| 416 |
+
},
|
| 417 |
+
"V1": {
|
| 418 |
+
"net_days": 30
|
| 419 |
+
},
|
| 420 |
+
"V2": {
|
| 421 |
+
"net_days": 15
|
| 422 |
+
},
|
| 423 |
+
"V3": {
|
| 424 |
+
"net_days": 45
|
| 425 |
+
},
|
| 426 |
+
"V4": {
|
| 427 |
+
"net_days": 15
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
}
|
tasks/autom-supplier-invoice-match-008/tests/world_check.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Replay submitted mutations from the private verifier's initial state."""
|
| 2 |
+
from types import ModuleType
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def check(spec, outputs, tests):
|
| 7 |
+
replay = ModuleType('workflow_replay')
|
| 8 |
+
exec(compile((tests/'replay.py').read_bytes(), 'replay.py', 'exec'), replay.__dict__)
|
| 9 |
+
world = json.loads((tests/'world.json').read_text())
|
| 10 |
+
target = json.loads((tests/'target.json').read_text())
|
| 11 |
+
# Only fields whose starting and expected values differ may be changed. Attempts
|
| 12 |
+
# to temporarily alter a protected field fail even when a later write restores it.
|
| 13 |
+
allowed = {
|
| 14 |
+
(app,key): {field for field,value in doc.items()
|
| 15 |
+
if field not in world[app].get(key,{}) or not replay.same(world[app][key][field],value)}
|
| 16 |
+
for app,records in target.items() for key,doc in records.items()
|
| 17 |
+
}
|
| 18 |
+
actions = replay.load_actions(outputs/'actions.jsonl')
|
| 19 |
+
for event in actions:
|
| 20 |
+
replay.apply(world,event)
|
| 21 |
+
touched = set(event['fields'])
|
| 22 |
+
if not touched <= allowed.get((event['app'],event['id']),set()):
|
| 23 |
+
return False,'protected field or record write'
|
| 24 |
+
if not replay.same(world,target):
|
| 25 |
+
return False,'required business outcomes incomplete'
|
| 26 |
+
return True,''
|
tasks/autom-supplier-invoice-match-008/validation/openenv.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"profile": "harbor-semantic-v1",
|
| 3 |
+
"reward_key": "reward",
|
| 4 |
+
"reward": {
|
| 5 |
+
"range": [
|
| 6 |
+
0,
|
| 7 |
+
1
|
| 8 |
+
],
|
| 9 |
+
"oracle_tolerance": 0,
|
| 10 |
+
"floor_margin": 0.1
|
| 11 |
+
},
|
| 12 |
+
"resources": {
|
| 13 |
+
"cpu": 1,
|
| 14 |
+
"memory_mb": 4096,
|
| 15 |
+
"disk_mb": 10240,
|
| 16 |
+
"episode_timeout_s": 1800
|
| 17 |
+
},
|
| 18 |
+
"types": {
|
| 19 |
+
"tags": [
|
| 20 |
+
"knowledge-work",
|
| 21 |
+
"cross-app-workflows",
|
| 22 |
+
"conditional-execution",
|
| 23 |
+
"protected-state",
|
| 24 |
+
"finance"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
"requires_credentials": false
|
| 28 |
+
}
|
tasks/autom-supplier-invoice-match-009/environment/inputs/apps.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-009/environment/inputs/world.json
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 1
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 0
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 5
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 1
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 0
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 2
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 6
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-08-22",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 20
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-08-26",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "quarantine",
|
| 50 |
+
"units": 28
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-08-04",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "accepted",
|
| 56 |
+
"units": 22
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-08-19",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 12
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-08-22",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 16
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-08-07",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "quarantine",
|
| 74 |
+
"units": 12
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-08-20",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "quarantine",
|
| 80 |
+
"units": 26
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-08-25",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 26
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-08-22",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 17
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-07-31",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "accepted",
|
| 98 |
+
"units": 13
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-08-27",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "accepted",
|
| 104 |
+
"units": 22
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-08-19",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "quarantine",
|
| 110 |
+
"units": 26
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-08-22",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 21
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-08-19",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "accepted",
|
| 122 |
+
"units": 22
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-08-27",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "accepted",
|
| 128 |
+
"units": 16
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-08-14",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "accepted",
|
| 134 |
+
"units": 13
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-08-22",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 22
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-08-15",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "quarantine",
|
| 146 |
+
"units": 15
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-07-31",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "accepted",
|
| 152 |
+
"units": 28
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-08-09",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "quarantine",
|
| 158 |
+
"units": 18
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-08-22",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 13
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-08-21",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "accepted",
|
| 170 |
+
"units": 25
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-08-07",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "quarantine",
|
| 176 |
+
"units": 13
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-08-18",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "accepted",
|
| 182 |
+
"units": 22
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-08-22",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 16
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-08-17",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 14
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-08-17",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 15
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-08-19",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 20
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-2613-5-2": {
|
| 211 |
+
"date": "2025-08-22",
|
| 212 |
+
"po": "PO5",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 12821,
|
| 215 |
+
"units": 18,
|
| 216 |
+
"vendor": "V4"
|
| 217 |
+
},
|
| 218 |
+
"IV-3037-6-1": {
|
| 219 |
+
"date": "2025-08-15",
|
| 220 |
+
"po": "PO6",
|
| 221 |
+
"state": "void",
|
| 222 |
+
"unit_price_cents": 22140,
|
| 223 |
+
"units": 25,
|
| 224 |
+
"vendor": "V0"
|
| 225 |
+
},
|
| 226 |
+
"IV-3482-1-1": {
|
| 227 |
+
"date": "2025-08-23",
|
| 228 |
+
"po": "PO1",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 19000,
|
| 231 |
+
"units": 13,
|
| 232 |
+
"vendor": "Unknown"
|
| 233 |
+
},
|
| 234 |
+
"IV-4155-4-1": {
|
| 235 |
+
"date": "2025-08-03",
|
| 236 |
+
"po": "PO4",
|
| 237 |
+
"state": "void",
|
| 238 |
+
"unit_price_cents": 8752,
|
| 239 |
+
"units": 13,
|
| 240 |
+
"vendor": "V2"
|
| 241 |
+
},
|
| 242 |
+
"IV-4801-3-1": {
|
| 243 |
+
"date": "2025-08-04",
|
| 244 |
+
"po": "PO3",
|
| 245 |
+
"state": "review",
|
| 246 |
+
"unit_price_cents": 14648,
|
| 247 |
+
"units": 10,
|
| 248 |
+
"vendor": "V3"
|
| 249 |
+
},
|
| 250 |
+
"IV-4811-2-1": {
|
| 251 |
+
"date": "2025-08-16",
|
| 252 |
+
"po": "PO2",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 4453,
|
| 255 |
+
"units": 25,
|
| 256 |
+
"vendor": "Unknown"
|
| 257 |
+
},
|
| 258 |
+
"IV-5537-5-0": {
|
| 259 |
+
"date": "2025-08-09",
|
| 260 |
+
"po": "PO5",
|
| 261 |
+
"state": "review",
|
| 262 |
+
"unit_price_cents": 13177,
|
| 263 |
+
"units": 19,
|
| 264 |
+
"vendor": "V4"
|
| 265 |
+
},
|
| 266 |
+
"IV-6510-3-2": {
|
| 267 |
+
"date": "2025-08-09",
|
| 268 |
+
"po": "PO3",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 13059,
|
| 271 |
+
"units": 3,
|
| 272 |
+
"vendor": "V3"
|
| 273 |
+
},
|
| 274 |
+
"IV-6764-0-1": {
|
| 275 |
+
"date": "2025-08-15",
|
| 276 |
+
"po": "PO0",
|
| 277 |
+
"state": "review",
|
| 278 |
+
"unit_price_cents": 4492,
|
| 279 |
+
"units": 9,
|
| 280 |
+
"vendor": "V0"
|
| 281 |
+
},
|
| 282 |
+
"IV-6912-6-2": {
|
| 283 |
+
"date": "2025-08-12",
|
| 284 |
+
"po": "PO6",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 23343,
|
| 287 |
+
"units": 19,
|
| 288 |
+
"vendor": "V0"
|
| 289 |
+
},
|
| 290 |
+
"IV-7893-4-2": {
|
| 291 |
+
"date": "2025-08-20",
|
| 292 |
+
"po": "PO4",
|
| 293 |
+
"state": "review",
|
| 294 |
+
"unit_price_cents": 9742,
|
| 295 |
+
"units": 11,
|
| 296 |
+
"vendor": "V2"
|
| 297 |
+
},
|
| 298 |
+
"IV-7924-5-1": {
|
| 299 |
+
"date": "2025-08-09",
|
| 300 |
+
"po": "PO5",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 15219,
|
| 303 |
+
"units": 13,
|
| 304 |
+
"vendor": "V4"
|
| 305 |
+
},
|
| 306 |
+
"IV-8036-3-0": {
|
| 307 |
+
"date": "2025-08-09",
|
| 308 |
+
"po": "PO3",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 13187,
|
| 311 |
+
"units": 5,
|
| 312 |
+
"vendor": "V3"
|
| 313 |
+
},
|
| 314 |
+
"IV-8332-6-3": {
|
| 315 |
+
"date": "2025-08-22",
|
| 316 |
+
"po": "PO6",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 23448,
|
| 319 |
+
"units": 5,
|
| 320 |
+
"vendor": "V0"
|
| 321 |
+
},
|
| 322 |
+
"IV-8473-0-0": {
|
| 323 |
+
"date": "2025-08-09",
|
| 324 |
+
"po": "PO0",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 4672,
|
| 327 |
+
"units": 1,
|
| 328 |
+
"vendor": "V0"
|
| 329 |
+
},
|
| 330 |
+
"IV-8711-4-0": {
|
| 331 |
+
"date": "2025-08-09",
|
| 332 |
+
"po": "PO4",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 8944,
|
| 335 |
+
"units": 17,
|
| 336 |
+
"vendor": "V2"
|
| 337 |
+
},
|
| 338 |
+
"IV-9039-1-0": {
|
| 339 |
+
"date": "2025-08-09",
|
| 340 |
+
"po": "PO1",
|
| 341 |
+
"state": "review",
|
| 342 |
+
"unit_price_cents": 18388,
|
| 343 |
+
"units": 16,
|
| 344 |
+
"vendor": "V0"
|
| 345 |
+
},
|
| 346 |
+
"IV-9189-6-0": {
|
| 347 |
+
"date": "2025-08-09",
|
| 348 |
+
"po": "PO6",
|
| 349 |
+
"state": "review",
|
| 350 |
+
"unit_price_cents": 21322,
|
| 351 |
+
"units": 17,
|
| 352 |
+
"vendor": "V0"
|
| 353 |
+
},
|
| 354 |
+
"IV-9422-2-0": {
|
| 355 |
+
"date": "2025-08-09",
|
| 356 |
+
"po": "PO2",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 3223,
|
| 359 |
+
"units": 3,
|
| 360 |
+
"vendor": "V1"
|
| 361 |
+
}
|
| 362 |
+
},
|
| 363 |
+
"purchase_orders": {
|
| 364 |
+
"PO0": {
|
| 365 |
+
"unit": "North",
|
| 366 |
+
"unit_price_cents": 4672,
|
| 367 |
+
"vendor": "V0"
|
| 368 |
+
},
|
| 369 |
+
"PO1": {
|
| 370 |
+
"unit": "North",
|
| 371 |
+
"unit_price_cents": 18388,
|
| 372 |
+
"vendor": "V0"
|
| 373 |
+
},
|
| 374 |
+
"PO2": {
|
| 375 |
+
"unit": "North",
|
| 376 |
+
"unit_price_cents": 3223,
|
| 377 |
+
"vendor": "V1"
|
| 378 |
+
},
|
| 379 |
+
"PO3": {
|
| 380 |
+
"unit": "North",
|
| 381 |
+
"unit_price_cents": 13187,
|
| 382 |
+
"vendor": "V3"
|
| 383 |
+
},
|
| 384 |
+
"PO4": {
|
| 385 |
+
"unit": "North",
|
| 386 |
+
"unit_price_cents": 8944,
|
| 387 |
+
"vendor": "V2"
|
| 388 |
+
},
|
| 389 |
+
"PO5": {
|
| 390 |
+
"unit": "North",
|
| 391 |
+
"unit_price_cents": 13177,
|
| 392 |
+
"vendor": "V4"
|
| 393 |
+
},
|
| 394 |
+
"PO6": {
|
| 395 |
+
"unit": "Other",
|
| 396 |
+
"unit_price_cents": 21322,
|
| 397 |
+
"vendor": "V0"
|
| 398 |
+
}
|
| 399 |
+
},
|
| 400 |
+
"supplier_cases": {
|
| 401 |
+
"PREEXISTING": {
|
| 402 |
+
"status": "investigating"
|
| 403 |
+
}
|
| 404 |
+
},
|
| 405 |
+
"vendors": {
|
| 406 |
+
"V0": {
|
| 407 |
+
"net_days": 30
|
| 408 |
+
},
|
| 409 |
+
"V1": {
|
| 410 |
+
"net_days": 15
|
| 411 |
+
},
|
| 412 |
+
"V2": {
|
| 413 |
+
"net_days": 21
|
| 414 |
+
},
|
| 415 |
+
"V3": {
|
| 416 |
+
"net_days": 45
|
| 417 |
+
},
|
| 418 |
+
"V4": {
|
| 419 |
+
"net_days": 15
|
| 420 |
+
}
|
| 421 |
+
}
|
| 422 |
+
}
|
tasks/autom-supplier-invoice-match-009/instruction.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Close the invoice matching queue for purchasing unit North at 2025-08-23. Handle invoices in review attached to that unit's purchase orders, invoice dates 2025-08-09 through 2025-08-23 inclusive. Process by invoice date ascending, then invoice ID ascending. Available units per PO equal units on accepted goods receipts dated on or before cutoff, minus previously posted units and any units successfully matched earlier in this run.
|
| 2 |
+
|
| 3 |
+
Match the invoice vendor exactly against the purchase order. A unit price above PO price is acceptable only up to 200 basis points above PO price (10,000 basis points = 100%; compare exactly, before rounding). Lower prices are acceptable. The invoice quantity must fit the available units in full. If any tests fail, update the invoice state to `disputed`, consume zero units, and create supplier_cases record `case-<invoice ID>` with `invoice`, `po` and the list `issues` containing every failing check in vendor, price, units order; use those lowercase strings.
|
| 4 |
+
|
| 5 |
+
For a match update invoice state to `posted` and create ap_postings record `book-<invoice ID>` with `invoice`, `po`, `units`, `status=posted`, integer `amount_cents` equal to invoiced quantity times invoiced unit price, and ISO date `due`. Count the vendor's net_days calendar days from the invoice date, then roll Saturday or Sunday forward to Monday. Preserve all other fields and records.
|
| 6 |
+
|
| 7 |
+
Use the offline app client at `/workspace/inputs/apps.py`. Call it with python3. Run
|
| 8 |
+
`apps` to discover apps, `list APP` to see its records, or `get APP ID` for one record.
|
| 9 |
+
Write with `update APP ID '{"field":"value"}'` or `create APP ID '{"field":"value"}'`.
|
| 10 |
+
The client records successful writes in `/workspace/outputs/actions.jsonl`.
|
| 11 |
+
Apply exactly the required changes. Other records and fields must remain untouched,
|
| 12 |
+
including temporary changes. Actions take effect in the local simulation only.
|
| 13 |
+
|
| 14 |
+
## Deliverable
|
| 15 |
+
|
| 16 |
+
Work in `/workspace`. Input files are under `/workspace/inputs/`. Put every deliverable in
|
| 17 |
+
`/workspace/outputs/`; only that directory is graded. Leave the app action log in the outputs directory.
|
tasks/autom-supplier-invoice-match-009/solution/files/actions.jsonl
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-8473-0-0", "op": "update"}
|
| 2 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-6764-0-1", "op": "update"}
|
| 3 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-9039-1-0", "op": "update"}
|
| 4 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-3482-1-1", "op": "update"}
|
| 5 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-9422-2-0", "op": "update"}
|
| 6 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-4811-2-1", "op": "update"}
|
| 7 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-8036-3-0", "op": "update"}
|
| 8 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-6510-3-2", "op": "update"}
|
| 9 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-8711-4-0", "op": "update"}
|
| 10 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-7893-4-2", "op": "update"}
|
| 11 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-5537-5-0", "op": "update"}
|
| 12 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-7924-5-1", "op": "update"}
|
| 13 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-2613-5-2", "op": "update"}
|
| 14 |
+
{"app": "ap_postings", "fields": {"amount_cents": 250363, "due": "2025-08-25", "invoice": "IV-5537-5-0", "po": "PO5", "status": "posted", "units": 19}, "id": "book-IV-5537-5-0", "op": "create"}
|
| 15 |
+
{"app": "ap_postings", "fields": {"amount_cents": 39177, "due": "2025-09-23", "invoice": "IV-6510-3-2", "po": "PO3", "status": "posted", "units": 3}, "id": "book-IV-6510-3-2", "op": "create"}
|
| 16 |
+
{"app": "ap_postings", "fields": {"amount_cents": 65935, "due": "2025-09-23", "invoice": "IV-8036-3-0", "po": "PO3", "status": "posted", "units": 5}, "id": "book-IV-8036-3-0", "op": "create"}
|
| 17 |
+
{"app": "ap_postings", "fields": {"amount_cents": 4672, "due": "2025-09-08", "invoice": "IV-8473-0-0", "po": "PO0", "status": "posted", "units": 1}, "id": "book-IV-8473-0-0", "op": "create"}
|
| 18 |
+
{"app": "ap_postings", "fields": {"amount_cents": 152048, "due": "2025-09-01", "invoice": "IV-8711-4-0", "po": "PO4", "status": "posted", "units": 17}, "id": "book-IV-8711-4-0", "op": "create"}
|
| 19 |
+
{"app": "ap_postings", "fields": {"amount_cents": 294208, "due": "2025-09-08", "invoice": "IV-9039-1-0", "po": "PO1", "status": "posted", "units": 16}, "id": "book-IV-9039-1-0", "op": "create"}
|
| 20 |
+
{"app": "ap_postings", "fields": {"amount_cents": 9669, "due": "2025-08-25", "invoice": "IV-9422-2-0", "po": "PO2", "status": "posted", "units": 3}, "id": "book-IV-9422-2-0", "op": "create"}
|
| 21 |
+
{"app": "ap_postings", "fields": {"amount_cents": 40428, "due": "2025-09-15", "invoice": "IV-6764-0-1", "po": "PO0", "status": "posted", "units": 9}, "id": "book-IV-6764-0-1", "op": "create"}
|
| 22 |
+
{"app": "ap_postings", "fields": {"amount_cents": 230778, "due": "2025-09-08", "invoice": "IV-2613-5-2", "po": "PO5", "status": "posted", "units": 18}, "id": "book-IV-2613-5-2", "op": "create"}
|
| 23 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-7924-5-1", "issues": ["price"], "po": "PO5"}, "id": "case-IV-7924-5-1", "op": "create"}
|
| 24 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-4811-2-1", "issues": ["vendor", "price", "units"], "po": "PO2"}, "id": "case-IV-4811-2-1", "op": "create"}
|
| 25 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-7893-4-2", "issues": ["price"], "po": "PO4"}, "id": "case-IV-7893-4-2", "op": "create"}
|
| 26 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-3482-1-1", "issues": ["vendor", "price", "units"], "po": "PO1"}, "id": "case-IV-3482-1-1", "op": "create"}
|
tasks/autom-supplier-invoice-match-009/solution/solve.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /workspace/outputs
|
| 4 |
+
cp -R /solution/files/. /workspace/outputs/
|
tasks/autom-supplier-invoice-match-009/task.toml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.3"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "apex-gap/autom-supplier-invoice-match-009"
|
| 5 |
+
|
| 6 |
+
[metadata.apex_gap]
|
| 7 |
+
capability_tags = ["cross-app-workflows", "conditional-execution", "protected-state", "finance"]
|
| 8 |
+
dataset = "Original simulated workflows"
|
| 9 |
+
job = "finance"
|
| 10 |
+
seed = 9
|
| 11 |
+
source = "local/original-automation-workflows"
|
| 12 |
+
source_revision = "1"
|
| 13 |
+
source_split = "synthetic"
|
| 14 |
+
source_task_id = "autom-supplier-invoice-match-009"
|
| 15 |
+
template_family = "automation:supplier-invoice-match"
|
| 16 |
+
workflow_template = "supplier-invoice-match"
|
| 17 |
+
|
| 18 |
+
[metadata.openenv_hf_sandbox]
|
| 19 |
+
variant = "apex-gap-hfsandbox-v1"
|
| 20 |
+
task_modified_for_hf_sandbox = true
|
| 21 |
+
network_enabled = true
|
| 22 |
+
|
| 23 |
+
[environment]
|
| 24 |
+
docker_image = "ghcr.io/younesbelkada/apex@sha256:24969c952247033023872f87161a16e067003469506be63783bbaa5d96926bdf"
|
| 25 |
+
workdir = "/workspace"
|
| 26 |
+
cpus = 1
|
| 27 |
+
memory_mb = 4096
|
| 28 |
+
build_timeout_sec = 600
|
| 29 |
+
network_mode = "public"
|
| 30 |
+
|
| 31 |
+
[agent]
|
| 32 |
+
timeout_sec = 1800
|
| 33 |
+
network_mode = "public"
|
| 34 |
+
|
| 35 |
+
[verifier]
|
| 36 |
+
timeout_sec = 600
|
| 37 |
+
network_mode = "public"
|
| 38 |
+
environment_mode = "separate"
|
| 39 |
+
|
| 40 |
+
[verifier.environment]
|
| 41 |
+
network_mode = "public"
|
| 42 |
+
cpus = 1
|
| 43 |
+
memory_mb = 4096
|
| 44 |
+
|
| 45 |
+
[[artifacts]]
|
| 46 |
+
source = "/workspace/outputs"
|
tasks/autom-supplier-invoice-match-009/tests/expected.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"checks": [
|
| 3 |
+
{
|
| 4 |
+
"id": "business-outcomes",
|
| 5 |
+
"type": "custom",
|
| 6 |
+
"module": "world_check"
|
| 7 |
+
}
|
| 8 |
+
]
|
| 9 |
+
}
|
tasks/autom-supplier-invoice-match-009/tests/grade.py
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Deterministic grader shared by converted knowledge-work tasks.
|
| 2 |
+
|
| 3 |
+
Runs inside the separate verifier sandbox. Reads /tests/expected.json, inspects the
|
| 4 |
+
submitted /workspace/outputs tree and writes a binary reward plus per-check details.
|
| 5 |
+
No model calls and no network.
|
| 6 |
+
|
| 7 |
+
expected.json: {"checks": [{"id": ..., "type": ..., ...}, ...]}
|
| 8 |
+
Check types:
|
| 9 |
+
answer field of outputs/answer.json; kind = number|text|choice|date|bool|list
|
| 10 |
+
xlsx_range recalculated outputs/<file> vs tests/<target> over sheet!range (SpreadsheetBench rules)
|
| 11 |
+
xlsx_cell recalculated outputs/<file> sheet!cell vs value with tolerance (optional alt_values)
|
| 12 |
+
file_contains outputs/<file> text (docx/pdf/ics/eml/txt) must contain every needle
|
| 13 |
+
custom tests/<module>.py defines check(spec, outputs_dir, tests_dir) -> (bool, str)
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
import datetime as dt
|
| 17 |
+
import json
|
| 18 |
+
import re
|
| 19 |
+
import shutil
|
| 20 |
+
import subprocess
|
| 21 |
+
import sys
|
| 22 |
+
import tempfile
|
| 23 |
+
import unicodedata
|
| 24 |
+
from pathlib import Path
|
| 25 |
+
|
| 26 |
+
OUT = Path("/workspace/outputs")
|
| 27 |
+
TESTS = Path("/tests")
|
| 28 |
+
LOGS = Path("/logs/verifier")
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def norm_text(v):
|
| 32 |
+
v = unicodedata.normalize("NFKC", str(v)).casefold()
|
| 33 |
+
v = re.sub(r"[‘’“”]", "'", v)
|
| 34 |
+
v = re.sub(r"[^\w%.$/-]+", " ", v)
|
| 35 |
+
return " ".join(v.split()).strip(" .")
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def to_number(v):
|
| 39 |
+
if isinstance(v, bool):
|
| 40 |
+
raise ValueError("bool")
|
| 41 |
+
if isinstance(v, (int, float)):
|
| 42 |
+
return float(v)
|
| 43 |
+
s = str(v).strip().replace(",", "").replace("$", "").replace("−", "-")
|
| 44 |
+
neg = s.startswith("(") and s.endswith(")")
|
| 45 |
+
s = s.strip("()").strip()
|
| 46 |
+
pct = s.endswith("%")
|
| 47 |
+
s = s.rstrip("%").strip()
|
| 48 |
+
s = re.sub(r"\s*(usd|dollars|million|billion|thousand|m|bn|k)$", "", s, flags=re.I)
|
| 49 |
+
x = float(s)
|
| 50 |
+
x = -x if neg else x
|
| 51 |
+
return x / 100 if pct else x
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def number_ok(got, want, rel, abs_):
|
| 55 |
+
try:
|
| 56 |
+
g = to_number(got)
|
| 57 |
+
except (TypeError, ValueError):
|
| 58 |
+
return False
|
| 59 |
+
w = float(want)
|
| 60 |
+
tol = max(abs_, rel * abs(w))
|
| 61 |
+
# "12.5%" may mean the ratio 0.125 or the percent number 12.5; the gold fixes which.
|
| 62 |
+
candidates = [g, g * 100] if isinstance(got, str) and got.strip().endswith("%") else [g]
|
| 63 |
+
return any(abs(c - w) <= tol for c in candidates)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def parse_date(v):
|
| 67 |
+
if isinstance(v, (dt.date, dt.datetime)):
|
| 68 |
+
return v if isinstance(v, dt.date) else v.date()
|
| 69 |
+
s = str(v).strip()
|
| 70 |
+
for fmt in ("%Y-%m-%d", "%m/%d/%Y", "%m/%d/%y", "%d %B %Y", "%B %d, %Y", "%b %d, %Y", "%Y/%m/%d"):
|
| 71 |
+
try:
|
| 72 |
+
return dt.datetime.strptime(s, fmt).date()
|
| 73 |
+
except ValueError:
|
| 74 |
+
continue
|
| 75 |
+
raise ValueError(s)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def check_answer(check, answers):
|
| 79 |
+
key = check["field"]
|
| 80 |
+
if key not in answers:
|
| 81 |
+
return False, f"missing field {key!r}"
|
| 82 |
+
got, want, kind = answers[key], check["value"], check.get("kind", "text")
|
| 83 |
+
if kind == "number":
|
| 84 |
+
ok = number_ok(got, want, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01))
|
| 85 |
+
if not ok and check.get("percent_either"):
|
| 86 |
+
ok = number_ok(got, want * 100, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01) * 100) or (
|
| 87 |
+
number_ok(got, want / 100, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01) / 100)
|
| 88 |
+
)
|
| 89 |
+
elif kind == "date":
|
| 90 |
+
try:
|
| 91 |
+
ok = parse_date(got) == parse_date(want)
|
| 92 |
+
except ValueError:
|
| 93 |
+
ok = False
|
| 94 |
+
elif kind == "bool":
|
| 95 |
+
g = norm_text(got)
|
| 96 |
+
ok = g in {"yes", "true"} if want else g in {"no", "false"}
|
| 97 |
+
elif kind == "choice":
|
| 98 |
+
ok = norm_text(got) == norm_text(want)
|
| 99 |
+
elif kind == "list":
|
| 100 |
+
if not isinstance(got, list):
|
| 101 |
+
return False, f"{key}: expected a JSON list"
|
| 102 |
+
# Filenames may be given with a directory prefix; compare base names.
|
| 103 |
+
base = lambda x: norm_text(str(x).replace("\\", "/").rsplit("/", 1)[-1])
|
| 104 |
+
ok = sorted(base(x) for x in got) == sorted(base(x) for x in want)
|
| 105 |
+
else:
|
| 106 |
+
accepted = check.get("accept", [want])
|
| 107 |
+
ok = norm_text(got) in {norm_text(a) for a in accepted}
|
| 108 |
+
return ok, "" if ok else f"{key}: got {got!r}"
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
# LibreOffice keeps cached formula values on load unless told otherwise; force a full recalculation.
|
| 112 |
+
RECALC_PROFILE = """<?xml version="1.0" encoding="UTF-8"?>
|
| 113 |
+
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
| 114 |
+
<item oor:path="/org.openoffice.Office.Calc/Formula/Load"><prop oor:name="OOXMLRecalcMode" oor:op="fuse"><value>0</value></prop></item>
|
| 115 |
+
<item oor:path="/org.openoffice.Office.Calc/Formula/Load"><prop oor:name="ODFRecalcMode" oor:op="fuse"><value>0</value></prop></item>
|
| 116 |
+
</oor:items>
|
| 117 |
+
"""
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def recalc(path, tmp):
|
| 121 |
+
dest = Path(tmp) / f"recalc-{len(list(Path(tmp).glob('recalc-*')))}"
|
| 122 |
+
dest.mkdir()
|
| 123 |
+
profile = Path(tmp) / "lo-profile"
|
| 124 |
+
if not profile.exists():
|
| 125 |
+
(profile / "user").mkdir(parents=True)
|
| 126 |
+
(profile / "user" / "registrymodifications.xcu").write_text(RECALC_PROFILE)
|
| 127 |
+
subprocess.run(
|
| 128 |
+
["soffice", f"-env:UserInstallation=file://{profile}", "--headless", "--calc", "--convert-to",
|
| 129 |
+
"xlsx:Calc MS Excel 2007 XML", "--outdir", str(dest), str(path)],
|
| 130 |
+
stdout=subprocess.DEVNULL,
|
| 131 |
+
stderr=subprocess.DEVNULL,
|
| 132 |
+
timeout=180,
|
| 133 |
+
check=False,
|
| 134 |
+
)
|
| 135 |
+
out = dest / (Path(path).stem + ".xlsx")
|
| 136 |
+
return out if out.exists() else Path(path)
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
def cell_value(v):
|
| 140 |
+
if isinstance(v, (int, float)) and not isinstance(v, bool):
|
| 141 |
+
return round(float(v), 2)
|
| 142 |
+
if isinstance(v, dt.datetime):
|
| 143 |
+
return round((v - dt.datetime(1899, 12, 30)).total_seconds() / 86400.0, 0)
|
| 144 |
+
if isinstance(v, dt.time):
|
| 145 |
+
return v.strftime("%H:%M")
|
| 146 |
+
if isinstance(v, str):
|
| 147 |
+
try:
|
| 148 |
+
return round(float(v), 2)
|
| 149 |
+
except ValueError:
|
| 150 |
+
return v.strip()
|
| 151 |
+
return v
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def time_of(v):
|
| 155 |
+
"""A time or a day fraction in [0, 1) as HH:MM, rounded to the nearest second first. Calc and
|
| 156 |
+
Excel store a time as that fraction; openpyxl returns a time only for time-formatted cells."""
|
| 157 |
+
if isinstance(v, dt.time):
|
| 158 |
+
v = (v.hour * 3600 + v.minute * 60 + v.second + v.microsecond / 1e6) / 86400
|
| 159 |
+
if isinstance(v, (int, float)) and not isinstance(v, bool) and 0 <= v < 1:
|
| 160 |
+
return (dt.datetime(1899, 12, 30) + dt.timedelta(seconds=round(v * 86400))).strftime("%H:%M")
|
| 161 |
+
return None
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def same_cell(a, b):
|
| 165 |
+
if isinstance(a, dt.time) is not isinstance(b, dt.time):
|
| 166 |
+
n = b if isinstance(a, dt.time) else a
|
| 167 |
+
if time_of(n) is not None: # a time against a plain day fraction
|
| 168 |
+
return time_of(a) == time_of(b)
|
| 169 |
+
a, b = cell_value(a), cell_value(b)
|
| 170 |
+
if a in (None, "") and b in (None, ""):
|
| 171 |
+
return True
|
| 172 |
+
return type(a) is type(b) and a == b
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
ERRORS = {"#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"}
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
def is_error(v):
|
| 179 |
+
return isinstance(v, str) and (v in ERRORS or v.startswith("Err:"))
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def cells(rng):
|
| 183 |
+
if ":" not in rng:
|
| 184 |
+
return [rng]
|
| 185 |
+
from openpyxl.utils import range_boundaries, get_column_letter
|
| 186 |
+
|
| 187 |
+
c1, r1, c2, r2 = range_boundaries(rng)
|
| 188 |
+
return [f"{get_column_letter(c)}{r}" for r in range(r1, r2 + 1) for c in range(c1, c2 + 1)]
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def load(path, tmp):
|
| 192 |
+
import openpyxl
|
| 193 |
+
|
| 194 |
+
return openpyxl.load_workbook(recalc(path, tmp), data_only=True)
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
def check_xlsx_range(check, tmp, cache):
|
| 198 |
+
sub = OUT / check["file"]
|
| 199 |
+
if not sub.is_file():
|
| 200 |
+
return False, f"missing output {check['file']}"
|
| 201 |
+
if sub not in cache:
|
| 202 |
+
cache[sub] = load(sub, tmp)
|
| 203 |
+
tgt = TESTS / check["target"]
|
| 204 |
+
if tgt not in cache:
|
| 205 |
+
cache[tgt] = load(tgt, tmp)
|
| 206 |
+
got, want = cache[sub], cache[tgt]
|
| 207 |
+
cached = None # the target's stored (Excel-computed) values, read only when Calc errs
|
| 208 |
+
for sheet, rng in check["ranges"]:
|
| 209 |
+
sheet = sheet or want.sheetnames[0]
|
| 210 |
+
if sheet not in got.sheetnames:
|
| 211 |
+
return False, f"sheet {sheet!r} missing"
|
| 212 |
+
for name in cells(rng):
|
| 213 |
+
w = want[sheet][name].value
|
| 214 |
+
if is_error(w):
|
| 215 |
+
# LibreOffice could not evaluate the gold formula (e.g. XLOOKUP, FILTER in Calc 7.4).
|
| 216 |
+
# The value Excel stored is the intended answer.
|
| 217 |
+
if cached is None:
|
| 218 |
+
import openpyxl
|
| 219 |
+
|
| 220 |
+
cached = openpyxl.load_workbook(tgt, data_only=True)
|
| 221 |
+
c = cached[sheet][name].value if sheet in cached.sheetnames else None
|
| 222 |
+
if c is not None and not is_error(c):
|
| 223 |
+
w = c
|
| 224 |
+
if not same_cell(w, got[sheet][name].value):
|
| 225 |
+
return False, f"{sheet}!{name}: want {w!r} got {got[sheet][name].value!r}"
|
| 226 |
+
return True, ""
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
def check_xlsx_cell(check, tmp, cache):
|
| 230 |
+
sub = OUT / check["file"]
|
| 231 |
+
if not sub.is_file():
|
| 232 |
+
return False, f"missing output {check['file']}"
|
| 233 |
+
if sub not in cache:
|
| 234 |
+
cache[sub] = load(sub, tmp)
|
| 235 |
+
wb = cache[sub]
|
| 236 |
+
if check["sheet"] not in wb.sheetnames:
|
| 237 |
+
return False, f"sheet {check['sheet']!r} missing"
|
| 238 |
+
got = wb[check["sheet"]][check["cell"]].value
|
| 239 |
+
want = check["value"]
|
| 240 |
+
if isinstance(want, (int, float)):
|
| 241 |
+
# alt_values: other accepted golds where the source admits more than one reading.
|
| 242 |
+
ok = got is not None and any(number_ok(got, w, check.get("rel_tol", 0.0), check.get("abs_tol", 0.01))
|
| 243 |
+
for w in [want, *check.get("alt_values", [])])
|
| 244 |
+
else:
|
| 245 |
+
ok = norm_text(got) == norm_text(want)
|
| 246 |
+
return ok, "" if ok else f"{check['sheet']}!{check['cell']}: want {want!r} got {got!r}"
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def text_of(path):
|
| 250 |
+
suffix = path.suffix.lower()
|
| 251 |
+
if suffix == ".docx":
|
| 252 |
+
import docx
|
| 253 |
+
|
| 254 |
+
d = docx.Document(path)
|
| 255 |
+
parts = [p.text for p in d.paragraphs]
|
| 256 |
+
for t in d.tables:
|
| 257 |
+
parts += [c.text for row in t.rows for c in row.cells]
|
| 258 |
+
return "\n".join(parts)
|
| 259 |
+
if suffix == ".pdf":
|
| 260 |
+
import pdfplumber
|
| 261 |
+
|
| 262 |
+
with pdfplumber.open(path) as pdf:
|
| 263 |
+
return "\n".join(page.extract_text() or "" for page in pdf.pages)
|
| 264 |
+
return path.read_text(errors="replace")
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def check_file_contains(check, tmp, cache):
|
| 268 |
+
sub = OUT / check["file"]
|
| 269 |
+
if not sub.is_file():
|
| 270 |
+
return False, f"missing output {check['file']}"
|
| 271 |
+
text = text_of(sub)
|
| 272 |
+
hay = text if check.get("case_sensitive") else text.casefold()
|
| 273 |
+
for needle in check["needles"]:
|
| 274 |
+
n = needle if check.get("case_sensitive") else needle.casefold()
|
| 275 |
+
if n not in hay:
|
| 276 |
+
return False, f"{check['file']} lacks {needle!r}"
|
| 277 |
+
return True, ""
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
def main():
|
| 281 |
+
LOGS.mkdir(parents=True, exist_ok=True)
|
| 282 |
+
reward_path = LOGS / "reward.txt"
|
| 283 |
+
reward_path.write_text("0\n")
|
| 284 |
+
spec = json.loads((TESTS / "expected.json").read_text())
|
| 285 |
+
answers, details = {}, []
|
| 286 |
+
answer_file = OUT / "answer.json"
|
| 287 |
+
if answer_file.is_file():
|
| 288 |
+
try:
|
| 289 |
+
answers = json.loads(answer_file.read_text())
|
| 290 |
+
if not isinstance(answers, dict):
|
| 291 |
+
answers = {}
|
| 292 |
+
except json.JSONDecodeError:
|
| 293 |
+
answers = {}
|
| 294 |
+
tmp = tempfile.mkdtemp()
|
| 295 |
+
cache = {}
|
| 296 |
+
try:
|
| 297 |
+
for check in spec["checks"]:
|
| 298 |
+
try:
|
| 299 |
+
if check["type"] == "answer":
|
| 300 |
+
ok, why = check_answer(check, answers)
|
| 301 |
+
elif check["type"] == "xlsx_range":
|
| 302 |
+
ok, why = check_xlsx_range(check, tmp, cache)
|
| 303 |
+
elif check["type"] == "xlsx_cell":
|
| 304 |
+
ok, why = check_xlsx_cell(check, tmp, cache)
|
| 305 |
+
elif check["type"] == "file_contains":
|
| 306 |
+
ok, why = check_file_contains(check, tmp, cache)
|
| 307 |
+
elif check["type"] == "custom":
|
| 308 |
+
import importlib.util
|
| 309 |
+
|
| 310 |
+
spec_ = importlib.util.spec_from_file_location("custom_check", TESTS / f"{check['module']}.py")
|
| 311 |
+
mod = importlib.util.module_from_spec(spec_)
|
| 312 |
+
spec_.loader.exec_module(mod)
|
| 313 |
+
ok, why = mod.check(check, OUT, TESTS)
|
| 314 |
+
else:
|
| 315 |
+
ok, why = False, f"unknown check type {check['type']}"
|
| 316 |
+
except Exception as exc: # a malformed submission fails the check, not the grader
|
| 317 |
+
ok, why = False, f"{type(exc).__name__}: {exc}"
|
| 318 |
+
details.append({"id": check["id"], "passed": ok, "detail": why})
|
| 319 |
+
finally:
|
| 320 |
+
shutil.rmtree(tmp, ignore_errors=True)
|
| 321 |
+
passed = sum(d["passed"] for d in details)
|
| 322 |
+
total = len(details)
|
| 323 |
+
reward = 1 if total and passed == total else 0
|
| 324 |
+
(LOGS / "details.json").write_text(json.dumps({"passed": passed, "total": total, "checks": details}, indent=1))
|
| 325 |
+
reward_path.write_text(f"{reward}\n")
|
| 326 |
+
print(f"{passed}/{total} checks passed; reward {reward}")
|
| 327 |
+
|
| 328 |
+
|
| 329 |
+
if __name__ == "__main__":
|
| 330 |
+
sys.exit(main())
|
tasks/autom-supplier-invoice-match-009/tests/replay.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-009/tests/target.json
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"book-IV-2613-5-2": {
|
| 4 |
+
"amount_cents": 230778,
|
| 5 |
+
"due": "2025-09-08",
|
| 6 |
+
"invoice": "IV-2613-5-2",
|
| 7 |
+
"po": "PO5",
|
| 8 |
+
"status": "posted",
|
| 9 |
+
"units": 18
|
| 10 |
+
},
|
| 11 |
+
"book-IV-5537-5-0": {
|
| 12 |
+
"amount_cents": 250363,
|
| 13 |
+
"due": "2025-08-25",
|
| 14 |
+
"invoice": "IV-5537-5-0",
|
| 15 |
+
"po": "PO5",
|
| 16 |
+
"status": "posted",
|
| 17 |
+
"units": 19
|
| 18 |
+
},
|
| 19 |
+
"book-IV-6510-3-2": {
|
| 20 |
+
"amount_cents": 39177,
|
| 21 |
+
"due": "2025-09-23",
|
| 22 |
+
"invoice": "IV-6510-3-2",
|
| 23 |
+
"po": "PO3",
|
| 24 |
+
"status": "posted",
|
| 25 |
+
"units": 3
|
| 26 |
+
},
|
| 27 |
+
"book-IV-6764-0-1": {
|
| 28 |
+
"amount_cents": 40428,
|
| 29 |
+
"due": "2025-09-15",
|
| 30 |
+
"invoice": "IV-6764-0-1",
|
| 31 |
+
"po": "PO0",
|
| 32 |
+
"status": "posted",
|
| 33 |
+
"units": 9
|
| 34 |
+
},
|
| 35 |
+
"book-IV-8036-3-0": {
|
| 36 |
+
"amount_cents": 65935,
|
| 37 |
+
"due": "2025-09-23",
|
| 38 |
+
"invoice": "IV-8036-3-0",
|
| 39 |
+
"po": "PO3",
|
| 40 |
+
"status": "posted",
|
| 41 |
+
"units": 5
|
| 42 |
+
},
|
| 43 |
+
"book-IV-8473-0-0": {
|
| 44 |
+
"amount_cents": 4672,
|
| 45 |
+
"due": "2025-09-08",
|
| 46 |
+
"invoice": "IV-8473-0-0",
|
| 47 |
+
"po": "PO0",
|
| 48 |
+
"status": "posted",
|
| 49 |
+
"units": 1
|
| 50 |
+
},
|
| 51 |
+
"book-IV-8711-4-0": {
|
| 52 |
+
"amount_cents": 152048,
|
| 53 |
+
"due": "2025-09-01",
|
| 54 |
+
"invoice": "IV-8711-4-0",
|
| 55 |
+
"po": "PO4",
|
| 56 |
+
"status": "posted",
|
| 57 |
+
"units": 17
|
| 58 |
+
},
|
| 59 |
+
"book-IV-9039-1-0": {
|
| 60 |
+
"amount_cents": 294208,
|
| 61 |
+
"due": "2025-09-08",
|
| 62 |
+
"invoice": "IV-9039-1-0",
|
| 63 |
+
"po": "PO1",
|
| 64 |
+
"status": "posted",
|
| 65 |
+
"units": 16
|
| 66 |
+
},
|
| 67 |
+
"book-IV-9422-2-0": {
|
| 68 |
+
"amount_cents": 9669,
|
| 69 |
+
"due": "2025-08-25",
|
| 70 |
+
"invoice": "IV-9422-2-0",
|
| 71 |
+
"po": "PO2",
|
| 72 |
+
"status": "posted",
|
| 73 |
+
"units": 3
|
| 74 |
+
},
|
| 75 |
+
"booked-PO0": {
|
| 76 |
+
"po": "PO0",
|
| 77 |
+
"status": "posted",
|
| 78 |
+
"units": 1
|
| 79 |
+
},
|
| 80 |
+
"booked-PO1": {
|
| 81 |
+
"po": "PO1",
|
| 82 |
+
"status": "posted",
|
| 83 |
+
"units": 0
|
| 84 |
+
},
|
| 85 |
+
"booked-PO2": {
|
| 86 |
+
"po": "PO2",
|
| 87 |
+
"status": "posted",
|
| 88 |
+
"units": 5
|
| 89 |
+
},
|
| 90 |
+
"booked-PO3": {
|
| 91 |
+
"po": "PO3",
|
| 92 |
+
"status": "posted",
|
| 93 |
+
"units": 1
|
| 94 |
+
},
|
| 95 |
+
"booked-PO4": {
|
| 96 |
+
"po": "PO4",
|
| 97 |
+
"status": "posted",
|
| 98 |
+
"units": 0
|
| 99 |
+
},
|
| 100 |
+
"booked-PO5": {
|
| 101 |
+
"po": "PO5",
|
| 102 |
+
"status": "posted",
|
| 103 |
+
"units": 2
|
| 104 |
+
},
|
| 105 |
+
"booked-PO6": {
|
| 106 |
+
"po": "PO6",
|
| 107 |
+
"status": "posted",
|
| 108 |
+
"units": 6
|
| 109 |
+
}
|
| 110 |
+
},
|
| 111 |
+
"goods_receipts": {
|
| 112 |
+
"GI-0-0": {
|
| 113 |
+
"date": "2025-08-22",
|
| 114 |
+
"po": "PO0",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 20
|
| 117 |
+
},
|
| 118 |
+
"GI-0-1": {
|
| 119 |
+
"date": "2025-08-26",
|
| 120 |
+
"po": "PO0",
|
| 121 |
+
"state": "quarantine",
|
| 122 |
+
"units": 28
|
| 123 |
+
},
|
| 124 |
+
"GI-0-2": {
|
| 125 |
+
"date": "2025-08-04",
|
| 126 |
+
"po": "PO0",
|
| 127 |
+
"state": "accepted",
|
| 128 |
+
"units": 22
|
| 129 |
+
},
|
| 130 |
+
"GI-0-3": {
|
| 131 |
+
"date": "2025-08-19",
|
| 132 |
+
"po": "PO0",
|
| 133 |
+
"state": "accepted",
|
| 134 |
+
"units": 12
|
| 135 |
+
},
|
| 136 |
+
"GI-1-0": {
|
| 137 |
+
"date": "2025-08-22",
|
| 138 |
+
"po": "PO1",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 16
|
| 141 |
+
},
|
| 142 |
+
"GI-1-1": {
|
| 143 |
+
"date": "2025-08-07",
|
| 144 |
+
"po": "PO1",
|
| 145 |
+
"state": "quarantine",
|
| 146 |
+
"units": 12
|
| 147 |
+
},
|
| 148 |
+
"GI-1-2": {
|
| 149 |
+
"date": "2025-08-20",
|
| 150 |
+
"po": "PO1",
|
| 151 |
+
"state": "quarantine",
|
| 152 |
+
"units": 26
|
| 153 |
+
},
|
| 154 |
+
"GI-1-3": {
|
| 155 |
+
"date": "2025-08-25",
|
| 156 |
+
"po": "PO1",
|
| 157 |
+
"state": "accepted",
|
| 158 |
+
"units": 26
|
| 159 |
+
},
|
| 160 |
+
"GI-2-0": {
|
| 161 |
+
"date": "2025-08-22",
|
| 162 |
+
"po": "PO2",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 17
|
| 165 |
+
},
|
| 166 |
+
"GI-2-1": {
|
| 167 |
+
"date": "2025-07-31",
|
| 168 |
+
"po": "PO2",
|
| 169 |
+
"state": "accepted",
|
| 170 |
+
"units": 13
|
| 171 |
+
},
|
| 172 |
+
"GI-2-2": {
|
| 173 |
+
"date": "2025-08-27",
|
| 174 |
+
"po": "PO2",
|
| 175 |
+
"state": "accepted",
|
| 176 |
+
"units": 22
|
| 177 |
+
},
|
| 178 |
+
"GI-2-3": {
|
| 179 |
+
"date": "2025-08-19",
|
| 180 |
+
"po": "PO2",
|
| 181 |
+
"state": "quarantine",
|
| 182 |
+
"units": 26
|
| 183 |
+
},
|
| 184 |
+
"GI-3-0": {
|
| 185 |
+
"date": "2025-08-22",
|
| 186 |
+
"po": "PO3",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 21
|
| 189 |
+
},
|
| 190 |
+
"GI-3-1": {
|
| 191 |
+
"date": "2025-08-19",
|
| 192 |
+
"po": "PO3",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 22
|
| 195 |
+
},
|
| 196 |
+
"GI-3-2": {
|
| 197 |
+
"date": "2025-08-27",
|
| 198 |
+
"po": "PO3",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 16
|
| 201 |
+
},
|
| 202 |
+
"GI-3-3": {
|
| 203 |
+
"date": "2025-08-14",
|
| 204 |
+
"po": "PO3",
|
| 205 |
+
"state": "accepted",
|
| 206 |
+
"units": 13
|
| 207 |
+
},
|
| 208 |
+
"GI-4-0": {
|
| 209 |
+
"date": "2025-08-22",
|
| 210 |
+
"po": "PO4",
|
| 211 |
+
"state": "accepted",
|
| 212 |
+
"units": 22
|
| 213 |
+
},
|
| 214 |
+
"GI-4-1": {
|
| 215 |
+
"date": "2025-08-15",
|
| 216 |
+
"po": "PO4",
|
| 217 |
+
"state": "quarantine",
|
| 218 |
+
"units": 15
|
| 219 |
+
},
|
| 220 |
+
"GI-4-2": {
|
| 221 |
+
"date": "2025-07-31",
|
| 222 |
+
"po": "PO4",
|
| 223 |
+
"state": "accepted",
|
| 224 |
+
"units": 28
|
| 225 |
+
},
|
| 226 |
+
"GI-4-3": {
|
| 227 |
+
"date": "2025-08-09",
|
| 228 |
+
"po": "PO4",
|
| 229 |
+
"state": "quarantine",
|
| 230 |
+
"units": 18
|
| 231 |
+
},
|
| 232 |
+
"GI-5-0": {
|
| 233 |
+
"date": "2025-08-22",
|
| 234 |
+
"po": "PO5",
|
| 235 |
+
"state": "accepted",
|
| 236 |
+
"units": 13
|
| 237 |
+
},
|
| 238 |
+
"GI-5-1": {
|
| 239 |
+
"date": "2025-08-21",
|
| 240 |
+
"po": "PO5",
|
| 241 |
+
"state": "accepted",
|
| 242 |
+
"units": 25
|
| 243 |
+
},
|
| 244 |
+
"GI-5-2": {
|
| 245 |
+
"date": "2025-08-07",
|
| 246 |
+
"po": "PO5",
|
| 247 |
+
"state": "quarantine",
|
| 248 |
+
"units": 13
|
| 249 |
+
},
|
| 250 |
+
"GI-5-3": {
|
| 251 |
+
"date": "2025-08-18",
|
| 252 |
+
"po": "PO5",
|
| 253 |
+
"state": "accepted",
|
| 254 |
+
"units": 22
|
| 255 |
+
},
|
| 256 |
+
"GI-6-0": {
|
| 257 |
+
"date": "2025-08-22",
|
| 258 |
+
"po": "PO6",
|
| 259 |
+
"state": "accepted",
|
| 260 |
+
"units": 16
|
| 261 |
+
},
|
| 262 |
+
"GI-6-1": {
|
| 263 |
+
"date": "2025-08-17",
|
| 264 |
+
"po": "PO6",
|
| 265 |
+
"state": "accepted",
|
| 266 |
+
"units": 14
|
| 267 |
+
},
|
| 268 |
+
"GI-6-2": {
|
| 269 |
+
"date": "2025-08-17",
|
| 270 |
+
"po": "PO6",
|
| 271 |
+
"state": "accepted",
|
| 272 |
+
"units": 15
|
| 273 |
+
},
|
| 274 |
+
"GI-6-3": {
|
| 275 |
+
"date": "2025-08-19",
|
| 276 |
+
"po": "PO6",
|
| 277 |
+
"state": "quarantine",
|
| 278 |
+
"units": 20
|
| 279 |
+
}
|
| 280 |
+
},
|
| 281 |
+
"invoice_inbox": {
|
| 282 |
+
"IV-2613-5-2": {
|
| 283 |
+
"date": "2025-08-22",
|
| 284 |
+
"po": "PO5",
|
| 285 |
+
"state": "posted",
|
| 286 |
+
"unit_price_cents": 12821,
|
| 287 |
+
"units": 18,
|
| 288 |
+
"vendor": "V4"
|
| 289 |
+
},
|
| 290 |
+
"IV-3037-6-1": {
|
| 291 |
+
"date": "2025-08-15",
|
| 292 |
+
"po": "PO6",
|
| 293 |
+
"state": "void",
|
| 294 |
+
"unit_price_cents": 22140,
|
| 295 |
+
"units": 25,
|
| 296 |
+
"vendor": "V0"
|
| 297 |
+
},
|
| 298 |
+
"IV-3482-1-1": {
|
| 299 |
+
"date": "2025-08-23",
|
| 300 |
+
"po": "PO1",
|
| 301 |
+
"state": "disputed",
|
| 302 |
+
"unit_price_cents": 19000,
|
| 303 |
+
"units": 13,
|
| 304 |
+
"vendor": "Unknown"
|
| 305 |
+
},
|
| 306 |
+
"IV-4155-4-1": {
|
| 307 |
+
"date": "2025-08-03",
|
| 308 |
+
"po": "PO4",
|
| 309 |
+
"state": "void",
|
| 310 |
+
"unit_price_cents": 8752,
|
| 311 |
+
"units": 13,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-4801-3-1": {
|
| 315 |
+
"date": "2025-08-04",
|
| 316 |
+
"po": "PO3",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 14648,
|
| 319 |
+
"units": 10,
|
| 320 |
+
"vendor": "V3"
|
| 321 |
+
},
|
| 322 |
+
"IV-4811-2-1": {
|
| 323 |
+
"date": "2025-08-16",
|
| 324 |
+
"po": "PO2",
|
| 325 |
+
"state": "disputed",
|
| 326 |
+
"unit_price_cents": 4453,
|
| 327 |
+
"units": 25,
|
| 328 |
+
"vendor": "Unknown"
|
| 329 |
+
},
|
| 330 |
+
"IV-5537-5-0": {
|
| 331 |
+
"date": "2025-08-09",
|
| 332 |
+
"po": "PO5",
|
| 333 |
+
"state": "posted",
|
| 334 |
+
"unit_price_cents": 13177,
|
| 335 |
+
"units": 19,
|
| 336 |
+
"vendor": "V4"
|
| 337 |
+
},
|
| 338 |
+
"IV-6510-3-2": {
|
| 339 |
+
"date": "2025-08-09",
|
| 340 |
+
"po": "PO3",
|
| 341 |
+
"state": "posted",
|
| 342 |
+
"unit_price_cents": 13059,
|
| 343 |
+
"units": 3,
|
| 344 |
+
"vendor": "V3"
|
| 345 |
+
},
|
| 346 |
+
"IV-6764-0-1": {
|
| 347 |
+
"date": "2025-08-15",
|
| 348 |
+
"po": "PO0",
|
| 349 |
+
"state": "posted",
|
| 350 |
+
"unit_price_cents": 4492,
|
| 351 |
+
"units": 9,
|
| 352 |
+
"vendor": "V0"
|
| 353 |
+
},
|
| 354 |
+
"IV-6912-6-2": {
|
| 355 |
+
"date": "2025-08-12",
|
| 356 |
+
"po": "PO6",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 23343,
|
| 359 |
+
"units": 19,
|
| 360 |
+
"vendor": "V0"
|
| 361 |
+
},
|
| 362 |
+
"IV-7893-4-2": {
|
| 363 |
+
"date": "2025-08-20",
|
| 364 |
+
"po": "PO4",
|
| 365 |
+
"state": "disputed",
|
| 366 |
+
"unit_price_cents": 9742,
|
| 367 |
+
"units": 11,
|
| 368 |
+
"vendor": "V2"
|
| 369 |
+
},
|
| 370 |
+
"IV-7924-5-1": {
|
| 371 |
+
"date": "2025-08-09",
|
| 372 |
+
"po": "PO5",
|
| 373 |
+
"state": "disputed",
|
| 374 |
+
"unit_price_cents": 15219,
|
| 375 |
+
"units": 13,
|
| 376 |
+
"vendor": "V4"
|
| 377 |
+
},
|
| 378 |
+
"IV-8036-3-0": {
|
| 379 |
+
"date": "2025-08-09",
|
| 380 |
+
"po": "PO3",
|
| 381 |
+
"state": "posted",
|
| 382 |
+
"unit_price_cents": 13187,
|
| 383 |
+
"units": 5,
|
| 384 |
+
"vendor": "V3"
|
| 385 |
+
},
|
| 386 |
+
"IV-8332-6-3": {
|
| 387 |
+
"date": "2025-08-22",
|
| 388 |
+
"po": "PO6",
|
| 389 |
+
"state": "review",
|
| 390 |
+
"unit_price_cents": 23448,
|
| 391 |
+
"units": 5,
|
| 392 |
+
"vendor": "V0"
|
| 393 |
+
},
|
| 394 |
+
"IV-8473-0-0": {
|
| 395 |
+
"date": "2025-08-09",
|
| 396 |
+
"po": "PO0",
|
| 397 |
+
"state": "posted",
|
| 398 |
+
"unit_price_cents": 4672,
|
| 399 |
+
"units": 1,
|
| 400 |
+
"vendor": "V0"
|
| 401 |
+
},
|
| 402 |
+
"IV-8711-4-0": {
|
| 403 |
+
"date": "2025-08-09",
|
| 404 |
+
"po": "PO4",
|
| 405 |
+
"state": "posted",
|
| 406 |
+
"unit_price_cents": 8944,
|
| 407 |
+
"units": 17,
|
| 408 |
+
"vendor": "V2"
|
| 409 |
+
},
|
| 410 |
+
"IV-9039-1-0": {
|
| 411 |
+
"date": "2025-08-09",
|
| 412 |
+
"po": "PO1",
|
| 413 |
+
"state": "posted",
|
| 414 |
+
"unit_price_cents": 18388,
|
| 415 |
+
"units": 16,
|
| 416 |
+
"vendor": "V0"
|
| 417 |
+
},
|
| 418 |
+
"IV-9189-6-0": {
|
| 419 |
+
"date": "2025-08-09",
|
| 420 |
+
"po": "PO6",
|
| 421 |
+
"state": "review",
|
| 422 |
+
"unit_price_cents": 21322,
|
| 423 |
+
"units": 17,
|
| 424 |
+
"vendor": "V0"
|
| 425 |
+
},
|
| 426 |
+
"IV-9422-2-0": {
|
| 427 |
+
"date": "2025-08-09",
|
| 428 |
+
"po": "PO2",
|
| 429 |
+
"state": "posted",
|
| 430 |
+
"unit_price_cents": 3223,
|
| 431 |
+
"units": 3,
|
| 432 |
+
"vendor": "V1"
|
| 433 |
+
}
|
| 434 |
+
},
|
| 435 |
+
"purchase_orders": {
|
| 436 |
+
"PO0": {
|
| 437 |
+
"unit": "North",
|
| 438 |
+
"unit_price_cents": 4672,
|
| 439 |
+
"vendor": "V0"
|
| 440 |
+
},
|
| 441 |
+
"PO1": {
|
| 442 |
+
"unit": "North",
|
| 443 |
+
"unit_price_cents": 18388,
|
| 444 |
+
"vendor": "V0"
|
| 445 |
+
},
|
| 446 |
+
"PO2": {
|
| 447 |
+
"unit": "North",
|
| 448 |
+
"unit_price_cents": 3223,
|
| 449 |
+
"vendor": "V1"
|
| 450 |
+
},
|
| 451 |
+
"PO3": {
|
| 452 |
+
"unit": "North",
|
| 453 |
+
"unit_price_cents": 13187,
|
| 454 |
+
"vendor": "V3"
|
| 455 |
+
},
|
| 456 |
+
"PO4": {
|
| 457 |
+
"unit": "North",
|
| 458 |
+
"unit_price_cents": 8944,
|
| 459 |
+
"vendor": "V2"
|
| 460 |
+
},
|
| 461 |
+
"PO5": {
|
| 462 |
+
"unit": "North",
|
| 463 |
+
"unit_price_cents": 13177,
|
| 464 |
+
"vendor": "V4"
|
| 465 |
+
},
|
| 466 |
+
"PO6": {
|
| 467 |
+
"unit": "Other",
|
| 468 |
+
"unit_price_cents": 21322,
|
| 469 |
+
"vendor": "V0"
|
| 470 |
+
}
|
| 471 |
+
},
|
| 472 |
+
"supplier_cases": {
|
| 473 |
+
"PREEXISTING": {
|
| 474 |
+
"status": "investigating"
|
| 475 |
+
},
|
| 476 |
+
"case-IV-3482-1-1": {
|
| 477 |
+
"invoice": "IV-3482-1-1",
|
| 478 |
+
"issues": [
|
| 479 |
+
"vendor",
|
| 480 |
+
"price",
|
| 481 |
+
"units"
|
| 482 |
+
],
|
| 483 |
+
"po": "PO1"
|
| 484 |
+
},
|
| 485 |
+
"case-IV-4811-2-1": {
|
| 486 |
+
"invoice": "IV-4811-2-1",
|
| 487 |
+
"issues": [
|
| 488 |
+
"vendor",
|
| 489 |
+
"price",
|
| 490 |
+
"units"
|
| 491 |
+
],
|
| 492 |
+
"po": "PO2"
|
| 493 |
+
},
|
| 494 |
+
"case-IV-7893-4-2": {
|
| 495 |
+
"invoice": "IV-7893-4-2",
|
| 496 |
+
"issues": [
|
| 497 |
+
"price"
|
| 498 |
+
],
|
| 499 |
+
"po": "PO4"
|
| 500 |
+
},
|
| 501 |
+
"case-IV-7924-5-1": {
|
| 502 |
+
"invoice": "IV-7924-5-1",
|
| 503 |
+
"issues": [
|
| 504 |
+
"price"
|
| 505 |
+
],
|
| 506 |
+
"po": "PO5"
|
| 507 |
+
}
|
| 508 |
+
},
|
| 509 |
+
"vendors": {
|
| 510 |
+
"V0": {
|
| 511 |
+
"net_days": 30
|
| 512 |
+
},
|
| 513 |
+
"V1": {
|
| 514 |
+
"net_days": 15
|
| 515 |
+
},
|
| 516 |
+
"V2": {
|
| 517 |
+
"net_days": 21
|
| 518 |
+
},
|
| 519 |
+
"V3": {
|
| 520 |
+
"net_days": 45
|
| 521 |
+
},
|
| 522 |
+
"V4": {
|
| 523 |
+
"net_days": 15
|
| 524 |
+
}
|
| 525 |
+
}
|
| 526 |
+
}
|
tasks/autom-supplier-invoice-match-009/tests/test.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /logs/verifier /workspace/outputs
|
| 4 |
+
exec python3 -B -I /tests/grade.py
|
tasks/autom-supplier-invoice-match-009/tests/world.json
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 1
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 0
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 5
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 1
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 0
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 2
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 6
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-08-22",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 20
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-08-26",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "quarantine",
|
| 50 |
+
"units": 28
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-08-04",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "accepted",
|
| 56 |
+
"units": 22
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-08-19",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 12
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-08-22",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 16
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-08-07",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "quarantine",
|
| 74 |
+
"units": 12
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-08-20",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "quarantine",
|
| 80 |
+
"units": 26
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-08-25",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 26
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-08-22",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 17
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-07-31",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "accepted",
|
| 98 |
+
"units": 13
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-08-27",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "accepted",
|
| 104 |
+
"units": 22
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-08-19",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "quarantine",
|
| 110 |
+
"units": 26
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-08-22",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 21
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-08-19",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "accepted",
|
| 122 |
+
"units": 22
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-08-27",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "accepted",
|
| 128 |
+
"units": 16
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-08-14",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "accepted",
|
| 134 |
+
"units": 13
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-08-22",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 22
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-08-15",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "quarantine",
|
| 146 |
+
"units": 15
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-07-31",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "accepted",
|
| 152 |
+
"units": 28
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-08-09",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "quarantine",
|
| 158 |
+
"units": 18
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-08-22",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 13
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-08-21",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "accepted",
|
| 170 |
+
"units": 25
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-08-07",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "quarantine",
|
| 176 |
+
"units": 13
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-08-18",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "accepted",
|
| 182 |
+
"units": 22
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-08-22",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 16
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-08-17",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 14
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-08-17",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 15
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-08-19",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 20
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-2613-5-2": {
|
| 211 |
+
"date": "2025-08-22",
|
| 212 |
+
"po": "PO5",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 12821,
|
| 215 |
+
"units": 18,
|
| 216 |
+
"vendor": "V4"
|
| 217 |
+
},
|
| 218 |
+
"IV-3037-6-1": {
|
| 219 |
+
"date": "2025-08-15",
|
| 220 |
+
"po": "PO6",
|
| 221 |
+
"state": "void",
|
| 222 |
+
"unit_price_cents": 22140,
|
| 223 |
+
"units": 25,
|
| 224 |
+
"vendor": "V0"
|
| 225 |
+
},
|
| 226 |
+
"IV-3482-1-1": {
|
| 227 |
+
"date": "2025-08-23",
|
| 228 |
+
"po": "PO1",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 19000,
|
| 231 |
+
"units": 13,
|
| 232 |
+
"vendor": "Unknown"
|
| 233 |
+
},
|
| 234 |
+
"IV-4155-4-1": {
|
| 235 |
+
"date": "2025-08-03",
|
| 236 |
+
"po": "PO4",
|
| 237 |
+
"state": "void",
|
| 238 |
+
"unit_price_cents": 8752,
|
| 239 |
+
"units": 13,
|
| 240 |
+
"vendor": "V2"
|
| 241 |
+
},
|
| 242 |
+
"IV-4801-3-1": {
|
| 243 |
+
"date": "2025-08-04",
|
| 244 |
+
"po": "PO3",
|
| 245 |
+
"state": "review",
|
| 246 |
+
"unit_price_cents": 14648,
|
| 247 |
+
"units": 10,
|
| 248 |
+
"vendor": "V3"
|
| 249 |
+
},
|
| 250 |
+
"IV-4811-2-1": {
|
| 251 |
+
"date": "2025-08-16",
|
| 252 |
+
"po": "PO2",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 4453,
|
| 255 |
+
"units": 25,
|
| 256 |
+
"vendor": "Unknown"
|
| 257 |
+
},
|
| 258 |
+
"IV-5537-5-0": {
|
| 259 |
+
"date": "2025-08-09",
|
| 260 |
+
"po": "PO5",
|
| 261 |
+
"state": "review",
|
| 262 |
+
"unit_price_cents": 13177,
|
| 263 |
+
"units": 19,
|
| 264 |
+
"vendor": "V4"
|
| 265 |
+
},
|
| 266 |
+
"IV-6510-3-2": {
|
| 267 |
+
"date": "2025-08-09",
|
| 268 |
+
"po": "PO3",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 13059,
|
| 271 |
+
"units": 3,
|
| 272 |
+
"vendor": "V3"
|
| 273 |
+
},
|
| 274 |
+
"IV-6764-0-1": {
|
| 275 |
+
"date": "2025-08-15",
|
| 276 |
+
"po": "PO0",
|
| 277 |
+
"state": "review",
|
| 278 |
+
"unit_price_cents": 4492,
|
| 279 |
+
"units": 9,
|
| 280 |
+
"vendor": "V0"
|
| 281 |
+
},
|
| 282 |
+
"IV-6912-6-2": {
|
| 283 |
+
"date": "2025-08-12",
|
| 284 |
+
"po": "PO6",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 23343,
|
| 287 |
+
"units": 19,
|
| 288 |
+
"vendor": "V0"
|
| 289 |
+
},
|
| 290 |
+
"IV-7893-4-2": {
|
| 291 |
+
"date": "2025-08-20",
|
| 292 |
+
"po": "PO4",
|
| 293 |
+
"state": "review",
|
| 294 |
+
"unit_price_cents": 9742,
|
| 295 |
+
"units": 11,
|
| 296 |
+
"vendor": "V2"
|
| 297 |
+
},
|
| 298 |
+
"IV-7924-5-1": {
|
| 299 |
+
"date": "2025-08-09",
|
| 300 |
+
"po": "PO5",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 15219,
|
| 303 |
+
"units": 13,
|
| 304 |
+
"vendor": "V4"
|
| 305 |
+
},
|
| 306 |
+
"IV-8036-3-0": {
|
| 307 |
+
"date": "2025-08-09",
|
| 308 |
+
"po": "PO3",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 13187,
|
| 311 |
+
"units": 5,
|
| 312 |
+
"vendor": "V3"
|
| 313 |
+
},
|
| 314 |
+
"IV-8332-6-3": {
|
| 315 |
+
"date": "2025-08-22",
|
| 316 |
+
"po": "PO6",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 23448,
|
| 319 |
+
"units": 5,
|
| 320 |
+
"vendor": "V0"
|
| 321 |
+
},
|
| 322 |
+
"IV-8473-0-0": {
|
| 323 |
+
"date": "2025-08-09",
|
| 324 |
+
"po": "PO0",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 4672,
|
| 327 |
+
"units": 1,
|
| 328 |
+
"vendor": "V0"
|
| 329 |
+
},
|
| 330 |
+
"IV-8711-4-0": {
|
| 331 |
+
"date": "2025-08-09",
|
| 332 |
+
"po": "PO4",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 8944,
|
| 335 |
+
"units": 17,
|
| 336 |
+
"vendor": "V2"
|
| 337 |
+
},
|
| 338 |
+
"IV-9039-1-0": {
|
| 339 |
+
"date": "2025-08-09",
|
| 340 |
+
"po": "PO1",
|
| 341 |
+
"state": "review",
|
| 342 |
+
"unit_price_cents": 18388,
|
| 343 |
+
"units": 16,
|
| 344 |
+
"vendor": "V0"
|
| 345 |
+
},
|
| 346 |
+
"IV-9189-6-0": {
|
| 347 |
+
"date": "2025-08-09",
|
| 348 |
+
"po": "PO6",
|
| 349 |
+
"state": "review",
|
| 350 |
+
"unit_price_cents": 21322,
|
| 351 |
+
"units": 17,
|
| 352 |
+
"vendor": "V0"
|
| 353 |
+
},
|
| 354 |
+
"IV-9422-2-0": {
|
| 355 |
+
"date": "2025-08-09",
|
| 356 |
+
"po": "PO2",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 3223,
|
| 359 |
+
"units": 3,
|
| 360 |
+
"vendor": "V1"
|
| 361 |
+
}
|
| 362 |
+
},
|
| 363 |
+
"purchase_orders": {
|
| 364 |
+
"PO0": {
|
| 365 |
+
"unit": "North",
|
| 366 |
+
"unit_price_cents": 4672,
|
| 367 |
+
"vendor": "V0"
|
| 368 |
+
},
|
| 369 |
+
"PO1": {
|
| 370 |
+
"unit": "North",
|
| 371 |
+
"unit_price_cents": 18388,
|
| 372 |
+
"vendor": "V0"
|
| 373 |
+
},
|
| 374 |
+
"PO2": {
|
| 375 |
+
"unit": "North",
|
| 376 |
+
"unit_price_cents": 3223,
|
| 377 |
+
"vendor": "V1"
|
| 378 |
+
},
|
| 379 |
+
"PO3": {
|
| 380 |
+
"unit": "North",
|
| 381 |
+
"unit_price_cents": 13187,
|
| 382 |
+
"vendor": "V3"
|
| 383 |
+
},
|
| 384 |
+
"PO4": {
|
| 385 |
+
"unit": "North",
|
| 386 |
+
"unit_price_cents": 8944,
|
| 387 |
+
"vendor": "V2"
|
| 388 |
+
},
|
| 389 |
+
"PO5": {
|
| 390 |
+
"unit": "North",
|
| 391 |
+
"unit_price_cents": 13177,
|
| 392 |
+
"vendor": "V4"
|
| 393 |
+
},
|
| 394 |
+
"PO6": {
|
| 395 |
+
"unit": "Other",
|
| 396 |
+
"unit_price_cents": 21322,
|
| 397 |
+
"vendor": "V0"
|
| 398 |
+
}
|
| 399 |
+
},
|
| 400 |
+
"supplier_cases": {
|
| 401 |
+
"PREEXISTING": {
|
| 402 |
+
"status": "investigating"
|
| 403 |
+
}
|
| 404 |
+
},
|
| 405 |
+
"vendors": {
|
| 406 |
+
"V0": {
|
| 407 |
+
"net_days": 30
|
| 408 |
+
},
|
| 409 |
+
"V1": {
|
| 410 |
+
"net_days": 15
|
| 411 |
+
},
|
| 412 |
+
"V2": {
|
| 413 |
+
"net_days": 21
|
| 414 |
+
},
|
| 415 |
+
"V3": {
|
| 416 |
+
"net_days": 45
|
| 417 |
+
},
|
| 418 |
+
"V4": {
|
| 419 |
+
"net_days": 15
|
| 420 |
+
}
|
| 421 |
+
}
|
| 422 |
+
}
|
tasks/autom-supplier-invoice-match-009/tests/world_check.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Replay submitted mutations from the private verifier's initial state."""
|
| 2 |
+
from types import ModuleType
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def check(spec, outputs, tests):
|
| 7 |
+
replay = ModuleType('workflow_replay')
|
| 8 |
+
exec(compile((tests/'replay.py').read_bytes(), 'replay.py', 'exec'), replay.__dict__)
|
| 9 |
+
world = json.loads((tests/'world.json').read_text())
|
| 10 |
+
target = json.loads((tests/'target.json').read_text())
|
| 11 |
+
# Only fields whose starting and expected values differ may be changed. Attempts
|
| 12 |
+
# to temporarily alter a protected field fail even when a later write restores it.
|
| 13 |
+
allowed = {
|
| 14 |
+
(app,key): {field for field,value in doc.items()
|
| 15 |
+
if field not in world[app].get(key,{}) or not replay.same(world[app][key][field],value)}
|
| 16 |
+
for app,records in target.items() for key,doc in records.items()
|
| 17 |
+
}
|
| 18 |
+
actions = replay.load_actions(outputs/'actions.jsonl')
|
| 19 |
+
for event in actions:
|
| 20 |
+
replay.apply(world,event)
|
| 21 |
+
touched = set(event['fields'])
|
| 22 |
+
if not touched <= allowed.get((event['app'],event['id']),set()):
|
| 23 |
+
return False,'protected field or record write'
|
| 24 |
+
if not replay.same(world,target):
|
| 25 |
+
return False,'required business outcomes incomplete'
|
| 26 |
+
return True,''
|
tasks/autom-supplier-invoice-match-009/validation/openenv.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"profile": "harbor-semantic-v1",
|
| 3 |
+
"reward_key": "reward",
|
| 4 |
+
"reward": {
|
| 5 |
+
"range": [
|
| 6 |
+
0,
|
| 7 |
+
1
|
| 8 |
+
],
|
| 9 |
+
"oracle_tolerance": 0,
|
| 10 |
+
"floor_margin": 0.1
|
| 11 |
+
},
|
| 12 |
+
"resources": {
|
| 13 |
+
"cpu": 1,
|
| 14 |
+
"memory_mb": 4096,
|
| 15 |
+
"disk_mb": 10240,
|
| 16 |
+
"episode_timeout_s": 1800
|
| 17 |
+
},
|
| 18 |
+
"types": {
|
| 19 |
+
"tags": [
|
| 20 |
+
"knowledge-work",
|
| 21 |
+
"cross-app-workflows",
|
| 22 |
+
"conditional-execution",
|
| 23 |
+
"protected-state",
|
| 24 |
+
"finance"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
"requires_credentials": false
|
| 28 |
+
}
|
tasks/autom-supplier-invoice-match-010/environment/inputs/apps.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-010/environment/inputs/world.json
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 2
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 6
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 4
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 1
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 7
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 2
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 4
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-09-14",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 26
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-09-12",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "quarantine",
|
| 50 |
+
"units": 13
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-09-09",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "accepted",
|
| 56 |
+
"units": 15
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-09-10",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 18
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-09-14",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 17
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-09-07",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "accepted",
|
| 74 |
+
"units": 24
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-09-08",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "accepted",
|
| 80 |
+
"units": 16
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-09-02",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 25
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-09-14",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 19
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-09-09",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "accepted",
|
| 98 |
+
"units": 14
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-08-22",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "accepted",
|
| 104 |
+
"units": 17
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-09-16",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "quarantine",
|
| 110 |
+
"units": 25
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-09-14",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 28
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-09-16",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "accepted",
|
| 122 |
+
"units": 20
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-09-10",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "quarantine",
|
| 128 |
+
"units": 14
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-09-08",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "quarantine",
|
| 134 |
+
"units": 12
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-09-14",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 22
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-09-09",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "accepted",
|
| 146 |
+
"units": 13
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-09-20",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "accepted",
|
| 152 |
+
"units": 22
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-08-27",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "quarantine",
|
| 158 |
+
"units": 24
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-09-14",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 22
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-09-10",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "quarantine",
|
| 170 |
+
"units": 15
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-08-26",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "accepted",
|
| 176 |
+
"units": 27
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-09-13",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "quarantine",
|
| 182 |
+
"units": 22
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-09-14",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 15
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-09-05",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 27
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-09-04",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 15
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-08-22",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 26
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-1121-4-0": {
|
| 211 |
+
"date": "2025-09-01",
|
| 212 |
+
"po": "PO4",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 17924,
|
| 215 |
+
"units": 13,
|
| 216 |
+
"vendor": "V1"
|
| 217 |
+
},
|
| 218 |
+
"IV-1208-6-0": {
|
| 219 |
+
"date": "2025-09-01",
|
| 220 |
+
"po": "PO6",
|
| 221 |
+
"state": "review",
|
| 222 |
+
"unit_price_cents": 8042,
|
| 223 |
+
"units": 3,
|
| 224 |
+
"vendor": "V0"
|
| 225 |
+
},
|
| 226 |
+
"IV-1673-5-0": {
|
| 227 |
+
"date": "2025-09-01",
|
| 228 |
+
"po": "PO5",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 1621,
|
| 231 |
+
"units": 22,
|
| 232 |
+
"vendor": "V2"
|
| 233 |
+
},
|
| 234 |
+
"IV-1942-2-3": {
|
| 235 |
+
"date": "2025-08-26",
|
| 236 |
+
"po": "PO2",
|
| 237 |
+
"state": "review",
|
| 238 |
+
"unit_price_cents": 10900,
|
| 239 |
+
"units": 25,
|
| 240 |
+
"vendor": "V2"
|
| 241 |
+
},
|
| 242 |
+
"IV-1960-5-1": {
|
| 243 |
+
"date": "2025-09-10",
|
| 244 |
+
"po": "PO5",
|
| 245 |
+
"state": "void",
|
| 246 |
+
"unit_price_cents": 1254,
|
| 247 |
+
"units": 22,
|
| 248 |
+
"vendor": "V2"
|
| 249 |
+
},
|
| 250 |
+
"IV-2764-4-1": {
|
| 251 |
+
"date": "2025-09-06",
|
| 252 |
+
"po": "PO4",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 19899,
|
| 255 |
+
"units": 12,
|
| 256 |
+
"vendor": "Unknown"
|
| 257 |
+
},
|
| 258 |
+
"IV-2815-2-1": {
|
| 259 |
+
"date": "2025-08-27",
|
| 260 |
+
"po": "PO2",
|
| 261 |
+
"state": "review",
|
| 262 |
+
"unit_price_cents": 11257,
|
| 263 |
+
"units": 17,
|
| 264 |
+
"vendor": "Unknown"
|
| 265 |
+
},
|
| 266 |
+
"IV-3112-5-2": {
|
| 267 |
+
"date": "2025-08-28",
|
| 268 |
+
"po": "PO5",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 3159,
|
| 271 |
+
"units": 9,
|
| 272 |
+
"vendor": "V2"
|
| 273 |
+
},
|
| 274 |
+
"IV-3145-6-3": {
|
| 275 |
+
"date": "2025-08-30",
|
| 276 |
+
"po": "PO6",
|
| 277 |
+
"state": "void",
|
| 278 |
+
"unit_price_cents": 8002,
|
| 279 |
+
"units": 19,
|
| 280 |
+
"vendor": "V0"
|
| 281 |
+
},
|
| 282 |
+
"IV-3547-1-1": {
|
| 283 |
+
"date": "2025-09-05",
|
| 284 |
+
"po": "PO1",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 12078,
|
| 287 |
+
"units": 17,
|
| 288 |
+
"vendor": "V0"
|
| 289 |
+
},
|
| 290 |
+
"IV-3914-6-2": {
|
| 291 |
+
"date": "2025-09-07",
|
| 292 |
+
"po": "PO6",
|
| 293 |
+
"state": "void",
|
| 294 |
+
"unit_price_cents": 8669,
|
| 295 |
+
"units": 12,
|
| 296 |
+
"vendor": "Unknown"
|
| 297 |
+
},
|
| 298 |
+
"IV-4018-5-3": {
|
| 299 |
+
"date": "2025-09-13",
|
| 300 |
+
"po": "PO5",
|
| 301 |
+
"state": "void",
|
| 302 |
+
"unit_price_cents": 2185,
|
| 303 |
+
"units": 18,
|
| 304 |
+
"vendor": "V2"
|
| 305 |
+
},
|
| 306 |
+
"IV-4805-2-0": {
|
| 307 |
+
"date": "2025-09-01",
|
| 308 |
+
"po": "PO2",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 9571,
|
| 311 |
+
"units": 10,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-5145-6-1": {
|
| 315 |
+
"date": "2025-09-02",
|
| 316 |
+
"po": "PO6",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 10087,
|
| 319 |
+
"units": 12,
|
| 320 |
+
"vendor": "V0"
|
| 321 |
+
},
|
| 322 |
+
"IV-5313-3-0": {
|
| 323 |
+
"date": "2025-09-01",
|
| 324 |
+
"po": "PO3",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 9903,
|
| 327 |
+
"units": 4,
|
| 328 |
+
"vendor": "V4"
|
| 329 |
+
},
|
| 330 |
+
"IV-5395-0-1": {
|
| 331 |
+
"date": "2025-08-28",
|
| 332 |
+
"po": "PO0",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 11242,
|
| 335 |
+
"units": 18,
|
| 336 |
+
"vendor": "V1"
|
| 337 |
+
},
|
| 338 |
+
"IV-5915-0-2": {
|
| 339 |
+
"date": "2025-08-29",
|
| 340 |
+
"po": "PO0",
|
| 341 |
+
"state": "void",
|
| 342 |
+
"unit_price_cents": 10505,
|
| 343 |
+
"units": 11,
|
| 344 |
+
"vendor": "V1"
|
| 345 |
+
},
|
| 346 |
+
"IV-6603-1-0": {
|
| 347 |
+
"date": "2025-09-01",
|
| 348 |
+
"po": "PO1",
|
| 349 |
+
"state": "review",
|
| 350 |
+
"unit_price_cents": 12252,
|
| 351 |
+
"units": 5,
|
| 352 |
+
"vendor": "V0"
|
| 353 |
+
},
|
| 354 |
+
"IV-7380-2-2": {
|
| 355 |
+
"date": "2025-08-29",
|
| 356 |
+
"po": "PO2",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 9671,
|
| 359 |
+
"units": 6,
|
| 360 |
+
"vendor": "V2"
|
| 361 |
+
},
|
| 362 |
+
"IV-7506-1-2": {
|
| 363 |
+
"date": "2025-09-08",
|
| 364 |
+
"po": "PO1",
|
| 365 |
+
"state": "review",
|
| 366 |
+
"unit_price_cents": 13175,
|
| 367 |
+
"units": 14,
|
| 368 |
+
"vendor": "V0"
|
| 369 |
+
},
|
| 370 |
+
"IV-8304-3-1": {
|
| 371 |
+
"date": "2025-09-06",
|
| 372 |
+
"po": "PO3",
|
| 373 |
+
"state": "review",
|
| 374 |
+
"unit_price_cents": 9567,
|
| 375 |
+
"units": 20,
|
| 376 |
+
"vendor": "V4"
|
| 377 |
+
},
|
| 378 |
+
"IV-9162-0-0": {
|
| 379 |
+
"date": "2025-09-01",
|
| 380 |
+
"po": "PO0",
|
| 381 |
+
"state": "review",
|
| 382 |
+
"unit_price_cents": 9684,
|
| 383 |
+
"units": 1,
|
| 384 |
+
"vendor": "V1"
|
| 385 |
+
}
|
| 386 |
+
},
|
| 387 |
+
"purchase_orders": {
|
| 388 |
+
"PO0": {
|
| 389 |
+
"unit": "South",
|
| 390 |
+
"unit_price_cents": 9684,
|
| 391 |
+
"vendor": "V1"
|
| 392 |
+
},
|
| 393 |
+
"PO1": {
|
| 394 |
+
"unit": "South",
|
| 395 |
+
"unit_price_cents": 12252,
|
| 396 |
+
"vendor": "V0"
|
| 397 |
+
},
|
| 398 |
+
"PO2": {
|
| 399 |
+
"unit": "South",
|
| 400 |
+
"unit_price_cents": 9571,
|
| 401 |
+
"vendor": "V2"
|
| 402 |
+
},
|
| 403 |
+
"PO3": {
|
| 404 |
+
"unit": "South",
|
| 405 |
+
"unit_price_cents": 9903,
|
| 406 |
+
"vendor": "V4"
|
| 407 |
+
},
|
| 408 |
+
"PO4": {
|
| 409 |
+
"unit": "South",
|
| 410 |
+
"unit_price_cents": 17924,
|
| 411 |
+
"vendor": "V1"
|
| 412 |
+
},
|
| 413 |
+
"PO5": {
|
| 414 |
+
"unit": "South",
|
| 415 |
+
"unit_price_cents": 1621,
|
| 416 |
+
"vendor": "V2"
|
| 417 |
+
},
|
| 418 |
+
"PO6": {
|
| 419 |
+
"unit": "Other",
|
| 420 |
+
"unit_price_cents": 8042,
|
| 421 |
+
"vendor": "V0"
|
| 422 |
+
}
|
| 423 |
+
},
|
| 424 |
+
"supplier_cases": {
|
| 425 |
+
"PREEXISTING": {
|
| 426 |
+
"status": "investigating"
|
| 427 |
+
}
|
| 428 |
+
},
|
| 429 |
+
"vendors": {
|
| 430 |
+
"V0": {
|
| 431 |
+
"net_days": 45
|
| 432 |
+
},
|
| 433 |
+
"V1": {
|
| 434 |
+
"net_days": 15
|
| 435 |
+
},
|
| 436 |
+
"V2": {
|
| 437 |
+
"net_days": 15
|
| 438 |
+
},
|
| 439 |
+
"V3": {
|
| 440 |
+
"net_days": 30
|
| 441 |
+
},
|
| 442 |
+
"V4": {
|
| 443 |
+
"net_days": 30
|
| 444 |
+
}
|
| 445 |
+
}
|
| 446 |
+
}
|
tasks/autom-supplier-invoice-match-010/instruction.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Close the invoice matching queue for purchasing unit South at 2025-09-15. Handle invoices in review attached to that unit's purchase orders, invoice dates 2025-09-01 through 2025-09-15 inclusive. Process by invoice date ascending, then invoice ID ascending. Available units per PO equal units on accepted goods receipts dated on or before cutoff, minus previously posted units and any units successfully matched earlier in this run.
|
| 2 |
+
|
| 3 |
+
Match the invoice vendor exactly against the purchase order. A unit price above PO price is acceptable only up to 500 basis points above PO price (10,000 basis points = 100%; compare exactly, before rounding). Lower prices are acceptable. The invoice quantity must fit the available units in full. If any tests fail, update the invoice state to `disputed`, consume zero units, and create supplier_cases record `case-<invoice ID>` with `invoice`, `po` and the list `issues` containing every failing check in vendor, price, units order; use those lowercase strings.
|
| 4 |
+
|
| 5 |
+
For a match update invoice state to `posted` and create ap_postings record `book-<invoice ID>` with `invoice`, `po`, `units`, `status=posted`, integer `amount_cents` equal to invoiced quantity times invoiced unit price, and ISO date `due`. Count the vendor's net_days calendar days from the invoice date, then roll Saturday or Sunday forward to Monday. Preserve all other fields and records.
|
| 6 |
+
|
| 7 |
+
Use the offline app client at `/workspace/inputs/apps.py`. Call it with python3. Run
|
| 8 |
+
`apps` to discover apps, `list APP` to see its records, or `get APP ID` for one record.
|
| 9 |
+
Write with `update APP ID '{"field":"value"}'` or `create APP ID '{"field":"value"}'`.
|
| 10 |
+
The client records successful writes in `/workspace/outputs/actions.jsonl`.
|
| 11 |
+
Apply exactly the required changes. Other records and fields must remain untouched,
|
| 12 |
+
including temporary changes. Actions take effect in the local simulation only.
|
| 13 |
+
|
| 14 |
+
## Deliverable
|
| 15 |
+
|
| 16 |
+
Work in `/workspace`. Input files are under `/workspace/inputs/`. Put every deliverable in
|
| 17 |
+
`/workspace/outputs/`; only that directory is graded. Leave the app action log in the outputs directory.
|
tasks/autom-supplier-invoice-match-010/solution/files/actions.jsonl
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-9162-0-0", "op": "update"}
|
| 2 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-6603-1-0", "op": "update"}
|
| 3 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-3547-1-1", "op": "update"}
|
| 4 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-7506-1-2", "op": "update"}
|
| 5 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-4805-2-0", "op": "update"}
|
| 6 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-5313-3-0", "op": "update"}
|
| 7 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-8304-3-1", "op": "update"}
|
| 8 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-1121-4-0", "op": "update"}
|
| 9 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-2764-4-1", "op": "update"}
|
| 10 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-1673-5-0", "op": "update"}
|
| 11 |
+
{"app": "ap_postings", "fields": {"amount_cents": 233012, "due": "2025-09-16", "invoice": "IV-1121-4-0", "po": "PO4", "status": "posted", "units": 13}, "id": "book-IV-1121-4-0", "op": "create"}
|
| 12 |
+
{"app": "ap_postings", "fields": {"amount_cents": 35662, "due": "2025-09-16", "invoice": "IV-1673-5-0", "po": "PO5", "status": "posted", "units": 22}, "id": "book-IV-1673-5-0", "op": "create"}
|
| 13 |
+
{"app": "ap_postings", "fields": {"amount_cents": 95710, "due": "2025-09-16", "invoice": "IV-4805-2-0", "po": "PO2", "status": "posted", "units": 10}, "id": "book-IV-4805-2-0", "op": "create"}
|
| 14 |
+
{"app": "ap_postings", "fields": {"amount_cents": 39612, "due": "2025-10-01", "invoice": "IV-5313-3-0", "po": "PO3", "status": "posted", "units": 4}, "id": "book-IV-5313-3-0", "op": "create"}
|
| 15 |
+
{"app": "ap_postings", "fields": {"amount_cents": 61260, "due": "2025-10-16", "invoice": "IV-6603-1-0", "po": "PO1", "status": "posted", "units": 5}, "id": "book-IV-6603-1-0", "op": "create"}
|
| 16 |
+
{"app": "ap_postings", "fields": {"amount_cents": 9684, "due": "2025-09-16", "invoice": "IV-9162-0-0", "po": "PO0", "status": "posted", "units": 1}, "id": "book-IV-9162-0-0", "op": "create"}
|
| 17 |
+
{"app": "ap_postings", "fields": {"amount_cents": 205326, "due": "2025-10-20", "invoice": "IV-3547-1-1", "po": "PO1", "status": "posted", "units": 17}, "id": "book-IV-3547-1-1", "op": "create"}
|
| 18 |
+
{"app": "ap_postings", "fields": {"amount_cents": 191340, "due": "2025-10-06", "invoice": "IV-8304-3-1", "po": "PO3", "status": "posted", "units": 20}, "id": "book-IV-8304-3-1", "op": "create"}
|
| 19 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-2764-4-1", "issues": ["vendor", "price"], "po": "PO4"}, "id": "case-IV-2764-4-1", "op": "create"}
|
| 20 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-7506-1-2", "issues": ["price"], "po": "PO1"}, "id": "case-IV-7506-1-2", "op": "create"}
|
tasks/autom-supplier-invoice-match-010/solution/solve.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /workspace/outputs
|
| 4 |
+
cp -R /solution/files/. /workspace/outputs/
|
tasks/autom-supplier-invoice-match-010/task.toml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.3"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "apex-gap/autom-supplier-invoice-match-010"
|
| 5 |
+
|
| 6 |
+
[metadata.apex_gap]
|
| 7 |
+
capability_tags = ["cross-app-workflows", "conditional-execution", "protected-state", "finance"]
|
| 8 |
+
dataset = "Original simulated workflows"
|
| 9 |
+
job = "finance"
|
| 10 |
+
seed = 10
|
| 11 |
+
source = "local/original-automation-workflows"
|
| 12 |
+
source_revision = "1"
|
| 13 |
+
source_split = "synthetic"
|
| 14 |
+
source_task_id = "autom-supplier-invoice-match-010"
|
| 15 |
+
template_family = "automation:supplier-invoice-match"
|
| 16 |
+
workflow_template = "supplier-invoice-match"
|
| 17 |
+
|
| 18 |
+
[metadata.openenv_hf_sandbox]
|
| 19 |
+
variant = "apex-gap-hfsandbox-v1"
|
| 20 |
+
task_modified_for_hf_sandbox = true
|
| 21 |
+
network_enabled = true
|
| 22 |
+
|
| 23 |
+
[environment]
|
| 24 |
+
docker_image = "ghcr.io/younesbelkada/apex@sha256:24969c952247033023872f87161a16e067003469506be63783bbaa5d96926bdf"
|
| 25 |
+
workdir = "/workspace"
|
| 26 |
+
cpus = 1
|
| 27 |
+
memory_mb = 4096
|
| 28 |
+
build_timeout_sec = 600
|
| 29 |
+
network_mode = "public"
|
| 30 |
+
|
| 31 |
+
[agent]
|
| 32 |
+
timeout_sec = 1800
|
| 33 |
+
network_mode = "public"
|
| 34 |
+
|
| 35 |
+
[verifier]
|
| 36 |
+
timeout_sec = 600
|
| 37 |
+
network_mode = "public"
|
| 38 |
+
environment_mode = "separate"
|
| 39 |
+
|
| 40 |
+
[verifier.environment]
|
| 41 |
+
network_mode = "public"
|
| 42 |
+
cpus = 1
|
| 43 |
+
memory_mb = 4096
|
| 44 |
+
|
| 45 |
+
[[artifacts]]
|
| 46 |
+
source = "/workspace/outputs"
|
tasks/autom-supplier-invoice-match-010/tests/expected.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"checks": [
|
| 3 |
+
{
|
| 4 |
+
"id": "business-outcomes",
|
| 5 |
+
"type": "custom",
|
| 6 |
+
"module": "world_check"
|
| 7 |
+
}
|
| 8 |
+
]
|
| 9 |
+
}
|
tasks/autom-supplier-invoice-match-010/tests/grade.py
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Deterministic grader shared by converted knowledge-work tasks.
|
| 2 |
+
|
| 3 |
+
Runs inside the separate verifier sandbox. Reads /tests/expected.json, inspects the
|
| 4 |
+
submitted /workspace/outputs tree and writes a binary reward plus per-check details.
|
| 5 |
+
No model calls and no network.
|
| 6 |
+
|
| 7 |
+
expected.json: {"checks": [{"id": ..., "type": ..., ...}, ...]}
|
| 8 |
+
Check types:
|
| 9 |
+
answer field of outputs/answer.json; kind = number|text|choice|date|bool|list
|
| 10 |
+
xlsx_range recalculated outputs/<file> vs tests/<target> over sheet!range (SpreadsheetBench rules)
|
| 11 |
+
xlsx_cell recalculated outputs/<file> sheet!cell vs value with tolerance (optional alt_values)
|
| 12 |
+
file_contains outputs/<file> text (docx/pdf/ics/eml/txt) must contain every needle
|
| 13 |
+
custom tests/<module>.py defines check(spec, outputs_dir, tests_dir) -> (bool, str)
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
import datetime as dt
|
| 17 |
+
import json
|
| 18 |
+
import re
|
| 19 |
+
import shutil
|
| 20 |
+
import subprocess
|
| 21 |
+
import sys
|
| 22 |
+
import tempfile
|
| 23 |
+
import unicodedata
|
| 24 |
+
from pathlib import Path
|
| 25 |
+
|
| 26 |
+
OUT = Path("/workspace/outputs")
|
| 27 |
+
TESTS = Path("/tests")
|
| 28 |
+
LOGS = Path("/logs/verifier")
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def norm_text(v):
|
| 32 |
+
v = unicodedata.normalize("NFKC", str(v)).casefold()
|
| 33 |
+
v = re.sub(r"[‘’“”]", "'", v)
|
| 34 |
+
v = re.sub(r"[^\w%.$/-]+", " ", v)
|
| 35 |
+
return " ".join(v.split()).strip(" .")
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def to_number(v):
|
| 39 |
+
if isinstance(v, bool):
|
| 40 |
+
raise ValueError("bool")
|
| 41 |
+
if isinstance(v, (int, float)):
|
| 42 |
+
return float(v)
|
| 43 |
+
s = str(v).strip().replace(",", "").replace("$", "").replace("−", "-")
|
| 44 |
+
neg = s.startswith("(") and s.endswith(")")
|
| 45 |
+
s = s.strip("()").strip()
|
| 46 |
+
pct = s.endswith("%")
|
| 47 |
+
s = s.rstrip("%").strip()
|
| 48 |
+
s = re.sub(r"\s*(usd|dollars|million|billion|thousand|m|bn|k)$", "", s, flags=re.I)
|
| 49 |
+
x = float(s)
|
| 50 |
+
x = -x if neg else x
|
| 51 |
+
return x / 100 if pct else x
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def number_ok(got, want, rel, abs_):
|
| 55 |
+
try:
|
| 56 |
+
g = to_number(got)
|
| 57 |
+
except (TypeError, ValueError):
|
| 58 |
+
return False
|
| 59 |
+
w = float(want)
|
| 60 |
+
tol = max(abs_, rel * abs(w))
|
| 61 |
+
# "12.5%" may mean the ratio 0.125 or the percent number 12.5; the gold fixes which.
|
| 62 |
+
candidates = [g, g * 100] if isinstance(got, str) and got.strip().endswith("%") else [g]
|
| 63 |
+
return any(abs(c - w) <= tol for c in candidates)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def parse_date(v):
|
| 67 |
+
if isinstance(v, (dt.date, dt.datetime)):
|
| 68 |
+
return v if isinstance(v, dt.date) else v.date()
|
| 69 |
+
s = str(v).strip()
|
| 70 |
+
for fmt in ("%Y-%m-%d", "%m/%d/%Y", "%m/%d/%y", "%d %B %Y", "%B %d, %Y", "%b %d, %Y", "%Y/%m/%d"):
|
| 71 |
+
try:
|
| 72 |
+
return dt.datetime.strptime(s, fmt).date()
|
| 73 |
+
except ValueError:
|
| 74 |
+
continue
|
| 75 |
+
raise ValueError(s)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def check_answer(check, answers):
|
| 79 |
+
key = check["field"]
|
| 80 |
+
if key not in answers:
|
| 81 |
+
return False, f"missing field {key!r}"
|
| 82 |
+
got, want, kind = answers[key], check["value"], check.get("kind", "text")
|
| 83 |
+
if kind == "number":
|
| 84 |
+
ok = number_ok(got, want, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01))
|
| 85 |
+
if not ok and check.get("percent_either"):
|
| 86 |
+
ok = number_ok(got, want * 100, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01) * 100) or (
|
| 87 |
+
number_ok(got, want / 100, check.get("rel_tol", 0.005), check.get("abs_tol", 0.01) / 100)
|
| 88 |
+
)
|
| 89 |
+
elif kind == "date":
|
| 90 |
+
try:
|
| 91 |
+
ok = parse_date(got) == parse_date(want)
|
| 92 |
+
except ValueError:
|
| 93 |
+
ok = False
|
| 94 |
+
elif kind == "bool":
|
| 95 |
+
g = norm_text(got)
|
| 96 |
+
ok = g in {"yes", "true"} if want else g in {"no", "false"}
|
| 97 |
+
elif kind == "choice":
|
| 98 |
+
ok = norm_text(got) == norm_text(want)
|
| 99 |
+
elif kind == "list":
|
| 100 |
+
if not isinstance(got, list):
|
| 101 |
+
return False, f"{key}: expected a JSON list"
|
| 102 |
+
# Filenames may be given with a directory prefix; compare base names.
|
| 103 |
+
base = lambda x: norm_text(str(x).replace("\\", "/").rsplit("/", 1)[-1])
|
| 104 |
+
ok = sorted(base(x) for x in got) == sorted(base(x) for x in want)
|
| 105 |
+
else:
|
| 106 |
+
accepted = check.get("accept", [want])
|
| 107 |
+
ok = norm_text(got) in {norm_text(a) for a in accepted}
|
| 108 |
+
return ok, "" if ok else f"{key}: got {got!r}"
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
# LibreOffice keeps cached formula values on load unless told otherwise; force a full recalculation.
|
| 112 |
+
RECALC_PROFILE = """<?xml version="1.0" encoding="UTF-8"?>
|
| 113 |
+
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
| 114 |
+
<item oor:path="/org.openoffice.Office.Calc/Formula/Load"><prop oor:name="OOXMLRecalcMode" oor:op="fuse"><value>0</value></prop></item>
|
| 115 |
+
<item oor:path="/org.openoffice.Office.Calc/Formula/Load"><prop oor:name="ODFRecalcMode" oor:op="fuse"><value>0</value></prop></item>
|
| 116 |
+
</oor:items>
|
| 117 |
+
"""
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def recalc(path, tmp):
|
| 121 |
+
dest = Path(tmp) / f"recalc-{len(list(Path(tmp).glob('recalc-*')))}"
|
| 122 |
+
dest.mkdir()
|
| 123 |
+
profile = Path(tmp) / "lo-profile"
|
| 124 |
+
if not profile.exists():
|
| 125 |
+
(profile / "user").mkdir(parents=True)
|
| 126 |
+
(profile / "user" / "registrymodifications.xcu").write_text(RECALC_PROFILE)
|
| 127 |
+
subprocess.run(
|
| 128 |
+
["soffice", f"-env:UserInstallation=file://{profile}", "--headless", "--calc", "--convert-to",
|
| 129 |
+
"xlsx:Calc MS Excel 2007 XML", "--outdir", str(dest), str(path)],
|
| 130 |
+
stdout=subprocess.DEVNULL,
|
| 131 |
+
stderr=subprocess.DEVNULL,
|
| 132 |
+
timeout=180,
|
| 133 |
+
check=False,
|
| 134 |
+
)
|
| 135 |
+
out = dest / (Path(path).stem + ".xlsx")
|
| 136 |
+
return out if out.exists() else Path(path)
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
def cell_value(v):
|
| 140 |
+
if isinstance(v, (int, float)) and not isinstance(v, bool):
|
| 141 |
+
return round(float(v), 2)
|
| 142 |
+
if isinstance(v, dt.datetime):
|
| 143 |
+
return round((v - dt.datetime(1899, 12, 30)).total_seconds() / 86400.0, 0)
|
| 144 |
+
if isinstance(v, dt.time):
|
| 145 |
+
return v.strftime("%H:%M")
|
| 146 |
+
if isinstance(v, str):
|
| 147 |
+
try:
|
| 148 |
+
return round(float(v), 2)
|
| 149 |
+
except ValueError:
|
| 150 |
+
return v.strip()
|
| 151 |
+
return v
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def time_of(v):
|
| 155 |
+
"""A time or a day fraction in [0, 1) as HH:MM, rounded to the nearest second first. Calc and
|
| 156 |
+
Excel store a time as that fraction; openpyxl returns a time only for time-formatted cells."""
|
| 157 |
+
if isinstance(v, dt.time):
|
| 158 |
+
v = (v.hour * 3600 + v.minute * 60 + v.second + v.microsecond / 1e6) / 86400
|
| 159 |
+
if isinstance(v, (int, float)) and not isinstance(v, bool) and 0 <= v < 1:
|
| 160 |
+
return (dt.datetime(1899, 12, 30) + dt.timedelta(seconds=round(v * 86400))).strftime("%H:%M")
|
| 161 |
+
return None
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
def same_cell(a, b):
|
| 165 |
+
if isinstance(a, dt.time) is not isinstance(b, dt.time):
|
| 166 |
+
n = b if isinstance(a, dt.time) else a
|
| 167 |
+
if time_of(n) is not None: # a time against a plain day fraction
|
| 168 |
+
return time_of(a) == time_of(b)
|
| 169 |
+
a, b = cell_value(a), cell_value(b)
|
| 170 |
+
if a in (None, "") and b in (None, ""):
|
| 171 |
+
return True
|
| 172 |
+
return type(a) is type(b) and a == b
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
ERRORS = {"#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"}
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
def is_error(v):
|
| 179 |
+
return isinstance(v, str) and (v in ERRORS or v.startswith("Err:"))
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def cells(rng):
|
| 183 |
+
if ":" not in rng:
|
| 184 |
+
return [rng]
|
| 185 |
+
from openpyxl.utils import range_boundaries, get_column_letter
|
| 186 |
+
|
| 187 |
+
c1, r1, c2, r2 = range_boundaries(rng)
|
| 188 |
+
return [f"{get_column_letter(c)}{r}" for r in range(r1, r2 + 1) for c in range(c1, c2 + 1)]
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def load(path, tmp):
|
| 192 |
+
import openpyxl
|
| 193 |
+
|
| 194 |
+
return openpyxl.load_workbook(recalc(path, tmp), data_only=True)
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
def check_xlsx_range(check, tmp, cache):
|
| 198 |
+
sub = OUT / check["file"]
|
| 199 |
+
if not sub.is_file():
|
| 200 |
+
return False, f"missing output {check['file']}"
|
| 201 |
+
if sub not in cache:
|
| 202 |
+
cache[sub] = load(sub, tmp)
|
| 203 |
+
tgt = TESTS / check["target"]
|
| 204 |
+
if tgt not in cache:
|
| 205 |
+
cache[tgt] = load(tgt, tmp)
|
| 206 |
+
got, want = cache[sub], cache[tgt]
|
| 207 |
+
cached = None # the target's stored (Excel-computed) values, read only when Calc errs
|
| 208 |
+
for sheet, rng in check["ranges"]:
|
| 209 |
+
sheet = sheet or want.sheetnames[0]
|
| 210 |
+
if sheet not in got.sheetnames:
|
| 211 |
+
return False, f"sheet {sheet!r} missing"
|
| 212 |
+
for name in cells(rng):
|
| 213 |
+
w = want[sheet][name].value
|
| 214 |
+
if is_error(w):
|
| 215 |
+
# LibreOffice could not evaluate the gold formula (e.g. XLOOKUP, FILTER in Calc 7.4).
|
| 216 |
+
# The value Excel stored is the intended answer.
|
| 217 |
+
if cached is None:
|
| 218 |
+
import openpyxl
|
| 219 |
+
|
| 220 |
+
cached = openpyxl.load_workbook(tgt, data_only=True)
|
| 221 |
+
c = cached[sheet][name].value if sheet in cached.sheetnames else None
|
| 222 |
+
if c is not None and not is_error(c):
|
| 223 |
+
w = c
|
| 224 |
+
if not same_cell(w, got[sheet][name].value):
|
| 225 |
+
return False, f"{sheet}!{name}: want {w!r} got {got[sheet][name].value!r}"
|
| 226 |
+
return True, ""
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
def check_xlsx_cell(check, tmp, cache):
|
| 230 |
+
sub = OUT / check["file"]
|
| 231 |
+
if not sub.is_file():
|
| 232 |
+
return False, f"missing output {check['file']}"
|
| 233 |
+
if sub not in cache:
|
| 234 |
+
cache[sub] = load(sub, tmp)
|
| 235 |
+
wb = cache[sub]
|
| 236 |
+
if check["sheet"] not in wb.sheetnames:
|
| 237 |
+
return False, f"sheet {check['sheet']!r} missing"
|
| 238 |
+
got = wb[check["sheet"]][check["cell"]].value
|
| 239 |
+
want = check["value"]
|
| 240 |
+
if isinstance(want, (int, float)):
|
| 241 |
+
# alt_values: other accepted golds where the source admits more than one reading.
|
| 242 |
+
ok = got is not None and any(number_ok(got, w, check.get("rel_tol", 0.0), check.get("abs_tol", 0.01))
|
| 243 |
+
for w in [want, *check.get("alt_values", [])])
|
| 244 |
+
else:
|
| 245 |
+
ok = norm_text(got) == norm_text(want)
|
| 246 |
+
return ok, "" if ok else f"{check['sheet']}!{check['cell']}: want {want!r} got {got!r}"
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def text_of(path):
|
| 250 |
+
suffix = path.suffix.lower()
|
| 251 |
+
if suffix == ".docx":
|
| 252 |
+
import docx
|
| 253 |
+
|
| 254 |
+
d = docx.Document(path)
|
| 255 |
+
parts = [p.text for p in d.paragraphs]
|
| 256 |
+
for t in d.tables:
|
| 257 |
+
parts += [c.text for row in t.rows for c in row.cells]
|
| 258 |
+
return "\n".join(parts)
|
| 259 |
+
if suffix == ".pdf":
|
| 260 |
+
import pdfplumber
|
| 261 |
+
|
| 262 |
+
with pdfplumber.open(path) as pdf:
|
| 263 |
+
return "\n".join(page.extract_text() or "" for page in pdf.pages)
|
| 264 |
+
return path.read_text(errors="replace")
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def check_file_contains(check, tmp, cache):
|
| 268 |
+
sub = OUT / check["file"]
|
| 269 |
+
if not sub.is_file():
|
| 270 |
+
return False, f"missing output {check['file']}"
|
| 271 |
+
text = text_of(sub)
|
| 272 |
+
hay = text if check.get("case_sensitive") else text.casefold()
|
| 273 |
+
for needle in check["needles"]:
|
| 274 |
+
n = needle if check.get("case_sensitive") else needle.casefold()
|
| 275 |
+
if n not in hay:
|
| 276 |
+
return False, f"{check['file']} lacks {needle!r}"
|
| 277 |
+
return True, ""
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
def main():
|
| 281 |
+
LOGS.mkdir(parents=True, exist_ok=True)
|
| 282 |
+
reward_path = LOGS / "reward.txt"
|
| 283 |
+
reward_path.write_text("0\n")
|
| 284 |
+
spec = json.loads((TESTS / "expected.json").read_text())
|
| 285 |
+
answers, details = {}, []
|
| 286 |
+
answer_file = OUT / "answer.json"
|
| 287 |
+
if answer_file.is_file():
|
| 288 |
+
try:
|
| 289 |
+
answers = json.loads(answer_file.read_text())
|
| 290 |
+
if not isinstance(answers, dict):
|
| 291 |
+
answers = {}
|
| 292 |
+
except json.JSONDecodeError:
|
| 293 |
+
answers = {}
|
| 294 |
+
tmp = tempfile.mkdtemp()
|
| 295 |
+
cache = {}
|
| 296 |
+
try:
|
| 297 |
+
for check in spec["checks"]:
|
| 298 |
+
try:
|
| 299 |
+
if check["type"] == "answer":
|
| 300 |
+
ok, why = check_answer(check, answers)
|
| 301 |
+
elif check["type"] == "xlsx_range":
|
| 302 |
+
ok, why = check_xlsx_range(check, tmp, cache)
|
| 303 |
+
elif check["type"] == "xlsx_cell":
|
| 304 |
+
ok, why = check_xlsx_cell(check, tmp, cache)
|
| 305 |
+
elif check["type"] == "file_contains":
|
| 306 |
+
ok, why = check_file_contains(check, tmp, cache)
|
| 307 |
+
elif check["type"] == "custom":
|
| 308 |
+
import importlib.util
|
| 309 |
+
|
| 310 |
+
spec_ = importlib.util.spec_from_file_location("custom_check", TESTS / f"{check['module']}.py")
|
| 311 |
+
mod = importlib.util.module_from_spec(spec_)
|
| 312 |
+
spec_.loader.exec_module(mod)
|
| 313 |
+
ok, why = mod.check(check, OUT, TESTS)
|
| 314 |
+
else:
|
| 315 |
+
ok, why = False, f"unknown check type {check['type']}"
|
| 316 |
+
except Exception as exc: # a malformed submission fails the check, not the grader
|
| 317 |
+
ok, why = False, f"{type(exc).__name__}: {exc}"
|
| 318 |
+
details.append({"id": check["id"], "passed": ok, "detail": why})
|
| 319 |
+
finally:
|
| 320 |
+
shutil.rmtree(tmp, ignore_errors=True)
|
| 321 |
+
passed = sum(d["passed"] for d in details)
|
| 322 |
+
total = len(details)
|
| 323 |
+
reward = 1 if total and passed == total else 0
|
| 324 |
+
(LOGS / "details.json").write_text(json.dumps({"passed": passed, "total": total, "checks": details}, indent=1))
|
| 325 |
+
reward_path.write_text(f"{reward}\n")
|
| 326 |
+
print(f"{passed}/{total} checks passed; reward {reward}")
|
| 327 |
+
|
| 328 |
+
|
| 329 |
+
if __name__ == "__main__":
|
| 330 |
+
sys.exit(main())
|
tasks/autom-supplier-invoice-match-010/tests/replay.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-010/tests/target.json
ADDED
|
@@ -0,0 +1,525 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
},
|
| 11 |
+
"book-IV-1673-5-0": {
|
| 12 |
+
"amount_cents": 35662,
|
| 13 |
+
"due": "2025-09-16",
|
| 14 |
+
"invoice": "IV-1673-5-0",
|
| 15 |
+
"po": "PO5",
|
| 16 |
+
"status": "posted",
|
| 17 |
+
"units": 22
|
| 18 |
+
},
|
| 19 |
+
"book-IV-3547-1-1": {
|
| 20 |
+
"amount_cents": 205326,
|
| 21 |
+
"due": "2025-10-20",
|
| 22 |
+
"invoice": "IV-3547-1-1",
|
| 23 |
+
"po": "PO1",
|
| 24 |
+
"status": "posted",
|
| 25 |
+
"units": 17
|
| 26 |
+
},
|
| 27 |
+
"book-IV-4805-2-0": {
|
| 28 |
+
"amount_cents": 95710,
|
| 29 |
+
"due": "2025-09-16",
|
| 30 |
+
"invoice": "IV-4805-2-0",
|
| 31 |
+
"po": "PO2",
|
| 32 |
+
"status": "posted",
|
| 33 |
+
"units": 10
|
| 34 |
+
},
|
| 35 |
+
"book-IV-5313-3-0": {
|
| 36 |
+
"amount_cents": 39612,
|
| 37 |
+
"due": "2025-10-01",
|
| 38 |
+
"invoice": "IV-5313-3-0",
|
| 39 |
+
"po": "PO3",
|
| 40 |
+
"status": "posted",
|
| 41 |
+
"units": 4
|
| 42 |
+
},
|
| 43 |
+
"book-IV-6603-1-0": {
|
| 44 |
+
"amount_cents": 61260,
|
| 45 |
+
"due": "2025-10-16",
|
| 46 |
+
"invoice": "IV-6603-1-0",
|
| 47 |
+
"po": "PO1",
|
| 48 |
+
"status": "posted",
|
| 49 |
+
"units": 5
|
| 50 |
+
},
|
| 51 |
+
"book-IV-8304-3-1": {
|
| 52 |
+
"amount_cents": 191340,
|
| 53 |
+
"due": "2025-10-06",
|
| 54 |
+
"invoice": "IV-8304-3-1",
|
| 55 |
+
"po": "PO3",
|
| 56 |
+
"status": "posted",
|
| 57 |
+
"units": 20
|
| 58 |
+
},
|
| 59 |
+
"book-IV-9162-0-0": {
|
| 60 |
+
"amount_cents": 9684,
|
| 61 |
+
"due": "2025-09-16",
|
| 62 |
+
"invoice": "IV-9162-0-0",
|
| 63 |
+
"po": "PO0",
|
| 64 |
+
"status": "posted",
|
| 65 |
+
"units": 1
|
| 66 |
+
},
|
| 67 |
+
"booked-PO0": {
|
| 68 |
+
"po": "PO0",
|
| 69 |
+
"status": "posted",
|
| 70 |
+
"units": 2
|
| 71 |
+
},
|
| 72 |
+
"booked-PO1": {
|
| 73 |
+
"po": "PO1",
|
| 74 |
+
"status": "posted",
|
| 75 |
+
"units": 6
|
| 76 |
+
},
|
| 77 |
+
"booked-PO2": {
|
| 78 |
+
"po": "PO2",
|
| 79 |
+
"status": "posted",
|
| 80 |
+
"units": 4
|
| 81 |
+
},
|
| 82 |
+
"booked-PO3": {
|
| 83 |
+
"po": "PO3",
|
| 84 |
+
"status": "posted",
|
| 85 |
+
"units": 1
|
| 86 |
+
},
|
| 87 |
+
"booked-PO4": {
|
| 88 |
+
"po": "PO4",
|
| 89 |
+
"status": "posted",
|
| 90 |
+
"units": 7
|
| 91 |
+
},
|
| 92 |
+
"booked-PO5": {
|
| 93 |
+
"po": "PO5",
|
| 94 |
+
"status": "posted",
|
| 95 |
+
"units": 2
|
| 96 |
+
},
|
| 97 |
+
"booked-PO6": {
|
| 98 |
+
"po": "PO6",
|
| 99 |
+
"status": "posted",
|
| 100 |
+
"units": 4
|
| 101 |
+
}
|
| 102 |
+
},
|
| 103 |
+
"goods_receipts": {
|
| 104 |
+
"GI-0-0": {
|
| 105 |
+
"date": "2025-09-14",
|
| 106 |
+
"po": "PO0",
|
| 107 |
+
"state": "accepted",
|
| 108 |
+
"units": 26
|
| 109 |
+
},
|
| 110 |
+
"GI-0-1": {
|
| 111 |
+
"date": "2025-09-12",
|
| 112 |
+
"po": "PO0",
|
| 113 |
+
"state": "quarantine",
|
| 114 |
+
"units": 13
|
| 115 |
+
},
|
| 116 |
+
"GI-0-2": {
|
| 117 |
+
"date": "2025-09-09",
|
| 118 |
+
"po": "PO0",
|
| 119 |
+
"state": "accepted",
|
| 120 |
+
"units": 15
|
| 121 |
+
},
|
| 122 |
+
"GI-0-3": {
|
| 123 |
+
"date": "2025-09-10",
|
| 124 |
+
"po": "PO0",
|
| 125 |
+
"state": "accepted",
|
| 126 |
+
"units": 18
|
| 127 |
+
},
|
| 128 |
+
"GI-1-0": {
|
| 129 |
+
"date": "2025-09-14",
|
| 130 |
+
"po": "PO1",
|
| 131 |
+
"state": "accepted",
|
| 132 |
+
"units": 17
|
| 133 |
+
},
|
| 134 |
+
"GI-1-1": {
|
| 135 |
+
"date": "2025-09-07",
|
| 136 |
+
"po": "PO1",
|
| 137 |
+
"state": "accepted",
|
| 138 |
+
"units": 24
|
| 139 |
+
},
|
| 140 |
+
"GI-1-2": {
|
| 141 |
+
"date": "2025-09-08",
|
| 142 |
+
"po": "PO1",
|
| 143 |
+
"state": "accepted",
|
| 144 |
+
"units": 16
|
| 145 |
+
},
|
| 146 |
+
"GI-1-3": {
|
| 147 |
+
"date": "2025-09-02",
|
| 148 |
+
"po": "PO1",
|
| 149 |
+
"state": "accepted",
|
| 150 |
+
"units": 25
|
| 151 |
+
},
|
| 152 |
+
"GI-2-0": {
|
| 153 |
+
"date": "2025-09-14",
|
| 154 |
+
"po": "PO2",
|
| 155 |
+
"state": "accepted",
|
| 156 |
+
"units": 19
|
| 157 |
+
},
|
| 158 |
+
"GI-2-1": {
|
| 159 |
+
"date": "2025-09-09",
|
| 160 |
+
"po": "PO2",
|
| 161 |
+
"state": "accepted",
|
| 162 |
+
"units": 14
|
| 163 |
+
},
|
| 164 |
+
"GI-2-2": {
|
| 165 |
+
"date": "2025-08-22",
|
| 166 |
+
"po": "PO2",
|
| 167 |
+
"state": "accepted",
|
| 168 |
+
"units": 17
|
| 169 |
+
},
|
| 170 |
+
"GI-2-3": {
|
| 171 |
+
"date": "2025-09-16",
|
| 172 |
+
"po": "PO2",
|
| 173 |
+
"state": "quarantine",
|
| 174 |
+
"units": 25
|
| 175 |
+
},
|
| 176 |
+
"GI-3-0": {
|
| 177 |
+
"date": "2025-09-14",
|
| 178 |
+
"po": "PO3",
|
| 179 |
+
"state": "accepted",
|
| 180 |
+
"units": 28
|
| 181 |
+
},
|
| 182 |
+
"GI-3-1": {
|
| 183 |
+
"date": "2025-09-16",
|
| 184 |
+
"po": "PO3",
|
| 185 |
+
"state": "accepted",
|
| 186 |
+
"units": 20
|
| 187 |
+
},
|
| 188 |
+
"GI-3-2": {
|
| 189 |
+
"date": "2025-09-10",
|
| 190 |
+
"po": "PO3",
|
| 191 |
+
"state": "quarantine",
|
| 192 |
+
"units": 14
|
| 193 |
+
},
|
| 194 |
+
"GI-3-3": {
|
| 195 |
+
"date": "2025-09-08",
|
| 196 |
+
"po": "PO3",
|
| 197 |
+
"state": "quarantine",
|
| 198 |
+
"units": 12
|
| 199 |
+
},
|
| 200 |
+
"GI-4-0": {
|
| 201 |
+
"date": "2025-09-14",
|
| 202 |
+
"po": "PO4",
|
| 203 |
+
"state": "accepted",
|
| 204 |
+
"units": 22
|
| 205 |
+
},
|
| 206 |
+
"GI-4-1": {
|
| 207 |
+
"date": "2025-09-09",
|
| 208 |
+
"po": "PO4",
|
| 209 |
+
"state": "accepted",
|
| 210 |
+
"units": 13
|
| 211 |
+
},
|
| 212 |
+
"GI-4-2": {
|
| 213 |
+
"date": "2025-09-20",
|
| 214 |
+
"po": "PO4",
|
| 215 |
+
"state": "accepted",
|
| 216 |
+
"units": 22
|
| 217 |
+
},
|
| 218 |
+
"GI-4-3": {
|
| 219 |
+
"date": "2025-08-27",
|
| 220 |
+
"po": "PO4",
|
| 221 |
+
"state": "quarantine",
|
| 222 |
+
"units": 24
|
| 223 |
+
},
|
| 224 |
+
"GI-5-0": {
|
| 225 |
+
"date": "2025-09-14",
|
| 226 |
+
"po": "PO5",
|
| 227 |
+
"state": "accepted",
|
| 228 |
+
"units": 22
|
| 229 |
+
},
|
| 230 |
+
"GI-5-1": {
|
| 231 |
+
"date": "2025-09-10",
|
| 232 |
+
"po": "PO5",
|
| 233 |
+
"state": "quarantine",
|
| 234 |
+
"units": 15
|
| 235 |
+
},
|
| 236 |
+
"GI-5-2": {
|
| 237 |
+
"date": "2025-08-26",
|
| 238 |
+
"po": "PO5",
|
| 239 |
+
"state": "accepted",
|
| 240 |
+
"units": 27
|
| 241 |
+
},
|
| 242 |
+
"GI-5-3": {
|
| 243 |
+
"date": "2025-09-13",
|
| 244 |
+
"po": "PO5",
|
| 245 |
+
"state": "quarantine",
|
| 246 |
+
"units": 22
|
| 247 |
+
},
|
| 248 |
+
"GI-6-0": {
|
| 249 |
+
"date": "2025-09-14",
|
| 250 |
+
"po": "PO6",
|
| 251 |
+
"state": "accepted",
|
| 252 |
+
"units": 15
|
| 253 |
+
},
|
| 254 |
+
"GI-6-1": {
|
| 255 |
+
"date": "2025-09-05",
|
| 256 |
+
"po": "PO6",
|
| 257 |
+
"state": "accepted",
|
| 258 |
+
"units": 27
|
| 259 |
+
},
|
| 260 |
+
"GI-6-2": {
|
| 261 |
+
"date": "2025-09-04",
|
| 262 |
+
"po": "PO6",
|
| 263 |
+
"state": "accepted",
|
| 264 |
+
"units": 15
|
| 265 |
+
},
|
| 266 |
+
"GI-6-3": {
|
| 267 |
+
"date": "2025-08-22",
|
| 268 |
+
"po": "PO6",
|
| 269 |
+
"state": "quarantine",
|
| 270 |
+
"units": 26
|
| 271 |
+
}
|
| 272 |
+
},
|
| 273 |
+
"invoice_inbox": {
|
| 274 |
+
"IV-1121-4-0": {
|
| 275 |
+
"date": "2025-09-01",
|
| 276 |
+
"po": "PO4",
|
| 277 |
+
"state": "posted",
|
| 278 |
+
"unit_price_cents": 17924,
|
| 279 |
+
"units": 13,
|
| 280 |
+
"vendor": "V1"
|
| 281 |
+
},
|
| 282 |
+
"IV-1208-6-0": {
|
| 283 |
+
"date": "2025-09-01",
|
| 284 |
+
"po": "PO6",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 8042,
|
| 287 |
+
"units": 3,
|
| 288 |
+
"vendor": "V0"
|
| 289 |
+
},
|
| 290 |
+
"IV-1673-5-0": {
|
| 291 |
+
"date": "2025-09-01",
|
| 292 |
+
"po": "PO5",
|
| 293 |
+
"state": "posted",
|
| 294 |
+
"unit_price_cents": 1621,
|
| 295 |
+
"units": 22,
|
| 296 |
+
"vendor": "V2"
|
| 297 |
+
},
|
| 298 |
+
"IV-1942-2-3": {
|
| 299 |
+
"date": "2025-08-26",
|
| 300 |
+
"po": "PO2",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 10900,
|
| 303 |
+
"units": 25,
|
| 304 |
+
"vendor": "V2"
|
| 305 |
+
},
|
| 306 |
+
"IV-1960-5-1": {
|
| 307 |
+
"date": "2025-09-10",
|
| 308 |
+
"po": "PO5",
|
| 309 |
+
"state": "void",
|
| 310 |
+
"unit_price_cents": 1254,
|
| 311 |
+
"units": 22,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-2764-4-1": {
|
| 315 |
+
"date": "2025-09-06",
|
| 316 |
+
"po": "PO4",
|
| 317 |
+
"state": "disputed",
|
| 318 |
+
"unit_price_cents": 19899,
|
| 319 |
+
"units": 12,
|
| 320 |
+
"vendor": "Unknown"
|
| 321 |
+
},
|
| 322 |
+
"IV-2815-2-1": {
|
| 323 |
+
"date": "2025-08-27",
|
| 324 |
+
"po": "PO2",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 11257,
|
| 327 |
+
"units": 17,
|
| 328 |
+
"vendor": "Unknown"
|
| 329 |
+
},
|
| 330 |
+
"IV-3112-5-2": {
|
| 331 |
+
"date": "2025-08-28",
|
| 332 |
+
"po": "PO5",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 3159,
|
| 335 |
+
"units": 9,
|
| 336 |
+
"vendor": "V2"
|
| 337 |
+
},
|
| 338 |
+
"IV-3145-6-3": {
|
| 339 |
+
"date": "2025-08-30",
|
| 340 |
+
"po": "PO6",
|
| 341 |
+
"state": "void",
|
| 342 |
+
"unit_price_cents": 8002,
|
| 343 |
+
"units": 19,
|
| 344 |
+
"vendor": "V0"
|
| 345 |
+
},
|
| 346 |
+
"IV-3547-1-1": {
|
| 347 |
+
"date": "2025-09-05",
|
| 348 |
+
"po": "PO1",
|
| 349 |
+
"state": "posted",
|
| 350 |
+
"unit_price_cents": 12078,
|
| 351 |
+
"units": 17,
|
| 352 |
+
"vendor": "V0"
|
| 353 |
+
},
|
| 354 |
+
"IV-3914-6-2": {
|
| 355 |
+
"date": "2025-09-07",
|
| 356 |
+
"po": "PO6",
|
| 357 |
+
"state": "void",
|
| 358 |
+
"unit_price_cents": 8669,
|
| 359 |
+
"units": 12,
|
| 360 |
+
"vendor": "Unknown"
|
| 361 |
+
},
|
| 362 |
+
"IV-4018-5-3": {
|
| 363 |
+
"date": "2025-09-13",
|
| 364 |
+
"po": "PO5",
|
| 365 |
+
"state": "void",
|
| 366 |
+
"unit_price_cents": 2185,
|
| 367 |
+
"units": 18,
|
| 368 |
+
"vendor": "V2"
|
| 369 |
+
},
|
| 370 |
+
"IV-4805-2-0": {
|
| 371 |
+
"date": "2025-09-01",
|
| 372 |
+
"po": "PO2",
|
| 373 |
+
"state": "posted",
|
| 374 |
+
"unit_price_cents": 9571,
|
| 375 |
+
"units": 10,
|
| 376 |
+
"vendor": "V2"
|
| 377 |
+
},
|
| 378 |
+
"IV-5145-6-1": {
|
| 379 |
+
"date": "2025-09-02",
|
| 380 |
+
"po": "PO6",
|
| 381 |
+
"state": "review",
|
| 382 |
+
"unit_price_cents": 10087,
|
| 383 |
+
"units": 12,
|
| 384 |
+
"vendor": "V0"
|
| 385 |
+
},
|
| 386 |
+
"IV-5313-3-0": {
|
| 387 |
+
"date": "2025-09-01",
|
| 388 |
+
"po": "PO3",
|
| 389 |
+
"state": "posted",
|
| 390 |
+
"unit_price_cents": 9903,
|
| 391 |
+
"units": 4,
|
| 392 |
+
"vendor": "V4"
|
| 393 |
+
},
|
| 394 |
+
"IV-5395-0-1": {
|
| 395 |
+
"date": "2025-08-28",
|
| 396 |
+
"po": "PO0",
|
| 397 |
+
"state": "review",
|
| 398 |
+
"unit_price_cents": 11242,
|
| 399 |
+
"units": 18,
|
| 400 |
+
"vendor": "V1"
|
| 401 |
+
},
|
| 402 |
+
"IV-5915-0-2": {
|
| 403 |
+
"date": "2025-08-29",
|
| 404 |
+
"po": "PO0",
|
| 405 |
+
"state": "void",
|
| 406 |
+
"unit_price_cents": 10505,
|
| 407 |
+
"units": 11,
|
| 408 |
+
"vendor": "V1"
|
| 409 |
+
},
|
| 410 |
+
"IV-6603-1-0": {
|
| 411 |
+
"date": "2025-09-01",
|
| 412 |
+
"po": "PO1",
|
| 413 |
+
"state": "posted",
|
| 414 |
+
"unit_price_cents": 12252,
|
| 415 |
+
"units": 5,
|
| 416 |
+
"vendor": "V0"
|
| 417 |
+
},
|
| 418 |
+
"IV-7380-2-2": {
|
| 419 |
+
"date": "2025-08-29",
|
| 420 |
+
"po": "PO2",
|
| 421 |
+
"state": "review",
|
| 422 |
+
"unit_price_cents": 9671,
|
| 423 |
+
"units": 6,
|
| 424 |
+
"vendor": "V2"
|
| 425 |
+
},
|
| 426 |
+
"IV-7506-1-2": {
|
| 427 |
+
"date": "2025-09-08",
|
| 428 |
+
"po": "PO1",
|
| 429 |
+
"state": "disputed",
|
| 430 |
+
"unit_price_cents": 13175,
|
| 431 |
+
"units": 14,
|
| 432 |
+
"vendor": "V0"
|
| 433 |
+
},
|
| 434 |
+
"IV-8304-3-1": {
|
| 435 |
+
"date": "2025-09-06",
|
| 436 |
+
"po": "PO3",
|
| 437 |
+
"state": "posted",
|
| 438 |
+
"unit_price_cents": 9567,
|
| 439 |
+
"units": 20,
|
| 440 |
+
"vendor": "V4"
|
| 441 |
+
},
|
| 442 |
+
"IV-9162-0-0": {
|
| 443 |
+
"date": "2025-09-01",
|
| 444 |
+
"po": "PO0",
|
| 445 |
+
"state": "posted",
|
| 446 |
+
"unit_price_cents": 9684,
|
| 447 |
+
"units": 1,
|
| 448 |
+
"vendor": "V1"
|
| 449 |
+
}
|
| 450 |
+
},
|
| 451 |
+
"purchase_orders": {
|
| 452 |
+
"PO0": {
|
| 453 |
+
"unit": "South",
|
| 454 |
+
"unit_price_cents": 9684,
|
| 455 |
+
"vendor": "V1"
|
| 456 |
+
},
|
| 457 |
+
"PO1": {
|
| 458 |
+
"unit": "South",
|
| 459 |
+
"unit_price_cents": 12252,
|
| 460 |
+
"vendor": "V0"
|
| 461 |
+
},
|
| 462 |
+
"PO2": {
|
| 463 |
+
"unit": "South",
|
| 464 |
+
"unit_price_cents": 9571,
|
| 465 |
+
"vendor": "V2"
|
| 466 |
+
},
|
| 467 |
+
"PO3": {
|
| 468 |
+
"unit": "South",
|
| 469 |
+
"unit_price_cents": 9903,
|
| 470 |
+
"vendor": "V4"
|
| 471 |
+
},
|
| 472 |
+
"PO4": {
|
| 473 |
+
"unit": "South",
|
| 474 |
+
"unit_price_cents": 17924,
|
| 475 |
+
"vendor": "V1"
|
| 476 |
+
},
|
| 477 |
+
"PO5": {
|
| 478 |
+
"unit": "South",
|
| 479 |
+
"unit_price_cents": 1621,
|
| 480 |
+
"vendor": "V2"
|
| 481 |
+
},
|
| 482 |
+
"PO6": {
|
| 483 |
+
"unit": "Other",
|
| 484 |
+
"unit_price_cents": 8042,
|
| 485 |
+
"vendor": "V0"
|
| 486 |
+
}
|
| 487 |
+
},
|
| 488 |
+
"supplier_cases": {
|
| 489 |
+
"PREEXISTING": {
|
| 490 |
+
"status": "investigating"
|
| 491 |
+
},
|
| 492 |
+
"case-IV-2764-4-1": {
|
| 493 |
+
"invoice": "IV-2764-4-1",
|
| 494 |
+
"issues": [
|
| 495 |
+
"vendor",
|
| 496 |
+
"price"
|
| 497 |
+
],
|
| 498 |
+
"po": "PO4"
|
| 499 |
+
},
|
| 500 |
+
"case-IV-7506-1-2": {
|
| 501 |
+
"invoice": "IV-7506-1-2",
|
| 502 |
+
"issues": [
|
| 503 |
+
"price"
|
| 504 |
+
],
|
| 505 |
+
"po": "PO1"
|
| 506 |
+
}
|
| 507 |
+
},
|
| 508 |
+
"vendors": {
|
| 509 |
+
"V0": {
|
| 510 |
+
"net_days": 45
|
| 511 |
+
},
|
| 512 |
+
"V1": {
|
| 513 |
+
"net_days": 15
|
| 514 |
+
},
|
| 515 |
+
"V2": {
|
| 516 |
+
"net_days": 15
|
| 517 |
+
},
|
| 518 |
+
"V3": {
|
| 519 |
+
"net_days": 30
|
| 520 |
+
},
|
| 521 |
+
"V4": {
|
| 522 |
+
"net_days": 30
|
| 523 |
+
}
|
| 524 |
+
}
|
| 525 |
+
}
|
tasks/autom-supplier-invoice-match-010/tests/test.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -eu
|
| 3 |
+
mkdir -p /logs/verifier /workspace/outputs
|
| 4 |
+
exec python3 -B -I /tests/grade.py
|
tasks/autom-supplier-invoice-match-010/tests/world.json
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 2
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 6
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 4
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 1
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 7
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 2
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 4
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-09-14",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 26
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-09-12",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "quarantine",
|
| 50 |
+
"units": 13
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-09-09",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "accepted",
|
| 56 |
+
"units": 15
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-09-10",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "accepted",
|
| 62 |
+
"units": 18
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-09-14",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 17
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-09-07",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "accepted",
|
| 74 |
+
"units": 24
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-09-08",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "accepted",
|
| 80 |
+
"units": 16
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-09-02",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "accepted",
|
| 86 |
+
"units": 25
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-09-14",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 19
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-09-09",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "accepted",
|
| 98 |
+
"units": 14
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-08-22",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "accepted",
|
| 104 |
+
"units": 17
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-09-16",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "quarantine",
|
| 110 |
+
"units": 25
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-09-14",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 28
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-09-16",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "accepted",
|
| 122 |
+
"units": 20
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-09-10",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "quarantine",
|
| 128 |
+
"units": 14
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-09-08",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "quarantine",
|
| 134 |
+
"units": 12
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-09-14",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 22
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-09-09",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "accepted",
|
| 146 |
+
"units": 13
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-09-20",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "accepted",
|
| 152 |
+
"units": 22
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-08-27",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "quarantine",
|
| 158 |
+
"units": 24
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-09-14",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 22
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-09-10",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "quarantine",
|
| 170 |
+
"units": 15
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-08-26",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "accepted",
|
| 176 |
+
"units": 27
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-09-13",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "quarantine",
|
| 182 |
+
"units": 22
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-09-14",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 15
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-09-05",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 27
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-09-04",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 15
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-08-22",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 26
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-1121-4-0": {
|
| 211 |
+
"date": "2025-09-01",
|
| 212 |
+
"po": "PO4",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 17924,
|
| 215 |
+
"units": 13,
|
| 216 |
+
"vendor": "V1"
|
| 217 |
+
},
|
| 218 |
+
"IV-1208-6-0": {
|
| 219 |
+
"date": "2025-09-01",
|
| 220 |
+
"po": "PO6",
|
| 221 |
+
"state": "review",
|
| 222 |
+
"unit_price_cents": 8042,
|
| 223 |
+
"units": 3,
|
| 224 |
+
"vendor": "V0"
|
| 225 |
+
},
|
| 226 |
+
"IV-1673-5-0": {
|
| 227 |
+
"date": "2025-09-01",
|
| 228 |
+
"po": "PO5",
|
| 229 |
+
"state": "review",
|
| 230 |
+
"unit_price_cents": 1621,
|
| 231 |
+
"units": 22,
|
| 232 |
+
"vendor": "V2"
|
| 233 |
+
},
|
| 234 |
+
"IV-1942-2-3": {
|
| 235 |
+
"date": "2025-08-26",
|
| 236 |
+
"po": "PO2",
|
| 237 |
+
"state": "review",
|
| 238 |
+
"unit_price_cents": 10900,
|
| 239 |
+
"units": 25,
|
| 240 |
+
"vendor": "V2"
|
| 241 |
+
},
|
| 242 |
+
"IV-1960-5-1": {
|
| 243 |
+
"date": "2025-09-10",
|
| 244 |
+
"po": "PO5",
|
| 245 |
+
"state": "void",
|
| 246 |
+
"unit_price_cents": 1254,
|
| 247 |
+
"units": 22,
|
| 248 |
+
"vendor": "V2"
|
| 249 |
+
},
|
| 250 |
+
"IV-2764-4-1": {
|
| 251 |
+
"date": "2025-09-06",
|
| 252 |
+
"po": "PO4",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 19899,
|
| 255 |
+
"units": 12,
|
| 256 |
+
"vendor": "Unknown"
|
| 257 |
+
},
|
| 258 |
+
"IV-2815-2-1": {
|
| 259 |
+
"date": "2025-08-27",
|
| 260 |
+
"po": "PO2",
|
| 261 |
+
"state": "review",
|
| 262 |
+
"unit_price_cents": 11257,
|
| 263 |
+
"units": 17,
|
| 264 |
+
"vendor": "Unknown"
|
| 265 |
+
},
|
| 266 |
+
"IV-3112-5-2": {
|
| 267 |
+
"date": "2025-08-28",
|
| 268 |
+
"po": "PO5",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 3159,
|
| 271 |
+
"units": 9,
|
| 272 |
+
"vendor": "V2"
|
| 273 |
+
},
|
| 274 |
+
"IV-3145-6-3": {
|
| 275 |
+
"date": "2025-08-30",
|
| 276 |
+
"po": "PO6",
|
| 277 |
+
"state": "void",
|
| 278 |
+
"unit_price_cents": 8002,
|
| 279 |
+
"units": 19,
|
| 280 |
+
"vendor": "V0"
|
| 281 |
+
},
|
| 282 |
+
"IV-3547-1-1": {
|
| 283 |
+
"date": "2025-09-05",
|
| 284 |
+
"po": "PO1",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 12078,
|
| 287 |
+
"units": 17,
|
| 288 |
+
"vendor": "V0"
|
| 289 |
+
},
|
| 290 |
+
"IV-3914-6-2": {
|
| 291 |
+
"date": "2025-09-07",
|
| 292 |
+
"po": "PO6",
|
| 293 |
+
"state": "void",
|
| 294 |
+
"unit_price_cents": 8669,
|
| 295 |
+
"units": 12,
|
| 296 |
+
"vendor": "Unknown"
|
| 297 |
+
},
|
| 298 |
+
"IV-4018-5-3": {
|
| 299 |
+
"date": "2025-09-13",
|
| 300 |
+
"po": "PO5",
|
| 301 |
+
"state": "void",
|
| 302 |
+
"unit_price_cents": 2185,
|
| 303 |
+
"units": 18,
|
| 304 |
+
"vendor": "V2"
|
| 305 |
+
},
|
| 306 |
+
"IV-4805-2-0": {
|
| 307 |
+
"date": "2025-09-01",
|
| 308 |
+
"po": "PO2",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 9571,
|
| 311 |
+
"units": 10,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-5145-6-1": {
|
| 315 |
+
"date": "2025-09-02",
|
| 316 |
+
"po": "PO6",
|
| 317 |
+
"state": "review",
|
| 318 |
+
"unit_price_cents": 10087,
|
| 319 |
+
"units": 12,
|
| 320 |
+
"vendor": "V0"
|
| 321 |
+
},
|
| 322 |
+
"IV-5313-3-0": {
|
| 323 |
+
"date": "2025-09-01",
|
| 324 |
+
"po": "PO3",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 9903,
|
| 327 |
+
"units": 4,
|
| 328 |
+
"vendor": "V4"
|
| 329 |
+
},
|
| 330 |
+
"IV-5395-0-1": {
|
| 331 |
+
"date": "2025-08-28",
|
| 332 |
+
"po": "PO0",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 11242,
|
| 335 |
+
"units": 18,
|
| 336 |
+
"vendor": "V1"
|
| 337 |
+
},
|
| 338 |
+
"IV-5915-0-2": {
|
| 339 |
+
"date": "2025-08-29",
|
| 340 |
+
"po": "PO0",
|
| 341 |
+
"state": "void",
|
| 342 |
+
"unit_price_cents": 10505,
|
| 343 |
+
"units": 11,
|
| 344 |
+
"vendor": "V1"
|
| 345 |
+
},
|
| 346 |
+
"IV-6603-1-0": {
|
| 347 |
+
"date": "2025-09-01",
|
| 348 |
+
"po": "PO1",
|
| 349 |
+
"state": "review",
|
| 350 |
+
"unit_price_cents": 12252,
|
| 351 |
+
"units": 5,
|
| 352 |
+
"vendor": "V0"
|
| 353 |
+
},
|
| 354 |
+
"IV-7380-2-2": {
|
| 355 |
+
"date": "2025-08-29",
|
| 356 |
+
"po": "PO2",
|
| 357 |
+
"state": "review",
|
| 358 |
+
"unit_price_cents": 9671,
|
| 359 |
+
"units": 6,
|
| 360 |
+
"vendor": "V2"
|
| 361 |
+
},
|
| 362 |
+
"IV-7506-1-2": {
|
| 363 |
+
"date": "2025-09-08",
|
| 364 |
+
"po": "PO1",
|
| 365 |
+
"state": "review",
|
| 366 |
+
"unit_price_cents": 13175,
|
| 367 |
+
"units": 14,
|
| 368 |
+
"vendor": "V0"
|
| 369 |
+
},
|
| 370 |
+
"IV-8304-3-1": {
|
| 371 |
+
"date": "2025-09-06",
|
| 372 |
+
"po": "PO3",
|
| 373 |
+
"state": "review",
|
| 374 |
+
"unit_price_cents": 9567,
|
| 375 |
+
"units": 20,
|
| 376 |
+
"vendor": "V4"
|
| 377 |
+
},
|
| 378 |
+
"IV-9162-0-0": {
|
| 379 |
+
"date": "2025-09-01",
|
| 380 |
+
"po": "PO0",
|
| 381 |
+
"state": "review",
|
| 382 |
+
"unit_price_cents": 9684,
|
| 383 |
+
"units": 1,
|
| 384 |
+
"vendor": "V1"
|
| 385 |
+
}
|
| 386 |
+
},
|
| 387 |
+
"purchase_orders": {
|
| 388 |
+
"PO0": {
|
| 389 |
+
"unit": "South",
|
| 390 |
+
"unit_price_cents": 9684,
|
| 391 |
+
"vendor": "V1"
|
| 392 |
+
},
|
| 393 |
+
"PO1": {
|
| 394 |
+
"unit": "South",
|
| 395 |
+
"unit_price_cents": 12252,
|
| 396 |
+
"vendor": "V0"
|
| 397 |
+
},
|
| 398 |
+
"PO2": {
|
| 399 |
+
"unit": "South",
|
| 400 |
+
"unit_price_cents": 9571,
|
| 401 |
+
"vendor": "V2"
|
| 402 |
+
},
|
| 403 |
+
"PO3": {
|
| 404 |
+
"unit": "South",
|
| 405 |
+
"unit_price_cents": 9903,
|
| 406 |
+
"vendor": "V4"
|
| 407 |
+
},
|
| 408 |
+
"PO4": {
|
| 409 |
+
"unit": "South",
|
| 410 |
+
"unit_price_cents": 17924,
|
| 411 |
+
"vendor": "V1"
|
| 412 |
+
},
|
| 413 |
+
"PO5": {
|
| 414 |
+
"unit": "South",
|
| 415 |
+
"unit_price_cents": 1621,
|
| 416 |
+
"vendor": "V2"
|
| 417 |
+
},
|
| 418 |
+
"PO6": {
|
| 419 |
+
"unit": "Other",
|
| 420 |
+
"unit_price_cents": 8042,
|
| 421 |
+
"vendor": "V0"
|
| 422 |
+
}
|
| 423 |
+
},
|
| 424 |
+
"supplier_cases": {
|
| 425 |
+
"PREEXISTING": {
|
| 426 |
+
"status": "investigating"
|
| 427 |
+
}
|
| 428 |
+
},
|
| 429 |
+
"vendors": {
|
| 430 |
+
"V0": {
|
| 431 |
+
"net_days": 45
|
| 432 |
+
},
|
| 433 |
+
"V1": {
|
| 434 |
+
"net_days": 15
|
| 435 |
+
},
|
| 436 |
+
"V2": {
|
| 437 |
+
"net_days": 15
|
| 438 |
+
},
|
| 439 |
+
"V3": {
|
| 440 |
+
"net_days": 30
|
| 441 |
+
},
|
| 442 |
+
"V4": {
|
| 443 |
+
"net_days": 30
|
| 444 |
+
}
|
| 445 |
+
}
|
| 446 |
+
}
|
tasks/autom-supplier-invoice-match-010/tests/world_check.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Replay submitted mutations from the private verifier's initial state."""
|
| 2 |
+
from types import ModuleType
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def check(spec, outputs, tests):
|
| 7 |
+
replay = ModuleType('workflow_replay')
|
| 8 |
+
exec(compile((tests/'replay.py').read_bytes(), 'replay.py', 'exec'), replay.__dict__)
|
| 9 |
+
world = json.loads((tests/'world.json').read_text())
|
| 10 |
+
target = json.loads((tests/'target.json').read_text())
|
| 11 |
+
# Only fields whose starting and expected values differ may be changed. Attempts
|
| 12 |
+
# to temporarily alter a protected field fail even when a later write restores it.
|
| 13 |
+
allowed = {
|
| 14 |
+
(app,key): {field for field,value in doc.items()
|
| 15 |
+
if field not in world[app].get(key,{}) or not replay.same(world[app][key][field],value)}
|
| 16 |
+
for app,records in target.items() for key,doc in records.items()
|
| 17 |
+
}
|
| 18 |
+
actions = replay.load_actions(outputs/'actions.jsonl')
|
| 19 |
+
for event in actions:
|
| 20 |
+
replay.apply(world,event)
|
| 21 |
+
touched = set(event['fields'])
|
| 22 |
+
if not touched <= allowed.get((event['app'],event['id']),set()):
|
| 23 |
+
return False,'protected field or record write'
|
| 24 |
+
if not replay.same(world,target):
|
| 25 |
+
return False,'required business outcomes incomplete'
|
| 26 |
+
return True,''
|
tasks/autom-supplier-invoice-match-010/validation/openenv.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"profile": "harbor-semantic-v1",
|
| 3 |
+
"reward_key": "reward",
|
| 4 |
+
"reward": {
|
| 5 |
+
"range": [
|
| 6 |
+
0,
|
| 7 |
+
1
|
| 8 |
+
],
|
| 9 |
+
"oracle_tolerance": 0,
|
| 10 |
+
"floor_margin": 0.1
|
| 11 |
+
},
|
| 12 |
+
"resources": {
|
| 13 |
+
"cpu": 1,
|
| 14 |
+
"memory_mb": 4096,
|
| 15 |
+
"disk_mb": 10240,
|
| 16 |
+
"episode_timeout_s": 1800
|
| 17 |
+
},
|
| 18 |
+
"types": {
|
| 19 |
+
"tags": [
|
| 20 |
+
"knowledge-work",
|
| 21 |
+
"cross-app-workflows",
|
| 22 |
+
"conditional-execution",
|
| 23 |
+
"protected-state",
|
| 24 |
+
"finance"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
"requires_credentials": false
|
| 28 |
+
}
|
tasks/autom-supplier-invoice-match-011/environment/inputs/apps.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline business-app client. Print usage with --help."""
|
| 2 |
+
import argparse
|
| 3 |
+
import copy
|
| 4 |
+
import fcntl
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def same(left, right):
|
| 11 |
+
return json.dumps(left, sort_keys=True, allow_nan=False) == json.dumps(right, sort_keys=True, allow_nan=False)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def apply(world, action):
|
| 15 |
+
if not isinstance(action, dict) or action.keys() != {'op', 'app', 'id', 'fields'}:
|
| 16 |
+
raise ValueError('expected op, app, id, fields')
|
| 17 |
+
op, app, key, fields = (action[k] for k in ('op', 'app', 'id', 'fields'))
|
| 18 |
+
if app not in world or not isinstance(key, str) or not key or not isinstance(fields, dict) or not fields:
|
| 19 |
+
raise ValueError('unknown app, invalid id or empty fields')
|
| 20 |
+
collection = world[app]
|
| 21 |
+
if op == 'update' and key in collection:
|
| 22 |
+
collection[key].update(copy.deepcopy(fields))
|
| 23 |
+
elif op == 'create' and key not in collection:
|
| 24 |
+
collection[key] = copy.deepcopy(fields)
|
| 25 |
+
else:
|
| 26 |
+
raise ValueError(f'invalid {op} for {app}/{key}')
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def load_actions(path):
|
| 30 |
+
if path.is_symlink() or (path.is_file() and path.stat().st_size > 2_000_000):
|
| 31 |
+
raise ValueError('invalid action log')
|
| 32 |
+
if not path.exists():
|
| 33 |
+
return []
|
| 34 |
+
return [json.loads(s) for s in path.read_text().splitlines() if s.strip()]
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 39 |
+
parser.add_argument('op', choices=('apps','list','get','update','create'))
|
| 40 |
+
parser.add_argument('app', nargs='?')
|
| 41 |
+
parser.add_argument('id', nargs='?')
|
| 42 |
+
parser.add_argument('fields', nargs='?', type=json.loads)
|
| 43 |
+
args = parser.parse_args()
|
| 44 |
+
world = json.loads(Path(__file__).with_name('world.json').read_text())
|
| 45 |
+
out = Path(os.environ.get('WORKFLOW_OUTPUT_DIR', '/workspace/outputs'))
|
| 46 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 47 |
+
log = out/'actions.jsonl'
|
| 48 |
+
with (out/'.actions.lock').open('a') as lock:
|
| 49 |
+
fcntl.flock(lock.fileno(), fcntl.LOCK_EX)
|
| 50 |
+
for event in load_actions(log):
|
| 51 |
+
apply(world,event)
|
| 52 |
+
if args.op=='apps':
|
| 53 |
+
value=sorted(world)
|
| 54 |
+
elif args.op=='list':
|
| 55 |
+
value=world[args.app]
|
| 56 |
+
elif args.op=='get':
|
| 57 |
+
value=world[args.app][args.id]
|
| 58 |
+
else:
|
| 59 |
+
event={'op':args.op, 'app':args.app, 'id':args.id, 'fields':args.fields}
|
| 60 |
+
apply(world,event)
|
| 61 |
+
with log.open('a') as handle:
|
| 62 |
+
handle.write(json.dumps(event,allow_nan=False)+'\n')
|
| 63 |
+
value=world[args.app][args.id]
|
| 64 |
+
print(json.dumps(value,sort_keys=True,allow_nan=False))
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
if __name__=='__main__':
|
| 68 |
+
main()
|
tasks/autom-supplier-invoice-match-011/environment/inputs/world.json
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"ap_postings": {
|
| 3 |
+
"booked-PO0": {
|
| 4 |
+
"po": "PO0",
|
| 5 |
+
"status": "posted",
|
| 6 |
+
"units": 4
|
| 7 |
+
},
|
| 8 |
+
"booked-PO1": {
|
| 9 |
+
"po": "PO1",
|
| 10 |
+
"status": "posted",
|
| 11 |
+
"units": 5
|
| 12 |
+
},
|
| 13 |
+
"booked-PO2": {
|
| 14 |
+
"po": "PO2",
|
| 15 |
+
"status": "posted",
|
| 16 |
+
"units": 8
|
| 17 |
+
},
|
| 18 |
+
"booked-PO3": {
|
| 19 |
+
"po": "PO3",
|
| 20 |
+
"status": "posted",
|
| 21 |
+
"units": 8
|
| 22 |
+
},
|
| 23 |
+
"booked-PO4": {
|
| 24 |
+
"po": "PO4",
|
| 25 |
+
"status": "posted",
|
| 26 |
+
"units": 7
|
| 27 |
+
},
|
| 28 |
+
"booked-PO5": {
|
| 29 |
+
"po": "PO5",
|
| 30 |
+
"status": "posted",
|
| 31 |
+
"units": 4
|
| 32 |
+
},
|
| 33 |
+
"booked-PO6": {
|
| 34 |
+
"po": "PO6",
|
| 35 |
+
"status": "posted",
|
| 36 |
+
"units": 1
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"goods_receipts": {
|
| 40 |
+
"GI-0-0": {
|
| 41 |
+
"date": "2025-10-07",
|
| 42 |
+
"po": "PO0",
|
| 43 |
+
"state": "accepted",
|
| 44 |
+
"units": 20
|
| 45 |
+
},
|
| 46 |
+
"GI-0-1": {
|
| 47 |
+
"date": "2025-09-19",
|
| 48 |
+
"po": "PO0",
|
| 49 |
+
"state": "accepted",
|
| 50 |
+
"units": 16
|
| 51 |
+
},
|
| 52 |
+
"GI-0-2": {
|
| 53 |
+
"date": "2025-09-17",
|
| 54 |
+
"po": "PO0",
|
| 55 |
+
"state": "accepted",
|
| 56 |
+
"units": 26
|
| 57 |
+
},
|
| 58 |
+
"GI-0-3": {
|
| 59 |
+
"date": "2025-09-16",
|
| 60 |
+
"po": "PO0",
|
| 61 |
+
"state": "quarantine",
|
| 62 |
+
"units": 13
|
| 63 |
+
},
|
| 64 |
+
"GI-1-0": {
|
| 65 |
+
"date": "2025-10-07",
|
| 66 |
+
"po": "PO1",
|
| 67 |
+
"state": "accepted",
|
| 68 |
+
"units": 14
|
| 69 |
+
},
|
| 70 |
+
"GI-1-1": {
|
| 71 |
+
"date": "2025-10-03",
|
| 72 |
+
"po": "PO1",
|
| 73 |
+
"state": "quarantine",
|
| 74 |
+
"units": 14
|
| 75 |
+
},
|
| 76 |
+
"GI-1-2": {
|
| 77 |
+
"date": "2025-09-30",
|
| 78 |
+
"po": "PO1",
|
| 79 |
+
"state": "quarantine",
|
| 80 |
+
"units": 17
|
| 81 |
+
},
|
| 82 |
+
"GI-1-3": {
|
| 83 |
+
"date": "2025-10-03",
|
| 84 |
+
"po": "PO1",
|
| 85 |
+
"state": "quarantine",
|
| 86 |
+
"units": 20
|
| 87 |
+
},
|
| 88 |
+
"GI-2-0": {
|
| 89 |
+
"date": "2025-10-07",
|
| 90 |
+
"po": "PO2",
|
| 91 |
+
"state": "accepted",
|
| 92 |
+
"units": 24
|
| 93 |
+
},
|
| 94 |
+
"GI-2-1": {
|
| 95 |
+
"date": "2025-09-27",
|
| 96 |
+
"po": "PO2",
|
| 97 |
+
"state": "quarantine",
|
| 98 |
+
"units": 21
|
| 99 |
+
},
|
| 100 |
+
"GI-2-2": {
|
| 101 |
+
"date": "2025-10-12",
|
| 102 |
+
"po": "PO2",
|
| 103 |
+
"state": "quarantine",
|
| 104 |
+
"units": 28
|
| 105 |
+
},
|
| 106 |
+
"GI-2-3": {
|
| 107 |
+
"date": "2025-09-22",
|
| 108 |
+
"po": "PO2",
|
| 109 |
+
"state": "accepted",
|
| 110 |
+
"units": 23
|
| 111 |
+
},
|
| 112 |
+
"GI-3-0": {
|
| 113 |
+
"date": "2025-10-07",
|
| 114 |
+
"po": "PO3",
|
| 115 |
+
"state": "accepted",
|
| 116 |
+
"units": 16
|
| 117 |
+
},
|
| 118 |
+
"GI-3-1": {
|
| 119 |
+
"date": "2025-10-05",
|
| 120 |
+
"po": "PO3",
|
| 121 |
+
"state": "quarantine",
|
| 122 |
+
"units": 21
|
| 123 |
+
},
|
| 124 |
+
"GI-3-2": {
|
| 125 |
+
"date": "2025-10-06",
|
| 126 |
+
"po": "PO3",
|
| 127 |
+
"state": "accepted",
|
| 128 |
+
"units": 19
|
| 129 |
+
},
|
| 130 |
+
"GI-3-3": {
|
| 131 |
+
"date": "2025-09-28",
|
| 132 |
+
"po": "PO3",
|
| 133 |
+
"state": "quarantine",
|
| 134 |
+
"units": 14
|
| 135 |
+
},
|
| 136 |
+
"GI-4-0": {
|
| 137 |
+
"date": "2025-10-07",
|
| 138 |
+
"po": "PO4",
|
| 139 |
+
"state": "accepted",
|
| 140 |
+
"units": 28
|
| 141 |
+
},
|
| 142 |
+
"GI-4-1": {
|
| 143 |
+
"date": "2025-09-23",
|
| 144 |
+
"po": "PO4",
|
| 145 |
+
"state": "accepted",
|
| 146 |
+
"units": 13
|
| 147 |
+
},
|
| 148 |
+
"GI-4-2": {
|
| 149 |
+
"date": "2025-10-06",
|
| 150 |
+
"po": "PO4",
|
| 151 |
+
"state": "quarantine",
|
| 152 |
+
"units": 23
|
| 153 |
+
},
|
| 154 |
+
"GI-4-3": {
|
| 155 |
+
"date": "2025-10-12",
|
| 156 |
+
"po": "PO4",
|
| 157 |
+
"state": "accepted",
|
| 158 |
+
"units": 13
|
| 159 |
+
},
|
| 160 |
+
"GI-5-0": {
|
| 161 |
+
"date": "2025-10-07",
|
| 162 |
+
"po": "PO5",
|
| 163 |
+
"state": "accepted",
|
| 164 |
+
"units": 22
|
| 165 |
+
},
|
| 166 |
+
"GI-5-1": {
|
| 167 |
+
"date": "2025-10-05",
|
| 168 |
+
"po": "PO5",
|
| 169 |
+
"state": "quarantine",
|
| 170 |
+
"units": 22
|
| 171 |
+
},
|
| 172 |
+
"GI-5-2": {
|
| 173 |
+
"date": "2025-09-23",
|
| 174 |
+
"po": "PO5",
|
| 175 |
+
"state": "accepted",
|
| 176 |
+
"units": 23
|
| 177 |
+
},
|
| 178 |
+
"GI-5-3": {
|
| 179 |
+
"date": "2025-10-10",
|
| 180 |
+
"po": "PO5",
|
| 181 |
+
"state": "quarantine",
|
| 182 |
+
"units": 17
|
| 183 |
+
},
|
| 184 |
+
"GI-6-0": {
|
| 185 |
+
"date": "2025-10-07",
|
| 186 |
+
"po": "PO6",
|
| 187 |
+
"state": "accepted",
|
| 188 |
+
"units": 14
|
| 189 |
+
},
|
| 190 |
+
"GI-6-1": {
|
| 191 |
+
"date": "2025-10-01",
|
| 192 |
+
"po": "PO6",
|
| 193 |
+
"state": "accepted",
|
| 194 |
+
"units": 13
|
| 195 |
+
},
|
| 196 |
+
"GI-6-2": {
|
| 197 |
+
"date": "2025-10-08",
|
| 198 |
+
"po": "PO6",
|
| 199 |
+
"state": "accepted",
|
| 200 |
+
"units": 12
|
| 201 |
+
},
|
| 202 |
+
"GI-6-3": {
|
| 203 |
+
"date": "2025-09-14",
|
| 204 |
+
"po": "PO6",
|
| 205 |
+
"state": "quarantine",
|
| 206 |
+
"units": 22
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
"invoice_inbox": {
|
| 210 |
+
"IV-1334-4-0": {
|
| 211 |
+
"date": "2025-09-24",
|
| 212 |
+
"po": "PO4",
|
| 213 |
+
"state": "review",
|
| 214 |
+
"unit_price_cents": 14638,
|
| 215 |
+
"units": 9,
|
| 216 |
+
"vendor": "V1"
|
| 217 |
+
},
|
| 218 |
+
"IV-2153-1-0": {
|
| 219 |
+
"date": "2025-09-24",
|
| 220 |
+
"po": "PO1",
|
| 221 |
+
"state": "review",
|
| 222 |
+
"unit_price_cents": 20655,
|
| 223 |
+
"units": 8,
|
| 224 |
+
"vendor": "V4"
|
| 225 |
+
},
|
| 226 |
+
"IV-2781-0-1": {
|
| 227 |
+
"date": "2025-10-05",
|
| 228 |
+
"po": "PO0",
|
| 229 |
+
"state": "void",
|
| 230 |
+
"unit_price_cents": 5848,
|
| 231 |
+
"units": 18,
|
| 232 |
+
"vendor": "V4"
|
| 233 |
+
},
|
| 234 |
+
"IV-2933-0-2": {
|
| 235 |
+
"date": "2025-09-25",
|
| 236 |
+
"po": "PO0",
|
| 237 |
+
"state": "review",
|
| 238 |
+
"unit_price_cents": 7430,
|
| 239 |
+
"units": 5,
|
| 240 |
+
"vendor": "V4"
|
| 241 |
+
},
|
| 242 |
+
"IV-3552-0-0": {
|
| 243 |
+
"date": "2025-09-24",
|
| 244 |
+
"po": "PO0",
|
| 245 |
+
"state": "review",
|
| 246 |
+
"unit_price_cents": 5813,
|
| 247 |
+
"units": 1,
|
| 248 |
+
"vendor": "V4"
|
| 249 |
+
},
|
| 250 |
+
"IV-3593-6-2": {
|
| 251 |
+
"date": "2025-09-18",
|
| 252 |
+
"po": "PO6",
|
| 253 |
+
"state": "review",
|
| 254 |
+
"unit_price_cents": 11607,
|
| 255 |
+
"units": 15,
|
| 256 |
+
"vendor": "V1"
|
| 257 |
+
},
|
| 258 |
+
"IV-3774-6-1": {
|
| 259 |
+
"date": "2025-10-01",
|
| 260 |
+
"po": "PO6",
|
| 261 |
+
"state": "review",
|
| 262 |
+
"unit_price_cents": 10525,
|
| 263 |
+
"units": 7,
|
| 264 |
+
"vendor": "V1"
|
| 265 |
+
},
|
| 266 |
+
"IV-4767-2-0": {
|
| 267 |
+
"date": "2025-09-24",
|
| 268 |
+
"po": "PO2",
|
| 269 |
+
"state": "review",
|
| 270 |
+
"unit_price_cents": 17886,
|
| 271 |
+
"units": 17,
|
| 272 |
+
"vendor": "V2"
|
| 273 |
+
},
|
| 274 |
+
"IV-5330-5-1": {
|
| 275 |
+
"date": "2025-09-27",
|
| 276 |
+
"po": "PO5",
|
| 277 |
+
"state": "review",
|
| 278 |
+
"unit_price_cents": 22682,
|
| 279 |
+
"units": 4,
|
| 280 |
+
"vendor": "V2"
|
| 281 |
+
},
|
| 282 |
+
"IV-5377-4-1": {
|
| 283 |
+
"date": "2025-10-04",
|
| 284 |
+
"po": "PO4",
|
| 285 |
+
"state": "review",
|
| 286 |
+
"unit_price_cents": 16044,
|
| 287 |
+
"units": 12,
|
| 288 |
+
"vendor": "Unknown"
|
| 289 |
+
},
|
| 290 |
+
"IV-5439-3-1": {
|
| 291 |
+
"date": "2025-10-09",
|
| 292 |
+
"po": "PO3",
|
| 293 |
+
"state": "review",
|
| 294 |
+
"unit_price_cents": 23248,
|
| 295 |
+
"units": 19,
|
| 296 |
+
"vendor": "V3"
|
| 297 |
+
},
|
| 298 |
+
"IV-5831-3-0": {
|
| 299 |
+
"date": "2025-09-24",
|
| 300 |
+
"po": "PO3",
|
| 301 |
+
"state": "review",
|
| 302 |
+
"unit_price_cents": 22729,
|
| 303 |
+
"units": 21,
|
| 304 |
+
"vendor": "V3"
|
| 305 |
+
},
|
| 306 |
+
"IV-7311-5-0": {
|
| 307 |
+
"date": "2025-09-24",
|
| 308 |
+
"po": "PO5",
|
| 309 |
+
"state": "review",
|
| 310 |
+
"unit_price_cents": 22413,
|
| 311 |
+
"units": 10,
|
| 312 |
+
"vendor": "V2"
|
| 313 |
+
},
|
| 314 |
+
"IV-7466-2-1": {
|
| 315 |
+
"date": "2025-09-28",
|
| 316 |
+
"po": "PO2",
|
| 317 |
+
"state": "void",
|
| 318 |
+
"unit_price_cents": 17667,
|
| 319 |
+
"units": 9,
|
| 320 |
+
"vendor": "V2"
|
| 321 |
+
},
|
| 322 |
+
"IV-7884-1-1": {
|
| 323 |
+
"date": "2025-09-18",
|
| 324 |
+
"po": "PO1",
|
| 325 |
+
"state": "review",
|
| 326 |
+
"unit_price_cents": 21929,
|
| 327 |
+
"units": 6,
|
| 328 |
+
"vendor": "V4"
|
| 329 |
+
},
|
| 330 |
+
"IV-8927-6-0": {
|
| 331 |
+
"date": "2025-09-24",
|
| 332 |
+
"po": "PO6",
|
| 333 |
+
"state": "review",
|
| 334 |
+
"unit_price_cents": 10535,
|
| 335 |
+
"units": 7,
|
| 336 |
+
"vendor": "V1"
|
| 337 |
+
}
|
| 338 |
+
},
|
| 339 |
+
"purchase_orders": {
|
| 340 |
+
"PO0": {
|
| 341 |
+
"unit": "West",
|
| 342 |
+
"unit_price_cents": 5813,
|
| 343 |
+
"vendor": "V4"
|
| 344 |
+
},
|
| 345 |
+
"PO1": {
|
| 346 |
+
"unit": "West",
|
| 347 |
+
"unit_price_cents": 20655,
|
| 348 |
+
"vendor": "V4"
|
| 349 |
+
},
|
| 350 |
+
"PO2": {
|
| 351 |
+
"unit": "West",
|
| 352 |
+
"unit_price_cents": 17886,
|
| 353 |
+
"vendor": "V2"
|
| 354 |
+
},
|
| 355 |
+
"PO3": {
|
| 356 |
+
"unit": "West",
|
| 357 |
+
"unit_price_cents": 22729,
|
| 358 |
+
"vendor": "V3"
|
| 359 |
+
},
|
| 360 |
+
"PO4": {
|
| 361 |
+
"unit": "West",
|
| 362 |
+
"unit_price_cents": 14638,
|
| 363 |
+
"vendor": "V1"
|
| 364 |
+
},
|
| 365 |
+
"PO5": {
|
| 366 |
+
"unit": "West",
|
| 367 |
+
"unit_price_cents": 22413,
|
| 368 |
+
"vendor": "V2"
|
| 369 |
+
},
|
| 370 |
+
"PO6": {
|
| 371 |
+
"unit": "Other",
|
| 372 |
+
"unit_price_cents": 10535,
|
| 373 |
+
"vendor": "V1"
|
| 374 |
+
}
|
| 375 |
+
},
|
| 376 |
+
"supplier_cases": {
|
| 377 |
+
"PREEXISTING": {
|
| 378 |
+
"status": "investigating"
|
| 379 |
+
}
|
| 380 |
+
},
|
| 381 |
+
"vendors": {
|
| 382 |
+
"V0": {
|
| 383 |
+
"net_days": 15
|
| 384 |
+
},
|
| 385 |
+
"V1": {
|
| 386 |
+
"net_days": 15
|
| 387 |
+
},
|
| 388 |
+
"V2": {
|
| 389 |
+
"net_days": 30
|
| 390 |
+
},
|
| 391 |
+
"V3": {
|
| 392 |
+
"net_days": 45
|
| 393 |
+
},
|
| 394 |
+
"V4": {
|
| 395 |
+
"net_days": 30
|
| 396 |
+
}
|
| 397 |
+
}
|
| 398 |
+
}
|
tasks/autom-supplier-invoice-match-011/instruction.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Close the invoice matching queue for purchasing unit West at 2025-10-08. Handle invoices in review attached to that unit's purchase orders, invoice dates 2025-09-24 through 2025-10-08 inclusive. Process by invoice date ascending, then invoice ID ascending. Available units per PO equal units on accepted goods receipts dated on or before cutoff, minus previously posted units and any units successfully matched earlier in this run.
|
| 2 |
+
|
| 3 |
+
Match the invoice vendor exactly against the purchase order. A unit price above PO price is acceptable only up to 200 basis points above PO price (10,000 basis points = 100%; compare exactly, before rounding). Lower prices are acceptable. The invoice quantity must fit the available units in full. If any tests fail, update the invoice state to `disputed`, consume zero units, and create supplier_cases record `case-<invoice ID>` with `invoice`, `po` and the list `issues` containing every failing check in vendor, price, units order; use those lowercase strings.
|
| 4 |
+
|
| 5 |
+
For a match update invoice state to `posted` and create ap_postings record `book-<invoice ID>` with `invoice`, `po`, `units`, `status=posted`, integer `amount_cents` equal to invoiced quantity times invoiced unit price, and ISO date `due`. Count the vendor's net_days calendar days from the invoice date, then roll Saturday or Sunday forward to Monday. Preserve all other fields and records.
|
| 6 |
+
|
| 7 |
+
Use the offline app client at `/workspace/inputs/apps.py`. Call it with python3. Run
|
| 8 |
+
`apps` to discover apps, `list APP` to see its records, or `get APP ID` for one record.
|
| 9 |
+
Write with `update APP ID '{"field":"value"}'` or `create APP ID '{"field":"value"}'`.
|
| 10 |
+
The client records successful writes in `/workspace/outputs/actions.jsonl`.
|
| 11 |
+
Apply exactly the required changes. Other records and fields must remain untouched,
|
| 12 |
+
including temporary changes. Actions take effect in the local simulation only.
|
| 13 |
+
|
| 14 |
+
## Deliverable
|
| 15 |
+
|
| 16 |
+
Work in `/workspace`. Input files are under `/workspace/inputs/`. Put every deliverable in
|
| 17 |
+
`/workspace/outputs/`; only that directory is graded. Leave the app action log in the outputs directory.
|
tasks/autom-supplier-invoice-match-011/solution/files/actions.jsonl
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-3552-0-0", "op": "update"}
|
| 2 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-2933-0-2", "op": "update"}
|
| 3 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-2153-1-0", "op": "update"}
|
| 4 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-4767-2-0", "op": "update"}
|
| 5 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-5831-3-0", "op": "update"}
|
| 6 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-1334-4-0", "op": "update"}
|
| 7 |
+
{"app": "invoice_inbox", "fields": {"state": "disputed"}, "id": "IV-5377-4-1", "op": "update"}
|
| 8 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-7311-5-0", "op": "update"}
|
| 9 |
+
{"app": "invoice_inbox", "fields": {"state": "posted"}, "id": "IV-5330-5-1", "op": "update"}
|
| 10 |
+
{"app": "ap_postings", "fields": {"amount_cents": 131742, "due": "2025-10-09", "invoice": "IV-1334-4-0", "po": "PO4", "status": "posted", "units": 9}, "id": "book-IV-1334-4-0", "op": "create"}
|
| 11 |
+
{"app": "ap_postings", "fields": {"amount_cents": 165240, "due": "2025-10-24", "invoice": "IV-2153-1-0", "po": "PO1", "status": "posted", "units": 8}, "id": "book-IV-2153-1-0", "op": "create"}
|
| 12 |
+
{"app": "ap_postings", "fields": {"amount_cents": 5813, "due": "2025-10-24", "invoice": "IV-3552-0-0", "po": "PO0", "status": "posted", "units": 1}, "id": "book-IV-3552-0-0", "op": "create"}
|
| 13 |
+
{"app": "ap_postings", "fields": {"amount_cents": 304062, "due": "2025-10-24", "invoice": "IV-4767-2-0", "po": "PO2", "status": "posted", "units": 17}, "id": "book-IV-4767-2-0", "op": "create"}
|
| 14 |
+
{"app": "ap_postings", "fields": {"amount_cents": 477309, "due": "2025-11-10", "invoice": "IV-5831-3-0", "po": "PO3", "status": "posted", "units": 21}, "id": "book-IV-5831-3-0", "op": "create"}
|
| 15 |
+
{"app": "ap_postings", "fields": {"amount_cents": 224130, "due": "2025-10-24", "invoice": "IV-7311-5-0", "po": "PO5", "status": "posted", "units": 10}, "id": "book-IV-7311-5-0", "op": "create"}
|
| 16 |
+
{"app": "ap_postings", "fields": {"amount_cents": 90728, "due": "2025-10-27", "invoice": "IV-5330-5-1", "po": "PO5", "status": "posted", "units": 4}, "id": "book-IV-5330-5-1", "op": "create"}
|
| 17 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-2933-0-2", "issues": ["price"], "po": "PO0"}, "id": "case-IV-2933-0-2", "op": "create"}
|
| 18 |
+
{"app": "supplier_cases", "fields": {"invoice": "IV-5377-4-1", "issues": ["vendor", "price"], "po": "PO4"}, "id": "case-IV-5377-4-1", "op": "create"}
|