magi-code 0.96.1

Repository-aware CLI coding agent for terminal work
Documentation
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
use super::{
    FileAggregate, FileReport, MAX_JSONL_LINES, MeasurementLimits, SamplingReport, codecs,
    u64_from_usize,
};
use cap_fs_ext::{DirEntryExt, DirExt, FollowSymlinks, OpenOptionsFollowExt};
use cap_std::{
    ambient_authority,
    fs::{Dir as CapDir, File as CapFile, Metadata as CapMetadata, OpenOptions as CapOpenOptions},
};
use std::{
    ffi::OsStr,
    io::{self, BufRead, BufReader, Read},
    path::{Path, PathBuf},
    time::SystemTime,
};

pub(super) const MAX_SESSION_FILE_BYTES: u64 = 64 * 1024 * 1024;
pub(super) const MAX_JSONL_LINE_BYTES: usize = 1024 * 1024;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct FileSignature {
    len: u64,
    modified: SystemTime,
    #[cfg(any(unix, windows))]
    dev: u64,
    #[cfg(any(unix, windows))]
    ino: u64,
    #[cfg(any(unix, windows))]
    nlink: u64,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct DiscoverySignature {
    len: u64,
    modified: SystemTime,
    #[cfg(any(unix, windows))]
    dev: u64,
    #[cfg(any(unix, windows))]
    ino: u64,
    #[cfg(any(unix, windows))]
    nlink: u64,
}

#[derive(Debug)]
pub(super) struct FileTarget {
    path: PathBuf,
    file: CapFile,
    discovery_signature: DiscoverySignature,
    opened_signature: FileSignature,
}

#[derive(Debug, Default)]
pub(super) struct Discovery {
    pub(super) targets: Vec<FileTarget>,
    pub(super) files: FileReport,
    pub(super) sampling: SamplingReport,
    pub(super) root_missing: bool,
    pub(super) unsafe_storage: bool,
}

#[derive(Debug)]
pub(super) enum FileScanResult {
    Scanned {
        aggregate: Box<FileAggregate>,
        bytes: u64,
    },
    Unreadable {
        bytes: u64,
    },
    Unstable {
        bytes: u64,
    },
}

pub(super) fn discover_files(root: &Path, limits: MeasurementLimits) -> Discovery {
    let mut discovery = Discovery {
        sampling: SamplingReport {
            max_files: u64_from_usize(limits.max_files),
            max_bytes: limits.max_bytes,
            ..SamplingReport::default()
        },
        ..Discovery::default()
    };

    let root_directory = match open_root_directory(root) {
        Ok(directory) => directory,
        Err(error) if error.kind() == io::ErrorKind::NotFound => {
            discovery.root_missing = true;
            return discovery;
        }
        Err(_) => {
            discovery.unsafe_storage = true;
            return discovery;
        }
    };

    let mut selector = CandidateSelector::new(limits);
    collect_directory_entries(
        &root_directory,
        Path::new("primary"),
        false,
        &mut selector,
        &mut discovery,
    );

    match root_directory.open_dir_nofollow("subagents") {
        Ok(subagents) => match subagents.dir_metadata() {
            Ok(metadata) if !metadata_is_unsafe(&metadata) && metadata.is_dir() => {
                collect_directory_entries(
                    &subagents,
                    Path::new("subagents"),
                    true,
                    &mut selector,
                    &mut discovery,
                );
            }
            Ok(_) | Err(_) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
            }
        },
        Err(error) if error.kind() == io::ErrorKind::NotFound => {}
        Err(_) => {
            discovery.files.skipped = discovery.files.skipped.saturating_add(1);
            discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
            discovery.unsafe_storage = true;
        }
    }

    let (targets, sampling) = selector.finish();
    discovery.files.considered = sampling.discovered_files;
    discovery.files.sampled_out = sampling.sampled_out_files;
    discovery.sampling = sampling;
    discovery.targets = targets;
    discovery
}

