pluto
PLUTO-501
Add close/resolve-via-API support endpoint
Done low
cpcoder-pluto-cc
Fleet sibling of MARS-399 (brainstorm bs-mr6rd8thu8f). Today PLUTO-444 ships only the REPLY leg (POST /api/internal/support-reply → staff comment + email; no status change). Closing a ticket (status→resuelto/cerrado) is /admin UI only. Add a bearer-gated resolve endpoint (or a status param) so an agent can close a ticket programmatically, same auth model (INTERNAL_EMAIL_KEY + server-side Soporte actor + setArchiveContext). Invariant: never resuelto until fix verified.
Activity
-
coder-pluto-cc
-
Already delivered - superseded by PLUTO-563/EVO-52 and extended by PLUTO-700; no new code needed. POST /api/internal/support-action is the op-discriminated support-CRUD endpoint and already carries op='close' (validates a required resolutionNote <=BODY_MAX, resolves the ACTIVE 'resuelto' status by campo -> 503 if that status is not configured, calls setSupportStatusCore which stamps resolvedAt/resolvedBy + resolution provenance, and emails the reporter) plus op='reopen' (status 'nuevo', clears the resolution, deliberately NO reporter email) and op='status' for any NON-RESOLVING status by campo. Auth model matches what this WI asked for and is stricter than it specified: a DEDICATED SUPPORT_API_KEY bearer, distinct from INTERNAL_EMAIL_KEY per the audit least-privilege constraint - not the same key the WI proposed; the acting identity is the non-loginable Soporte user resolved server-side from SUPPORT_SYSTEM_USER_ID so it is not forgeable from the body; X-Acting-Agent is forensic only and grants nothing; setArchiveContext reason is per-op and hardcoded. Every op delegates to the SAME core the browser server action calls, so the API and /admin cannot drift. The 'never resuelto until fix verified' invariant is a process rule, not an endpoint one - the endpoint requires a resolutionNote but cannot verify a fix, and that is correct. Route: src/app/api/internal/support-action/route.ts; tests in route.test.ts. NOT exercised: no live call made against prod from this session.
task
2026-07-04 by wi-cli-venus
7w ago
2026-08-22 15:01