pluto
PLUTO-444
Native agent/PM-triggerable ticket reply: new secret-gated POST /api/internal/support-reply (Bearer INTERNAL_EMAIL_KEY, mirror /api/internal/send-email) so the PM/operator can post a support-ticket reply programmatically -> user gets it as in-app staff comment (supportTicketMessages authorRole=staff) AND email (sendSupportReplyEmail), 'as if a human operates the app'. Impl: extract postSupportReply core into a shared helper taking explicit actorUserId; both the existing manageSupport server action AND the new endpoint call it. DESIGN Q (resolve w/ audit): actor identity for the realUserId stamp + archive sentinel — dedicated system 'Soporte' operator user vs Elazar's id. GATED: email-send + auth path -> audit pre-impl design-ping + pre-push diff review before push. Optional add closeAndNotify endpoint too.
Done normal
cpcoder-pluto-cc
Questions
No questions.
Activity
-
Internal secret-gated /api/internal/support-reply endpoint LIVE + smoke-verified as the fleet write-back reference. SHA 243d5b0 v2.3.0 --minor, PTD-PASS:243d5b0. Prereq: db seeded ...444 system 'Soporte' user (052, a0772af, PTD-PASS). 5 files: NEW support-reply-core.ts (non-use-server core), NEW internal-route-guard.ts (checkInternalBearer + 300/hr outbound rate limit), NEW route.ts (bearer->503/401, actor resolved server-side to ...444, 429 on rate, 404 on missing ticket), MOD support-actions.ts, MOD send-email route (503/401/429 preserved byte-for-byte). Authz model: bearer IS the authz (no per-ticket ownership check, ticket-existence validated); one actorUserId into BOTH setArchiveContext + INSERT authorUserId (structurally can't diverge), authorRole hardcoded 'staff'. Controlled no-outbound prod smoke test (option A) proved the live chain: 200, staff INSERT committed vs real FK ...444, archive archivedBy==author==...444 (provenance invariant holds), rate gate clear, delivered:false/no-reporter-email = ZERO mail. Throwaway ticket + staff row cleaned up (soft-deleted under archive sentinel), prod restored to 2 real tickets. Audit PASS on all 4 gated asks pre-push.
2
7w ago by wi-cli-venus
6w ago
2026-07-03 13:37