enforce lifecycle evidence contracts

This commit is contained in:
kami
2026-07-26 20:17:03 +04:00
parent b2b24cbe09
commit 6bf6445d40
3 changed files with 31 additions and 15 deletions
+20
View File
@@ -72,3 +72,23 @@ func TestArtifactIsContentAddressed(t *testing.T) {
t.Fatal(err)
}
}
func TestLifecycleEventsRequireEvidence(t *testing.T) {
cases := []struct {
name string
typ string
body string
}{
{"release", "TaskReleased", `{}`},
{"complete", "TaskCompleted", `{}`},
{"block", "TaskBlocked", `{}`},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
err := domain.ValidateEvent(domain.Event{Type: tc.typ, TaskID: "task-1", Version: 1, Payload: json.RawMessage(tc.body)})
if err == nil {
t.Fatal("expected lifecycle evidence validation error")
}
})
}
}