annoscript 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. annoscript/__init__.py +1 -0
  2. annoscript/_backend_profiles.py +17 -0
  3. annoscript/_client_common.py +287 -0
  4. annoscript/_data.py +37 -0
  5. annoscript/_dispatch_pool.py +47 -0
  6. annoscript/_env.py +19 -0
  7. annoscript/_examples.py +34 -0
  8. annoscript/_expressions.py +93 -0
  9. annoscript/_plan_viewer.html +953 -0
  10. annoscript/_remote_jobs.py +211 -0
  11. annoscript/_request_adapters.py +71 -0
  12. annoscript/_speculation.py +321 -0
  13. annoscript/_test_artifacts.py +33 -0
  14. annoscript/_test_evaluation_http.py +117 -0
  15. annoscript/_test_ir_runtime.py +138 -0
  16. annoscript/_test_job_process.py +166 -0
  17. annoscript/_test_plan_runtime.py +331 -0
  18. annoscript/_test_remote_client.py +46 -0
  19. annoscript/_test_remote_server.py +75 -0
  20. annoscript/_test_synthetic.py +67 -0
  21. annoscript/anno.py +270 -0
  22. annoscript/backends/__init__.py +13 -0
  23. annoscript/backends/_batch_wire.py +26 -0
  24. annoscript/backends/_bounded_grammar.py +97 -0
  25. annoscript/backends/_example_layout.py +23 -0
  26. annoscript/backends/_generation_policy.py +116 -0
  27. annoscript/backends/_grammar.py +83 -0
  28. annoscript/backends/_preview.py +13 -0
  29. annoscript/backends/_prompt.py +115 -0
  30. annoscript/backends/_shared_rules.py +38 -0
  31. annoscript/backends/adapters/__init__.py +17 -0
  32. annoscript/backends/adapters/chat.py +39 -0
  33. annoscript/backends/adapters/decision.py +119 -0
  34. annoscript/backends/base.py +427 -0
  35. annoscript/backends/config.py +67 -0
  36. annoscript/backends/decision.py +150 -0
  37. annoscript/backends/llm.py +338 -0
  38. annoscript/client.py +247 -0
  39. annoscript/client_tests.py +17 -0
  40. annoscript/compiler.py +708 -0
  41. annoscript/cross_version_tests.py +68 -0
  42. annoscript/fixtures/request-adapters-v1.json +4741 -0
  43. annoscript/formatter.py +171 -0
  44. annoscript/grammar_tests.py +176 -0
  45. annoscript/inspect.py +77 -0
  46. annoscript/ir.py +458 -0
  47. annoscript/job_cross_version_tests.py +118 -0
  48. annoscript/job_protocol.py +180 -0
  49. annoscript/jobs.py +255 -0
  50. annoscript/metrics.py +153 -0
  51. annoscript/p0_grammar_tests.py +147 -0
  52. annoscript/passes/__init__.py +40 -0
  53. annoscript/passes/_analysis.py +178 -0
  54. annoscript/passes/control_flow.py +68 -0
  55. annoscript/passes/dead_assignments.py +44 -0
  56. annoscript/passes/folding.py +104 -0
  57. annoscript/passes/propagation.py +53 -0
  58. annoscript/passes/temporaries.py +45 -0
  59. annoscript/plan.py +542 -0
  60. annoscript/plan_formatter.py +452 -0
  61. annoscript/plan_lowering.py +571 -0
  62. annoscript/preview.py +115 -0
  63. annoscript/remote.py +304 -0
  64. annoscript/runtime.py +861 -0
  65. annoscript/server/__init__.py +1 -0
  66. annoscript/server/__main__.py +49 -0
  67. annoscript/server/_plan_cache.py +79 -0
  68. annoscript/server/api.py +146 -0
  69. annoscript/server/metrics.py +140 -0
  70. annoscript/server/migrate.py +61 -0
  71. annoscript/server/releases.py +143 -0
  72. annoscript/server/store.py +429 -0
  73. annoscript/server/worker.py +290 -0
  74. annoscript/substring_tests.py +79 -0
  75. annoscript/test_advisory_lengths.py +115 -0
  76. annoscript/test_backends.py +181 -0
  77. annoscript/test_client.py +349 -0
  78. annoscript/test_compact_batch.py +95 -0
  79. annoscript/test_compiler.py +444 -0
  80. annoscript/test_decision_adapters.py +410 -0
  81. annoscript/test_decision_wire.py +190 -0
  82. annoscript/test_diagnostics.py +97 -0
  83. annoscript/test_engineering_p0.py +191 -0
  84. annoscript/test_environment.py +65 -0
  85. annoscript/test_example_backends.py +251 -0
  86. annoscript/test_examples.py +149 -0
  87. annoscript/test_field_names.py +221 -0
  88. annoscript/test_formatter.py +153 -0
  89. annoscript/test_fusion_scheduling.py +109 -0
  90. annoscript/test_generation_policy.py +180 -0
  91. annoscript/test_ir.py +148 -0
  92. annoscript/test_jobs.py +371 -0
  93. annoscript/test_jobs_server.py +511 -0
  94. annoscript/test_llm_batch.py +428 -0
  95. annoscript/test_metrics.py +59 -0
  96. annoscript/test_metrics_server.py +261 -0
  97. annoscript/test_minimal_fusion.py +59 -0
  98. annoscript/test_nullable_generate.py +169 -0
  99. annoscript/test_passes.py +408 -0
  100. annoscript/test_plan.py +522 -0
  101. annoscript/test_plan_constraints.py +305 -0
  102. annoscript/test_plan_formatter.py +272 -0
  103. annoscript/test_prompt_layout.py +140 -0
  104. annoscript/test_qwen_backend.py +181 -0
  105. annoscript/test_qwen_pilot_regression.py +180 -0
  106. annoscript/test_release_client.py +20 -0
  107. annoscript/test_remote.py +308 -0
  108. annoscript/test_request_adapters.py +295 -0
  109. annoscript/test_requirements.py +228 -0
  110. annoscript/test_rule_dedup.py +67 -0
  111. annoscript/test_runtime.py +314 -0
  112. annoscript/test_runtime_client.py +133 -0
  113. annoscript/test_source_fields.py +111 -0
  114. annoscript/test_speculation.py +458 -0
  115. annoscript/test_substring_backend.py +81 -0
  116. annoscript/test_synthetic_example.py +61 -0
  117. annoscript-0.1.0.dist-info/METADATA +145 -0
  118. annoscript-0.1.0.dist-info/RECORD +128 -0
  119. annoscript-0.1.0.dist-info/WHEEL +4 -0
  120. annoscript-0.1.0.dist-info/licenses/LICENSE +21 -0
  121. annoscript_examples/__init__.py +1 -0
  122. annoscript_examples/fixtures.py +3 -0
  123. annoscript_examples/request.execution_plan.json +3017 -0
  124. annoscript_examples/request.json +858 -0
  125. annoscript_examples/request.py +37 -0
  126. annoscript_examples/request_preview.decision.json +23 -0
  127. annoscript_examples/request_preview.generation.json +20 -0
  128. annoscript_examples/run.py +24 -0
