carlos / platform Public

console: the SES door's claim fixture reaches mail_caller_sends

TestClaimConsoleMutationInvariant requires every app-scoped SQL writer to
be reached by some door's open run. The POST /api/ses/events fixture sent
a Delivery with no caller, which takes the domain fallback and never
writes the new caller-class table. It now sends a Send named by the
app's own IAM user, so the named path writes mail_events,
mail_sender_counts and mail_caller_sends, all under bab/titogo's permit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 6433c0d82f1cf1484b7523dc0f0af56ebf52345e parent cf082ce
1 file changed, +10 −4
  • internal/console/claim_invariant_fixtures_test.go +10 −4

CI failed — run details

diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go
index 7e29e86f8..8a313d66a 100644
--- a/internal/console/claim_invariant_fixtures_test.go
+++ b/internal/console/claim_invariant_fixtures_test.go
@@ -1445,7 +1445,8 @@ var claimFixtures = map[string]claimFixture{
}},
// ---- POST: unauthenticated, signed ----
- // SES delivery events count against the sending app (mail_sender_counts).
+ // SES events count against the sending app (mail_sender_counts, and a Send
+ // by caller class in mail_caller_sends).
// Account subdomains (apisubdomain.go): every method of the door and
// the inventory refuses on a host-claim console, after the operator
// gate and before any read. The doors name no app; the setup enrolls
@@ -1490,11 +1491,16 @@ var claimFixtures = map[string]claimFixture{
cx.srv.snsVerify = func(snsEnvelope) error { return nil } // the signature check's own seam
cx.emailProvisioned(t)
},
+ // A Send named by the app's own IAM user: the named path writes the
+ // app's log rows (mail_events), its per-sender count
+ // (mail_sender_counts) and its caller-class count
+ // (mail_caller_sends, platform mail submission Task 2), all under
+ // bab/titogo's permit.
do: func(t *testing.T, cx *claimCase) int {
resp := sesPost(t, cx.consoleFixture, `{"Type":"Notification","TopicArn":"arn:aws:sns:eu-west-1:1:carlos-mail",`+
- `"Message":"{\"eventType\":\"Delivery\",\"mail\":{\"source\":\"hello@`+claimMailDomain+`\",`+
- `\"messageId\":\"claim-fixture-message\",\"destination\":[\"claim@example.com\"]},`+
- `\"delivery\":{\"recipients\":[\"claim@example.com\"]}}",`+
+ `"Message":"{\"eventType\":\"Send\",\"mail\":{\"source\":\"hello@`+claimMailDomain+`\",`+
+ `\"messageId\":\"claim-fixture-message\",\"destination\":[\"claim@example.com\"],`+
+ `\"tags\":{\"ses:caller-identity\":[\"carlos-mail-bab-titogo\"]}}}",`+
`"SigningCertURL":"https://sns.eu-west-1.amazonaws.com/x.pem","Signature":"x"}`)
resp.Body.Close()
return resp.StatusCode