Repository navigation
Expand file tree
/
Copy pathsample_eval_set.json
More file actions
1717 lines (1717 loc) · 76.4 KB
/
Copy pathsample_eval_set.json
File metadata and controls
1717 lines (1717 loc) · 76.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"repositories": [
{
"id": "documenso",
"name": "Documenso",
"github_url": "https://github.com/documenso/documenso.git",
"cases": [
{
"id": "documenso-purpose",
"category": "architecture",
"question": "What is Documenso and what product problem is it trying to solve?",
"ground_truth": "Documenso is an open-source document signing platform and DocuSign alternative. It lets users create, send, and sign documents electronically while emphasizing self-hosting, trust, and the ability to inspect how the signing system works under the hood.",
"expected_sources": ["README.md", "MANIFEST.md", "ARCHITECTURE.md"],
"must_include_any": ["document signing", "self-host", "DocuSign", "open trust"]
},
{
"id": "documenso-api-v2-document-router",
"category": "api",
"question": "Where is the current document API implemented and how is it exposed?",
"ground_truth": "The current API V2 is implemented under packages/trpc/server, with document operations organized under a document router. It is exposed through API V2 routes with tRPC and OpenAPI support.",
"expected_sources": ["ARCHITECTURE.md", "packages/trpc/server", "packages/trpc/server/document-router", "apps/remix/server"],
"must_include_any": ["packages/trpc/server", "document-router", "API V2", "OpenAPI", "tRPC"]
},
{
"id": "documenso-signing-package",
"category": "specific-function",
"question": "What does the @documenso/signing package do, and where is it implemented?",
"ground_truth": "The @documenso/signing package owns PDF signing behavior. Its signPdf entry point selects a signing transport, applies timestamp authority settings when configured, and supports local P12 signing and Google Cloud KMS/HSM-backed signing through transport implementations.",
"expected_sources": ["ARCHITECTURE.md", "packages/signing/index.ts", "packages/signing/helpers", "packages/signing/transports", ".env.example"],
"must_include_any": ["PDF signing", "packages/signing", "transports", "local", "Google", "KMS"]
},
{
"id": "documenso-document-send-flow",
"category": "cross-file",
"question": "How does a document send operation flow across the Documenso codebase?",
"ground_truth": "A document send operation starts at an API or UI route, delegates core behavior to server-only document logic and related recipient or field logic, persists state through the data layer, and can trigger emails or jobs.",
"expected_sources": ["packages/trpc/server/document-router", "packages/lib/server-only/document", "packages/lib/server-only/recipient", "packages/prisma", "packages/email", "packages/lib/jobs"],
"must_include_any": ["document-router", "server-only/document", "recipient", "prisma", "email", "jobs"]
},
{
"id": "documenso-required-env",
"category": "config-setup",
"question": "Which environment variables are central to running a self-hosted Documenso instance?",
"ground_truth": "Self-hosting requires configuration for authentication, encryption, the public web URL, database connectivity, and SMTP/email delivery. The environment example and self-hosting documentation are the primary sources.",
"expected_sources": ["README.md", ".env.example", "apps/docs/content/docs/self-hosting/configuration/environment.mdx"],
"must_include_any": ["NEXTAUTH_SECRET", "NEXT_PUBLIC_WEBAPP_URL", "DATABASE_URL", "SMTP", "encryption"]
},
{
"id": "documenso-playwright-tests",
"category": "tests",
"question": "Where does Documenso keep end-to-end app tests?",
"ground_truth": "Documenso keeps end-to-end application tests in the @documenso/app-tests package under packages/app-tests, using Playwright for app-level coverage.",
"expected_sources": ["ARCHITECTURE.md", "packages/app-tests", "packages/app-tests/package.json"],
"must_include_any": ["app-tests", "E2E", "Playwright"]
},
{
"id": "documenso-webhook-security-errors",
"category": "error-handling",
"question": "Where should you look for webhook security or SSRF-related safeguards?",
"ground_truth": "Webhook security safeguards are implemented in packages/lib/server-only/webhooks, with related configuration such as SSRF bypass hosts documented in environment configuration.",
"expected_sources": [".env.example", "packages/lib/server-only/webhooks"],
"must_include_any": ["webhook", "SSRF", "bypass", "hosts"]
},
{
"id": "documenso-followup-signing-bridge",
"category": "conversation",
"turns": [
{"role": "user", "content": "How does Documenso seal or sign completed documents?"},
{"role": "assistant", "content": "Completed PDFs cross server-only document/job logic and the @documenso/signing package, whose signPdf entry point supports multiple signing transports."}
],
"question": "show me where that signing package plugs in",
"ground_truth": "The follow-up should connect the @documenso/signing package, especially its entry point, transports, and helpers, with the seal-document job that passes completed PDFs into signing and with relevant signing configuration.",
"expected_sources": ["packages/signing/index.ts", "packages/signing/transports", "packages/signing/helpers", "packages/lib/jobs/definitions/internal/seal-document.handler.ts", ".env.example"],
"must_include_any": ["packages/signing", "transports", "seal-document", "PDF", "signing"]
}
,
{
"id": "documenso-remix-server-entry",
"category": "architecture",
"question": "What role does the Remix server play in Documenso's application architecture?",
"ground_truth": "The Remix application is the main user-facing app. Its server mounts the Hono routes and connects the web application to the API and server-side behavior.",
"expected_sources": [
"ARCHITECTURE.md",
"apps/remix/server"
],
"must_include_any": [
"main application",
"Hono",
"apps/remix/server"
]
},
{
"id": "documenso-api-v1-location",
"category": "api",
"question": "Where does the legacy API V1 live, and what API framework does it use?",
"ground_truth": "The deprecated but maintained API V1 is under packages/api/v1 and uses ts-rest for contract-based REST endpoints.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/api/v1"
],
"must_include_any": [
"packages/api/v1",
"ts-rest",
"API V1"
]
},
{
"id": "documenso-prisma-data-layer",
"category": "implementation",
"question": "Which package owns Documenso's database schema and data access layer?",
"ground_truth": "The packages/prisma package owns the Prisma schema and database client, and the architecture also identifies Kysely in the data layer.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/prisma"
],
"must_include_any": [
"packages/prisma",
"Prisma",
"Kysely"
]
},
{
"id": "documenso-auth-package",
"category": "architecture",
"question": "Where is authentication functionality grouped, and which authentication approaches are listed?",
"ground_truth": "Authentication is grouped in packages/auth. The architecture describes OAuth through Arctic and WebAuthn/passkeys as supported approaches.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/auth"
],
"must_include_any": [
"packages/auth",
"OAuth",
"WebAuthn",
"Passkeys"
]
},
{
"id": "documenso-background-jobs",
"category": "implementation",
"question": "Where are background job definitions located in the Documenso monorepo?",
"ground_truth": "Background job code is grouped under packages/lib/jobs. The architecture lists Inngest and local execution among the job technologies.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/lib/jobs"
],
"must_include_any": [
"packages/lib/jobs",
"Inngest",
"jobs"
]
},
{
"id": "documenso-email-package",
"category": "implementation",
"question": "Which package owns email templates and mail delivery?",
"ground_truth": "Email templates and the mailer are grouped in packages/email; the architecture lists React Email and Nodemailer in this layer.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/email"
],
"must_include_any": [
"packages/email",
"React Email",
"Nodemailer"
]
},
{
"id": "documenso-storage-architecture",
"category": "architecture",
"question": "What storage approaches does Documenso list for documents and related assets?",
"ground_truth": "The architecture lists S3-compatible storage and database-backed storage as options in the storage layer.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/lib/server-only"
],
"must_include_any": [
"S3-compatible",
"database",
"storage"
]
},
{
"id": "documenso-document-router-layout",
"category": "implementation",
"question": "How are document operations organized inside the current tRPC server package?",
"ground_truth": "Document procedures are grouped under packages/trpc/server/document-router, with individual operation modules such as get-document and related type files.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/trpc/server/document-router"
],
"must_include_any": [
"document-router",
"get-document",
"packages/trpc/server"
]
},
{
"id": "documenso-envelope-api",
"category": "api",
"question": "Where are API V2 envelope operations organized, and what kind of workflow do they represent?",
"ground_truth": "API V2 envelope operations are organized in the tRPC server's envelope-router. The architecture describes envelopes as supporting multi-document workflows.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/trpc/server/envelope-router"
],
"must_include_any": [
"envelope-router",
"multi-document",
"API V2"
]
},
{
"id": "documenso-openapi-exposure",
"category": "api",
"question": "How does Documenso expose OpenAPI support for its current API?",
"ground_truth": "The current tRPC API V2 uses trpc-to-openapi support and is mounted under the API V2 route prefixes documented in the repository architecture.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/trpc/server",
"apps/remix/server"
],
"must_include_any": [
"trpc-to-openapi",
"API V2",
"OpenAPI"
]
},
{
"id": "documenso-server-only-boundary",
"category": "architecture",
"question": "How does the repository distinguish server-only business logic from client-side and shared code?",
"ground_truth": "The lib package is divided into server-only, client-only, and universal code, making the intended execution boundary explicit in the monorepo structure.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/lib/server-only",
"packages/lib/client-only",
"packages/lib/universal"
],
"must_include_any": [
"server-only",
"client-only",
"universal"
]
},
{
"id": "documenso-document-create-handoff",
"category": "cross-file",
"question": "At a high level, how does a document creation API operation reach document business logic?",
"ground_truth": "A document operation is exposed through a procedure in the tRPC document router, which delegates server-side behavior to the lib package's server-only document code. The exact operation module and helper determine the detailed handoffs.",
"expected_sources": [
"packages/trpc/server/document-router",
"packages/lib/server-only/document"
],
"must_include_any": [
"document-router",
"server-only/document",
"procedure"
]
},
{
"id": "documenso-recipient-business-logic",
"category": "implementation",
"question": "Where is server-side recipient business logic grouped?",
"ground_truth": "Recipient-related server business logic is grouped under packages/lib/server-only/recipient, separate from the API router layer.",
"expected_sources": [
"packages/lib/server-only/recipient",
"packages/trpc/server/document-router"
],
"must_include_any": [
"server-only/recipient",
"recipient",
"server-side"
]
},
{
"id": "documenso-signing-transports",
"category": "implementation",
"question": "What signing backends are represented by the signing package's transport layer?",
"ground_truth": "The signing package separates signing transports and supports local P12 signing and Google Cloud KMS/HSM-backed signing, as described in the architecture and package layout.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/signing/transports"
],
"must_include_any": [
"P12",
"Google Cloud KMS",
"transports"
]
},
{
"id": "documenso-signing-timestamp-authority",
"category": "specific-function",
"question": "What timestamp-authority behavior does the PDF signing entry point support?",
"ground_truth": "The signing entry point can apply timestamp-authority settings when configured as part of PDF signing; the behavior is implemented in the signing package and its helpers.",
"expected_sources": [
"packages/signing/index.ts",
"packages/signing/helpers"
],
"must_include_any": [
"timestamp",
"signPdf",
"signing"
]
},
{
"id": "documenso-seal-document-job",
"category": "cross-file",
"question": "Which background job connects completed-document sealing with the signing package?",
"ground_truth": "The internal seal-document job handler is the job-layer integration point for sealing completed documents and passing PDF signing work into the signing package.",
"expected_sources": [
"packages/lib/jobs/definitions/internal/seal-document.handler.ts",
"packages/signing"
],
"must_include_any": [
"seal-document",
"signing",
"PDF"
]
},
{
"id": "documenso-webhook-package",
"category": "security",
"question": "Where should an engineer inspect server-side webhook behavior and its request-safety checks?",
"ground_truth": "Webhook server-side behavior is grouped under packages/lib/server-only/webhooks. Related SSRF configuration is documented in the environment example and self-hosting configuration.",
"expected_sources": [
"packages/lib/server-only/webhooks",
".env.example"
],
"must_include_any": [
"webhooks",
"SSRF",
"server-only"
]
},
{
"id": "documenso-environment-database-email",
"category": "config-setup",
"question": "Which configuration areas should be set up for self-hosted database and email delivery?",
"ground_truth": "Self-hosting configuration includes database connectivity and SMTP/email delivery settings. The environment example and self-hosting environment documentation enumerate the concrete variables.",
"expected_sources": [
".env.example",
"apps/docs/content/docs/self-hosting/configuration/environment.mdx"
],
"must_include_any": [
"DATABASE_URL",
"SMTP",
"email"
]
},
{
"id": "documenso-monorepo-test-package",
"category": "tests",
"question": "Which package is intended for end-to-end application testing, and what runner does it use?",
"ground_truth": "The @documenso/app-tests package under packages/app-tests contains end-to-end app tests and uses Playwright.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/app-tests",
"packages/app-tests/package.json"
],
"must_include_any": [
"packages/app-tests",
"Playwright",
"E2E"
]
},
{
"id": "documenso-ui-component-library",
"category": "architecture",
"question": "Where are shared UI components maintained, and which component and styling tools are listed?",
"ground_truth": "Shared UI components are grouped in packages/ui. The architecture lists Shadcn, Radix, and Tailwind in this layer.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/ui"
],
"must_include_any": [
"packages/ui",
"Radix",
"Tailwind"
]
},
{
"id": "documenso-pdf-stack",
"category": "architecture",
"question": "Which PDF technologies are listed in Documenso's architecture?",
"ground_truth": "The architecture lists @libpdf/core and pdfjs-dist in the PDF technology stack.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/lib/server-only/pdf"
],
"must_include_any": [
"@libpdf/core",
"pdfjs-dist",
"PDF"
]
},
{
"id": "documenso-application-routes",
"category": "implementation",
"question": "Where are the main Remix application's authenticated and recipient-facing routes organized?",
"ground_truth": "The main Remix app organizes route modules under apps/remix/app/routes, including authenticated, unauthenticated, and recipient route groups.",
"expected_sources": [
"ARCHITECTURE.md",
"apps/remix/app/routes"
],
"must_include_any": [
"apps/remix/app/routes",
"authenticated",
"recipient"
]
},
{
"id": "documenso-hono-entrypoint",
"category": "implementation",
"question": "Which files are identified as the Remix server's Hono route-mounting and process entry points?",
"ground_truth": "The architecture identifies apps/remix/server/router.ts for Hono route mounting and apps/remix/server/main.js as the server entry point.",
"expected_sources": [
"ARCHITECTURE.md",
"apps/remix/server"
],
"must_include_any": [
"router.ts",
"main.js",
"Hono"
]
},
{
"id": "documenso-api-auth-modes",
"category": "security",
"question": "What authentication methods does the current API V2 document for API access?",
"ground_truth": "The API V2 architecture lists API token or session-cookie authentication for the current API.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/trpc/server"
],
"must_include_any": [
"API Token",
"Session Cookie",
"API V2"
]
},
{
"id": "documenso-api-v1-status",
"category": "api",
"question": "Is API V1 removed, or does the repository still maintain it?",
"ground_truth": "The architecture labels API V1 deprecated but maintained; its implementation remains under packages/api/v1.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/api/v1"
],
"must_include_any": [
"deprecated",
"maintained",
"packages/api/v1"
]
},
{
"id": "documenso-folder-router",
"category": "api",
"question": "Where are folder API operations organized in API V2?",
"ground_truth": "Folder operations are organized in the current tRPC API under packages/trpc/server/folder-router.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/trpc/server/folder-router"
],
"must_include_any": [
"folder-router",
"packages/trpc/server",
"API V2"
]
},
{
"id": "documenso-template-router",
"category": "api",
"question": "Where are template API operations grouped in the current API architecture?",
"ground_truth": "Template operations are grouped under the current tRPC server's template-router, as part of API V2.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/trpc/server/template-router"
],
"must_include_any": [
"template-router",
"API V2",
"tRPC"
]
},
{
"id": "documenso-public-analytics-api",
"category": "architecture",
"question": "Which application in the monorepo is identified as the public analytics API?",
"ground_truth": "The monorepo architecture identifies apps/openpage-api as the public analytics API application.",
"expected_sources": [
"ARCHITECTURE.md",
"apps/openpage-api"
],
"must_include_any": [
"openpage-api",
"analytics",
"public"
]
},
{
"id": "documenso-enterprise-package",
"category": "architecture",
"question": "Where are Enterprise Edition features grouped in the monorepo?",
"ground_truth": "Enterprise Edition features are grouped in the packages/ee package.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/ee"
],
"must_include_any": [
"packages/ee",
"Enterprise Edition"
]
},
{
"id": "documenso-job-and-email-handoff",
"category": "cross-file",
"question": "At an architectural level, how can background jobs and email delivery be located as separate concerns?",
"ground_truth": "Background job definitions are grouped under packages/lib/jobs, while email templates and mail delivery are grouped under packages/email. A particular workflow's handler establishes whether and how they call one another.",
"expected_sources": [
"ARCHITECTURE.md",
"packages/lib/jobs",
"packages/email"
],
"must_include_any": [
"packages/lib/jobs",
"packages/email",
"handler"
]
},
{
"id": "documenso-self-hosting-config-doc",
"category": "config-setup",
"question": "Where is the detailed self-hosted environment-variable reference documented?",
"ground_truth": "The self-hosting environment reference is in the documentation under apps/docs/content/docs/self-hosting/configuration/environment.mdx, alongside the repository's .env.example.",
"expected_sources": [
"apps/docs/content/docs/self-hosting/configuration/environment.mdx",
".env.example"
],
"must_include_any": [
"environment.mdx",
".env.example",
"self-hosting"
]
},
{
"id": "documenso-followup-api-route",
"category": "conversation",
"turns": [
{
"role": "user",
"content": "Where is Documenso's current API V2 implemented?"
},
{
"role": "assistant",
"content": "It is implemented with tRPC under packages/trpc/server and exposed by the Remix server."
}
],
"question": "where does the document-specific part live?",
"ground_truth": "The document-specific procedures live in packages/trpc/server/document-router, within the current tRPC API V2 implementation.",
"expected_sources": [
"packages/trpc/server/document-router",
"ARCHITECTURE.md"
],
"must_include_any": [
"document-router",
"tRPC",
"API V2"
]
}
]
},
{
"id": "fastapi",
"name": "FastAPI",
"github_url": "https://github.com/fastapi/fastapi.git",
"cases": [
{
"id": "fastapi-purpose",
"category": "architecture",
"question": "What is FastAPI and what is it built on top of?",
"ground_truth": "FastAPI is a Python web framework for building APIs. It builds on Starlette for web functionality and Pydantic for data validation and serialization, and it generates OpenAPI-based documentation.",
"expected_sources": ["README.md", "fastapi/applications.py", "pyproject.toml"],
"must_include_any": ["Starlette", "Pydantic", "OpenAPI"]
},
{
"id": "fastapi-app-class",
"category": "specific-function",
"question": "What does the FastAPI application class do and where is it defined?",
"ground_truth": "The central FastAPI class is defined in fastapi/applications.py and coordinates application routing, middleware, exception handling, dependency-related behavior, and OpenAPI generation.",
"expected_sources": ["fastapi/applications.py"],
"must_include_any": ["applications.py", "routing", "OpenAPI"]
},
{
"id": "fastapi-routing",
"category": "implementation",
"question": "Where is path operation routing implemented in FastAPI?",
"ground_truth": "Path operation routing is implemented in fastapi/routing.py, including APIRoute and APIRouter and request handling that integrates dependency resolution and response serialization.",
"expected_sources": ["fastapi/routing.py"],
"must_include_any": ["APIRoute", "APIRouter", "routing.py"]
},
{
"id": "fastapi-dependency-injection",
"category": "cross-file",
"question": "How does FastAPI resolve dependencies declared with Depends()?",
"ground_truth": "Depends-related parameter declarations are defined in FastAPI's parameter modules, while dependency tree construction and request-time resolution live under fastapi/dependencies and are integrated into routing.",
"expected_sources": ["fastapi/dependencies/utils.py", "fastapi/params.py", "fastapi/param_functions.py", "fastapi/routing.py"],
"must_include_any": ["Depends", "dependencies/utils.py", "dependency", "routing.py"]
},
{
"id": "fastapi-openapi-generation",
"category": "api",
"question": "How does FastAPI generate the OpenAPI schema and interactive docs?",
"ground_truth": "FastAPI generates its OpenAPI schema from routes and models using its OpenAPI utilities, while Swagger UI and ReDoc HTML are produced by helpers in the OpenAPI docs module.",
"expected_sources": ["fastapi/openapi/utils.py", "fastapi/openapi/docs.py"],
"must_include_any": ["OpenAPI", "Swagger", "ReDoc", "openapi/utils.py"]
},
{
"id": "fastapi-error-handling",
"category": "error-handling",
"question": "How does FastAPI turn validation failures and raised exceptions into HTTP responses?",
"ground_truth": "FastAPI defines framework exceptions such as HTTPException and RequestValidationError and provides default exception handlers that convert them into HTTP responses.",
"expected_sources": ["fastapi/exceptions.py", "fastapi/exception_handlers.py"],
"must_include_any": ["HTTPException", "RequestValidationError", "exception_handlers.py"]
},
{
"id": "fastapi-security",
"category": "specific-function",
"question": "How does FastAPI support authentication schemes like OAuth2 and HTTP Bearer tokens?",
"ground_truth": "FastAPI provides authentication helpers under fastapi/security, including OAuth2 and HTTP bearer classes. They integrate with dependency injection and contribute security information to OpenAPI generation.",
"expected_sources": ["fastapi/security", "fastapi/openapi/utils.py"],
"must_include_any": ["OAuth2", "HTTPBearer", "security", "dependency"]
},
{
"id": "fastapi-followup-encoder",
"category": "conversation",
"turns": [
{"role": "user", "content": "How does FastAPI encode response data before it goes back to the client?"},
{"role": "assistant", "content": "Response data can be converted with jsonable_encoder before serialization, taking declared response behavior into account."}
],
"question": "where is jsonable_encoder implemented and where is that behavior tested?",
"ground_truth": "jsonable_encoder is implemented in fastapi/encoders.py and converts supported Python and Pydantic values into JSON-compatible structures. Its behavior is exercised by the test suite.",
"expected_sources": ["fastapi/encoders.py", "tests"],
"must_include_any": ["jsonable_encoder", "encoders.py", "tests"]
}
,
{
"id": "fastapi-sync-async-dependencies",
"category": "implementation",
"question": "How does FastAPI run synchronous and asynchronous dependency callables?",
"ground_truth": "FastAPI inspects whether a dependency is async and runs it accordingly; synchronous callables are sent through the thread pool while async callables are awaited.",
"expected_sources": [
"fastapi/dependencies/utils.py",
"fastapi/concurrency.py"
],
"must_include_any": [
"thread pool",
"await",
"dependency"
]
},
{
"id": "fastapi-lifespan",
"category": "architecture",
"question": "How does FastAPI run setup and cleanup code around an application lifespan?",
"ground_truth": "A lifespan context manager passed to the FastAPI application runs setup before yield and cleanup after yield during shutdown.",
"expected_sources": [
"fastapi/applications.py",
"docs/en/docs/advanced/events.md"
],
"must_include_any": [
"lifespan",
"startup",
"shutdown"
]
},
{
"id": "fastapi-middleware-registration",
"category": "architecture",
"question": "Where does FastAPI expose middleware registration, and what does middleware wrap?",
"ground_truth": "FastAPI exposes middleware registration through its application API. Middleware wraps request and response processing; the middleware guide describes registration and ordering.",
"expected_sources": [
"fastapi/applications.py",
"docs/en/docs/advanced/middleware.md"
],
"must_include_any": [
"middleware",
"add_middleware",
"request"
]
},
{
"id": "fastapi-include-router",
"category": "cross-file",
"question": "How does an APIRouter become part of a FastAPI application?",
"ground_truth": "An APIRouter groups path operations; including it on the application adds its routes and combines router configuration with the application.",
"expected_sources": [
"fastapi/applications.py",
"fastapi/routing.py",
"docs/en/docs/tutorial/bigger-applications.md"
],
"must_include_any": [
"include_router",
"APIRouter",
"routes"
]
},
{
"id": "fastapi-apiroute-request-handler",
"category": "specific-function",
"question": "What work does APIRoute perform when handling a request?",
"ground_truth": "APIRoute builds a path-operation request handler that coordinates body parsing and validation, dependency solving, endpoint execution, and response serialization.",
"expected_sources": [
"fastapi/routing.py"
],
"must_include_any": [
"APIRoute",
"request handler",
"response"
]
},
{
"id": "fastapi-dependency-tree",
"category": "cross-file",
"question": "How does FastAPI turn Depends declarations into dependencies to solve for a request?",
"ground_truth": "Depends is represented by parameter metadata, dependency analysis builds a dependency graph, and request-time solving resolves its nodes before calling the path operation. Routing invokes dependency utilities.",
"expected_sources": [
"fastapi/params.py",
"fastapi/param_functions.py",
"fastapi/dependencies/utils.py",
"fastapi/routing.py"
],
"must_include_any": [
"Depends",
"dependency graph",
"solve_dependencies"
]
},
{
"id": "fastapi-yield-dependencies",
"category": "implementation",
"question": "How are dependencies that use yield cleaned up after a request?",
"ground_truth": "FastAPI supports yield dependencies by entering their context and scheduling post-yield cleanup in request handling. Dependency utilities contain the context-manager and exit-stack logic.",
"expected_sources": [
"fastapi/dependencies/utils.py",
"docs/en/docs/tutorial/dependencies/dependencies-with-yield.md"
],
"must_include_any": [
"yield",
"cleanup",
"dependencies/utils.py"
]
},
{
"id": "fastapi-dependency-overrides",
"category": "testing",
"question": "How can a test replace an application dependency without calling the original dependency?",
"ground_truth": "Tests can set app.dependency_overrides, mapping the original dependency callable to a replacement. FastAPI uses the replacement during dependency solving; the guide shows how to clear overrides.",
"expected_sources": [
"fastapi/dependencies/utils.py",
"docs/en/docs/advanced/testing-dependencies.md"
],
"must_include_any": [
"dependency_overrides",
"override",
"testing"
]
},
{
"id": "fastapi-response-model",
"category": "specific-function",
"question": "What does a response_model do to a path operation result?",
"ground_truth": "A response model declares the output shape. FastAPI validates and serializes the returned value against it and uses it in the generated schema.",
"expected_sources": [
"fastapi/routing.py",
"docs/en/docs/tutorial/response-model.md"
],
"must_include_any": [
"response model",
"validate",
"serialize"
]
},
{
"id": "fastapi-response-serialization",
"category": "cross-file",
"question": "Where does FastAPI handle response validation and JSON response serialization?",
"ground_truth": "Path-operation routing prepares and validates response data, then serializes it into the configured response. The routing module coordinates the response field and response class behavior.",
"expected_sources": [
"fastapi/routing.py",
"fastapi/encoders.py"
],
"must_include_any": [
"response",
"serialize",
"jsonable_encoder"
]
},
{
"id": "fastapi-jsonable-encoder-datatypes",
"category": "implementation",
"question": "What kinds of values is jsonable_encoder intended to convert?",
"ground_truth": "jsonable_encoder converts supported Python and Pydantic values into JSON-compatible data, handling models, collections, dates, and configured encoders.",
"expected_sources": [
"fastapi/encoders.py",
"docs/en/docs/tutorial/encoder.md"
],
"must_include_any": [
"jsonable_encoder",
"JSON-compatible",
"encoders.py"
]
},
{
"id": "fastapi-openapi-route-input",
"category": "cross-file",
"question": "How do registered routes and their metadata contribute to FastAPI OpenAPI generation?",
"ground_truth": "OpenAPI utilities inspect application routes and path-operation metadata, then assemble operations, parameters, request bodies, responses, and component schemas.",
"expected_sources": [
"fastapi/openapi/utils.py",
"fastapi/applications.py"
],
"must_include_any": [
"OpenAPI",
"routes",
"schema"
]
},
{
"id": "fastapi-docs-endpoints",
"category": "api",
"question": "Where are the Swagger UI and ReDoc HTML helpers implemented?",
"ground_truth": "FastAPI provides helpers for generating Swagger UI and ReDoc HTML in fastapi/openapi/docs.py; the application exposes interactive documentation endpoints using those helpers.",
"expected_sources": [
"fastapi/openapi/docs.py",
"fastapi/applications.py"
],
"must_include_any": [
"Swagger UI",
"ReDoc",
"openapi/docs.py"
]
},
{
"id": "fastapi-custom-openapi",
"category": "api",
"question": "How can an application customize or cache its generated OpenAPI schema?",
"ground_truth": "The FastAPI application exposes an openapi method and app.openapi_schema cache. Applications can override the method to customize schema generation while reusing the OpenAPI utilities.",
"expected_sources": [
"fastapi/applications.py",
"fastapi/openapi/utils.py",
"docs/en/docs/how-to/extending-openapi.md"
],
"must_include_any": [
"openapi_schema",
"openapi",
"customize"
]
},
{
"id": "fastapi-http-exception",
"category": "error-handling",
"question": "Where is HTTPException defined, and how does it request an HTTP error response?",
"ground_truth": "HTTPException is defined in FastAPI exceptions. Raising it from a path operation or dependency signals an HTTP error that exception handling converts into a response.",
"expected_sources": [
"fastapi/exceptions.py",
"fastapi/exception_handlers.py",
"docs/en/docs/tutorial/handling-errors.md"
],
"must_include_any": [
"HTTPException",
"status_code",
"exception"
]
},
{
"id": "fastapi-validation-error-response",
"category": "error-handling",
"question": "How does FastAPI turn request validation failures into an error response?",
"ground_truth": "FastAPI represents request validation failures with RequestValidationError and registers a default handler that returns a structured 422 response.",
"expected_sources": [
"fastapi/exceptions.py",
"fastapi/exception_handlers.py",
"fastapi/routing.py"
],
"must_include_any": [
"RequestValidationError",
"422",
"exception handler"
]
},
{
"id": "fastapi-custom-exception-handler",
"category": "error-handling",
"question": "How can an application register a handler for a custom exception?",
"ground_truth": "The application provides exception-handler registration, and FastAPI dispatches matching exceptions to the registered handler to produce a response.",
"expected_sources": [
"fastapi/applications.py",
"fastapi/exception_handlers.py",
"docs/en/docs/tutorial/handling-errors.md"
],
"must_include_any": [
"exception_handler",
"handler",
"exception"
]
},
{
"id": "fastapi-background-tasks",
"category": "implementation",
"question": "How are BackgroundTasks declared and run after a response is sent?",
"ground_truth": "A path operation or dependency can receive BackgroundTasks and add work to it. FastAPI carries the tasks into the response so Starlette can execute them after sending it.",
"expected_sources": [
"fastapi/background.py",
"fastapi/routing.py",
"docs/en/docs/tutorial/background-tasks.md"
],
"must_include_any": [
"BackgroundTasks",
"after",
"response"
]
},
{
"id": "fastapi-upload-file",
"category": "specific-function",
"question": "How does FastAPI represent an uploaded file parameter?",
"ground_truth": "FastAPI provides UploadFile for uploaded files, backed by Starlette, and parameter declarations use it to expose file metadata and content access.",
"expected_sources": [
"fastapi/datastructures.py",
"fastapi/param_functions.py",
"docs/en/docs/tutorial/request-files.md"
],
"must_include_any": [
"UploadFile",
"upload",
"multipart"
]
},
{
"id": "fastapi-form-file-parsing",
"category": "cross-file",
"question": "How does FastAPI distinguish form fields and uploaded files from JSON request bodies?",
"ground_truth": "FastAPI uses File and Form declarations for multipart/form-data inputs. Routing and dependency parsing read the form body and populate endpoint parameters.",
"expected_sources": [
"fastapi/params.py",
"fastapi/dependencies/utils.py",
"fastapi/routing.py",
"docs/en/docs/tutorial/request-forms-and-files.md"
],
"must_include_any": [
"File",
"Form",
"multipart"
]
},
{
"id": "fastapi-oauth2-password-bearer",
"category": "security",
"question": "Where is OAuth2PasswordBearer implemented and how does it obtain a bearer token?",
"ground_truth": "OAuth2PasswordBearer is a security dependency under fastapi/security. It reads the Authorization bearer token and contributes OAuth2 metadata to OpenAPI.",
"expected_sources": [
"fastapi/security/oauth2.py",
"fastapi/openapi/utils.py",
"docs/en/docs/tutorial/security/first-steps.md"
],
"must_include_any": [
"OAuth2PasswordBearer",
"Bearer",
"security"
]
},
{
"id": "fastapi-http-bearer",
"category": "security",
"question": "How does HTTPBearer parse an Authorization header and represent its result?",
"ground_truth": "HTTPBearer parses an Authorization header using the Bearer scheme and returns credentials containing the scheme and token.",
"expected_sources": [
"fastapi/security/http.py",
"fastapi/security/__init__.py"
],
"must_include_any": [
"HTTPBearer",
"HTTPAuthorizationCredentials",
"Bearer"
]
},
{
"id": "fastapi-security-scopes",
"category": "security",
"question": "How are OAuth2 scopes declared on a dependency and exposed in the API schema?",
"ground_truth": "FastAPI represents scopes through OAuth2 helpers and dependency declarations; OpenAPI generation collects required scopes and emits them in operation security requirements.",
"expected_sources": [
"fastapi/security/oauth2.py",
"fastapi/dependencies/utils.py",
"fastapi/openapi/utils.py"
],
"must_include_any": [
"SecurityScopes",