minutes-cli 0.18.8

CLI for minutes — record, transcribe, and search conversation memory
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
use chrono::{Days, Local};
use std::fs;
use std::io::{self, BufRead, IsTerminal, Write};
use std::path::{Path, PathBuf};
use std::thread;
use std::time::Duration;

const DEMO_TAG: &str = "minutes-demo-seed";
const SNOWCRASH_TAG: &str = "snow-crash";
// These demo fixtures live in `crates/cli/fixtures/demo/` (a copy of the shared
// set under `crates/mcp/fixtures/demo/`). They MUST stay inside the cli crate:
// `include_str!` of a path outside the crate root (the old `../../mcp/...`) makes
// `cargo publish` fail to package them (#280-era publish revival). If the demo
// content changes, update both copies.
const MCP_DEMO_FIXTURES: &[(&str, &str)] = &[
    (
        "2026-02-28-pricing-strategy.md",
        include_str!("../fixtures/demo/2026-02-28-pricing-strategy.md"),
    ),
    (
        "2026-03-04-northwind-call.md",
        include_str!("../fixtures/demo/2026-03-04-northwind-call.md"),
    ),
    (
        "2026-03-11-eng-standup.md",
        include_str!("../fixtures/demo/2026-03-11-eng-standup.md"),
    ),
    (
        "2026-03-25-pricing-reversal.md",
        include_str!("../fixtures/demo/2026-03-25-pricing-reversal.md"),
    ),
    (
        "2026-04-17-prioritization.md",
        include_str!("../fixtures/demo/2026-04-17-prioritization.md"),
    ),
];

pub struct McpDemoInstallResult {
    pub demo_dir: PathBuf,
    pub total_fixtures: usize,
    pub updated_fixtures: usize,
}

pub fn install_mcp_demo_fixtures(demo_dir: &Path) -> anyhow::Result<McpDemoInstallResult> {
    fs::create_dir_all(demo_dir)?;

    let mut updated_fixtures = 0usize;
    for (name, content) in MCP_DEMO_FIXTURES {
        let target = demo_dir.join(name);
        let needs_write = match fs::read_to_string(&target) {
            Ok(existing) => existing != *content,
            Err(_) => true,
        };
        if needs_write {
            fs::write(&target, content)?;
            updated_fixtures += 1;
        }
    }

    Ok(McpDemoInstallResult {
        demo_dir: demo_dir.to_path_buf(),
        total_fixtures: MCP_DEMO_FIXTURES.len(),
        updated_fixtures,
    })
}

// ── ANSI escape helpers ────────────────────────────────────────

const RESET: &str = "\x1b[0m";
const BOLD: &str = "\x1b[1m";
const DIM: &str = "\x1b[2m";
const ITALIC: &str = "\x1b[3m";
const CYAN: &str = "\x1b[36m";
const GREEN: &str = "\x1b[32m";
const YELLOW: &str = "\x1b[33m";
const WHITE: &str = "\x1b[97m";
const HIDE_CURSOR: &str = "\x1b[?25l";
const SHOW_CURSOR: &str = "\x1b[?25h";
const ERASE_LINE: &str = "\x1b[K";

fn tty() -> bool {
    io::stderr().is_terminal()
}

fn pause(ms: u64) {
    if tty() {
        thread::sleep(Duration::from_millis(ms));
    }
}

fn typewriter(w: &mut impl Write, text: &str, char_ms: u64) {
    if tty() && char_ms > 0 {
        for ch in text.chars() {
            write!(w, "{}", ch).ok();
            w.flush().ok();
            thread::sleep(Duration::from_millis(char_ms));
        }
    } else {
        write!(w, "{}", text).ok();
    }
}

fn rule(w: &mut impl Write, ch: char, width: usize) {
    let line: String = std::iter::repeat_n(ch, width).collect();
    writeln!(w, "{DIM}{}{RESET}", line).ok();
}

fn term_width() -> usize {
    #[cfg(unix)]
    {
        use std::mem::MaybeUninit;
        unsafe {
            let mut ws = MaybeUninit::<libc::winsize>::uninit();
            if libc::ioctl(2, libc::TIOCGWINSZ, ws.as_mut_ptr()) == 0 {
                let ws = ws.assume_init();
                if ws.ws_col > 0 {
                    return (ws.ws_col as usize).clamp(40, 120);
                }
            }
        }
    }
    std::env::var("COLUMNS")
        .ok()
        .and_then(|v| v.parse::<usize>().ok())
        .unwrap_or(80)
        .clamp(40, 120)
}

fn scanning_animation(w: &mut impl Write) {
    if tty() {
        let scanned = [
            "Metaverse Infrastructure Standup",
            "CosaNostra Delivery Logistics",
            "Avatar Expression System",
            "Rat Things Perimeter Security",
            "Intel Debrief",
        ];
        for (i, name) in scanned.iter().enumerate() {
            write!(w, "\r{ERASE_LINE}  {DIM}Reading {}{RESET}", name).ok();
            w.flush().ok();
            thread::sleep(Duration::from_millis(if i == 0 { 200 } else { 120 }));
        }
        writeln!(w, "\r{ERASE_LINE}").ok();
    } else {
        writeln!(w, "  Reading 5 meetings...").ok();
        writeln!(w).ok();
    }
}