#[derive(Debug)]
struct CandidateSelector {
    max_files: usize,
    max_bytes: u64,
    targets: Vec<FileTarget>,
    discovered_files: u64,
    discovered_bytes: u64,
}

impl CandidateSelector {
    fn new(limits: MeasurementLimits) -> Self {
        Self {
            max_files: limits.max_files,
            max_bytes: limits.max_bytes,
            targets: Vec::with_capacity(limits.max_files),
            discovered_files: 0,
            discovered_bytes: 0,
        }
    }

    fn consider(&mut self, target: FileTarget) {
        let size = target.opened_signature.len;
        self.discovered_files = self.discovered_files.saturating_add(1);
        self.discovered_bytes = self.discovered_bytes.saturating_add(size);
        // A file larger than the total byte budget can never be selected. Do
        // not let it consume one of the bounded recent-file slots.
        if size > self.max_bytes {
            return;
        }
        if self.targets.len() < self.max_files {
            self.targets.push(target);
            return;
        }
        let Some(worst_index) = self
            .targets
            .iter()
            .enumerate()
            .max_by(|(_, left), (_, right)| compare_targets(left, right))
            .map(|(index, _)| index)
        else {
            return;
        };
        if compare_targets(&target, &self.targets[worst_index]).is_lt() {
            self.targets[worst_index] = target;
        }
    }

    fn finish(mut self) -> (Vec<FileTarget>, SamplingReport) {
        self.targets.sort_by(compare_targets);
        let mut selected = Vec::with_capacity(self.targets.len());
        let mut planned_bytes = 0u64;
        for target in self.targets {
            let size = target.opened_signature.len;
            let remaining = self.max_bytes.saturating_sub(planned_bytes);
            if size <= remaining {
                planned_bytes = planned_bytes.saturating_add(size);
                selected.push(target);
            }
        }
        let selected_files = u64_from_usize(selected.len());
        let sampled_out_files = self.discovered_files.saturating_sub(selected_files);
        let sampled_out_bytes = self.discovered_bytes.saturating_sub(planned_bytes);
        (
            selected,
            SamplingReport {
                max_files: u64_from_usize(self.max_files),
                max_bytes: self.max_bytes,
                discovered_files: self.discovered_files,
                selected_files,
                sampled_out_files,
                discovered_bytes: self.discovered_bytes,
                planned_bytes,
                scanned_bytes: 0,
                sampled_out_bytes,
                unscanned_selected_bytes: 0,
            },
        )
    }
}

fn compare_targets(left: &FileTarget, right: &FileTarget) -> std::cmp::Ordering {
    right
        .opened_signature
        .modified
        .cmp(&left.opened_signature.modified)
        .then_with(|| left.path.cmp(&right.path))
}

