gemel 0.2.0

Evidence-native version control for agentic software development: canonical object encoding, content-addressed identity, immutable object store, change workflow, and CLI.
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
//! The change workflow (SPECIFICATION.md Phase 1; brief §42).
//!
//! `gemel change begin` opens a pending change (workspace metadata); `gemel
//! change finish` computes the resulting state from the working tree,
//! synthesizes operations from the delta, records claims/evidence/residuals,
//! creates the Change, and advances the Trajectory — all under one journaled
//! ref transaction. Human names (`I<n>`, `T<n>`, `C<n>`, `S<n>`) are
//! registered in the ref namespace; identities remain content-addressed.

use crate::content;
use crate::family::Family;
use crate::gid::Gid;
use crate::ignore::Ignore;
use crate::store::refs::{RefOp, RefTransaction};
use crate::store::{now_ms, Error, Repo, REF_HEAD, REF_NAMES, REF_STATE_HEAD, REF_TRAJECTORIES};
use crate::value::{Field, Object, Value};
use std::path::PathBuf;

/// The default workspace id (Phase 1 has one workspace per repository).
pub const DEFAULT_WORKSPACE: &str = "default";

/// The pending-change record schema.
pub const PENDING_SCHEMA: &str = "gemel.pending.v1";

fn f(tag: u8, value: Value) -> Field {
    Field::new(tag, value)
}
fn arr(vals: Vec<Value>) -> Value {
    Value::Array(vals)
}
fn s(v: &str) -> Value {
    Value::Str(v.to_string())
}

// ---------------------------------------------------------------------------
// Workspace metadata
// ---------------------------------------------------------------------------

/// The workspace metadata directory.
pub fn workspace_dir(repo: &Repo) -> PathBuf {
    repo.meta_dir().join("worktrees").join(DEFAULT_WORKSPACE)
}

/// The state the workspace is currently materialized from, if any.
pub fn workspace_state(repo: &Repo) -> Result<Option<Gid>, Error> {
    let path = workspace_dir(repo).join("state.ref");
    match std::fs::read_to_string(&path) {
        Ok(text) => text
            .trim()
            .parse::<Gid>()
            .map(Some)
            .map_err(|e| Error::RefCorrupt {
                name: "worktree state.ref".into(),
                detail: e.to_string(),
            }),
        Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(None),
        Err(e) => Err(e.into()),
    }
}

/// Updates the workspace's materialized state (caller holds the writer lock).
pub fn set_workspace_state(repo: &Repo, gid: Gid) -> Result<(), Error> {
    let dir = workspace_dir(repo);
    std::fs::create_dir_all(&dir)?;
    crate::store::objects::write_atomic(
        &dir.join("state.ref"),
        &format!("{}\n", gid).into_bytes(),
    )?;
    Ok(())
}

/// The pending change record, if any.
pub fn read_pending(repo: &Repo) -> Result<Option<serde_json::Value>, Error> {
    let path = workspace_dir(repo).join("pending.json");
    match std::fs::read_to_string(&path) {
        Ok(text) => serde_json::from_str(&text)
            .map(Some)
            .map_err(|e| Error::Invalid(format!("pending.json: {e}"))),
        Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(None),
        Err(e) => Err(e.into()),
    }
}

fn write_pending(repo: &Repo, value: &serde_json::Value) -> Result<(), Error> {
    let dir = workspace_dir(repo);
    std::fs::create_dir_all(&dir)?;
    let mut bytes = serde_json::to_vec_pretty(value).map_err(|e| Error::Invalid(e.to_string()))?;
    bytes.push(b'\n');
    crate::store::objects::write_atomic(&dir.join("pending.json"), &bytes)?;
    Ok(())
}

// ---------------------------------------------------------------------------
// Names and counters
// ---------------------------------------------------------------------------

fn next_name(repo: &Repo, kind: &str) -> Result<String, Error> {
    let mut meta = repo.read_meta()?;
    let n = meta["counters"][kind].as_u64().unwrap_or(0) + 1;
    meta["counters"][kind] = serde_json::json!(n);
    repo.write_meta(&meta)?;
    let prefix = match kind {
        "intent" => "I",
        "trajectory" => "T",
        "change" => "C",
        "state" => "S",
        _ => return Err(Error::Invalid(format!("unknown counter {kind}"))),
    };
    Ok(format!("{prefix}{n}"))
}

