Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions crates/frameshift-orchestrator/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ impl PersonaProfile {
if let Some(desc) = &src.persona.description {
text_parts.push(desc.clone());
}
// Topical tags bias keyword-based selection, mirroring the pack.toml path.
for tag in &src.persona.tags {
text_parts.push(tag.clone());
}
text_parts.push(src.persona.voice.tone.clone());
if let Some(vt) = &src.persona.voice.text {
text_parts.push(vt.clone());
Expand Down Expand Up @@ -626,6 +630,7 @@ mod tests {
name: name.to_string(),
version: None,
description: Some(format!("{name} persona for testing")),
tags: vec![],
license: None,
author: None,
extends: None,
Expand Down Expand Up @@ -673,6 +678,22 @@ mod tests {
.any(|k| k == "rust" || k == "expert"));
}

/// persona.toml tags land in the selection keyword corpus.
#[test]
fn profile_includes_tags_in_keywords() {
let mut src = minimal_source("helper", "neutral tone");
src.persona.tags = vec!["embedded".to_string(), "Firmware".to_string()];
let profile = PersonaProfile::from_source(&src);
assert!(
profile.keywords.iter().any(|k| k == "embedded"),
"tag should appear in keywords"
);
assert!(
profile.keywords.iter().any(|k| k == "firmware"),
"tags should be lowercased like the rest of the corpus"
);
}

/// PersonaIndex::build creates one profile per source.
#[test]
fn index_build_count() {
Expand Down
1 change: 1 addition & 0 deletions crates/frameshift-source/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ mod tests {
name: "test".to_string(),
version: None,
description: None,
tags: vec![],
license: None,
author: None,
extends: None,
Expand Down
7 changes: 7 additions & 0 deletions crates/frameshift-source/src/persona.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ pub struct Persona {
/// Short human-readable description of what this persona does.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Topical tags that bias keyword-based persona selection and feed
/// registry search, mirroring the `tags` field in `pack.toml`.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub tags: Vec<String>,
/// SPDX license identifier for this persona pack.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub license: Option<String>,
Expand Down Expand Up @@ -263,6 +267,7 @@ impl Persona {
name: name.into(),
version: None,
description: None,
tags: Vec::new(),
license: None,
author: None,
extends: None,
Expand Down Expand Up @@ -319,6 +324,7 @@ mod tests {
name: "cryptographic".to_string(),
version: None,
description: None,
tags: Vec::new(),
license: None,
author: None,
extends: None,
Expand Down Expand Up @@ -368,6 +374,7 @@ mod tests {
name: "enriched".to_string(),
version: Some("1.2.3".to_string()),
description: Some("A fully-enriched test persona.".to_string()),
tags: vec!["security".to_string(), "rust".to_string()],
license: Some("MIT".to_string()),
author: Some(Author {
handle: "testauthor".to_string(),
Expand Down
2 changes: 2 additions & 0 deletions crates/frameshift-source/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ mod tests {
name: "demo".to_string(),
version: None,
description: None,
tags: vec![],
license: None,
author: None,
extends: None,
Expand Down Expand Up @@ -740,6 +741,7 @@ mod tests {
name: "demo".to_string(),
version: None,
description: None,
tags: vec![],
license: None,
author: None,
extends: None,
Expand Down
1 change: 1 addition & 0 deletions crates/frameshift-source/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ mod tests {
name: "demo".to_string(),
version: None,
description: None,
tags: vec![],
license: None,
author: None,
extends: None,
Expand Down
Loading