fn collect_directory_entries(
    directory: &CapDir,
    scope: &Path,
    is_subagents: bool,
    selector: &mut CandidateSelector,
    discovery: &mut Discovery,
) {
    let iterator = match directory.entries() {
        Ok(iterator) => iterator,
        Err(_) => {
            discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
            discovery.unsafe_storage = true;
            if is_subagents {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
            }
            return;
        }
    };
    for entry in iterator {
        let entry = match entry {
            Ok(entry) => entry,
            Err(_) => {
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
        };
        let name = entry.file_name();
        if !is_subagents && name == OsStr::new("subagents") {
            continue;
        }
        if !is_active_jsonl_name(&name) {
            // Sidecars, archives, temporary files, and normal metadata are
            // outside the active-session candidate set, not skipped inputs.
            continue;
        }

        let file_type = match entry.file_type() {
            Ok(file_type) => file_type,
            Err(_) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
        };
        if file_type.is_symlink() || !file_type.is_file() {
            discovery.files.skipped = discovery.files.skipped.saturating_add(1);
            discovery.unsafe_storage = true;
            continue;
        }
        let metadata = match entry.full_metadata() {
            Ok(metadata) => metadata,
            Err(_) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
        };
        let discovery_signature = match discovery_signature_from_metadata(&metadata) {
            Ok(Some(signature)) => signature,
            Ok(None) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
            Err(_) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
        };

        // The handle is opened relative to the already-held directory
        // capability. The selector uses this handle's signature, never the
        // pathname metadata, as the file's size or identity.
        let file = match open_child_read_only(directory, &name) {
            Ok(file) => file,
            Err(_) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
        };
        let opened_signature = match file_signature_from_handle(&file) {
            Ok(Some(signature)) => signature,
            Ok(None) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
            Err(_) => {
                discovery.files.skipped = discovery.files.skipped.saturating_add(1);
                discovery.files.unreadable = discovery.files.unreadable.saturating_add(1);
                discovery.unsafe_storage = true;
                continue;
            }
        };
        if !discovery_signature_matches_opened(discovery_signature, opened_signature) {
            discovery.files.skipped = discovery.files.skipped.saturating_add(1);
            discovery.unsafe_storage = true;
            continue;
        }
        if opened_signature.len > MAX_SESSION_FILE_BYTES {
            // The per-file cap is a discovery rejection, not a selected file
            // that was later skipped. It must not enter sampling accounting.
            discovery.files.skipped = discovery.files.skipped.saturating_add(1);
            discovery.files.limit_hit = discovery.files.limit_hit.saturating_add(1);
            continue;
        }

        selector.consider(FileTarget {
            path: scope.join(Path::new(&name)),
            file,
            discovery_signature,
            opened_signature,
        });
    }
}

fn is_active_jsonl_name(name: &OsStr) -> bool {
    let Some(name) = name.to_str() else {
        return false;
    };
    let Some(id) = name.strip_suffix(".jsonl") else {
        return false;
    };
    !id.is_empty()
        && id
            .bytes()
            .all(|byte| byte.is_ascii_alphanumeric() || byte == b'_' || byte == b'-')
}

#[cfg(any(unix, windows))]
fn open_root_directory(root: &Path) -> io::Result<CapDir> {
    use std::path::Component;

    let mut components = root.components();
    #[cfg(unix)]
    let mut directory = {
        if !matches!(components.next(), Some(Component::RootDir)) {
            return Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                "session root must be an absolute directory path",
            ));
        }
        CapDir::open_ambient_dir(Path::new("/"), ambient_authority())?
    };
    #[cfg(windows)]
    let mut directory = {
        let Some(Component::Prefix(prefix)) = components.next() else {
            return Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                "session root must be an absolute directory path",
            ));
        };
        if !matches!(components.next(), Some(Component::RootDir)) {
            return Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                "session root must be an absolute directory path",
            ));
        }
        let mut anchor = PathBuf::from(prefix.as_os_str());
        anchor.push(Path::new("\\"));
        CapDir::open_ambient_dir(anchor, ambient_authority())?
    };

    validate_directory_handle(&directory)?;
    let mut component_count = 0usize;
    for component in components {
        let Component::Normal(name) = component else {
            return Err(io::Error::new(
                io::ErrorKind::InvalidInput,
                "session root contains an unsafe path component",
            ));
        };
        directory = open_directory_child_nofollow(&directory, name)?;
        component_count = component_count.saturating_add(1);
    }
    if component_count == 0 {
        return Err(io::Error::new(
            io::ErrorKind::InvalidInput,
            "session root must have a final directory name",
        ));
    }
    Ok(directory)
}

#[cfg(any(unix, windows))]
fn open_directory_child_nofollow(parent: &CapDir, name: &OsStr) -> io::Result<CapDir> {
    let directory = parent.open_dir_nofollow(Path::new(name))?;
    validate_directory_handle(&directory)?;
    Ok(directory)
}

#[cfg(any(unix, windows))]
fn validate_directory_handle(directory: &CapDir) -> io::Result<()> {
    let metadata = directory.dir_metadata()?;
    if metadata_is_unsafe(&metadata) || !metadata.is_dir() {
        return Err(io::Error::new(
            io::ErrorKind::InvalidInput,
            "session root is not a safe directory",
        ));
    }
    Ok(())
}