/// Registers a human name under a namespace (caller holds the writer lock).
fn register_name(repo: &Repo, namespace: &str, name: &str, gid: Gid) -> Result<(), Error> {
    let ops = vec![RefOp::set(&format!("{namespace}/{name}"), gid)];
    repo.apply_refs_unlocked(&RefTransaction { ops })
}

/// The name registered for `gid` in a namespace, if any.
pub fn name_in_namespace(repo: &Repo, namespace: &str, gid: &Gid) -> Result<Option<String>, Error> {
    let prefix = format!("{namespace}/");
    for (name, target) in repo.all_refs()? {
        if let Some(short) = name.strip_prefix(&prefix) {
            if &target == gid {
                return Ok(Some(short.to_string()));
            }
        }
    }
    Ok(None)
}

// ---------------------------------------------------------------------------
// change begin
// ---------------------------------------------------------------------------

/// Options for `change begin`.
#[derive(Debug, Clone, Default)]
pub struct BeginOptions {
    /// Explicit input state (default: workspace state, then head state).
    pub from_state: Option<Gid>,
    /// Existing intent to pursue.
    pub intent: Option<Gid>,
    /// Creates a new intent with this summary.
    pub intent_summary: Option<String>,
    /// Producer identity (default: repository default producer).
    pub producer: Option<Gid>,
}

/// The outcome of `change begin`.
#[derive(Debug, Clone)]
pub struct BeginOutcome {
    pub input_state: Option<Gid>,
    pub intent: Option<Gid>,
    pub intent_name: Option<String>,
    pub producer: Gid,
    pub started_at: i64,
}

/// Opens a pending change.
pub fn begin_change(repo: &Repo, opts: &BeginOptions) -> Result<BeginOutcome, Error> {
    repo.with_write_lock(|| {
        if read_pending(repo)?.is_some() {
            return Err(Error::PendingChangeAlreadyExists);
        }
        let input_state = match opts.from_state {
            Some(g) => Some(g),
            None => match workspace_state(repo)? {
                Some(g) => Some(g),
                None => repo.read_ref(REF_STATE_HEAD)?,
            },
        };
        let producer = match opts.producer {
            Some(g) => g,
            None => repo.read_meta()?["default_producer"]
                .as_str()
                .ok_or_else(|| Error::Invalid("meta.json has no default_producer".into()))?
                .parse::<Gid>()
                .map_err(|e| Error::Invalid(e.to_string()))?,
        };
        // Intent: explicit, or create from the summary.
        let (intent, intent_name) = match (opts.intent, &opts.intent_summary) {
            (Some(g), _) => (Some(g), None),
            (None, Some(summary)) => {
                let obj = Object::fields(
                    Family::Intent,
                    vec![
                        f(0x01, s(summary)),
                        f(0x0B, Value::Gid(producer)),
                        f(0x0C, Value::I(now_ms())),
                    ],
                );
                let gid = repo.insert_object(&obj)?;
                let name = next_name(repo, "intent")?;
                register_name(repo, REF_NAMES, &name, gid)?;
                (Some(gid), Some(name))
            }
            (None, None) => (None, None),
        };
        let pending = serde_json::json!({
            "schema": PENDING_SCHEMA,
            "input_state": input_state.map(|g| g.to_string()),
            "intent": intent.map(|g| g.to_string()),
            "producer": producer.to_string(),
            "started_at": now_ms(),
        });
        write_pending(repo, &pending)?;
        Ok(BeginOutcome {
            input_state,
            intent,
            intent_name,
            producer,
            started_at: pending["started_at"].as_i64().unwrap_or(0),
        })
    })
}

// ---------------------------------------------------------------------------
// change finish
// ---------------------------------------------------------------------------

/// A basic claim specification for `change finish`.
#[derive(Debug, Clone)]
pub struct ClaimSpec {
    pub subject: Option<String>,
    pub predicate: String,
    pub kind: String,
}

/// A basic evidence specification for `change finish`.
#[derive(Debug, Clone)]
pub struct EvidenceSpec {
    pub subject: Option<String>,
    pub outcome: String,
    pub kind: String,
}

/// A basic residual specification for `change finish`.
#[derive(Debug, Clone)]
pub struct ResidualSpec {
    pub summary: String,
    pub classification: String,
    pub severity: String,
}

/// Options for `change finish`.
#[derive(Debug, Clone, Default)]
pub struct FinishOptions {
    pub summary: String,
    pub claims: Vec<ClaimSpec>,
    pub evidence: Vec<EvidenceSpec>,
    pub residuals: Vec<ResidualSpec>,
}

