fmf_contract/versions.rs
1//! Version pins and the pipe name. An incompatible wire change bumps the
2//! pipe name itself (`-v2`), not just a number — see ARCHITECTURE.md.
3
4// v2: FmfQueryOptions grew `regex_mode` (16→20 B) — an incompatible wire
5// change, so the pipe name moves to -v2 (a stale v1 service then can't be
6// reached at all, instead of decoding a 20 B request as 16 B + text;
7// ADR-0023).
8/// FFI ABI version — bumped when the in-process `fmf_engine.dll` POD layout
9/// changes incompatibly.
10pub const ABI_VERSION: u32 = 2;
11/// Pipe wire protocol version — bumped when the named-pipe message format
12/// changes incompatibly (which also moves the pipe name to `-v2`).
13pub const PROTOCOL_VERSION: u32 = 2;
14
15/// Full pipe path (Rust side opens this).
16pub const PIPE_NAME: &str = r"\\.\pipe\fmf-engine-v2";
17/// Short name (C# `NamedPipeClientStream` takes the name without the
18/// `\\.\pipe\` prefix; gen-contract radiates this one).
19pub const PIPE_NAME_SHORT: &str = "fmf-engine-v2";
20/// SCM service name — deployment surface shared by fmf-service's
21/// lifecycle subcommands and the app's in-app service setup.
22pub const SERVICE_NAME: &str = "fmf-engine";
23
24#[cfg(test)]
25mod tests {
26 use super::*;
27
28 #[test]
29 fn pipe_names_agree() {
30 assert_eq!(PIPE_NAME, format!(r"\\.\pipe\{PIPE_NAME_SHORT}"));
31 }
32}