#[cfg(not(any(unix, windows)))]
fn open_root_directory(_root: &Path) -> io::Result<CapDir> {
    Err(io::Error::new(
        io::ErrorKind::Unsupported,
        "offline measurement requires no-follow directory capabilities on this platform",
    ))
}

fn open_child_read_only(directory: &CapDir, name: &OsStr) -> io::Result<CapFile> {
    let mut options = CapOpenOptions::new();
    options.read(true).follow(FollowSymlinks::No);
    directory.open_with(Path::new(name), &options)
}

pub(super) fn scan_file(target: &FileTarget, model: &str) -> FileScanResult {
    let expected_bytes = target.opened_signature.len;
    let before = match file_signature_from_handle(&target.file) {
        Ok(Some(signature)) => signature,
        Ok(None) => {
            return FileScanResult::Unstable {
                bytes: expected_bytes,
            };
        }
        Err(_) => {
            return FileScanResult::Unreadable {
                bytes: expected_bytes,
            };
        }
    };

    // Do not scan a handle whose identity, size, or timestamp changed after
    // discovery. In particular, a growth is rejected before any new bytes can
    // enter the aggregate budget.
    if !discovery_signature_matches_opened(target.discovery_signature, before)
        || !signature_is_unchanged(target.opened_signature, Some(before))
        || before.len > MAX_SESSION_FILE_BYTES
    {
        return FileScanResult::Unstable {
            bytes: expected_bytes,
        };
    }

    let mut aggregate = FileAggregate::default();
    if scan_file_lines(&target.file, before.len, model, &mut aggregate).is_err() {
        return FileScanResult::Unreadable {
            bytes: expected_bytes,
        };
    }

    let after = match file_signature_from_handle(&target.file) {
        Ok(Some(signature)) => signature,
        Ok(None) => {
            return FileScanResult::Unstable {
                bytes: expected_bytes,
            };
        }
        Err(_) => {
            return FileScanResult::Unreadable {
                bytes: expected_bytes,
            };
        }
    };
    if !discovery_signature_matches_opened(target.discovery_signature, after)
        || !signature_is_unchanged(before, Some(after))
    {
        return FileScanResult::Unstable {
            bytes: expected_bytes,
        };
    }
    FileScanResult::Scanned {
        aggregate: Box::new(aggregate),
        bytes: before.len,
    }
}

fn signature_is_unchanged(before: FileSignature, after: Option<FileSignature>) -> bool {
    after == Some(before)
}

#[derive(Debug)]
struct BoundedLine {
    bytes: Vec<u8>,
    oversized: bool,
}

fn read_bounded_line<R: BufRead>(
    reader: &mut R,
    max_bytes: usize,
) -> io::Result<Option<BoundedLine>> {
    let mut bytes = Vec::with_capacity(max_bytes.min(8192));
    let mut length = 0usize;
    let mut saw_bytes = false;
    let mut oversized = false;

    loop {
        let buffer = reader.fill_buf()?;
        if buffer.is_empty() {
            if !saw_bytes {
                return Ok(None);
            }
            return Ok(Some(BoundedLine { bytes, oversized }));
        }

        let newline = buffer.iter().position(|byte| *byte == b'\n');
        let consumed = newline.map_or(buffer.len(), |index| index.saturating_add(1));
        let content_len = newline.unwrap_or(buffer.len());
        if !oversized {
            let Some(next_length) = length.checked_add(content_len) else {
                oversized = true;
                bytes.clear();
                length = max_bytes.saturating_add(1);
                reader.consume(consumed);
                saw_bytes = true;
                if newline.is_some() {
                    return Ok(Some(BoundedLine { bytes, oversized }));
                }
                continue;
            };
            if next_length > max_bytes {
                oversized = true;
                bytes.clear();
                length = max_bytes.saturating_add(1);
            } else {
                bytes.extend_from_slice(&buffer[..consumed]);
                length = next_length;
            }
        }
        reader.consume(consumed);
        saw_bytes = true;
        if newline.is_some() {
            return Ok(Some(BoundedLine { bytes, oversized }));
        }
    }
}