/// The outcome of `change finish`.
#[derive(Debug, Clone)]
pub struct FinishOutcome {
    pub change: Gid,
    pub change_name: String,
    pub trajectory: Gid,
    pub trajectory_name: String,
    pub state: Gid,
    pub state_name: String,
    pub operations: Vec<Gid>,
    pub claims: Vec<Gid>,
    pub evidence: Vec<Gid>,
    pub residuals: Vec<Gid>,
    pub is_new_trajectory: bool,
}

/// Finishes the pending change (SPECIFICATION.md Phase 1 demo:
/// State S0 → Intent I1 → Trajectory T1 → Change C1 → State S1).
pub fn finish_change(repo: &Repo, opts: &FinishOptions) -> Result<FinishOutcome, Error> {
    // Fast-fail when nothing is pending.
    if read_pending(repo)?.is_none() {
        return Err(Error::NoPendingChange);
    }

    // Build the resulting state from the working tree (lock-free inserts).
    let ignore = Ignore::from_root(repo.root());
    let snapshot = content::build_state(repo, repo.root(), &ignore)?;
    let resulting_state = snapshot.state;

    repo.with_write_lock(|| {
        let pending = read_pending(repo)?
            .ok_or_else(|| Error::Invalid("pending change disappeared mid-finish".into()))?;
        let input_state: Option<Gid> = pending["input_state"]
            .as_str()
            .map(|s| s.parse::<Gid>())
            .transpose()
            .map_err(|e| Error::Invalid(e.to_string()))?;
        let intent: Option<Gid> = pending["intent"]
            .as_str()
            .map(|s| s.parse::<Gid>())
            .transpose()
            .map_err(|e| Error::Invalid(e.to_string()))?;
        let producer: Gid = pending["producer"]
            .as_str()
            .ok_or_else(|| Error::Invalid("pending has no producer".into()))?
            .parse::<Gid>()
            .map_err(|e| Error::Invalid(e.to_string()))?;

        // File-level delta and operations.
        let operations = match &input_state {
            Some(base) => {
                let deltas = content::diff_states(repo, base, &resulting_state)?;
                content::synthesize_operations(repo, &deltas, &producer)?
            }
            None => {
                // Initial change from an empty base: synthesize creates for
                // every working-tree file from the snapshot we just built.
                let st = repo.load(&resulting_state)?;
                let tree = st
                    .field_sequence()
                    .and_then(|fs| fs.iter().find(|f| f.tag == 0x01))
                    .and_then(|f| match &f.value {
                        Value::Gid(g) => Some(*g),
                        _ => None,
                    })
                    .ok_or_else(|| Error::Invalid("state has no root_tree".into()))?;
                let files = content::flatten_tree(repo, &tree)?;
                synthesize_creates(repo, files, &producer)?
            }
        };

        // Claims, evidence, residuals (basic support).
        let mut claim_ids = Vec::new();
        let mut evidence_ids = Vec::new();
        for spec in &opts.evidence {
            // Field tags in strict ascending order (0x01, 0x02, [0x03], 0x0D,
            // 0x10).
            let mut fields = vec![f(0x01, Value::Gid(producer)), f(0x02, s(&spec.kind))];
            if let Some(subject) = &spec.subject {
                fields.push(f(0x03, s(subject)));
            }
            fields.push(f(0x0D, Value::Record(vec![f(0x01, s(&spec.outcome))])));
            fields.push(f(0x10, Value::I(now_ms())));
            evidence_ids.push(repo.insert_object(&Object::fields(Family::Evidence, fields))?);
        }
        for spec in &opts.claims {
            // Field tags in strict ascending order ([0x01], 0x03, 0x04, 0x07,
            // [0x08], 0x0E).
            let mut fields = Vec::new();
            if let Some(subject) = &spec.subject {
                fields.push(f(0x01, s(subject)));
            }
            fields.push(f(0x03, s(&spec.predicate)));
            fields.push(f(0x04, s(&spec.kind)));
            fields.push(f(0x07, Value::Gid(producer)));
            // Basic linking: a claim links to evidence with the same
            // subject produced by this change.
            if let Some(subject) = &spec.subject {
                let matched: Vec<Value> = opts
                    .evidence
                    .iter()
                    .zip(evidence_ids.iter())
                    .filter(|(e, _)| e.subject.as_deref() == Some(subject.as_str()))
                    .map(|(_, id)| Value::Gid(*id))
                    .collect();
                if !matched.is_empty() {
                    fields.push(f(0x08, arr(matched)));
                }
            }
            fields.push(f(0x0E, Value::I(now_ms())));
            claim_ids.push(repo.insert_object(&Object::fields(Family::Claim, fields))?);
        }
        let mut residual_ids = Vec::new();
        for spec in &opts.residuals {
            // Field tags in strict ascending order (0x02, 0x03, 0x04, [0x06],
            // [0x08], 0x0C).
            let mut fields = vec![
                f(0x02, s(&spec.summary)),
                f(0x03, s(&spec.classification)),
                f(0x04, s(&spec.severity)),
            ];
            if let (Some(last_evidence), Some(last_claim)) = (evidence_ids.last(), claim_ids.last())
            {
                fields.push(f(0x06, arr(vec![Value::Gid(*last_claim)])));
                fields.push(f(0x08, Value::Gid(*last_evidence)));
            }
            fields.push(f(0x0C, Value::I(now_ms())));
            residual_ids.push(repo.insert_object(&Object::fields(Family::Residual, fields))?);
        }

        // Causal parent: chain off head when the change's input equals the
        // head's resulting state.
        let mut causal_parents = Vec::new();
        if let Some(head) = repo.read_ref(REF_HEAD)? {
            if let Ok(head_obj) = repo.load(&head) {
                if let Some(Value::Gid(hrs)) = head_obj
                    .field_sequence()
                    .and_then(|fs| fs.iter().find(|f| f.tag == 0x05).map(|f| &f.value))
                {
                    if Some(*hrs) == input_state {
                        causal_parents.push(Value::Gid(head));
                    }
                }
            }
        }

        // Trajectory: continue the most recent trajectory with the same
        // intent, else create a new one.
        let meta = repo.read_meta()?;
        let last_t: u64 = meta["counters"]["trajectory"].as_u64().unwrap_or(0);
        let (trajectory_previous, base_state, is_new) = if last_t > 0 {
            let latest = repo.read_ref(&format!("{REF_TRAJECTORIES}/T{last_t}"))?;
            match latest {
                Some(gid) => {
                    let obj = repo.load(&gid)?;
                    let traj_intent = obj
                        .field_sequence()
                        .and_then(|fs| fs.iter().find(|f| f.tag == 0x02))
                        .and_then(|f| match &f.value {
                            Value::Gid(g) => Some(*g),
                            _ => None,
                        });
                    let same_intent = traj_intent == intent;
                    if same_intent {
                        let base = obj
                            .field_sequence()
                            .and_then(|fs| fs.iter().find(|f| f.tag == 0x03))
                            .and_then(|f| match &f.value {
                                Value::Gid(g) => Some(*g),
                                _ => None,
                            });
                        (Some(gid), base, false)
                    } else {
                        (None, input_state, true)
                    }
                }
                None => (None, input_state, true),
            }
        } else {
            (None, input_state, true)
        };

        // The Change object. Field tags in strict ascending order:
        // 0x01, [0x02], [0x03], [0x04], 0x05, 0x06, [0x0C], [0x0D], [0x0E],
        // [0x11], 0x15.
        let mut change_fields = vec![f(
            0x01,
            s(if opts.summary.is_empty() {
                "change"
            } else {
                opts.summary.as_str()
            }),
        )];
        if let Some(intent) = intent {
            change_fields.push(f(0x02, Value::Gid(intent)));
        }
        if let Some(input) = input_state {
            change_fields.push(f(0x03, Value::Gid(input)));
        }
        if !operations.is_empty() {
            change_fields.push(f(
                0x04,
                arr(operations.iter().copied().map(Value::Gid).collect()),
            ));
        }
        change_fields.push(f(0x05, Value::Gid(resulting_state)));
        change_fields.push(f(0x06, Value::Gid(producer)));
        if !claim_ids.is_empty() {
            change_fields.push(f(
                0x0C,
                arr(claim_ids.iter().copied().map(Value::Gid).collect()),
            ));
        }
        if !evidence_ids.is_empty() {
            change_fields.push(f(
                0x0D,
                arr(evidence_ids.iter().copied().map(Value::Gid).collect()),
            ));
        }
        if !residual_ids.is_empty() {
            change_fields.push(f(
                0x0E,
                arr(residual_ids.iter().copied().map(Value::Gid).collect()),
            ));
        }
        if !causal_parents.is_empty() {
            change_fields.push(f(0x11, arr(causal_parents)));
        }
        change_fields.push(f(0x15, Value::I(now_ms())));
        let change = repo.insert_object(&Object::fields(Family::Change, change_fields))?;

        // The Trajectory object. Field tags in strict ascending order:
        // [0x01], [0x02], [0x03], 0x04, 0x06, [0x08], [0x09], 0x0D, 0x0E.
        let mut traj_fields = Vec::new();
        if let Some(prev) = trajectory_previous {
            traj_fields.push(f(0x01, Value::Gid(prev)));
        }
        if let Some(intent) = intent {
            traj_fields.push(f(0x02, Value::Gid(intent)));
        }
        if let Some(base) = base_state {
            traj_fields.push(f(0x03, Value::Gid(base)));
        }
        traj_fields.push(f(0x04, Value::Gid(producer)));
        traj_fields.push(f(0x06, arr(vec![Value::Gid(change)])));
        if !evidence_ids.is_empty() {
            traj_fields.push(f(
                0x08,
                arr(evidence_ids.iter().copied().map(Value::Gid).collect()),
            ));
        }
        if !residual_ids.is_empty() {
            traj_fields.push(f(
                0x09,
                arr(residual_ids.iter().copied().map(Value::Gid).collect()),
            ));
        }
        traj_fields.push(f(0x0D, Value::I(now_ms())));
        traj_fields.push(f(0x0E, Value::I(now_ms())));
        let trajectory = repo.insert_object(&Object::fields(Family::Trajectory, traj_fields))?;

        // Names + counters + refs, one journaled transaction.
        let change_name = next_name(repo, "change")?;
        let state_name = next_name(repo, "state")?;
        let trajectory_name = if is_new {
            next_name(repo, "trajectory")?
        } else {
            format!("T{last_t}")
        };
        let ops = vec![
            RefOp::set(REF_HEAD, change),
            RefOp::set(REF_STATE_HEAD, resulting_state),
            RefOp::set(&format!("{REF_NAMES}/{change_name}"), change),
            RefOp::set(&format!("{REF_NAMES}/{state_name}"), resulting_state),
            RefOp::set(&format!("{REF_TRAJECTORIES}/{trajectory_name}"), trajectory),
            RefOp::set(&format!("{REF_TRAJECTORIES}/current"), trajectory),
        ];
        repo.apply_refs_unlocked(&RefTransaction { ops })?;

        // Workspace now materializes the resulting state.
        set_workspace_state(repo, resulting_state)?;

        // Clear the pending change.
        let pending_path = workspace_dir(repo).join("pending.json");
        match std::fs::remove_file(&pending_path) {
            Ok(()) => {}
            Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
            Err(e) => return Err(e.into()),
        }

        Ok(FinishOutcome {
            change,
            change_name,
            trajectory,
            trajectory_name,
            state: resulting_state,
            state_name,
            operations,
            claims: claim_ids,
            evidence: evidence_ids,
            residuals: residual_ids,
            is_new_trajectory: is_new,
        })
    })
}