/// The main animated presentation after seeding demo meetings.
pub fn present_demo(meeting_count: usize, people_count: usize, _output_dir: &Path) {
    let mut w = io::stderr();
    let is_tty = tty();
    let width = if is_tty { term_width() } else { 80 };

    if is_tty {
        write!(w, "{HIDE_CURSOR}").ok();
    }

    // ── Header ──────────────────────────────────────────────

    writeln!(w).ok();
    let version = env!("CARGO_PKG_VERSION");
    writeln!(
        w,
        "  {BOLD}{WHITE}MINUTES{RESET} {DIM}v{version}{RESET}  {DIM}demo universe: {RESET}{CYAN}{BOLD}Snow Crash{RESET}"
    )
    .ok();
    writeln!(w).ok();

    // ── Card data ────────────────────────────────────────────

    struct MeetingCard {
        title: &'static str,
        days_ago: u32,
        people: &'static str,
        teaser: &'static str,
    }

    let cards = [
        MeetingCard {
            title: "Metaverse Infrastructure Standup",
            days_ago: 14,
            people: "Hiro Protagonist, Da5id Meier",
            teaser: "\"I can fix it by Friday.\"",
        },
        MeetingCard {
            title: "CosaNostra Delivery Logistics",
            days_ago: 11,
            people: "Y.T., Uncle Enzo",
            teaser: "\"The 30-minute guarantee is sacred.\"",
        },
        MeetingCard {
            title: "Avatar Expression System",
            days_ago: 7,
            people: "Hiro Protagonist, Juanita Marquez",
            teaser: "\"Last I heard he was at the Raft.\"",
        },
        MeetingCard {
            title: "Rat Things Perimeter Security",
            days_ago: 4,
            people: "Mr. Lee, Ng, Hiro Protagonist",
            teaser:
                "\"Anything running through that corridor is going to hit the new checkpoints.\"",
        },
        MeetingCard {
            title: "Intel Debrief",
            days_ago: 1,
            people: "Hiro Protagonist, Y.T.",
            teaser: "\"He told me he was heads-down coding. He's been at the Raft.\"",
        },
    ];

    // ── Timeline cards ──────────────────────────────────────

    for (i, card) in cards.iter().enumerate().take(meeting_count) {
        pause(if i == 0 { 60 } else { 100 });

        let day_label = format!("{}d", card.days_ago);
        writeln!(
            w,
            "  {DIM}{:>3}{RESET} {DIM}\u{2500}\u{2500}{RESET} {WHITE}{}{RESET}",
            day_label, card.title
        )
        .ok();
        writeln!(w, "       {DIM}{}{RESET}", card.people).ok();
        writeln!(w, "       {ITALIC}{}{RESET}", card.teaser).ok();

        if i < meeting_count - 1 {
            writeln!(w, "    {DIM}\u{2502}{RESET}").ok();
        } else {
            writeln!(w).ok();
        }
        w.flush().ok();
    }

    // ── Summary stats ───────────────────────────────────────

    pause(200);
    if is_tty {
        rule(&mut w, '\u{2500}', width.min(72));
    }
    writeln!(
        w,
        "  {BOLD}{WHITE}{} people{RESET}  {DIM}\u{00b7}{RESET}  {BOLD}{WHITE}{} meetings{RESET}  {DIM}\u{00b7}{RESET}  {BOLD}{WHITE}2 threads{RESET}",
        people_count, meeting_count
    )
    .ok();
    writeln!(w).ok();

    // ── Interactive thread picker ────────────────────────────

    let interactive = is_tty && io::stdin().is_terminal();

    if interactive {
        pause(200);
        writeln!(
            w,
            "  {DIM}Two threads run through these meetings. Neither was discussed directly.{RESET}"
        )
        .ok();
        writeln!(w).ok();
        writeln!(
            w,
            "  {WHITE}{BOLD}[1]{RESET} {WHITE}The Da5id Problem{RESET} {DIM}-- a commitment traced across 3 meetings{RESET}"
        )
        .ok();
        writeln!(
            w,
            "  {WHITE}{BOLD}[2]{RESET} {WHITE}The Territory Collision{RESET} {DIM}-- a security change about to wreck a delivery route{RESET}"
        )
        .ok();
        writeln!(w).ok();
        write!(
            w,
            "  {WHITE}Pick a thread ({BOLD}1{RESET}{WHITE}/{BOLD}2{RESET}{WHITE}), or {BOLD}q{RESET}{WHITE} to explore on your own {RESET}"
        )
        .ok();
        write!(w, "{SHOW_CURSOR}").ok();
        w.flush().ok();

        let mut input = String::new();
        io::stdin().lock().read_line(&mut input).ok();
        let choice = input.trim().to_lowercase();

        write!(w, "{HIDE_CURSOR}").ok();
        w.flush().ok();

        match choice.as_str() {
            "q" | "quit" | "n" | "no" => {
                writeln!(w).ok();
                present_explore_commands(&mut w);
                writeln!(
                    w,
                    "  {DIM}Missed the threads? Run {RESET}{CYAN}minutes demo --clean --full{RESET}{DIM} to replay.{RESET}"
                )
                .ok();
                writeln!(w).ok();
            }
            "2" => {
                present_territory_thread(&mut w, width);
                let saw_both = prompt_continue(&mut w, "See the Da5id thread?");
                if saw_both {
                    present_query_inner_short(&mut w, width);
                    present_connection_punchline(&mut w, width);
                }
                writeln!(w).ok();
                present_end_card(&mut w, width, saw_both);
            }
            _ => {
                present_query_inner(&mut w, width);
                let saw_both = prompt_continue(&mut w, "See the territory collision?");
                if saw_both {
                    present_territory_thread_short(&mut w, width);
                    present_connection_punchline(&mut w, width);
                }
                writeln!(w).ok();
                present_end_card(&mut w, width, saw_both);
            }
        }
    } else {
        present_explore_commands(&mut w);
    }

    if is_tty {
        write!(w, "{SHOW_CURSOR}").ok();
    }
    w.flush().ok();
}

