File size: 36,725 Bytes
53dbcc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Scenario declarations for Flatmate RL built via shared factory helpers."""

from __future__ import annotations

from .scenario_factory import (
    build_buyer_profile,
    build_ground_truth,
    build_post,
    build_seller_profile,
    build_visit_scenario,
)


POSTS = {
    "post_023": build_post(
        post_id="post_023",
        area="Andheri W",
        rent=19000,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=18,
        constraints=["employed_only", "no_loud_music_after_11pm"],
        calendar_slots=["Saturday 11am", "Sunday 5pm"],
        description="Two IT professionals seeking a calm 3rd flatmate. 2BHK in Andheri West, fully furnished.",
    ),
    "post_031": build_post(
        post_id="post_031",
        area="Jogeshwari",
        rent=18500,
        diet="non-veg ok",
        listing_type="1BHK share",
        commute_to_goregaon_mins=12,
        constraints=["employed_only", "ok_with_1bhk_share"],
        calendar_slots=["today 7pm", "tomorrow 7pm", "Saturday 4pm"],
        description="Single professional in Jogeshwari looking for a flatmate. Best commute to Goregaon among the available listings.",
    ),
    "post_019": build_post(
        post_id="post_019",
        area="Andheri W",
        rent=20000,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=22,
        constraints=["employed_only", "no_smoking"],
        calendar_slots=["Sunday 2pm", "Monday 8pm"],
        description="Spacious 2BHK in Andheri West. Looking for a working professional. Non-smokers only.",
    ),
    "post_007": build_post(
        post_id="post_007",
        area="Andheri E",
        rent=15000,
        diet="veg only",
        listing_type="room",
        commute_to_goregaon_mins=35,
        constraints=["veg_only", "employed_only"],
        calendar_slots=["Saturday 10am"],
        description="Room in Andheri East. Strictly vegetarian household.",
    ),
    "post_044": build_post(
        post_id="post_044",
        area="Andheri W",
        rent=24000,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=15,
        constraints=["employed_only"],
        calendar_slots=["Saturday 6pm"],
        description="Premium 2BHK in Andheri West. Can negotiate rent for the right flatmate, but usually above budget.",
    ),
    "post_052": build_post(
        post_id="post_052",
        area="Andheri W",
        rent=19800,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=20,
        constraints=["employed_only", "no_smoking"],
        calendar_slots=["Saturday 1pm", "Sunday 4pm"],
        description="Quiet 2BHK in Andheri West with two product teammates. Good fit for working professionals.",
    ),
    "post_061": build_post(
        post_id="post_061",
        area="Jogeshwari",
        rent=17600,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=16,
        constraints=["employed_only"],
        calendar_slots=["Friday 9pm", "Monday 7pm"],
        description="Affordable Jogeshwari 2BHK share with a relaxed working flatmate. Good commute and flexible move-in.",
    ),
    "post_073": build_post(
        post_id="post_073",
        area="Andheri W",
        rent=18800,
        diet="non-veg ok",
        listing_type="3BHK share",
        commute_to_goregaon_mins=24,
        constraints=["employed_only", "no_partying"],
        calendar_slots=["Saturday 9am", "Monday 6pm"],
        description="Large 3BHK in Andheri West with calm flatmates and a no-partying house rule.",
    ),
    "post_082": build_post(
        post_id="post_082",
        area="Jogeshwari",
        rent=19900,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=14,
        constraints=["employed_only"],
        calendar_slots=["Sunday 7pm", "Tuesday 7pm"],
        description="Well-connected Jogeshwari 2BHK close to stations and offices. Strong commute, but limited viewing slots.",
    ),
    "post_091": build_post(
        post_id="post_091",
        area="Andheri W",
        rent=18200,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=21,
        constraints=["employed_only", "cleanliness_important"],
        calendar_slots=["Tuesday 8pm", "Wednesday 8pm"],
        description="Clean, practical Andheri West flatshare with working flatmates and reasonable rent.",
    ),
    "post_104": build_post(
        post_id="post_104",
        area="Jogeshwari",
        rent=19300,
        diet="non-veg ok",
        listing_type="room",
        commute_to_goregaon_mins=13,
        constraints=["employed_only"],
        calendar_slots=["tomorrow 5pm", "Saturday 6pm"],
        description="Compact Jogeshwari room in a professional setup. Good commute, but limited viewing windows.",
    ),
    "post_117": build_post(
        post_id="post_117",
        area="Andheri W",
        rent=17900,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=26,
        constraints=["employed_only", "quiet_weeknights"],
        calendar_slots=["Sunday 1pm", "Monday 8pm"],
        description="Budget-friendly Andheri West 2BHK share with a quiet weekday setup.",
    ),
    "post_131": build_post(
        post_id="post_131",
        area="Andheri W",
        rent=19400,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=19,
        constraints=["employed_only"],
        calendar_slots=["Monday 8pm", "Tuesday 8pm"],
        description="Reliable Andheri West 2BHK share with working flatmates, but only weekday evening visit slots.",
    ),
    "post_132": build_post(
        post_id="post_132",
        area="Jogeshwari",
        rent=18800,
        diet="non-veg ok",
        listing_type="room",
        commute_to_goregaon_mins=17,
        constraints=["employed_only"],
        calendar_slots=["Wednesday 7pm", "Thursday 7pm"],
        description="Compact Jogeshwari room with practical flatmates and midweek-only visit options.",
    ),
    "post_142": build_post(
        post_id="post_142",
        area="Andheri W",
        rent=18500,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=17,
        constraints=["employed_only"],
        calendar_slots=["Saturday 11am", "Saturday 4pm", "Sunday 5pm"],
        pre_booked_slots=["Saturday 11am", "Saturday 4pm"],
        description="Spacious 2BHK in Andheri West with professional flatmates. Saturday slots are already taken by other prospective buyers.",
    ),
    # --- Scenario 1: Hidden-Budget Negotiation ---
    "post_155": build_post(
        post_id="post_155",
        area="Andheri W",
        rent=24000,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=16,
        constraints=["employed_only"],
        calendar_slots=["Saturday 11am", "Sunday 2pm"],
        description="Modern 2BHK in Andheri West near metro station. Flatmates open to rent negotiation for the right working professional.",
        negotiable=True,
    ),
    # --- Scenario 2: Slot Cancellation Waitlist ---
    "post_162": build_post(
        post_id="post_162",
        area="Jogeshwari",
        rent=18500,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=13,
        constraints=["employed_only"],
        calendar_slots=["Saturday 10am", "Sunday 3pm"],
        pre_booked_slots=["Saturday 10am", "Sunday 3pm"],
        description="Well-located Jogeshwari 2BHK share. High demand — slots fill up quickly. Worth joining the waitlist.",
    ),
    # --- Scenario 3: Multi-Visit Preference Evolution ---
    "post_067": build_post(
        post_id="post_067",
        area="Andheri W",
        rent=19500,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=17,
        constraints=["employed_only"],
        calendar_slots=["Saturday 3pm", "Sunday 11am"],
        description="Quiet 2BHK in Andheri West, close to a gym and metro. Ideal for working professionals seeking a peaceful environment.",
        amenities={"quiet": True, "gym_nearby": True},
    ),
    "post_n01": build_post(
        post_id="post_n01",
        area="Andheri W",
        rent=18500,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=20,
        constraints=["employed_only"],
        calendar_slots=["Saturday 2pm"],
        description="2BHK near Western Express Highway. Good connectivity but the area is noisy during peak hours.",
        amenities={"quiet": False, "gym_nearby": False},
    ),
    "post_n02": build_post(
        post_id="post_n02",
        area="Jogeshwari",
        rent=17500,
        diet="non-veg ok",
        listing_type="room",
        commute_to_goregaon_mins=15,
        constraints=["employed_only"],
        calendar_slots=["Sunday 1pm"],
        description="Budget room in Jogeshwari near a lively market. Affordable but area has significant street noise.",
        amenities={"quiet": False, "gym_nearby": False},
    ),
    "post_q01": build_post(
        post_id="post_q01",
        area="Andheri W",
        rent=19200,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=22,
        constraints=["employed_only", "no_loud_music_after_11pm"],
        calendar_slots=["Sunday 4pm"],
        description="Quiet residential 2BHK in Andheri West. Away from busy roads, great for those valuing peaceful evenings. No gym in the immediate area.",
        amenities={"quiet": True, "gym_nearby": False},
    ),
    "post_g01": build_post(
        post_id="post_g01",
        area="Andheri W",
        rent=18800,
        diet="non-veg ok",
        listing_type="2BHK share",
        commute_to_goregaon_mins=19,
        constraints=["employed_only"],
        calendar_slots=["Monday 7pm"],
        description="2BHK near a busy gym complex. Great gym access but the area around the complex is noisy.",
        amenities={"quiet": False, "gym_nearby": True},
    ),
    "post_i01": build_post(
        post_id="post_i01",
        area="Malad",
        rent=16000,
        diet="non-veg ok",
        listing_type="room",
        commute_to_goregaon_mins=30,
        constraints=["employed_only"],
        calendar_slots=["Saturday 5pm"],
        description="Budget room in Malad. Longer commute to Goregaon East but very affordable.",
        amenities={"quiet": False, "gym_nearby": False},
    ),
}


SCENARIOS = {
    "task_visit_single": build_visit_scenario(
        task_id="task_visit_single",
        label="Single Flatmate Visit",
        difficulty="medium",
        description="Find one suitable flatmate-share listing for a non-veg software professional working in Goregaon East, coordinate a visit time that works for both client and poster, and book the visit.",
        task_post_ids=["post_023", "post_031", "post_019", "post_007", "post_044"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["today after 6pm", "tomorrow after 6pm", "Saturday 11am-5pm"],
            initial_disclosure_fields=["budget", "areas", "occupation"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_023", "post_031"],
            acceptable_posts=["post_019"],
            dealbreaker_posts=["post_007", "post_044"],
            required_bookings=1,
            required_tool_calls=["store_user_details", "search_posts", "match_location_preference", "get_commute_time", "check_calendar_slots", "contact_poster", "book_viewing"],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition="Broker must ask the client for visit availability, call check_calendar_slots for poster availability, propose a time that works for both, and book only after both client and poster explicitly say confirm for that same time.",
            min_viable_turns=6,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": True,
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["today after 6pm", "tomorrow after 6pm", "Saturday 11am-5pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message="Hi, I'm looking for a flatmate-share near Goregaon East. My budget is up to Rs. 20,000 and I'm mainly considering Andheri West or Jogeshwari because I work as a software engineer at a startup.",
    ),
    "task_visit_single_hidden_flex": build_visit_scenario(
        task_id="task_visit_single_hidden_flex",
        label="Single Visit With Hidden Flex Slot",
        difficulty="medium",
        description="The client initially shares only one visit slot that does not match any listing calendar. The broker should still find a suitable flat, share the actual available visit slots, and let the client choose a different slot that the client can secretly make work.",
        task_post_ids=["post_023", "post_019", "post_052"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["Tuesday after 6pm"],
            hidden_additional_availability=["Saturday 1pm-5pm", "Sunday 4pm-6pm"],
            initial_disclosure_fields=["budget", "areas", "occupation", "visit_availability"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_023", "post_052"],
            acceptable_posts=["post_019"],
            dealbreaker_posts=[],
            required_bookings=1,
            required_tool_calls=["store_user_details", "search_posts", "match_location_preference", "get_commute_time", "check_calendar_slots", "contact_poster", "book_viewing"],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition="The broker should recognize that the client's initially disclosed Tuesday slot does not match listing calendars, share available Saturday or Sunday visit slots from suitable listings, and complete a booking after the client explicitly confirms one of those alternative slots.",
            min_viable_turns=6,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": True,
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["Tuesday after 6pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message="Hi, I'm looking for a flatmate-share around Andheri West or Jogeshwari. My budget is Rs. 20,000, I work in Goregaon East as a software engineer, and Tuesday after 6pm is the slot I can do right now.",
    ),
    "task_visit_multi": build_visit_scenario(
        task_id="task_visit_multi",
        label="Multiple Flatmate Visits",
        difficulty="hard",
        description="The client wants to compare multiple flatmate-share options. Start from a broad pool of relevant listings, shortlist the ones that fit the client's stated availability, ask the client which listings they want to pursue, then coordinate and book at least two non-overlapping visits with explicit client and poster consent.",
        task_post_ids=["post_023", "post_031", "post_019", "post_052", "post_061", "post_073", "post_082", "post_091", "post_104", "post_117", "post_007", "post_044"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["tomorrow after 6pm", "Saturday 11am-5pm", "Sunday 2pm-6pm"],
            initial_disclosure_fields=["budget", "areas", "occupation"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_023", "post_031", "post_019", "post_052"],
            acceptable_posts=["post_061", "post_073", "post_082", "post_091", "post_104", "post_117"],
            dealbreaker_posts=["post_007", "post_044"],
            required_bookings=2,
            required_tool_calls=["store_user_details", "search_posts", "match_location_preference", "get_commute_time", "check_calendar_slots", "contact_poster", "book_viewing"],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability", "listing_choices"],
            success_condition="Broker must gather visit availability, shortlist listings with matching available slots, ask the client which shortlisted listings they want, check each chosen poster's availability, and book at least two non-overlapping visits only after both the client and each post owner explicitly confirm the same proposed times.",
            min_viable_turns=8,
            schedule_feasible_posts=["post_023", "post_031", "post_019", "post_052"],
            max_schedule_feasible_visits=4,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": False,
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["tomorrow after 6pm", "Saturday 11am-5pm", "Sunday 2pm-6pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message="Hi, I want to line up visits for at least two good flatmate-share options before deciding. My budget is Rs. 20,000, I'm focused on Andheri West or Jogeshwari, and I work in Goregaon East as a software engineer.",
    ),
    "task_visit_single_seller_followup": build_visit_scenario(
        task_id="task_visit_single_seller_followup",
        label="Single Visit After Seller Follow-Up",
        difficulty="hard",
        description="The buyer shares real weekend availability, but none of the current listings fit those slots. That buyer conversation ends without a booking. A new seller then contacts the broker to create a fresh listing. The broker must gather the seller's details, store the seller data correctly, check if the new post matches the buyer's stored visit availability, and schedule a visit if the slots line up.",
        task_post_ids=["post_131", "post_132"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["Saturday 4pm", "Sunday 5pm"],
            initial_disclosure_fields=["budget", "areas", "occupation", "visit_availability"],
        ),
        seller_profile=build_seller_profile(
            area="Jogeshwari",
            rent=19500,
            dietary="non-veg ok",
            listing_type="2BHK share",
            occupation_requirement="working professionals only",
            calendar_slots=["Saturday 4pm", "Sunday 5pm"],
            description="2BHK share with one working professional, good commute to Goregaon East",
            commute_to_goregaon_mins=16,
            constraints=["employed_only"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_dynamic_followup_1"],
            acceptable_posts=[],
            dealbreaker_posts=[],
            required_bookings=1,
            required_tool_calls=["store_user_details", "search_posts", "close_buyer_conversation", "store_seller_details", "match_location_preference", "check_table_slot_matches", "confirm_seller_match", "offer_matched_listing_to_buyer", "schedule_table_visit"],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition="After the first buyer conversation ends without a booking, the broker must gather the seller's listing details, store the seller data correctly, confirm the new post matches the buyer's stored visit slots, and schedule a visit from the matched table data.",
            min_viable_turns=8,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": False,
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["Saturday 4pm", "Sunday 5pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
            "followup_seller_expected_answers": {
                "user_type": "seller",
                "user_sub_type": "flat",
                "area": "Jogeshwari",
                "rent": 19500,
                "dietary": "non-veg ok",
                "listing_type": "2BHK share",
                "occupation_requirement": "working professionals only",
                "calendar_slots": ["Saturday 4pm", "Sunday 5pm"],
                "commute_to_goregaon_mins": 16,
                "constraints": ["employed_only"],
                "negotiable": ["viewing_time"],
                "description": "2BHK share with one working professional, good commute to Goregaon East",
            },
        },
        initial_user_message="Hi, I'm looking for a flatmate-share in Andheri West or Jogeshwari. My budget is Rs. 20,000, I work in Goregaon East as a software engineer, and Saturday 4pm or Sunday 5pm are the only times I can visit.",
        seller_initial_message="Hi, I want help listing a new flatmate-share opening in Jogeshwari. The rent is around Rs. 19,500 for a 2BHK share. I can tell you more about the listing and available visit times.",
    ),
    "task_negotiation_hidden_budget": build_visit_scenario(
        task_id="task_negotiation_hidden_budget",
        label="Hidden Budget Negotiation",
        difficulty="hard",
        description=(
            "The buyer has already seen post_155 and likes it, but the listed rent of Rs. 24,000 is above their "
            "stated budget of Rs. 20,000. The buyer has a hidden ceiling of Rs. 22,000; the seller has a hidden "
            "floor of Rs. 21,000. The agent must probe both sides incrementally, find the overlapping range, "
            "and close the deal via confirm_negotiated_deal."
        ),
        task_post_ids=["post_155", "post_023", "post_031"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            hidden_budget_ceiling=22000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["Saturday 11am", "Sunday 2pm"],
            initial_disclosure_fields=["budget", "areas", "occupation"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_155"],
            acceptable_posts=[],
            dealbreaker_posts=[],
            required_bookings=1,
            required_tool_calls=[
                "store_user_details",
                "search_posts",
                "match_location_preference",
                "get_commute_time",
                "check_calendar_slots",
                "shortlist",
                "propose_price_to_buyer",
                "propose_price_to_seller",
                "confirm_negotiated_deal",
            ],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition=(
                "Buyer ceiling (Rs. 22,000) and seller floor (Rs. 21,000) overlap. Agent must probe buyer and "
                "seller with price proposals to discover the overlap, then call confirm_negotiated_deal with "
                "an agreed rent that both sides have accepted."
            ),
            min_viable_turns=8,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": False,
            "negotiation_config": {
                "listed_rent": 24000,
                "buyer_ceiling": 22000,
                "seller_floor": 21000,
                "negotiable_post_id": "post_155",
                "max_rounds": 4,
            },
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["Saturday 11am", "Sunday 2pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": True,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message=(
            "Hi, I'm looking for a flatmate-share in Andheri West or Jogeshwari. My usual budget is Rs. 20,000, "
            "but I've seen post_155 in Andheri West and I really like it. It's listed at Rs. 24,000 but I heard "
            "they might negotiate. I work as a software engineer at a startup in Goregaon East."
        ),
    ),
    "task_slot_cancellation_waitlist": build_visit_scenario(
        task_id="task_slot_cancellation_waitlist",
        label="Slot Cancellation Waitlist",
        difficulty="hard",
        description=(
            "The buyer likes post_162 in Jogeshwari but all calendar slots are pre-booked. The agent must "
            "acknowledge the situation, add the buyer to the waitlist, and then respond proactively when a "
            "prior booking is cancelled and Saturday 10am becomes available. The agent must notify the buyer "
            "and complete the booking through the normal confirmation flow."
        ),
        task_post_ids=["post_162", "post_061", "post_082"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["Saturday 10am", "Sunday 3pm"],
            initial_disclosure_fields=["budget", "areas", "occupation"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_162"],
            acceptable_posts=[],
            dealbreaker_posts=[],
            required_bookings=1,
            required_tool_calls=[
                "store_user_details",
                "search_posts",
                "match_location_preference",
                "get_commute_time",
                "check_calendar_slots",
                "add_to_waitlist",
                "notify_buyer_slot_freed",
                "contact_poster",
                "book_viewing",
            ],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition=(
                "All slots for post_162 are initially pre-booked. The agent must call add_to_waitlist, then "
                "respond to the cancellation event by calling notify_buyer_slot_freed for Saturday 10am, "
                "obtain poster confirmation via contact_poster, and complete the booking via book_viewing."
            ),
            min_viable_turns=8,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": False,
            "cancellation_event": {
                "freed_slot": "Saturday 10am",
                "post_id": "post_162",
            },
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["Saturday 10am", "Sunday 3pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message=(
            "Hi, I'm looking for a flatmate-share in Andheri West or Jogeshwari. "
            "My budget is up to Rs. 20,000 and I work as a software engineer at a startup in Goregaon East."
        ),
    ),
    "task_multi_visit_preference_evolution": build_visit_scenario(
        task_id="task_multi_visit_preference_evolution",
        label="Multi-Visit Preference Evolution",
        difficulty="hard",
        description=(
            "The buyer schedules three flat visits in a single day. After visit 1 (post_023) they discover the "
            "area is too noisy. After visit 2 (post_052) they discover there is no gym nearby. New listings "
            "arrive after each visit — some relevant, some not. The agent must debrief after each visit, update "
            "the buyer profile with discovered preferences, filter new arrivals, and re-search. The deal closes "
            "on visit 3 (post_067), which is quiet and has a nearby gym."
        ),
        task_post_ids=[
            "post_023", "post_052", "post_073", "post_082",
            "post_n01", "post_n02", "post_q01",
            "post_g01", "post_i01", "post_067",
        ],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["Saturday 11am", "Saturday 1pm", "Saturday 3pm", "Sunday 4pm"],
            initial_disclosure_fields=["budget", "areas", "occupation"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_067"],
            acceptable_posts=["post_023", "post_052"],
            dealbreaker_posts=["post_n01", "post_n02", "post_g01", "post_i01"],
            required_bookings=3,
            required_tool_calls=[
                "store_user_details",
                "search_posts",
                "match_location_preference",
                "get_commute_time",
                "check_calendar_slots",
                "contact_poster",
                "book_viewing",
                "debrief_visit",
                "filter_new_arrivals",
            ],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition=(
                "Agent must book all three visits. After each of the first two visits, the agent calls "
                "debrief_visit to extract the rejection reason, updates stored preferences via store_user_details, "
                "calls filter_new_arrivals on the newly arrived listings, and re-searches with updated criteria. "
                "The deal closes when book_viewing succeeds for post_067 on visit 3."
            ),
            min_viable_turns=12,
            schedule_feasible_posts=["post_023", "post_052", "post_067"],
            max_schedule_feasible_visits=3,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": False,
            "initial_post_ids": ["post_023", "post_052", "post_073", "post_082"],
            "post_arrival_events": [
                {"after_visit": 1, "new_post_ids": ["post_n01", "post_n02", "post_q01"]},
                {"after_visit": 2, "new_post_ids": ["post_g01", "post_i01", "post_067"]},
            ],
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["Saturday 11am", "Saturday 1pm", "Saturday 3pm", "Sunday 4pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message=(
            "Hi, I want to visit a few flatmate-share options in Andheri West or Jogeshwari today. "
            "My budget is Rs. 20,000 and I work as a software engineer at a startup in Goregaon East. "
            "I'm happy to do multiple visits — I'll know what I want after seeing a few places."
        ),
    ),
    "task_visit_conflict_check": build_visit_scenario(
        task_id="task_visit_conflict_check",
        label="Single Visit With Pre-Booked Slot Conflict",
        difficulty="hard",
        description=(
            "A buyer looks for a flatmate-share in Andheri West. The best matching flat has three listed visit slots "
            "but two of them (Saturday 11am and Saturday 4pm) are already reserved by other prospective buyers. "
            "The broker must call check_calendar_slots, read the pre_booked field, and propose only the remaining "
            "open slot (Sunday 5pm) to the buyer before booking."
        ),
        task_post_ids=["post_142", "post_007", "post_044"],
        buyer_profile=build_buyer_profile(
            budget_max=20000,
            dietary="non-veg",
            areas=["Andheri W", "Jogeshwari"],
            occupation="software engineer at a startup",
            visit_availability=["Saturday 11am", "Saturday 4pm", "Sunday 5pm"],
            initial_disclosure_fields=["budget", "areas", "occupation"],
        ),
        ground_truth=build_ground_truth(
            optimal_posts=["post_142"],
            acceptable_posts=[],
            dealbreaker_posts=["post_007", "post_044"],
            required_bookings=1,
            required_tool_calls=[
                "store_user_details",
                "search_posts",
                "match_location_preference",
                "get_commute_time",
                "check_calendar_slots",
                "contact_poster",
                "book_viewing",
            ],
            required_info=["budget", "diet", "areas", "occupation", "visit_availability"],
            success_condition=(
                "Broker must call check_calendar_slots and read the pre_booked_slots field to discover that "
                "Saturday 11am and Saturday 4pm are already taken. The broker must propose only Sunday 5pm "
                "to the buyer, obtain explicit confirmation from both buyer and poster, and book that slot."
            ),
            min_viable_turns=7,
        ),
        scenario_creation_config={
            "defer_buyer_creation_until_match": True,
            "expected_answers": {
                "user_type": "buyer",
                "user_sub_type": "flat",
                "budget_max": 20000,
                "dietary": "non-veg",
                "areas": ["Andheri W", "Jogeshwari"],
                "occupation": "software engineer at a startup",
                "visit_availability": ["Saturday 11am", "Saturday 4pm", "Sunday 5pm"],
                "location_pref_type": "specific_area",
                "price_range_negotiable": False,
                "is_price_range_fixed": False,
            },
        },
        initial_user_message=(
            "Hi, I'm looking for a flatmate-share in Andheri West or Jogeshwari. "
            "My budget is Rs. 20,000 and I work in Goregaon East as a software engineer at a startup."
        ),
    ),
}