/// Synthesizes create operations for a set of (path, (mode, blob)) files
/// (used for the initial change from an empty base).
fn synthesize_creates(
    repo: &Repo,
    files: std::collections::HashMap<String, (u64, Gid)>,
    producer: &Gid,
) -> Result<Vec<Gid>, Error> {
    let ts = Value::I(now_ms());
    let mut files: Vec<(String, (u64, Gid))> = files.into_iter().collect();
    files.sort();
    let mut out = Vec::new();
    for (path, (_mode, blob)) in files {
        let fields = vec![
            f(0x01, s("create_file")),
            f(0x02, s(&path)),
            f(0x05, arr(vec![Value::Gid(blob)])),
            f(0x06, Value::Record(vec![f(0x01, s("ok"))])),
            f(0x07, Value::Gid(*producer)),
            f(0x09, ts.clone()),
            f(0x0A, ts.clone()),
            f(0x11, Value::Gid(blob)),
        ];
        out.push(repo.insert_object(&Object::fields(Family::Operation, fields))?);
    }
    Ok(out)
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::store::testing::fresh_repo;

    #[test]
    fn counters_and_names() {
        let (repo, _) = fresh_repo("names2");
        repo.with_write_lock(|| {
            assert_eq!(next_name(&repo, "change").unwrap(), "C1");
            assert_eq!(next_name(&repo, "change").unwrap(), "C2");
            assert_eq!(next_name(&repo, "intent").unwrap(), "I1");
            assert_eq!(next_name(&repo, "trajectory").unwrap(), "T1");
            assert_eq!(next_name(&repo, "state").unwrap(), "S1");
            Ok(())
        })
        .unwrap();
    }
}