fix(routing): pin managed skill payloads to LF (#502)

This commit is contained in:
lhzapata
2026-08-27 18:15:15 -03:00
committed by GitHub
parent f873966eda
commit bc31f180ec
5 changed files with 30 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
# These files are embedded verbatim by include_str!, so checkout EOLs become
# part of the CLI and MCP payload contract.
crates/ai-memory-core/src/routing_skills/*/SKILL.md text eol=lf
+5
View File
@@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.32.2] - 2026-08-26
### Fixed
- Made managed routing `SKILL.md` payloads byte-identical across release
platforms. Windows builds previously embedded CRLF from the runner checkout
while Linux and macOS builds embedded LF, so one tag returned different
bytes through CLI installs and `memory_install_self_routing`. The embedded
assets now use LF everywhere without rewriting user-authored files. (#502)
- The native client now trusts CAs from the platform trust store. It was built
with reqwest's `rustls-tls`, which bundles the Mozilla webpki roots and
ignores the OS store, so a CA the operator had installed locally — Caddy's
+2
View File
@@ -629,6 +629,8 @@ one matching entry.
(`ai-memory install-instructions`, or `--target AGENTS.md` for AGENTS-based
projects) when you want new tool guidance. The refresh writes the slim
markered snippet and managed Agent Skills from the same binary-owned assets.
Managed skill payloads use LF line endings on every release platform, while
user-authored files keep their existing line endings.
For every client in the [Support Matrix](#support-matrix), plus curl-based hook
installs, source builds, CLI environment variables, and the full subcommand
+17 -2
View File
@@ -146,6 +146,22 @@ mod tests {
}
}
#[test]
fn managed_skill_payloads_use_lf_line_endings() {
for skill in MANAGED_SKILLS {
assert!(
!skill.content.contains('\r'),
"{} must use LF line endings",
skill.name
);
assert!(
skill.content.ends_with('\n'),
"{} must end with a newline",
skill.name
);
}
}
#[test]
fn relative_paths_are_safe_relative_skill_markdown_files() {
for skill in MANAGED_SKILLS {
@@ -197,8 +213,7 @@ mod tests {
}
fn parse_frontmatter(skill: &ManagedSkill) -> Frontmatter {
let content = skill.content.replace("\r\n", "\n");
let Some(rest) = content.strip_prefix("---\n") else {
let Some(rest) = skill.content.strip_prefix("---\n") else {
panic!("{} must start with frontmatter", skill.name);
};
let Some((frontmatter, _body)) = rest.split_once("\n---\n") else {
+3
View File
@@ -1752,6 +1752,9 @@ with the slim snippet, leaves unrelated instructions before and after it alone,
and writes a timestamped `.bak-*` backup before changing an existing file.
Managed skill files contain an ai-memory ownership marker; same-name user skills
without that marker are preserved unless you explicitly force replacement.
Their embedded payloads use LF line endings on every release platform, so CLI
installs and `memory_install_self_routing` return the same bytes on Windows,
Linux, and macOS. This does not rewrite line endings in user-authored files.
`install-instructions --print` previews only the instruction snippet; run
`install-skills --print` when you want to preview the managed skill payloads.