MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / seed_session_store

Function seed_session_store

tests/dashboard_api_test/analytics.rs:81–127  ·  view source on GitHub ↗
(db_path: &Path, project: &Path)

Source from the content-addressed store, hash-verified

79}
80
81async fn seed_session_store(db_path: &Path, project: &Path) {
82 let gdb = GlobalDb::open_at(db_path).await.expect("open session db");
83 assert!(gdb.upsert_session(&session(project)).await);
84
85 let rows = [
86 message(
87 "msg-1",
88 "assistant",
89 1,
90 "Using tracedecay:exploring-code before shell search.",
91 "message",
92 Some("mcp__tracedecay__tracedecay_context,mcp__tracedecay__tracedecay_search"),
93 Some(r#"{"skills":["tracedecay:exploring-code"]}"#),
94 ),
95 message(
96 "msg-2",
97 "assistant",
98 2,
99 "Falling back to rg for a literal route path.",
100 "tool_use",
101 Some("Bash,rg"),
102 None,
103 ),
104 message(
105 "msg-3",
106 "assistant",
107 3,
108 "Reading one file after indexed context.",
109 "tool_use",
110 Some("Read"),
111 None,
112 ),
113 message(
114 "msg-4",
115 "assistant",
116 4,
117 "Applying focused route edits.",
118 "tool_use",
119 Some("apply_patch"),
120 None,
121 ),
122 ];
123
124 for row in rows {
125 assert!(gdb.upsert_session_message(&row).await);
126 }
127}
128
129fn analytics_event(project_id: &str, timestamp: i64, event_kind: &str) -> AnalyticsEventInsert {
130 AnalyticsEventInsert {

Callers 1

start_fixtureFunction · 0.85

Calls 1

messageFunction · 0.70

Tested by

no test coverage detected