Skip to content

Commit ea5a0a9

Browse files
wesbillmannpub1gjuws2a2dc8z2nszprtg7v6u9q7ffeah3hgl5yx45jwn7y7aqs6s5e9xj6npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d
authored
Replace built-in personas with Fizz (#987)
Signed-off-by: Wes <[email protected]> Signed-off-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1gjuws2a2dc8z2nszprtg7v6u9q7ffeah3hgl5yx45jwn7y7aqs6s5e9xj6 <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>
1 parent 6541765 commit ea5a0a9

14 files changed

Lines changed: 278 additions & 622 deletions

File tree

‎desktop/src-tauri/src/managed_agents/personas.rs‎

Lines changed: 84 additions & 376 deletions
Large diffs are not rendered by default.

‎desktop/src-tauri/src/managed_agents/personas/tests.rs‎

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn merge_personas_adds_missing_built_ins() {
3838
.iter()
3939
.map(|record| record.display_name.as_str())
4040
.collect();
41-
assert_eq!(display_names, vec!["Solo", "Kit", "Scout"]);
41+
assert_eq!(display_names, vec!["Fizz"]);
4242
}
4343

4444
#[test]
@@ -52,7 +52,7 @@ fn merge_personas_preserves_custom_records() {
5252

5353
#[test]
5454
fn merge_personas_restores_builtin_defaults() {
55-
let mut edited_builtin = custom_persona("builtin:solo", "My Solo");
55+
let mut edited_builtin = custom_persona("builtin:fizz", "My Fizz");
5656
edited_builtin.is_builtin = true;
5757
edited_builtin.is_active = true;
5858
let original_created_at = edited_builtin.created_at.clone();
@@ -61,19 +61,19 @@ fn merge_personas_restores_builtin_defaults() {
6161
let (records, changed) = merge_personas(vec![edited_builtin], "2026-03-19T00:00:00Z");
6262

6363
assert!(changed);
64-
let solo = records
64+
let fizz = records
6565
.iter()
66-
.find(|record| record.id == "builtin:solo")
67-
.expect("solo built-in should exist");
66+
.find(|record| record.id == "builtin:fizz")
67+
.expect("fizz built-in should exist");
6868
let canonical = BUILT_IN_PERSONAS
6969
.iter()
70-
.find(|persona| persona.id == "builtin:solo")
71-
.expect("solo built-in definition should exist");
72-
assert_eq!(solo.display_name, canonical.display_name);
73-
assert_eq!(solo.avatar_url.as_deref(), canonical.avatar_url,);
74-
assert_eq!(solo.created_at, original_created_at);
75-
assert_eq!(solo.updated_at, original_updated_at);
76-
assert!(solo.is_active);
70+
.find(|persona| persona.id == "builtin:fizz")
71+
.expect("fizz built-in definition should exist");
72+
assert_eq!(fizz.display_name, canonical.display_name);
73+
assert_eq!(fizz.avatar_url.as_deref(), canonical.avatar_url,);
74+
assert_eq!(fizz.created_at, original_created_at);
75+
assert_eq!(fizz.updated_at, original_updated_at);
76+
assert!(fizz.is_active);
7777
}
7878

7979
#[test]
@@ -82,7 +82,7 @@ fn merge_personas_restores_builtin_env_vars() {
8282
// the canonical (empty) env on merge. Built-ins are intended immutable —
8383
// if a user wants per-persona credentials, they create or duplicate to a
8484
// custom persona.
85-
let mut tampered = custom_persona("builtin:solo", "Solo");
85+
let mut tampered = custom_persona("builtin:fizz", "Fizz");
8686
tampered.is_builtin = true;
8787
tampered.avatar_url = None;
8888
tampered.is_active = true;
@@ -92,48 +92,48 @@ fn merge_personas_restores_builtin_env_vars() {
9292
let (records, changed) = merge_personas(vec![tampered], "2026-03-19T00:00:00Z");
9393

9494
assert!(changed);
95-
let solo = records
95+
let fizz = records
9696
.iter()
97-
.find(|record| record.id == "builtin:solo")
98-
.expect("solo built-in should exist");
97+
.find(|record| record.id == "builtin:fizz")
98+
.expect("fizz built-in should exist");
9999
// Built-in persona definitions have no `env_vars` field — they are
100100
// always empty. The merge reset should clear the tampered key entirely.
101101
assert!(
102-
solo.env_vars.is_empty(),
102+
fizz.env_vars.is_empty(),
103103
"expected empty, got {:?}",
104-
solo.env_vars
104+
fizz.env_vars
105105
);
106106
}
107107

108108
#[test]
109109
fn merge_personas_restores_builtin_name_pool_and_preserves_is_active() {
110-
let mut solo = custom_persona("builtin:solo", "Solo");
111-
solo.is_builtin = true;
112-
solo.avatar_url = None;
113-
solo.is_active = true;
114-
solo.name_pool = vec!["Definitely Not Solo".to_string()];
110+
let mut fizz = custom_persona("builtin:fizz", "Fizz");
111+
fizz.is_builtin = true;
112+
fizz.avatar_url = None;
113+
fizz.is_active = true;
114+
fizz.name_pool = vec!["Definitely Not Fizz".to_string()];
115115

116-
let (records, changed) = merge_personas(vec![solo], "2026-03-19T00:00:00Z");
116+
let (records, changed) = merge_personas(vec![fizz], "2026-03-19T00:00:00Z");
117117

118118
assert!(changed);
119-
let solo = records
119+
let fizz = records
120120
.iter()
121-
.find(|record| record.id == "builtin:solo")
122-
.expect("solo built-in should exist");
121+
.find(|record| record.id == "builtin:fizz")
122+
.expect("fizz built-in should exist");
123123
let expected_name_pool = BUILT_IN_PERSONAS
124124
.iter()
125-
.find(|persona| persona.id == "builtin:solo")
126-
.expect("solo built-in definition should exist")
125+
.find(|persona| persona.id == "builtin:fizz")
126+
.expect("fizz built-in definition should exist")
127127
.name_pool
128128
.iter()
129129
.map(|name| (*name).to_string())
130130
.collect::<Vec<_>>();
131-
assert_eq!(solo.name_pool, expected_name_pool);
132-
assert!(solo.is_active);
131+
assert_eq!(fizz.name_pool, expected_name_pool);
132+
assert!(fizz.is_active);
133133
}
134134

135135
#[test]
136-
fn merge_personas_backfills_new_builtins_for_existing_store() {
136+
fn merge_personas_adds_fizz_and_retires_old_builtins_for_existing_store() {
137137
let mut legacy_builtins = vec![custom_persona("builtin:solo", "Solo")];
138138
for persona in &mut legacy_builtins {
139139
persona.is_builtin = true;
@@ -143,23 +143,20 @@ fn merge_personas_backfills_new_builtins_for_existing_store() {
143143
let (records, changed) = merge_personas(legacy_builtins, "2026-03-19T00:00:00Z");
144144

145145
assert!(changed);
146-
assert!(records.iter().any(|record| record.id == "builtin:kit"));
147-
assert!(records.iter().any(|record| record.id == "builtin:scout"));
148-
assert!(records.iter().any(|record| record.id == "builtin:solo"));
149-
assert!(
150-
records
151-
.iter()
152-
.find(|record| record.id == "builtin:solo")
153-
.expect("solo built-in should exist")
154-
.is_active
155-
);
156-
assert!(
157-
records
158-
.iter()
159-
.find(|record| record.id == "builtin:kit")
160-
.expect("kit built-in should exist")
161-
.is_active
162-
);
146+
let fizz = records
147+
.iter()
148+
.find(|record| record.id == "builtin:fizz")
149+
.expect("fizz built-in should exist");
150+
assert!(fizz.is_builtin);
151+
assert!(fizz.is_active);
152+
153+
let solo = records
154+
.iter()
155+
.find(|record| record.id == "builtin:solo")
156+
.expect("old solo record should be retained as retired custom persona");
157+
assert!(!solo.is_builtin);
158+
assert!(!solo.is_active);
159+
assert_eq!(solo.display_name, "Solo (retired)");
163160
}
164161

165162
#[test]
@@ -196,15 +193,15 @@ fn ensure_persona_is_active_rejects_missing_personas() {
196193

197194
#[test]
198195
fn ensure_persona_is_active_rejects_inactive_personas() {
199-
let mut persona = custom_persona("builtin:solo", "Solo");
196+
let mut persona = custom_persona("builtin:fizz", "Fizz");
200197
persona.is_builtin = true;
201198
persona.is_active = false;
202199

203-
let err = ensure_persona_is_active(&[persona], "builtin:solo").unwrap_err();
200+
let err = ensure_persona_is_active(&[persona], "builtin:fizz").unwrap_err();
204201

205202
assert_eq!(
206203
err,
207-
"Solo is not in My Agents. Choose it from Persona Catalog first."
204+
"Fizz is not in My Agents. Choose it from Persona Catalog first."
208205
);
209206
}
210207

@@ -236,33 +233,33 @@ fn validate_persona_activation_change_rejects_non_builtins() {
236233

237234
#[test]
238235
fn validate_persona_activation_change_rejects_managed_agent_references() {
239-
let mut persona = custom_persona("builtin:solo", "Solo");
236+
let mut persona = custom_persona("builtin:fizz", "Fizz");
240237
persona.is_builtin = true;
241238

242239
let err = validate_persona_activation_change(&persona, false, true, false).unwrap_err();
243240

244241
assert_eq!(
245242
err,
246-
"Solo is still assigned to a managed agent. Remove or reassign those agents first."
243+
"Fizz is still assigned to a managed agent. Remove or reassign those agents first."
247244
);
248245
}
249246

250247
#[test]
251248
fn validate_persona_activation_change_rejects_team_references() {
252-
let mut persona = custom_persona("builtin:solo", "Solo");
249+
let mut persona = custom_persona("builtin:fizz", "Fizz");
253250
persona.is_builtin = true;
254251

255252
let err = validate_persona_activation_change(&persona, false, false, true).unwrap_err();
256253

257254
assert_eq!(
258255
err,
259-
"Solo is still referenced by a team. Remove it from those teams first."
256+
"Fizz is still referenced by a team. Remove it from those teams first."
260257
);
261258
}
262259

263260
#[test]
264261
fn validate_persona_activation_change_allows_safe_builtin_updates() {
265-
let mut persona = custom_persona("builtin:solo", "Solo");
262+
let mut persona = custom_persona("builtin:fizz", "Fizz");
266263
persona.is_builtin = true;
267264

268265
assert!(validate_persona_activation_change(&persona, true, false, false).is_ok());
@@ -271,7 +268,7 @@ fn validate_persona_activation_change_allows_safe_builtin_updates() {
271268

272269
#[test]
273270
fn validate_persona_deletion_rejects_builtins() {
274-
let mut persona = custom_persona("builtin:solo", "Solo");
271+
let mut persona = custom_persona("builtin:fizz", "Fizz");
275272
persona.is_builtin = true;
276273

277274
let err = validate_persona_deletion(&persona, false).unwrap_err();
@@ -358,7 +355,7 @@ fn pack_id_rejects_too_long() {
358355
#[test]
359356
fn migrate_retires_unmodified_personas() {
360357
let now = "2026-04-01T00:00:00Z";
361-
// Simulate a store from before the Solo/Kit/Scout transition: all 6
358+
// Simulate a store from before the Fizz transition: all 6
362359
// retired personas with original system prompts.
363360
let mut stored: Vec<PersonaRecord> = RETIRED_PERSONAS
364361
.iter()

‎desktop/src-tauri/src/managed_agents/team_repair.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ mod tests {
321321

322322
#[test]
323323
fn team_persona_key_falls_back_to_id() {
324-
let t = team("builtin-team:kit-scout");
325-
assert_eq!(team_persona_key(&t), "builtin-team:kit-scout");
324+
let t = team("builtin-team:fizz");
325+
assert_eq!(team_persona_key(&t), "builtin-team:fizz");
326326
}
327327

328328
// ── backfill_source_dirs ─────────────────────────────────────────────
@@ -375,7 +375,7 @@ mod tests {
375375
let teams_dir = tmp.path();
376376
std::fs::create_dir(teams_dir.join("com.test.pack")).unwrap();
377377

378-
let mut builtin = team("builtin-team:kit-scout");
378+
let mut builtin = team("builtin-team:fizz");
379379
builtin.is_builtin = true;
380380
builtin.persona_ids = vec!["p1".to_string()];
381381

‎desktop/src-tauri/src/managed_agents/teams.rs‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ struct BuiltInTeam {
5050
}
5151

5252
const BUILT_IN_TEAMS: &[BuiltInTeam] = &[BuiltInTeam {
53-
id: "builtin-team:kit-scout",
54-
name: "Kit & Scout",
55-
description: Some("Kit orchestrates and builds; Scout researches, plans, and reviews."),
56-
persona_ids: &["builtin:kit", "builtin:scout"],
53+
id: "builtin-team:fizz",
54+
name: "Fizz",
55+
description: Some("Fizz works carefully and collaboratively."),
56+
persona_ids: &["builtin:fizz"],
5757
}];
5858

5959
fn built_in_team_records(now: &str) -> Vec<TeamRecord> {
@@ -890,12 +890,12 @@ mod tests {
890890
let json = serde_json::json!({
891891
"version": 1,
892892
"type": "team",
893-
"name": "Solo",
893+
"name": "Fizz",
894894
});
895895
let bytes = serde_json::to_vec(&json).unwrap();
896896
let parsed = parse_team_json(&bytes).unwrap();
897897
assert!(parsed.personas.is_empty());
898-
assert_eq!(parsed.name, "Solo");
898+
assert_eq!(parsed.name, "Fizz");
899899
}
900900

901901
// -----------------------------------------------------------------------
@@ -910,24 +910,24 @@ mod tests {
910910
assert_eq!(records.len(), BUILT_IN_TEAMS.len());
911911
assert!(records.iter().all(|record| record.is_builtin));
912912
let names: Vec<&str> = records.iter().map(|t| t.name.as_str()).collect();
913-
assert_eq!(names, vec!["Kit & Scout"]);
913+
assert_eq!(names, vec!["Fizz"]);
914914
}
915915

916916
#[test]
917917
fn merge_teams_preserves_user_customizations_to_builtin() {
918-
let mut customized = team("builtin-team:kit-scout", "Kit & Scout (mine)");
918+
let mut customized = team("builtin-team:fizz", "Fizz (mine)");
919919
customized.is_builtin = true;
920-
customized.persona_ids = vec!["builtin:kit".to_string()];
920+
customized.persona_ids = vec!["builtin:fizz".to_string()];
921921

922922
let (records, _changed) = merge_teams(vec![customized], "2026-05-07T00:00:00Z");
923923

924-
let kit_scout = records
924+
let fizz = records
925925
.iter()
926-
.find(|t| t.id == "builtin-team:kit-scout")
927-
.expect("Kit & Scout built-in should exist");
928-
assert_eq!(kit_scout.name, "Kit & Scout (mine)");
929-
assert_eq!(kit_scout.persona_ids, vec!["builtin:kit".to_string()]);
930-
assert!(kit_scout.is_builtin);
926+
.find(|t| t.id == "builtin-team:fizz")
927+
.expect("Fizz built-in should exist");
928+
assert_eq!(fizz.name, "Fizz (mine)");
929+
assert_eq!(fizz.persona_ids, vec!["builtin:fizz".to_string()]);
930+
assert!(fizz.is_builtin);
931931
}
932932

933933
#[test]
@@ -936,7 +936,7 @@ mod tests {
936936
let (records, _changed) = merge_teams(vec![user_team], "2026-05-07T00:00:00Z");
937937

938938
assert!(records.iter().any(|t| t.id == "user-uuid"));
939-
assert!(records.iter().any(|t| t.id == "builtin-team:kit-scout"));
939+
assert!(records.iter().any(|t| t.id == "builtin-team:fizz"));
940940
}
941941

942942
#[test]
@@ -959,22 +959,22 @@ mod tests {
959959
fn merge_teams_repromotes_existing_builtin_marked_as_custom() {
960960
// If someone hand-edits the store and flips is_builtin to false on a
961961
// canonical built-in id, merge_teams should restore the flag.
962-
let mut downgraded = team("builtin-team:kit-scout", "Kit & Scout");
962+
let mut downgraded = team("builtin-team:fizz", "Fizz");
963963
downgraded.is_builtin = false;
964964

965965
let (records, changed) = merge_teams(vec![downgraded], "2026-05-07T00:00:00Z");
966966

967967
assert!(changed);
968-
let kit_scout = records
968+
let fizz = records
969969
.iter()
970-
.find(|t| t.id == "builtin-team:kit-scout")
971-
.expect("Kit & Scout should exist");
972-
assert!(kit_scout.is_builtin);
970+
.find(|t| t.id == "builtin-team:fizz")
971+
.expect("Fizz should exist");
972+
assert!(fizz.is_builtin);
973973
}
974974

975975
#[test]
976976
fn validate_team_deletion_rejects_built_ins() {
977-
let mut built_in = team("builtin-team:kit-scout", "Kit & Scout");
977+
let mut built_in = team("builtin-team:fizz", "Fizz");
978978
built_in.is_builtin = true;
979979

980980
let err = validate_team_deletion(&built_in).unwrap_err();

‎desktop/src-tauri/src/managed_agents/types.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ mod tests {
635635
fn persona_record_defaults_active_when_field_is_missing() {
636636
let record: PersonaRecord = serde_json::from_str(
637637
r#"{
638-
"id": "builtin:solo",
639-
"display_name": "Solo",
638+
"id": "builtin:fizz",
639+
"display_name": "Fizz",
640640
"avatar_url": null,
641641
"system_prompt": "Prompt",
642642
"created_at": "2026-03-19T00:00:00Z",

0 commit comments

Comments
 (0)