Add agent dispatch intent contract
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package agent_execution_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.cin.su/m/Assistant/contracts/work"
|
||||
workdomain "git.cin.su/m/Assistant/modules/work/domain"
|
||||
)
|
||||
|
||||
func TestDispatchIntentRequiresStableExecutionIdentity(t *testing.T) {
|
||||
intent := work.AgentDispatchIntent{DispatchID: "dispatch-1", IdempotencyKey: "idem-1", DelegationID: "delegation-1", RunID: "run-1", ImplementationID: "agent-1", ImplementationRevision: 2, SourceRevision: "commit-1", WorktreeID: "worktree-1", VerificationPlanRef: "verify-plan-1", CreatedAtUnixMillis: 10}
|
||||
if err := workdomain.ValidateDispatchIntent(intent); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
intent.IdempotencyKey = ""
|
||||
if err := workdomain.ValidateDispatchIntent(intent); err == nil {
|
||||
t.Fatal("expected missing idempotency rejection")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user