- 1474
.append_message(user_text("find the weather")) - 1475
.unwrap() - 1476
.id; - 1477
let reading = vak_intent::Reading::general(); - 1478
log.append_intent(IntentRecord { - 1479
reading, - 1480
engagement: vak_intent::Engagement::general(), - 1481
provenance: vak_intent::Provenance::new(vak_intent::Tier::General, 1, Vec::new()), - 1482
outcome: None, - 1483
model_visible: None, - 1484
commitment_id: None, - 1485
strands: Vec::new(), - 1486
strand_commitments: Default::default(), - 1487
}) - 1488
.unwrap(); - 1489
log.append_message(assistant_text("it is sunny")).unwrap(); - 1490
let index = TurnIndex::from_log(&log); - 1491
let turn = index.turn_by_id(&t1).unwrap(); - 1492
let card = turn.build_card("completed", "it is sunny".to_string(), &|s| { - 1493
s.len() as u64 / 4 - 1494
}); - 1495
assert_eq!(card.reading.act, "answer"); - 1496
} - 1497
- 1498
#[test] - 1499
fn every_ledger_activity_entry_is_ignored_by_turn_structure() { - 1500
let dir = tempfile::tempdir().unwrap(); - 1501
let mut log = open_log(dir.path()); - 1502
log.append_message(user_text("hi")).unwrap(); - 1503
log.append_activity(ActivityRecord { - 1504
activity_id: "a1".into(), - 1505
turn: None, - 1506
kind: ActivityKind::Diagnostic, - 1507
status: ActivityStatus::Succeeded, - 1508
label: "note".into(), - 1509
detail: None, - 1510
data: Default::default(), - 1511
}) - 1512
.unwrap(); - 1513
log.append_message(assistant_text("hello")).unwrap(); - 1514
let index = TurnIndex::from_log(&log); - 1515
assert_eq!(index.turns.len(), 1); - 1516
} - 1517
- 1518
#[test] - 1519
fn packets_collect_compaction_entries() { - 1520
let dir = tempfile::tempdir().unwrap(); - 1521
let mut log = open_log(dir.path()); - 1522
let t1 = log.append_message(user_text("first")).unwrap().id; - 1523
log.append_message(assistant_text("first answer")).unwrap(); - 1524
log.append(Entry::new( - 1525
log.tail_id().cloned(), - 1526
EntryPayload::Compaction(CompactionEntry { - 1527
summary: "summary text".into(), - 1528
first_turn_id: t1.clone(), - 1529
last_turn_id: t1, - 1530
model: "fixture-model".into(), - 1531
tokens_before: 100, - 1532
reset_all: false, - 1533
}), - 1534
)) - 1535
.unwrap(); - 1536
let index = TurnIndex::from_log(&log); - 1537
assert_eq!(index.packets.len(), 1); - 1538
assert_eq!(index.packets[0].summary, "summary text"); - 1539
} - 1540
} - 1541
Indexing the workspace…
Vakyartha documentation is discovering safe artifacts, anchors, and source references.