fn prompt_continue(w: &mut impl Write, label: &str) -> bool {
    if !tty() || !io::stdin().is_terminal() {
        return false;
    }
    writeln!(w).ok();
    write!(
        w,
        "  {WHITE}{label} ({BOLD}Enter{RESET}{WHITE}/{BOLD}q{RESET}{WHITE}) {RESET}"
    )
    .ok();
    write!(w, "{SHOW_CURSOR}").ok();
    w.flush().ok();

    let mut input = String::new();
    io::stdin().lock().read_line(&mut input).ok();
    let choice = input.trim().to_lowercase();

    write!(w, "{HIDE_CURSOR}").ok();
    w.flush().ok();

    !matches!(choice.as_str(), "q" | "quit" | "n" | "no")
}

fn present_connection_punchline(w: &mut impl Write, width: usize) {
    writeln!(w).ok();
    if tty() {
        rule(w, '\u{2500}', width.min(72));
    }
    writeln!(w).ok();

    let is_tty = tty();
    typewriter(
        w,
        &format!("{BOLD}{WHITE}  The Intel Debrief is where both threads surface.{RESET}"),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    pause(200);
    typewriter(
        w,
        &format!("{BOLD}{WHITE}  Hiro was in 4 of 5 meetings. He never connected the dots.{RESET}"),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    pause(300);
    typewriter(
        w,
        &format!("{BOLD}{WHITE}  Minutes did.{RESET}"),
        if is_tty { 18 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();
}

fn present_explore_commands(w: &mut impl Write) {
    writeln!(w, "  {DIM}Pull the threads:{RESET}").ok();
    writeln!(w).ok();
    writeln!(
        w,
        "    {CYAN}minutes search{RESET} {DIM}\"rendering pipeline\"{RESET}     {DIM}# the Da5id thread{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {CYAN}minutes search{RESET} {DIM}\"east side\"{RESET}              {DIM}# the territory collision{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {CYAN}minutes actions{RESET} {DIM}--open{RESET}                  {DIM}# stale commitments{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {CYAN}minutes people{RESET}                           {DIM}# who knows who{RESET}"
    )
    .ok();
    writeln!(w).ok();
    writeln!(
        w,
        "  {DIM}Or ask your AI:{RESET}  {ITALIC}\"What did Da5id promise and did he deliver?\"{RESET}"
    )
    .ok();
    writeln!(w).ok();
}

// ── Thread 1: The Da5id Problem ─────────────────────────────────

fn present_query_inner(w: &mut impl Write, width: usize) {
    let is_tty = tty();
    let rw = width.min(72);

    writeln!(w).ok();
    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    write!(w, "  {DIM}>{RESET} ").ok();
    typewriter(
        w,
        &format!("{BOLD}{WHITE}What did Da5id promise and did he deliver?{RESET}"),
        if is_tty { 8 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();

    scanning_animation(w);

    pause(150);
    writeln!(
        w,
        "  {GREEN}{BOLD}COMMIT{RESET}   {DIM}Metaverse Infrastructure Standup, 14 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Da5id: \"I think I can fix it by Friday if I swap out{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}the spatial index.\"{RESET}").ok();
    writeln!(w).ok();

    pause(400);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Avatar Expression System, 7 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Juanita: \"Last I heard he was spending time down at the Raft.\"{RESET}"
    )
    .ok();
    writeln!(w).ok();

    pause(400);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Intel Debrief, yesterday{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Y.T.: \"Uncle Enzo said he saw him at the Raft three times{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}in the last two weeks.\"{RESET}").ok();
    writeln!(w).ok();

    pause(900);

    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    typewriter(
        w,
        &format!(
            "{BOLD}{WHITE}  Da5id committed to the rendering pipeline fix 14 days ago.{RESET}"
        ),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    pause(300);
    typewriter(
        w,
        &format!("{BOLD}{WHITE}  He didn't deliver.{RESET}"),
        if is_tty { 12 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();
    pause(200);

    writeln!(
        w,
        "{DIM}  Minutes connected a casual aside from Juanita, delivery intel"
    )
    .ok();
    writeln!(
        w,
        "  from Y.T., and a 14-day-old commitment from a standup. Three"
    )
    .ok();
    writeln!(
        w,
        "  separate conversations, one thread. No human would have caught it.{RESET}"
    )
    .ok();
    writeln!(w).ok();
}

// ── Thread 2: The Territory Collision ───────────────────────────

fn present_territory_thread(w: &mut impl Write, width: usize) {
    let is_tty = tty();
    let rw = width.min(72);

    writeln!(w).ok();
    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    write!(w, "  {DIM}>{RESET} ").ok();
    typewriter(
        w,
        &format!("{BOLD}{WHITE}Is anything about to disrupt Y.T.'s delivery routes?{RESET}"),
        if is_tty { 8 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();

    scanning_animation(w);

    pause(150);
    writeln!(
        w,
        "  {GREEN}{BOLD}COMMIT{RESET}   {DIM}CosaNostra Delivery Logistics, 11 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Enzo: \"90-day trial. You keep the times under 30, the territory{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}is yours.\"{RESET}").ok();
    writeln!(w).ok();

    pause(400);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Rat Things Perimeter Security, 4 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Ng: \"Anything running through that corridor, deliveries, supply{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}trucks, whatever, is going to hit the new checkpoints.\"{RESET}"
    )
    .ok();
    writeln!(w).ok();

    pause(400);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Intel Debrief, yesterday{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Y.T.: \"If anyone's doing perimeter changes on the east side,{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}that's going to wreck my routes.\"{RESET}").ok();
    writeln!(w).ok();

    pause(900);

    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    typewriter(
        w,
        &format!(
            "{BOLD}{WHITE}  Y.T. signed an exclusive Valley delivery territory 11 days ago.{RESET}"
        ),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    pause(300);
    typewriter(
        w,
        &format!(
            "{BOLD}{WHITE}  Ng's east-side security expansion is about to reroute her corridor.{RESET}"
        ),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();
    pause(200);

    writeln!(
        w,
        "{DIM}  A delivery franchise, a security perimeter, and a passing warning."
    )
    .ok();
    writeln!(
        w,
        "  Three meetings, two teams, zero overlap in the room. Hiro was in"
    )
    .ok();
    writeln!(
        w,
        "  both conversations but never connected the dots.{RESET}"
    )
    .ok();
    writeln!(w).ok();
}

// ── Short variants (skip scanning, used for the second thread) ──

fn present_query_inner_short(w: &mut impl Write, width: usize) {
    let is_tty = tty();
    let rw = width.min(72);

    writeln!(w).ok();
    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    writeln!(
        w,
        "  {DIM}>{RESET} {BOLD}{WHITE}What did Da5id promise and did he deliver?{RESET}"
    )
    .ok();
    writeln!(w).ok();

    pause(150);
    writeln!(
        w,
        "  {GREEN}{BOLD}COMMIT{RESET}   {DIM}Metaverse Infrastructure Standup, 14 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Da5id: \"I think I can fix it by Friday if I swap out{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}the spatial index.\"{RESET}").ok();
    writeln!(w).ok();

    pause(300);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Avatar Expression System, 7 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Juanita: \"Last I heard he was spending time down at the Raft.\"{RESET}"
    )
    .ok();
    writeln!(w).ok();

    pause(300);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Intel Debrief, yesterday{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Y.T.: \"Uncle Enzo said he saw him at the Raft three times{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}in the last two weeks.\"{RESET}").ok();
    writeln!(w).ok();

    pause(600);

    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    typewriter(
        w,
        &format!(
            "{BOLD}{WHITE}  Da5id committed to the rendering pipeline fix 14 days ago.{RESET}"
        ),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    pause(300);
    typewriter(
        w,
        &format!("{BOLD}{WHITE}  He didn't deliver.{RESET}"),
        if is_tty { 12 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();
    pause(200);

    writeln!(
        w,
        "{DIM}  Minutes connected a casual aside from Juanita, delivery intel"
    )
    .ok();
    writeln!(
        w,
        "  from Y.T., and a 14-day-old commitment from a standup. Three"
    )
    .ok();
    writeln!(
        w,
        "  separate conversations, one thread. No human would have caught it.{RESET}"
    )
    .ok();
    writeln!(w).ok();
}

fn present_territory_thread_short(w: &mut impl Write, width: usize) {
    let is_tty = tty();
    let rw = width.min(72);

    writeln!(w).ok();
    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    writeln!(
        w,
        "  {DIM}>{RESET} {BOLD}{WHITE}Is anything about to disrupt Y.T.'s delivery routes?{RESET}"
    )
    .ok();
    writeln!(w).ok();

    pause(150);
    writeln!(
        w,
        "  {GREEN}{BOLD}COMMIT{RESET}   {DIM}CosaNostra Delivery Logistics, 11 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Enzo: \"90-day trial. You keep the times under 30, the territory{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}is yours.\"{RESET}").ok();
    writeln!(w).ok();

    pause(300);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Rat Things Perimeter Security, 4 days ago{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Ng: \"Anything running through that corridor, deliveries, supply{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}trucks, whatever, is going to hit the new checkpoints.\"{RESET}"
    )
    .ok();
    writeln!(w).ok();

    pause(300);

    writeln!(
        w,
        "  {YELLOW}{BOLD}SIGNAL{RESET}   {DIM}Intel Debrief, yesterday{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {ITALIC}Y.T.: \"If anyone's doing perimeter changes on the east side,{RESET}"
    )
    .ok();
    writeln!(w, "    {ITALIC}that's going to wreck my routes.\"{RESET}").ok();
    writeln!(w).ok();

    pause(600);

    if is_tty {
        rule(w, '\u{2500}', rw);
    }
    writeln!(w).ok();

    typewriter(
        w,
        &format!(
            "{BOLD}{WHITE}  Y.T. signed an exclusive Valley delivery territory 11 days ago.{RESET}"
        ),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    pause(300);
    typewriter(
        w,
        &format!(
            "{BOLD}{WHITE}  Ng's east-side security expansion is about to reroute her corridor.{RESET}"
        ),
        if is_tty { 10 } else { 0 },
    );
    writeln!(w).ok();
    writeln!(w).ok();
    pause(200);

    writeln!(
        w,
        "{DIM}  A delivery franchise, a security perimeter, and a passing warning."
    )
    .ok();
    writeln!(
        w,
        "  Three meetings, two teams, zero overlap in the room. Hiro was in"
    )
    .ok();
    writeln!(
        w,
        "  both conversations but never connected the dots.{RESET}"
    )
    .ok();
    writeln!(w).ok();
}

// ── End card ────────────────────────────────────────────────────

fn present_end_card(w: &mut impl Write, width: usize, saw_both: bool) {
    if tty() {
        rule(w, '\u{2500}', width.min(72));
    }
    writeln!(w).ok();
    if saw_both {
        writeln!(
            w,
            "  {DIM}Two threads. Five meetings. Zero manual work.{RESET}"
        )
        .ok();
    } else {
        writeln!(
            w,
            "  {DIM}One thread. Five meetings. Zero manual work.{RESET}"
        )
        .ok();
    }
    writeln!(
        w,
        "  {DIM}This is what your AI sees when it reads your conversations.{RESET}"
    )
    .ok();
    writeln!(w).ok();
    writeln!(w, "  {DIM}Try it yourself:{RESET}").ok();
    writeln!(
        w,
        "    {CYAN}minutes search{RESET} {DIM}\"rendering pipeline\"{RESET}     {DIM}# cross-meeting search{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {CYAN}minutes search{RESET} {DIM}\"east side\"{RESET}              {DIM}# the other thread{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {CYAN}minutes actions{RESET} {DIM}--open{RESET}                  {DIM}# stale commitments{RESET}"
    )
    .ok();
    writeln!(
        w,
        "    {CYAN}minutes people{RESET}                           {DIM}# who knows who{RESET}"
    )
    .ok();
    writeln!(w).ok();
}

/// Remove all demo meetings from the output directory.
/// Identifies demo files by the `demo` tag in YAML frontmatter, not filename.
/// Returns count of files removed.
pub fn clean_demo_meetings(output_dir: &Path) -> anyhow::Result<usize> {
    let mut removed = 0;
    if !output_dir.exists() {
        return Ok(0);
    }
    for entry in fs::read_dir(output_dir)? {
        let entry = entry?;
        let path = entry.path();
        if path.extension().is_none_or(|e| e != "md") {
            continue;
        }
        // Check frontmatter for demo tag
        if let Ok(content) = fs::read_to_string(&path) {
            if content.starts_with("---") && content.contains(&format!("- {}", DEMO_TAG)) {
                let name = entry.file_name();
                fs::remove_file(&path)?;
                eprintln!("  Removed {}", name.to_string_lossy());
                removed += 1;
            }
        }
    }
    Ok(removed)
}

/// Run a cross-meeting query against the demo data to show the agent experience
/// without requiring Claude or any MCP client.
pub fn query_demo(output_dir: &Path) -> anyhow::Result<()> {
    let has_demo = output_dir.exists()
        && fs::read_dir(output_dir)?.any(|e| {
            e.ok()
                .and_then(|e| fs::read_to_string(e.path()).ok())
                .is_some_and(|c| c.contains(&format!("- {}", DEMO_TAG)))
        });
    if !has_demo {
        eprintln!("No demo meetings found. Run `minutes demo --full` first.");
        return Ok(());
    }

    let mut w = io::stderr();
    let width = if tty() { term_width() } else { 80 };
    if tty() {
        write!(w, "{HIDE_CURSOR}").ok();
    }

    present_query_inner(&mut w, width);
    writeln!(w).ok();
    present_end_card(&mut w, width, false);

    if tty() {
        write!(w, "{SHOW_CURSOR}").ok();
    }
    w.flush().ok();
    Ok(())
}

/// Generate 5 Snow Crash-themed demo meetings with interconnected storylines.
/// Dates are computed relative to now so they always feel fresh.
/// Returns the paths of created files.
pub fn seed_demo_meetings(output_dir: &Path) -> anyhow::Result<Vec<std::path::PathBuf>> {
    fs::create_dir_all(output_dir)?;

    let now = Local::now();
    let d = |days_ago: u64, hour: u32, min: u32| -> String {
        let day = now.checked_sub_days(Days::new(days_ago)).unwrap_or(now);
        day.format(&format!("%Y-%m-%dT{:02}:{:02}:00%:z", hour, min))
            .to_string()
    };
    let date_short = |days_ago: u64| -> String {
        let day = now.checked_sub_days(Days::new(days_ago)).unwrap_or(now);
        day.format("%Y-%m-%d").to_string()
    };
    let due_date = |days_ago: u64| -> String {
        let day = now
            .checked_sub_days(Days::new(days_ago.saturating_sub(2)))
            .unwrap_or(now);
        day.format("%Y-%m-%d").to_string()
    };

    let meetings = vec![
        // Meeting 1: Hiro & Da5id — Metaverse Infrastructure Standup
        (
            format!("{}-metaverse-infrastructure-standup.md", date_short(14)),
            format!(
                r#"---
title: Metaverse Infrastructure Standup
type: meeting
date: {date}
duration: 24m
status: complete
tags:
  - {demo}
  - {snowcrash}
attendees:
  - Hiro Protagonist
  - Da5id Meier
people:
  - Hiro Protagonist
  - Da5id Meier
action_items:
  - assignee: Da5id Meier
    task: Fix avatar rendering pipeline before Friday
    due: "{due}"
    status: open
  - assignee: Hiro Protagonist
    task: Benchmark new distributed server architecture
    due: "{due}"
    status: done
decisions:
  - text: Migrate the Street to distributed architecture across 8 regional nodes
    topic: infrastructure
  - text: Deprecate the old monolithic renderer after migration
    topic: infrastructure
speaker_map:
  - speaker_label: SPEAKER_00
    name: Hiro Protagonist
    confidence: high
    source: calendar
  - speaker_label: SPEAKER_01
    name: Da5id Meier
    confidence: high
    source: calendar
---

## Transcript

**Hiro Protagonist**: Da5id, what's the status on the rendering pipeline? We're getting frame drops in the, uh, high-density zones around the Street.

**Da5id Meier**: Yeah so I've been profiling it. The bottleneck is the avatar mesh deduplication layer. When you get more than 10,000 avatars in a sector it just falls off a cliff. I think I can fix it by Friday if I swap out the spatial index.

**Hiro Protagonist**: Friday works. Hold on, let me pull up the... okay yeah. The Black Sun is hosting that concert event next week and we can't have it stuttering with 50k people in there. What about the architecture migration?

**Da5id Meier**: So I looked at your benchmark numbers. The distributed setup is about 3x throughput per node, and we can shard the Street into 8 regions. Latency stays under 40ms for users in the same region. Actually wait, I think it was 38, let me... yeah, 38ms p99.

**Hiro Protagonist**: Let's do it. I'll write up the migration plan. We deprecate the monolith after the new system is stable. No point maintaining both.

**Da5id Meier**: Agreed. I'll have the rendering fix ready by Friday and then I can help with the migration next week. Shouldn't be too bad once the spatial index is swapped.

**Hiro Protagonist**: Sounds good. I already finished the benchmarks by the way. Numbers are in the shared doc. Oh and can you make sure the fix doesn't break the texture streaming? Last time someone touched that layer we had avatars walking around as grey blobs for two hours.

**Da5id Meier**: [laughs] Yeah I remember that. I'll run the full regression suite before I push anything.
"#,
                date = d(14, 10, 0),
                due = due_date(14),
                demo = DEMO_TAG,
                snowcrash = SNOWCRASH_TAG,
            ),
        ),
        // Meeting 2: Y.T. & Uncle Enzo — CosaNostra Delivery Logistics
        (
            format!("{}-cosanostra-delivery-logistics.md", date_short(11)),
            format!(
                r#"---
title: CosaNostra Delivery Logistics
type: meeting
date: {date}
duration: 18m
status: complete
tags:
  - {demo}
  - {snowcrash}
attendees:
  - Y.T.
  - Uncle Enzo
people:
  - Y.T.
  - Uncle Enzo
action_items:
  - assignee: Y.T.
    task: Handle all Valley delivery zone dispatches starting next Monday
    status: open
  - assignee: Uncle Enzo
    task: Send franchise agreement for Y.T. to review
    status: open
decisions:
  - text: "30-minute delivery guarantee is non-negotiable: any violation triggers automatic customer comp"
    topic: operations
  - text: Y.T. gets exclusive Valley territory for 90-day trial period
    topic: territory
speaker_map:
  - speaker_label: SPEAKER_00
    name: Uncle Enzo
    confidence: high
    source: calendar
  - speaker_label: SPEAKER_01
    name: Y.T.
    confidence: high
    source: calendar
---

## Transcript

**Uncle Enzo**: I've been watching your delivery times. You're consistently under 22 minutes in the downtown corridor. That's better than anyone else we've got.

**Y.T.**: My board's dialed in. I know every shortcut between here and the coast. The Valley is where you need help though right?

**Uncle Enzo**: The Valley is a disaster. Three drivers quit last month. Customers are getting cold pizza and the 30-minute guarantee is sacred. You understand? Non-negotiable. A late pizza, we comp the customer automatically. That comes out of the driver's cut.

**Y.T.**: I can handle the Valley. But I want exclusive territory. No other Kouriers poaching my routes or I'm not gonna be able to guarantee anything.

**Uncle Enzo**: 90-day trial. You keep the times under 30, the territory is yours. I'll send over the franchise agreement, read it carefully. My lawyers don't mess around.

**Y.T.**: Deal. When do I start?

**Uncle Enzo**: Monday. And Y.T., one more thing. I heard you've been talking to Hiro Protagonist. He's a friend of ours but keep CosaNostra business out of whatever he's building, capisce?

**Y.T.**: Yeah, understood. Totally separate.

**Uncle Enzo**: Good. [pause] You know, you remind me of myself at your age. Except I didn't have a skateboard. I had a... never mind. Monday. Don't be late.
"#,
                date = d(11, 14, 30),
                demo = DEMO_TAG,
                snowcrash = SNOWCRASH_TAG,
            ),
        ),
        // Meeting 3: Hiro & Juanita — Avatar Expression System
        (
            format!("{}-avatar-expression-system.md", date_short(7)),
            format!(
                r#"---
title: Avatar Expression System
type: meeting
date: {date}
duration: 31m
status: complete
tags:
  - {demo}
  - {snowcrash}
attendees:
  - Hiro Protagonist
  - Juanita Marquez
people:
  - Hiro Protagonist
  - Juanita Marquez
action_items:
  - assignee: Hiro Protagonist
    task: Integrate facial expression SDK into the Metaverse client
    due: "{due}"
    status: open
  - assignee: Juanita Marquez
    task: Send SDK documentation and sample models
    status: done
decisions:
  - text: Ship avatar expressions as a plugin architecture, not baked into core renderer
    topic: architecture
  - text: Use Juanita's 43-muscle facial model as the standard
    topic: technical
speaker_map:
  - speaker_label: SPEAKER_00
    name: Hiro Protagonist
    confidence: high
    source: calendar
  - speaker_label: SPEAKER_01
    name: Juanita Marquez
    confidence: high
    source: calendar
---

## Transcript

**Juanita Marquez**: Okay so I finished the facial expression system. 43 muscle groups, real-time blending. When someone smiles in the Metaverse it actually looks like a smile now, not that weird uncanny valley thing we've been shipping.

**Hiro Protagonist**: That's incredible. The current avatars are basically mannequins. Can I see the... hold on, my mic was muted for like the first ten seconds of this call. Could you hear me?

**Juanita Marquez**: Yeah I heard you fine. Anyway, I'll send you the SDK and sample models after this call. Actually already done, check your messages. The question is how we integrate it. I don't think it should go into the core renderer.

**Hiro Protagonist**: Agreed, especially with Da5id's rendering pipeline already being fragile. Speaking of which, have you talked to him? He was supposed to fix the avatar mesh dedup layer like two weeks ago and I haven't seen a commit.

**Juanita Marquez**: I haven't talked to Da5id in a while honestly. Last I heard he was spending time down at the Raft.

**Hiro Protagonist**: The Raft? He told me he was heads-down on the rendering fix. That's... okay that's not great. Anyway let's make the expression system a plugin. That way it doesn't depend on his pipeline work and we can ship it independently.

**Juanita Marquez**: Smart. Plugin architecture means anyone can build alternative expression systems too. I'll standardize the API. Should have a draft spec by end of week.

**Hiro Protagonist**: Perfect. I'll integrate your SDK by next sprint. And Juanita, seriously, this is going to change how people experience the Metaverse. The emotional bandwidth of a conversation goes way up when you can actually read someone's face.

**Juanita Marquez**: That's literally why I built it. [laughs] Okay I gotta run, I have another call in five.
"#,
                date = d(7, 11, 0),
                due = due_date(7),
                demo = DEMO_TAG,
                snowcrash = SNOWCRASH_TAG,
            ),
        ),
        // Meeting 4: Ng Security Review — Rat Things Perimeter
        (
            format!("{}-rat-things-security-review.md", date_short(4)),
            format!(
                r#"---
title: Rat Things Perimeter Security Review
type: meeting
date: {date}
duration: 42m
status: complete
tags:
  - {demo}
  - {snowcrash}
attendees:
  - Mr. Lee
  - Ng
  - Hiro Protagonist
people:
  - Mr. Lee
  - Ng
  - Hiro Protagonist
action_items:
  - assignee: Ng
    task: Patch east-side perimeter vulnerability with redundant sensor array
    due: "{due}"
    status: open
  - assignee: Mr. Lee
    task: Approve expanded Rat Things budget for additional 12 units
    status: open
  - assignee: Hiro Protagonist
    task: Review autonomous mode failsafe code before deployment
    status: open
decisions:
  - text: Expand Rat Things perimeter coverage by 30% on the east side
    topic: security
  - text: Switch from manual override to autonomous mode for faster response times
    topic: operations
speaker_map:
  - speaker_label: SPEAKER_00
    name: Mr. Lee
    confidence: high
    source: calendar
  - speaker_label: SPEAKER_01
    name: Ng
    confidence: high
    source: calendar
  - speaker_label: SPEAKER_02
    name: Hiro Protagonist
    confidence: high
    source: calendar
---

## Transcript

**Mr. Lee**: Ng, walk us through the perimeter assessment.

**Ng**: So we have a gap on the east side. The current Rat Things deployment covers about 70% of the perimeter there. An intruder came within 50 meters of the compound last Tuesday before a unit intercepted. That's way too close.

**Mr. Lee**: Unacceptable. What do you need?

**Ng**: Twelve additional units and a redundant sensor array. That closes the gap and gives us roughly 30% more coverage. I also recommend switching to autonomous mode. The manual override adds about 4 seconds of response latency and at the speeds these things run, 4 seconds is the difference between interception at 200 meters versus 50.

**Hiro Protagonist**: I wrote the original failsafe code for autonomous mode. It's solid but I should review it before we flip the switch. There's an edge case around the thermal sensors in rain that I've been meaning to look at. Sorry, can you hear that buzzing? I think it's on my end.

**Mr. Lee**: I can hear it. Proceed.

**Hiro Protagonist**: Right, so the edge case. When it rains the thermal signatures blur and the targeting gets... imprecise. I want to make sure the failsafe actually kicks in under those conditions. Give me two days. I want to be thorough.

**Ng**: I can have the new sensor array installed by Wednesday regardless. The Rat Things expansion depends on Mr. Lee's budget approval.

**Mr. Lee**: You'll have it by end of day. Security is not a line item we negotiate on. Ng, proceed with the sensor array. Hiro, get that code review done. Anything else?

**Ng**: One more thing. The units are running hot. Literally. The thermal dissipation on the newer models is... we may need to look at that. But it's a separate issue.

**Mr. Lee**: Flag it. We'll address it next cycle.

**Ng**: Oh one more thing. The expanded perimeter is going to reroute all ground traffic on the east side. Anything running through that corridor, deliveries, supply trucks, whatever, is going to hit the new checkpoints.
"#,
                date = d(4, 9, 0),
                due = due_date(4),
                demo = DEMO_TAG,
                snowcrash = SNOWCRASH_TAG,
            ),
        ),
        // Meeting 5: Hiro & Y.T. — Intel Debrief
        (
            format!("{}-intel-debrief.md", date_short(1)),
            format!(
                r#"---
title: Intel Debrief
type: meeting
date: {date}
duration: 19m
status: complete
tags:
  - {demo}
  - {snowcrash}
attendees:
  - Hiro Protagonist
  - Y.T.
people:
  - Hiro Protagonist
  - Y.T.
action_items:
  - assignee: Hiro Protagonist
    task: Confront Da5id about the rendering pipeline and his whereabouts
    status: open
decisions:
  - text: Postpone Metaverse launch event until rendering pipeline is confirmed fixed
    topic: launch
  - text: Route all Da5id-related commitments through Hiro for accountability
    topic: process
speaker_map:
  - speaker_label: SPEAKER_00
    name: Hiro Protagonist
    confidence: high
    source: calendar
  - speaker_label: SPEAKER_01
    name: Y.T.
    confidence: high
    source: calendar
---

## Transcript

**Hiro Protagonist**: Y.T., thanks for meeting. I need to compare notes on a few things.

**Y.T.**: Yeah sure what's up?

**Hiro Protagonist**: Da5id. Two weeks ago he told me he'd have the rendering pipeline fixed by Friday. That was like 12 days ago. No commit, no update, nothing. And Juanita told me last week she heard he's been spending time at the Raft.

**Y.T.**: Oh that totally tracks. Uncle Enzo mentioned Da5id too actually. Said he saw him at the Raft three times in the last two weeks. Enzo keeps tabs on everyone near the Raft because of the supply chain stuff. He's got people watching.

**Hiro Protagonist**: So wait. Da5id told me he was heads-down coding, but he's actually been at the Raft. The rendering pipeline isn't fixed. The Black Sun concert is in a week and we're going to have 50,000 avatars stuttering at like 4 frames per second. This is bad.

**Y.T.**: Yeah that's not good. Can you fix it yourself?

**Hiro Protagonist**: I can probably hack a workaround but the real fix needs Da5id's expertise on the spatial index. He's the one who wrote that whole layer. I need to talk to him directly and figure out what's going on. In the meantime we should postpone the launch event. I'd rather delay than embarrass ourselves in front of... [sigh] okay yeah we're postponing.

**Y.T.**: Makes sense. Enzo's not going to be happy about the concert delay though. He was planning to use it for a CosaNostra promo. Like a big pizza giveaway thing in the Black Sun.

**Hiro Protagonist**: That's his problem. From now on, anything Da5id commits to goes through me. I need to verify he's actually doing the work before we count on it for planning. I'm not getting burned like this again.

**Y.T.**: Want me to track him down? I know some people at the Raft.

**Hiro Protagonist**: Not yet. Let me try talking to him first. If he ghosts me then... yeah then maybe. Thanks Y.T.

**Y.T.**: Anytime. Let me know how it goes. Oh and heads up, I just signed an exclusive deal for the Valley delivery zone with Enzo. If anyone's doing construction or perimeter changes on the east side, that's going to wreck my routes. Enzo will lose it.

**Hiro Protagonist**: Noted. I'll keep an ear out.
"#,
                date = d(1, 16, 0),
                demo = DEMO_TAG,
                snowcrash = SNOWCRASH_TAG,
            ),
        ),
    ];

    let mut paths = Vec::new();
    for (filename, content) in &meetings {
        let path = output_dir.join(filename);
        if path.exists() {
            continue;
        }
        fs::write(&path, content)?;
        #[cfg(unix)]
        {
            use std::os::unix::fs::PermissionsExt;
            fs::set_permissions(&path, fs::Permissions::from_mode(0o600))?;
        }
        paths.push(path);
    }

    Ok(paths)
}