From ea5733542a4f9f82097c11047effe5949e299e90 Mon Sep 17 00:00:00 2001 From: "Claude Opus 5.5 (claude-opus-5-5)" Date: Mon, 23 Nov 2026 16:27:56 +0100 Subject: [PATCH 1/3] fix(windows): read a manifest key that holds `\` as its `/` form A manifest written on Windows with `\` between the parts of a key named files that the `/` keys rune writes did not match. `flatten_tree` now reads each key and its provenance path through `manifest::slash_lossy`, which turns `\` into `/` on Windows only. On Unix a `\` stays a character of the name, and a test there holds it. From pull request 85 by LangrMartin, rebuilt on main's own path helper. Co-Authored-By: Martin Zeman --- src/manifest/read.rs | 11 +++++++++-- src/manifest/tests.rs | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/manifest/read.rs b/src/manifest/read.rs index 2e4b30a5..16b00ec8 100644 --- a/src/manifest/read.rs +++ b/src/manifest/read.rs @@ -1,5 +1,6 @@ use super::ManifestEntry; use std::collections::HashMap; +use std::path::Path; /// Deserialize a nested YAML manifest tree into a flat `HashMap`. /// @@ -36,9 +37,13 @@ fn flatten_tree( let Some(key_string) = key.as_str() else { continue; }; + // A manifest written on Windows with `\` between the parts of a key + // names the same file as the `/` form. Elsewhere `\` is a character + // of a name and stays. + let key_string = super::slash_lossy(Path::new(key_string)); let full_path = if prefix.is_empty() { - key_string.to_string() + key_string } else { format!("{prefix}/{key_string}") }; @@ -49,7 +54,9 @@ fn flatten_tree( if child_map.contains_key("fingerprint") { let fingerprint = super::extract::string_field(value, "fingerprint", &full_path)?; - let provenance = super::extract::string_field(value, "provenance", &full_path).ok(); + let provenance = super::extract::string_field(value, "provenance", &full_path) + .ok() + .map(|path| super::slash_lossy(Path::new(&path))); entries.insert( full_path, diff --git a/src/manifest/tests.rs b/src/manifest/tests.rs index 12f43ab8..8b1ee9b9 100644 --- a/src/manifest/tests.rs +++ b/src/manifest/tests.rs @@ -158,6 +158,36 @@ fn read_parses_all_entries() { assert!(entries.contains_key("rules/CodeStyle.md")); } +const MANIFEST_WITH_BACKSLASHES: &str = "skills:\n Explain\\SKILL.md:\n fingerprint: abc\n provenance: skills/Explain\\.provenance\\SKILL.md.yaml\n"; + +#[cfg(windows)] +#[test] +fn read_takes_a_backslash_in_a_key_as_a_separator_on_windows() { + let entries = read(MANIFEST_WITH_BACKSLASHES).unwrap(); + + let entry = entries + .get("skills/Explain/SKILL.md") + .expect("the key reads with slashes"); + assert_eq!( + entry.provenance.as_deref(), + Some("skills/Explain/.provenance/SKILL.md.yaml") + ); +} + +#[cfg(not(windows))] +#[test] +fn read_keeps_a_backslash_in_a_key_where_it_is_a_name_character() { + let entries = read(MANIFEST_WITH_BACKSLASHES).unwrap(); + + let entry = entries + .get("skills/Explain\\SKILL.md") + .expect("the key keeps its backslash"); + assert_eq!( + entry.provenance.as_deref(), + Some("skills/Explain\\.provenance\\SKILL.md.yaml") + ); +} + #[test] fn read_ignores_entries_without_fingerprint() { let entries = read(MANIFEST_INVALID).unwrap(); From 9ca76f43aefb6b50429ae0764042eda0aec522ba Mon Sep 17 00:00:00 2001 From: "Claude Opus 5.5 (claude-opus-5-5)" Date: Mon, 23 Nov 2026 16:27:56 +0100 Subject: [PATCH 2/3] fix(dotrune): name the module as provenance source of a single module A single-module source in `.rune` gave its files no `source_uri`, so provenance fell back to the consumer's root, which has no module.yaml, and recorded an empty source. Every install from such a source then warned that each provider's source snapshot remains unverified. The module's own module.yaml now names the source, as a deck entry's does. From pull request 85 by LangrMartin (a6139fe), with a test that fails without it. Co-Authored-By: Martin Zeman --- src/cli/dotrune/resolve.rs | 17 +++++++++++------ tests/dotrune.rs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/cli/dotrune/resolve.rs b/src/cli/dotrune/resolve.rs index c1500765..d7f3bba6 100644 --- a/src/cli/dotrune/resolve.rs +++ b/src/cli/dotrune/resolve.rs @@ -49,12 +49,17 @@ pub fn resolve_sources( ), )); } - filter_to_requested( - sources::collect(module_root, valid_qualifiers)?, - rune_list, - source_label, - module_root, - )? + // The module names its own source, as a deck entry does + // below. Without it provenance falls back to the consumer's + // root, which has no module.yaml, and records an empty source. + let source_uri = crate::cli::config::load_source_uri(module_root); + let mut files = sources::collect(module_root, valid_qualifiers)?; + if !source_uri.is_empty() { + for file in &mut files { + file.source_uri = Some(source_uri.clone()); + } + } + filter_to_requested(files, rune_list, source_label, module_root)? } CanonicalSource::Deck(deck) => { let mut files = Vec::new(); diff --git a/tests/dotrune.rs b/tests/dotrune.rs index 91895c93..5eed42b9 100644 --- a/tests/dotrune.rs +++ b/tests/dotrune.rs @@ -651,6 +651,40 @@ fn single_module_source_still_resolves_bare_name() { ); } +#[test] +fn single_module_source_names_the_module_as_provenance_source() { + let producer = tempfile::tempdir().unwrap(); + let consumer = tempfile::tempdir().unwrap(); + scaffold_producer(producer.path(), "producer"); + write_skill(producer.path(), "Sourced"); + write_dotrune( + consumer.path(), + &format!( + "version: 1\nsources:\n producer:\n local: {}\nrunes:\n producer:\n skills: [Sourced]\n", + producer.path().display() + ), + ); + + let output = install(consumer.path()).success().get_output().clone(); + + let printed = format!( + "{}{}", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + ); + assert!(!printed.contains("remains unverified"), "{printed}"); + let statement = fs::read_to_string( + consumer + .path() + .join(".claude/skills/Sourced/.provenance/SKILL.md.yaml"), + ) + .unwrap(); + assert!( + statement.contains("https://github.com/example/producer"), + "{statement}" + ); +} + #[test] fn dotrune_manifest_inside_a_rune_directory_installs_too() { let producer = tempfile::tempdir().unwrap(); From 4be4ce0e94ac7330cff9903c239103e70b1e8bf7 Mon Sep 17 00:00:00 2001 From: "Claude Opus 5.5 (claude-opus-5-5)" Date: Mon, 23 Nov 2026 16:27:56 +0100 Subject: [PATCH 3/3] docs(changelog): list the two fixes from pull request 85 under 0.7.1 Co-Authored-By: Martin Zeman --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10d895ec..c4f7cbf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). - Make `rune install`, `deploy`, `drift`, `prune`, `doctor`, `validate`, and `spec` work on Windows. Hooks, `rune exec` of a shell script, and `rune sign queue` still need a Unix shell. - Write manifest keys with `/` on Windows. `rune install` refused every skill there, and `rune doctor` reported every deployed file as an orphan. +- Read a manifest key and its provenance path that hold `\` on Windows as their `/` form, so a manifest a Windows build wrote that way still names the files it deployed. +- Record the module as the provenance source of a single-module source in `.rune`. The source was empty, and every install from one warned that the source snapshot remains unverified. - Follow `HOME` on Windows, as git does there. `rune.exe` read only the profile folder of the account, so nothing could point it at another home. - Print a path on Windows without the `\\?\` prefix and with one kind of separator, and name `rune`, not `rune.exe`, in the usage line. - Treat a file more than 260 characters deep as inside its folder on Windows. rune wrote the two paths in different forms, and a check that a path stays inside a folder gave the wrong answer.