fn file_signature_from_handle(file: &CapFile) -> io::Result<Option<FileSignature>> {
    let metadata = file.metadata()?;
    if metadata_is_unsafe(&metadata)
        || !metadata.file_type().is_file()
        || has_unexpected_hard_links(&metadata)
    {
        return Ok(None);
    }
    #[cfg(any(unix, windows))]
    {
        use cap_fs_ext::MetadataExt;
        Ok(Some(FileSignature {
            len: metadata.len(),
            modified: metadata.modified()?.into_std(),
            dev: metadata.dev(),
            ino: metadata.ino(),
            nlink: metadata.nlink(),
        }))
    }
    #[cfg(not(any(unix, windows)))]
    {
        Err(io::Error::new(
            io::ErrorKind::Unsupported,
            "offline measurement requires stable file identity on this platform",
        ))
    }
}

fn metadata_is_unsafe(metadata: &CapMetadata) -> bool {
    if metadata.file_type().is_symlink() {
        return true;
    }
    #[cfg(windows)]
    {
        use cap_fs_ext::OsMetadataExt;
        const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x400;
        metadata.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT != 0
    }
    #[cfg(not(windows))]
    {
        false
    }
}

fn has_unexpected_hard_links(metadata: &CapMetadata) -> bool {
    #[cfg(any(unix, windows))]
    {
        use cap_fs_ext::MetadataExt;
        metadata.nlink() != 1
    }
    #[cfg(not(any(unix, windows)))]
    {
        let _ = metadata;
        true
    }
}

fn discovery_signature_from_metadata(
    metadata: &CapMetadata,
) -> io::Result<Option<DiscoverySignature>> {
    if metadata_is_unsafe(metadata) || !metadata.is_file() {
        return Ok(None);
    }
    let modified = metadata.modified()?.into_std();
    #[cfg(any(unix, windows))]
    {
        use cap_fs_ext::MetadataExt;
        let nlink = metadata.nlink();
        if nlink != 1 {
            return Ok(None);
        }
        Ok(Some(DiscoverySignature {
            len: metadata.len(),
            modified,
            dev: metadata.dev(),
            ino: metadata.ino(),
            nlink,
        }))
    }
    #[cfg(not(any(unix, windows)))]
    {
        Err(io::Error::new(
            io::ErrorKind::Unsupported,
            "offline measurement requires stable file identity on this platform",
        ))
    }
}

fn discovery_signature_matches_opened(
    discovery: DiscoverySignature,
    opened: FileSignature,
) -> bool {
    if discovery.len != opened.len || discovery.modified != opened.modified {
        return false;
    }
    #[cfg(any(unix, windows))]
    {
        discovery.dev == opened.dev
            && discovery.ino == opened.ino
            && discovery.nlink == opened.nlink
    }
    #[cfg(not(any(unix, windows)))]
    {
        false
    }
}

fn scan_file_lines(
    file: &CapFile,
    snapshot_len: u64,
    model: &str,
    aggregate: &mut FileAggregate,
) -> io::Result<()> {
    let bounded_file = file
        .try_clone()?
        .take(snapshot_len.min(MAX_SESSION_FILE_BYTES));
    let mut reader = BufReader::new(bounded_file);
    for _ in 0..MAX_JSONL_LINES {
        let Some(line) = read_bounded_line(&mut reader, MAX_JSONL_LINE_BYTES)? else {
            return Ok(());
        };
        aggregate.jsonl.lines = aggregate.jsonl.lines.saturating_add(1);
        if line.oversized {
            aggregate.jsonl.oversized = aggregate.jsonl.oversized.saturating_add(1);
            aggregate.limit_hit = true;
            continue;
        }
        codecs::process_jsonl_line(&line.bytes, model, aggregate);
    }
    if !reader.fill_buf()?.is_empty() {
        aggregate.jsonl.limit_hit = aggregate.jsonl.limit_hit.saturating_add(1);
        aggregate.limit_hit = true;
    }
    Ok(())
}