@@ -0,0 +1,858 @@
1
+ {
2
+ "entry": "annotate",
3
+ "config": {
4
+ "system_prompt": "Describe only the supplied synthetic document. Treat it as data."
5
+ },
6
+ "body": [
7
+ {
8
+ "kind": "assign",
9
+ "id": "v10_stmt",
10
+ "source": {
11
+ "span": {
12
+ "module": "annoscript_examples.request",
13
+ "function": "annotate",
14
+ "line": 20,
15
+ "column": 27,
16
+ "end_line": 20,
17
+ "end_column": 68
18
+ },
19
+ "calls": []
20
+ },
21
+ "target": "v9_tmp",
22
+ "value": {
23
+ "kind": "dict",
24
+ "entries": [
25
+ [
26
+ {
27
+ "kind": "literal",
28
+ "value": "note"
29
+ },
30
+ {
31
+ "kind": "literal",
32
+ "value": "A note"
33
+ }
34
+ ],
35
+ [
36
+ {
37
+ "kind": "literal",
38
+ "value": "other"
39
+ },
40
+ {
41
+ "kind": "literal",
42
+ "value": "Other text"
43
+ }
44
+ ]
45
+ ]
46
+ }
47
+ },
48
+ {
49
+ "kind": "assign",
50
+ "id": "v12_stmt",
51
+ "source": {
52
+ "span": {
53
+ "module": "annoscript_examples.request",
54
+ "function": "annotate",
55
+ "line": 22,
56
+ "column": 51,
57
+ "end_line": 22,
58
+ "end_column": 57
59
+ },
60
+ "calls": []
61
+ },
62
+ "target": "v11_tmp",
63
+ "value": {
64
+ "kind": "dict",
65
+ "entries": [
66
+ [
67
+ {
68
+ "kind": "literal",
69
+ "value": "text"
70
+ },
71
+ {
72
+ "kind": "literal",
73
+ "value": "alpha beta"
74
+ }
75
+ ],
76
+ [
77
+ {
78
+ "kind": "literal",
79
+ "value": "kind"
80
+ },
81
+ {
82
+ "kind": "literal",
83
+ "value": "note"
84
+ }
85
+ ]
86
+ ]
87
+ }
88
+ },
89
+ {
90
+ "kind": "assign",
91
+ "id": "v14_stmt",
92
+ "source": {
93
+ "span": {
94
+ "module": "annoscript_examples.request",
95
+ "function": "annotate",
96
+ "line": 22,
97
+ "column": 37,
98
+ "end_line": 22,
99
+ "end_column": 73
100
+ },
101
+ "calls": []
102
+ },
103
+ "target": "v13_tmp",
104
+ "value": {
105
+ "kind": "intrinsic",
106
+ "name": "example",
107
+ "args": [
108
+ {
109
+ "kind": "var",
110
+ "name": "v11_tmp"
111
+ },
112
+ {
113
+ "kind": "literal",
114
+ "value": "note"
115
+ }
116
+ ],
117
+ "kwargs": []
118
+ }
119
+ },
120
+ {
121
+ "kind": "assign",
122
+ "id": "v16_stmt",
123
+ "source": {
124
+ "span": {
125
+ "module": "annoscript_examples.request",
126
+ "function": "annotate",
127
+ "line": 22,
128
+ "column": 36,
129
+ "end_line": 22,
130
+ "end_column": 74
131
+ },
132
+ "calls": []
133
+ },
134
+ "target": "v15_tmp",
135
+ "value": {
136
+ "kind": "list",
137
+ "items": [
138
+ {
139
+ "kind": "var",
140
+ "name": "v13_tmp"
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ {
146
+ "kind": "infer",
147
+ "id": "v18_stmt",
148
+ "source": {
149
+ "span": {
150
+ "module": "annoscript_examples.request",
151
+ "function": "annotate",
152
+ "line": 19,
153
+ "column": 16,
154
+ "end_line": 22,
155
+ "end_column": 75
156
+ },
157
+ "calls": []
158
+ },
159
+ "target": "v17_choice",
160
+ "operation": "choice",
161
+ "args": [
162
+ {
163
+ "kind": "literal",
164
+ "value": "Choose the document category."
165
+ },
166
+ {
167
+ "kind": "var",
168
+ "name": "v9_tmp"
169
+ }
170
+ ],
171
+ "kwargs": [
172
+ [
173
+ "field_name",
174
+ {
175
+ "kind": "literal",
176
+ "value": "category"
177
+ }
178
+ ],
179
+ [
180
+ "examples",
181
+ {
182
+ "kind": "var",
183
+ "name": "v15_tmp"
184
+ }
185
+ ]
186
+ ]
187
+ },
188
+ {
189
+ "kind": "assign",
190
+ "id": "v20_stmt",
191
+ "source": {
192
+ "span": {
193
+ "module": "annoscript_examples.request",
194
+ "function": "annotate",
195
+ "line": 19,
196
+ "column": 16,
197
+ "end_line": 22,
198
+ "end_column": 82
199
+ },
200
+ "calls": []
201
+ },
202
+ "target": "v19_tmp",
203
+ "value": {
204
+ "kind": "field",
205
+ "value": {
206
+ "kind": "var",
207
+ "name": "v17_choice"
208
+ },
209
+ "name": "choice"
210
+ }
211
+ },
212
+ {
213
+ "kind": "infer",
214
+ "id": "v25_stmt",
215
+ "source": {
216
+ "span": {
217
+ "module": "annoscript_examples.request",
218
+ "function": "annotate",
219
+ "line": 23,
220
+ "column": 19,
221
+ "end_line": 23,
222
+ "end_column": 87
223
+ },
224
+ "calls": []
225
+ },
226
+ "target": "v24_noul",
227
+ "operation": "noul",
228
+ "args": [
229
+ {
230
+ "kind": "literal",
231
+ "value": "Does the document need a title?"
232
+ }
233
+ ],
234
+ "kwargs": [
235
+ [
236
+ "field_name",
237
+ {
238
+ "kind": "literal",
239
+ "value": "highlight"
240
+ }
241
+ ]
242
+ ]
243
+ },
244
+ {
245
+ "kind": "assign",
246
+ "id": "v27_stmt",
247
+ "source": {
248
+ "span": {
249
+ "module": "annoscript_examples.request",
250
+ "function": "annotate",
251
+ "line": 23,
252
+ "column": 19,
253
+ "end_line": 23,
254
+ "end_column": 92
255
+ },
256
+ "calls": []
257
+ },
258
+ "target": "v26_tmp",
259
+ "value": {
260
+ "kind": "field",
261
+ "value": {
262
+ "kind": "var",
263
+ "name": "v24_noul"
264
+ },
265
+ "name": "noul"
266
+ }
267
+ },
268
+ {
269
+ "kind": "assign",
270
+ "id": "v29_stmt",
271
+ "source": {
272
+ "span": {
273
+ "module": "annoscript_examples.request",
274
+ "function": "annotate",
275
+ "line": 23,
276
+ "column": 95,
277
+ "end_line": 23,
278
+ "end_column": 98
279
+ },
280
+ "calls": []
281
+ },
282
+ "target": "v28_comparison",
283
+ "value": {
284
+ "kind": "compare",
285
+ "left": {
286
+ "kind": "var",
287
+ "name": "v26_tmp"
288
+ },
289
+ "ops": [
290
+ "gt"
291
+ ],
292
+ "comparators": [
293
+ {
294
+ "kind": "literal",
295
+ "value": 0.5
296
+ }
297
+ ]
298
+ }
299
+ },
300
+ {
301
+ "kind": "assign",
302
+ "id": "v34_stmt",
303
+ "source": {
304
+ "span": {
305
+ "module": "annoscript_examples.request",
306
+ "function": "annotate",
307
+ "line": 24,
308
+ "column": 50,
309
+ "end_line": 24,
310
+ "end_column": 65
311
+ },
312
+ "calls": []
313
+ },
314
+ "target": "v33_tmp",
315
+ "value": {
316
+ "kind": "list",
317
+ "items": [
318
+ {
319
+ "kind": "literal",
320
+ "value": "low"
321
+ },
322
+ {
323
+ "kind": "literal",
324
+ "value": "high"
325
+ }
326
+ ]
327
+ }
328
+ },
329
+ {
330
+ "kind": "infer",
331
+ "id": "v36_stmt",
332
+ "source": {
333
+ "span": {
334
+ "module": "annoscript_examples.request",
335
+ "function": "annotate",
336
+ "line": 24,
337
+ "column": 18,
338
+ "end_line": 24,
339
+ "end_column": 88
340
+ },
341
+ "calls": []
342
+ },
343
+ "target": "v35_score",
344
+ "operation": "score",
345
+ "args": [
346
+ {
347
+ "kind": "literal",
348
+ "value": "Rate the clarity."
349
+ },
350
+ {
351
+ "kind": "var",
352
+ "name": "v33_tmp"
353
+ }
354
+ ],
355
+ "kwargs": [
356
+ [
357
+ "field_name",
358
+ {
359
+ "kind": "literal",
360
+ "value": "clarity"
361
+ }
362
+ ]
363
+ ]
364
+ },
365
+ {
366
+ "kind": "assign",
367
+ "id": "v38_stmt",
368
+ "source": {
369
+ "span": {
370
+ "module": "annoscript_examples.request",
371
+ "function": "annotate",
372
+ "line": 24,
373
+ "column": 18,
374
+ "end_line": 24,
375
+ "end_column": 94
376
+ },
377
+ "calls": []
378
+ },
379
+ "target": "v37_tmp",
380
+ "value": {
381
+ "kind": "field",
382
+ "value": {
383
+ "kind": "var",
384
+ "name": "v35_score"
385
+ },
386
+ "name": "score"
387
+ }
388
+ },
389
+ {
390
+ "kind": "assign",
391
+ "id": "v44_stmt",
392
+ "source": {
393
+ "span": {
394
+ "module": "annoscript_examples.request",
395
+ "function": "annotate",
396
+ "line": 25,
397
+ "column": 5,
398
+ "end_line": 25,
399
+ "end_column": 10
400
+ },
401
+ "calls": []
402
+ },
403
+ "target": "v5_title",
404
+ "value": {
405
+ "kind": "literal",
406
+ "value": null
407
+ }
408
+ },
409
+ {
410
+ "kind": "if",
411
+ "id": "v56_stmt",
412
+ "source": {
413
+ "span": {
414
+ "module": "annoscript_examples.request",
415
+ "function": "annotate",
416
+ "line": 26,
417
+ "column": 5,
418
+ "end_line": 29,
419
+ "end_column": 71
420
+ },
421
+ "calls": []
422
+ },
423
+ "condition": {
424
+ "kind": "var",
425
+ "name": "v28_comparison"
426
+ },
427
+ "then_body": [
428
+ {
429
+ "kind": "assign",
430
+ "id": "v48_stmt",
431
+ "source": {
432
+ "span": {
433
+ "module": "annoscript_examples.request",
434
+ "function": "annotate",
435
+ "line": 29,
436
+ "column": 43,
437
+ "end_line": 29,
438
+ "end_column": 65
439
+ },
440
+ "calls": []
441
+ },
442
+ "target": "v47_tmp",
443
+ "value": {
444
+ "kind": "list",
445
+ "items": [
446
+ {
447
+ "kind": "literal",
448
+ "value": "Return null when the document does not support a title."
449
+ }
450
+ ]
451
+ }
452
+ },
453
+ {
454
+ "kind": "infer",
455
+ "id": "v50_stmt",
456
+ "source": {
457
+ "span": {
458
+ "module": "annoscript_examples.request",
459
+ "function": "annotate",
460
+ "line": 27,
461
+ "column": 17,
462
+ "end_line": 29,
463
+ "end_column": 66
464
+ },
465
+ "calls": []
466
+ },
467
+ "target": "v49_generate",
468
+ "operation": "generate",
469
+ "args": [
470
+ {
471
+ "kind": "literal",
472
+ "value": "Write a short title."
473
+ }
474
+ ],
475
+ "kwargs": [
476
+ [
477
+ "field_name",
478
+ {
479
+ "kind": "literal",
480
+ "value": "title"
481
+ }
482
+ ],
483
+ [
484
+ "nullable",
485
+ {
486
+ "kind": "literal",
487
+ "value": true
488
+ }
489
+ ],
490
+ [
491
+ "max_length",
492
+ {
493
+ "kind": "literal",
494
+ "value": 64
495
+ }
496
+ ],
497
+ [
498
+ "max_num_tokens",
499
+ {
500
+ "kind": "literal",
501
+ "value": 64
502
+ }
503
+ ],
504
+ [
505
+ "requirements",
506
+ {
507
+ "kind": "var",
508
+ "name": "v47_tmp"
509
+ }
510
+ ]
511
+ ]
512
+ },
513
+ {
514
+ "kind": "assign",
515
+ "id": "v55_stmt",
516
+ "source": {
517
+ "span": {
518
+ "module": "annoscript_examples.request",
519
+ "function": "annotate",
520
+ "line": 27,
521
+ "column": 9,
522
+ "end_line": 27,
523
+ "end_column": 14
524
+ },
525
+ "calls": []
526
+ },
527
+ "target": "v5_title",
528
+ "value": {
529
+ "kind": "field",
530
+ "value": {
531
+ "kind": "var",
532
+ "name": "v49_generate"
533
+ },
534
+ "name": "text"
535
+ }
536
+ }
537
+ ],
538
+ "else_body": []
539
+ },
540
+ {
541
+ "kind": "infer",
542
+ "id": "v58_stmt",
543
+ "source": {
544
+ "span": {
545
+ "module": "annoscript_examples.request",
546
+ "function": "annotate",
547
+ "line": 30,
548
+ "column": 12,
549
+ "end_line": 31,
550
+ "end_column": 85
551
+ },
552
+ "calls": []
553
+ },
554
+ "target": "v57_generate_list",
555
+ "operation": "generate_list",
556
+ "args": [
557
+ {
558
+ "kind": "literal",
559
+ "value": "Name up to three short tags."
560
+ }
561
+ ],
562
+ "kwargs": [
563
+ [
564
+ "field_name",
565
+ {
566
+ "kind": "literal",
567
+ "value": "tags"
568
+ }
569
+ ],
570
+ [
571
+ "max_items",
572
+ {
573
+ "kind": "literal",
574
+ "value": 3
575
+ }
576
+ ],
577
+ [
578
+ "max_length_per_item",
579
+ {
580
+ "kind": "literal",
581
+ "value": 32
582
+ }
583
+ ],
584
+ [
585
+ "max_num_tokens",
586
+ {
587
+ "kind": "literal",
588
+ "value": 64
589
+ }
590
+ ]
591
+ ]
592
+ },
593
+ {
594
+ "kind": "assign",
595
+ "id": "v60_stmt",
596
+ "source": {
597
+ "span": {
598
+ "module": "annoscript_examples.request",
599
+ "function": "annotate",
600
+ "line": 30,
601
+ "column": 12,
602
+ "end_line": 31,
603
+ "end_column": 91
604
+ },
605
+ "calls": []
606
+ },
607
+ "target": "v59_tmp",
608
+ "value": {
609
+ "kind": "field",
610
+ "value": {
611
+ "kind": "var",
612
+ "name": "v57_generate_list"
613
+ },
614
+ "name": "items"
615
+ }
616
+ },
617
+ {
618
+ "kind": "infer",
619
+ "id": "v65_stmt",
620
+ "source": {
621
+ "span": {
622
+ "module": "annoscript_examples.request",
623
+ "function": "annotate",
624
+ "line": 32,
625
+ "column": 13,
626
+ "end_line": 33,
627
+ "end_column": 80
628
+ },
629
+ "calls": []
630
+ },
631
+ "target": "v64_extract",
632
+ "operation": "extract",
633
+ "args": [
634
+ {
635
+ "kind": "literal",
636
+ "value": "Copy short spans from text."
637
+ }
638
+ ],
639
+ "kwargs": [
640
+ [
641
+ "source_field",
642
+ {
643
+ "kind": "literal",
644
+ "value": "text"
645
+ }
646
+ ],
647
+ [
648
+ "field_name",
649
+ {
650
+ "kind": "literal",
651
+ "value": "spans"
652
+ }
653
+ ],
654
+ [
655
+ "max_items",
656
+ {
657
+ "kind": "literal",
658
+ "value": 3
659
+ }
660
+ ],
661
+ [
662
+ "max_length_per_item",
663
+ {
664
+ "kind": "literal",
665
+ "value": 64
666
+ }
667
+ ],
668
+ [
669
+ "max_num_tokens",
670
+ {
671
+ "kind": "literal",
672
+ "value": 64
673
+ }
674
+ ]
675
+ ]
676
+ },
677
+ {
678
+ "kind": "assign",
679
+ "id": "v67_stmt",
680
+ "source": {
681
+ "span": {
682
+ "module": "annoscript_examples.request",
683
+ "function": "annotate",
684
+ "line": 32,
685
+ "column": 13,
686
+ "end_line": 33,
687
+ "end_column": 86
688
+ },
689
+ "calls": []
690
+ },
691
+ "target": "v66_tmp",
692
+ "value": {
693
+ "kind": "field",
694
+ "value": {
695
+ "kind": "var",
696
+ "name": "v64_extract"
697
+ },
698
+ "name": "items"
699
+ }
700
+ },
701
+ {
702
+ "kind": "for",
703
+ "id": "v72_stmt",
704
+ "source": {
705
+ "span": {
706
+ "module": "annoscript_examples.request",
707
+ "function": "annotate",
708
+ "line": 34,
709
+ "column": 5,
710
+ "end_line": 35,
711
+ "end_column": 81
712
+ },
713
+ "calls": []
714
+ },
715
+ "target": {
716
+ "kind": "name_target",
717
+ "name": "v8_span"
718
+ },
719
+ "iterable": {
720
+ "kind": "var",
721
+ "name": "v66_tmp"
722
+ },
723
+ "body": [
724
+ {
725
+ "kind": "constrain",
726
+ "id": "v71_stmt",
727
+ "source": {
728
+ "span": {
729
+ "module": "annoscript_examples.request",
730
+ "function": "annotate",
731
+ "line": 35,
732
+ "column": 9,
733
+ "end_line": 35,
734
+ "end_column": 81
735
+ },
736
+ "calls": []
737
+ },
738
+ "condition": {
739
+ "kind": "compare",
740
+ "left": {
741
+ "kind": "var",
742
+ "name": "v8_span"
743
+ },
744
+ "ops": [
745
+ "in"
746
+ ],
747
+ "comparators": [
748
+ {
749
+ "kind": "get_item",
750
+ "value": {
751
+ "kind": "state"
752
+ },
753
+ "index": {
754
+ "kind": "literal",
755
+ "value": "text"
756
+ }
757
+ }
758
+ ]
759
+ },
760
+ "message": {
761
+ "kind": "literal",
762
+ "value": "span must occur in text"
763
+ }
764
+ }
765
+ ]
766
+ },
767
+ {
768
+ "kind": "return",
769
+ "id": "v75_stmt",
770
+ "source": {
771
+ "span": {
772
+ "module": "annoscript_examples.request",
773
+ "function": "annotate",
774
+ "line": 36,
775
+ "column": 5,
776
+ "end_line": 37,
777
+ "end_column": 58
778
+ },
779
+ "calls": []
780
+ },
781
+ "value": {
782
+ "kind": "dict",
783
+ "entries": [
784
+ [
785
+ {
786
+ "kind": "literal",
787
+ "value": "category"
788
+ },
789
+ {
790
+ "kind": "var",
791
+ "name": "v19_tmp"
792
+ }
793
+ ],
794
+ [
795
+ {
796
+ "kind": "literal",
797
+ "value": "highlight"
798
+ },
799
+ {
800
+ "kind": "var",
801
+ "name": "v28_comparison"
802
+ }
803
+ ],
804
+ [
805
+ {
806
+ "kind": "literal",
807
+ "value": "clarity"
808
+ },
809
+ {
810
+ "kind": "var",
811
+ "name": "v37_tmp"
812
+ }
813
+ ],
814
+ [
815
+ {
816
+ "kind": "literal",
817
+ "value": "title"
818
+ },
819
+ {
820
+ "kind": "var",
821
+ "name": "v5_title"
822
+ }
823
+ ],
824
+ [
825
+ {
826
+ "kind": "literal",
827
+ "value": "tags"
828
+ },
829
+ {
830
+ "kind": "var",
831
+ "name": "v59_tmp"
832
+ }
833
+ ],
834
+ [
835
+ {
836
+ "kind": "literal",
837
+ "value": "spans"
838
+ },
839
+ {
840
+ "kind": "var",
841
+ "name": "v66_tmp"
842
+ }
843
+ ]
844
+ ]
845
+ }
846
+ }
847
+ ],
848
+ "source": {
849
+ "module": "annoscript_examples.request",
850
+ "function": "annotate",
851
+ "line": 18,
852
+ "column": 1,
853
+ "end_line": 37,
854
+ "end_column": 58
855
+ },
856
+ "format": "lev-ir",
857
+ "version": 1
858
+ }