package contracts import ( "os" "strings" "testing" ) func TestCleanupScopeRetainsIdentityProtectionUntilLocalCompletion(t *testing.T) { data, err := os.ReadFile("schema/saas-dispatcher.md") if err != nil { t.Fatal(err) } text := string(data) for _, required := range []string{ "执行或回执仍被本地保留期间,同类型同身份只保留首次事实", "完成并满足本地清理条件后,再收到同 `event_id` 的命令可按新执行处理", "源 `event_id` 仍原样保留", "本条不规定 SaaS 对重复反馈的处理", "不拼接、清洗或哈希改号", "`(dispatcher_id,event_type,event_id)`", } { if !strings.Contains(text, required) { t.Fatalf("cleanup scope or identity protection missing: %q", required) } } }