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
13 changes: 13 additions & 0 deletions rivet-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7551,6 +7551,7 @@ fn parse_yaml_content(
})
.collect(),
fields: raw.fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(std::path::PathBuf::from(file_path)),
})
Expand Down Expand Up @@ -7580,6 +7581,7 @@ fn parse_yaml_content(
})
.collect(),
fields: raw.fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(std::path::PathBuf::from(file_path)),
})
Expand Down Expand Up @@ -11376,6 +11378,7 @@ fn cmd_add(
tags: tags.to_vec(),
links: link_vec,
fields: fields_map,
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -11882,6 +11885,7 @@ fn cmd_batch(cli: &Cli, file: &std::path::Path) -> Result<bool> {
tags: tags.clone(),
links: link_vec,
fields: fields.clone(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -11971,6 +11975,7 @@ fn cmd_batch(cli: &Cli, file: &std::path::Path) -> Result<bool> {
tags: tags.clone(),
links: link_vec,
fields: fields.clone(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -13750,6 +13755,7 @@ mod lsp_tests {
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path.clone()),
})
Expand Down Expand Up @@ -13794,6 +13800,7 @@ mod lsp_tests {
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path.clone()),
})
Expand Down Expand Up @@ -13835,6 +13842,7 @@ mod lsp_tests {
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path.clone()),
})
Expand Down Expand Up @@ -13921,6 +13929,7 @@ mod lsp_tests {
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path_a.clone()),
})
Expand All @@ -13935,6 +13944,7 @@ mod lsp_tests {
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path_b.clone()),
})
Expand All @@ -13949,6 +13959,7 @@ mod lsp_tests {
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path_b.clone()),
})
Expand Down Expand Up @@ -14020,6 +14031,7 @@ artifacts:
tags: vec![],
links: vec![],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(path.clone()),
})
Expand Down Expand Up @@ -14165,6 +14177,7 @@ mod stats_tests {
tags: vec![],
links: vec![],
fields: Default::default(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
1 change: 1 addition & 0 deletions rivet-cli/src/mcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ fn tool_add(project_dir: &Path, arguments: &Value) -> Result<Value> {
tags,
links,
fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down
4 changes: 4 additions & 0 deletions rivet-core/benches/core_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ fn generate_artifacts(n: usize, links_per: usize) -> Vec<Artifact> {
f.insert("priority".into(), serde_yaml::Value::String("must".into()));
f
},
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down Expand Up @@ -282,6 +283,7 @@ fn build_diff_stores(n: usize) -> (Store, Store) {
tags: vec!["common".into()],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -310,6 +312,7 @@ fn build_diff_stores(n: usize) -> (Store, Store) {
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand All @@ -328,6 +331,7 @@ fn build_diff_stores(n: usize) -> (Store, Store) {
tags: vec!["new".into()],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down
1 change: 1 addition & 0 deletions rivet-core/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ mod tests {
})
.collect(),
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
6 changes: 6 additions & 0 deletions rivet-core/src/cited_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ last-checked: 2026-04-28T14:30:00Z
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -993,6 +994,7 @@ last-checked: 2026-04-28T14:30:00Z
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -1023,6 +1025,7 @@ last-checked: 2026-04-28T14:30:00Z
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -1177,6 +1180,7 @@ artifacts:
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -1213,6 +1217,7 @@ artifacts:
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -1275,6 +1280,7 @@ artifacts:
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down
1 change: 1 addition & 0 deletions rivet-core/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@
let mut line = 0u32;
let mut col = 0u32;
for (i, ch) in source.char_indices() {
if i >= offset {

Check warning on line 260 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace >= with < in byte_offset_to_line_col
break;
}
if ch == '\n' {

Check warning on line 263 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace == with != in byte_offset_to_line_col
line += 1;

Check warning on line 264 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace += with *= in byte_offset_to_line_col

Check warning on line 264 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace += with -= in byte_offset_to_line_col
col = 0;
} else {
col += 1;

Check warning on line 267 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace += with *= in byte_offset_to_line_col

Check warning on line 267 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace += with -= in byte_offset_to_line_col
}
}
(line, col)
Expand All @@ -274,9 +274,9 @@
fn parse_yaml_error_location(msg: &str) -> (Option<u32>, Option<u32>) {
// serde_yaml errors contain "at line X column Y"
if let Some(pos) = msg.find("at line ") {
let rest = &msg[pos + 8..];

Check warning on line 277 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace + with - in parse_yaml_error_location

Check warning on line 277 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace + with * in parse_yaml_error_location
let parts: Vec<&str> = rest.split_whitespace().collect();
if parts.len() >= 3 && parts[1] == "column" {

Check warning on line 279 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace >= with < in parse_yaml_error_location

Check warning on line 279 in rivet-core/src/db.rs

View workflow job for this annotation

GitHub Actions / Mutation Testing (rivet-core)

Missed mutant

replace && with || in parse_yaml_error_location
let line = parts[0].parse::<u32>().ok().map(|l| l.saturating_sub(1)); // 0-based
let col = parts[2].parse::<u32>().ok().map(|c| c.saturating_sub(1));
return (line, col);
Expand Down Expand Up @@ -1621,6 +1621,7 @@
tags: vec!["aadl".into()],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
1 change: 1 addition & 0 deletions rivet-core/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ mod tests {
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
1 change: 1 addition & 0 deletions rivet-core/src/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,7 @@ mod tests {
tags: tags.iter().map(|t| t.to_string()).collect(),
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
3 changes: 3 additions & 0 deletions rivet-core/src/externals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,7 @@ mod tests {
},
],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -1322,6 +1323,7 @@ mod tests {
target: "other:REQ-001".to_string(), // cross-external ref
}],
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down Expand Up @@ -1356,6 +1358,7 @@ mod tests {
tags: vec![],
links: vec![], // no links at all
fields: std::collections::BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
};
Expand Down
3 changes: 3 additions & 0 deletions rivet-core/src/formats/aadl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ fn analysis_diagnostic_to_artifact(
tags: vec!["aadl".into(), diag.analysis.clone()],
links: vec![],
fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down Expand Up @@ -401,6 +402,7 @@ fn component_to_artifact(
tags: vec!["aadl".into()],
links: vec![],
fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down Expand Up @@ -436,6 +438,7 @@ fn diagnostic_to_artifact(index: usize, diag: &SparDiagnostic) -> Artifact {
tags: vec!["aadl".into(), diag.analysis.clone()],
links: vec![],
fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
8 changes: 8 additions & 0 deletions rivet-core/src/formats/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ impl Adapter for GenericYamlAdapter {
})
.collect(),
fields: a.fields.clone(),
fields_per_variant: a.fields_per_variant.clone(),
provenance: a.provenance.clone(),
})
.collect(),
Expand Down Expand Up @@ -167,6 +168,12 @@ struct GenericArtifact {
links: Vec<GenericLink>,
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
fields: BTreeMap<String, serde_yaml::Value>,
#[serde(
default,
rename = "fields-per-variant",
skip_serializing_if = "BTreeMap::is_empty"
)]
fields_per_variant: BTreeMap<String, BTreeMap<String, serde_yaml::Value>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
provenance: Option<Provenance>,
}
Expand Down Expand Up @@ -200,6 +207,7 @@ pub fn parse_generic_yaml(content: &str, source: Option<&Path>) -> Result<Vec<Ar
})
.collect(),
fields: a.fields,
fields_per_variant: a.fields_per_variant,
provenance: a.provenance,
source_file: source.map(|p| p.to_path_buf()),
})
Expand Down
1 change: 1 addition & 0 deletions rivet-core/src/formats/needs_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ fn convert_need(
tags: item.tags.clone(),
links,
fields,
fields_per_variant: Default::default(),
provenance: None,
source_file: source.map(|p| p.to_path_buf()),
}
Expand Down
2 changes: 2 additions & 0 deletions rivet-core/src/impact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ mod tests {
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand All @@ -354,6 +355,7 @@ mod tests {
})
.collect(),
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: None,
}
Expand Down
1 change: 1 addition & 0 deletions rivet-core/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,7 @@ mod tests {
tags: vec![],
links: vec![],
fields: BTreeMap::new(),
fields_per_variant: Default::default(),
provenance: None,
source_file: Some(PathBuf::from("artifacts/test.yaml")),
}
Expand Down
Loading
Loading