package main // content_rule.go is messenger's own content rule (modules/messenger/cmd/messenger/content.go, novox/hq ADR // 0253 §3), copied here verbatim — byte for byte, only the file renamed, since Go allows nothing else to // differ (novox/hq issue 868, review round 1). mesh-mail carries it at run time, not only in its tests: the // ask it builds is checked against the real rule before it is published (send.go), so a subject or a first // line the masking does not catch (an IP, a hardware address, a path-shaped reference, a hex hash, …) falls // back to a safe explanation rather than refusing the whole ask. Messenger's content rule stays messenger's: // this is a pinned copy, never a dependency on it, the way modules/networkmanager/cmd/uplink-tools/copies_test.go // pins its copy of uplink.go. import ( "bytes" "os" "path/filepath" "testing" ) func TestContentRuleCopyMatchesMessengers(t *testing.T) { src := filepath.Join("..", "..", "..", "messenger", "cmd", "messenger", "content.go") theirs, err := os.ReadFile(src) if err != nil { t.Skipf("messenger's content.go is not beside this module (%v); nothing to pin against", err) } mine, err := os.ReadFile("content_rule.go") if err != nil { t.Fatal(err) } if !bytes.Equal(mine, theirs) { t.Error("mesh-mail's copy of messenger's content.go (content_rule.go) differs from " + src + ": change this copy to match messenger's content rule, verbatim, whenever it changes") } }