Freeze SCUM typed RCON run contract
This commit is contained in:
@@ -109,6 +109,53 @@ func TestRunJobResultRequestParsesSQLiteTemplateEnvelope(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunJobResultRequestParsesTypedRCONTemplateEnvelope(t *testing.T) {
|
||||
payload := `{
|
||||
"runEndpointId":"run-local",
|
||||
"sessionToken":"run-session",
|
||||
"jobId":"job-rcon",
|
||||
"leaseToken":"lease-rcon",
|
||||
"attempt":1,
|
||||
"state":"succeeded",
|
||||
"progress":{"percent":100,"message":"done"},
|
||||
"executionResult":{
|
||||
"kind":"rcon.template-command",
|
||||
"rconTemplate":{
|
||||
"requestId":"request-rcon",
|
||||
"jobId":"job-rcon",
|
||||
"binding":{"serverInstanceId":"server-scum","runBindingId":"runtime-binding-server-scum","runEndpointId":"run-local","pluginId":"server.scum","pluginVersion":"1.0.0","adapterVersion":"scum-live-data-v0","gameVersion":"1.0.0","databaseIdentity":"scum-database"},
|
||||
"status":"succeeded",
|
||||
"capability":"economy-command.write",
|
||||
"transportKey":"scum-rcon",
|
||||
"targetKey":"scum-rcon",
|
||||
"templateKey":"economy.fame.set.v1",
|
||||
"adapterVersion":"scum-live-data-v0",
|
||||
"schemaFingerprint":"sha256:` + strings.Repeat("a", 64) + `",
|
||||
"assetDigest":"sha256:` + strings.Repeat("d", 64) + `",
|
||||
"payloadDigest":"sha256:` + strings.Repeat("e", 64) + `",
|
||||
"confirmationDigest":"sha256:` + strings.Repeat("f", 64) + `",
|
||||
"targetIdentityDigest":"sha256:` + strings.Repeat("c", 64) + `",
|
||||
"observedAt":"2026-08-13T00:00:00Z",
|
||||
"resultDigest":"sha256:` + strings.Repeat("b", 64) + `",
|
||||
"responseDigest":"sha256:` + strings.Repeat("1", 64) + `",
|
||||
"confirmationStatus":"confirmed",
|
||||
"confirmationDigestId":"sha256:` + strings.Repeat("2", 64) + `",
|
||||
"safeSummary":"confirmed by declared readback",
|
||||
"limits":{"maxPayloadBytes":2048,"timeoutMs":5000,"maxResponseBytes":16384,"maxConfirmRecords":16}
|
||||
}
|
||||
}
|
||||
}`
|
||||
var request RunJobResultRequest
|
||||
if err := json.Unmarshal([]byte(payload), &request); err != nil {
|
||||
t.Fatalf("unmarshal Run job result: %v", err)
|
||||
}
|
||||
domainRequest := request.ToDomain()
|
||||
result := domainRequest.ExecutionResult.RCONTemplate
|
||||
if result == nil || result.TemplateKey != "economy.fame.set.v1" || result.PayloadDigest != "sha256:"+strings.Repeat("e", 64) || result.ConfirmationStatus != domain.SCUMRCONConfirmationConfirmed {
|
||||
t.Fatalf("rconTemplate envelope did not parse: %+v", result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAIProviderFromDomainCopiesModels(t *testing.T) {
|
||||
provider := domain.AIProvider{
|
||||
ID: "ai.openai",
|
||||
|
||||
Reference in New Issue
Block a user