Embed RuntimeArtifactPaths into RuntimePaths via serde flatten
Intent: Eliminate field duplication between RuntimeArtifactPaths and RuntimePaths. The three artifact path fields (events_path, status_path, result_path) already had a dedicated struct; RuntimePaths was carrying its own copies with independent serde defaults. This step replaces the three loose fields with a single flattened embed, enforcing a single source of truth for those paths and their defaults.
Affected files: crates/pika-cloud/src/paths.rs
@@ -71,12 +71,8 @@ impl RuntimeArtifactPaths {
pub struct RuntimePaths {
#[serde(default = "runtime_state_dir")]
pub state_dir: String,
- #[serde(default = "events_path")]
- pub events_path: String,
- #[serde(default = "status_path")]
- pub status_path: String,
- #[serde(default = "result_path")]
- pub result_path: String,
+ #[serde(flatten)]
+ pub runtime_artifacts: RuntimeArtifactPaths,
@@ -91,9 +87,7 @@ impl Default for RuntimePaths {
fn default() -> Self {
Self {
state_dir: runtime_state_dir(),
- events_path: events_path(),
- status_path: status_path(),
- result_path: result_path(),
+ runtime_artifacts: RuntimeArtifactPaths::default(),
The RuntimePaths struct previously declared events_path, status_path, and result_path directly, each with its own #[serde(default = "…")] attribute and a matching line in Default::default(). The crate already had RuntimeArtifactPaths holding exactly these three fields with identical defaults.
This change replaces the three loose fields with:
#[serde(flatten)]
pub runtime_artifacts: RuntimeArtifactPaths,
#[serde(flatten)] ensures the JSON wire format is unchanged — the three keys still appear at the top level of the RuntimePaths object, so existing serialized specs remain compatible. The Default impl delegates to RuntimeArtifactPaths::default() instead of calling three individual default functions.
This is a mechanical but important contract tightening: any future change to the canonical artifact paths only needs to happen in one place.