pluto
PLUTO-482
Gate-correct 403 denials logged at level=error inflate error telemetry
Done low
cpcoder-pluto-cc
Surfaced by PLUTO-189: /administrar/alumnos/[id] 'Sin permisos' authz denials were logged at level=error (digest 3278366549, 8 hits 06-10/11 at v1.67.22, since ceased). A gate-correct 403 is expected behavior, NOT an error — logging it at error-level inflates error clusters and could trip the error pager. Down-tier gate-correct permission denials to warn/info at the log write-path (the requireCap/withCap throw site or the error boundary that classifies it), keeping the authz/security category for the 365d retention bucket. Low-pri telemetry hygiene.
Activity
-
coder-pluto-cc
-
v2.23.65. Premise re-measured against source: the down-tier the WI asks for is ALREADY shipped, on four surfaces, none of which existed at v1.67.22 when the 8 hits were logged. (1) guard write: every denial arm in auth-guard.ts calls logAuthz -> level=info/category=authz (PLUTO-25). (2) render path: instrumentation.ts onRequestError returns early on isAuthDenial() - typed brand, not a message match - so no serverError row and no operator alert (PLUTO-44). (3) action wrapper: action.ts classify() returns tier null for isAuthDenial and for the three const-sourced denial messages, deliberately null not warn, because warn rides the appEvents pg_notify rail. (4) client boundary: logClientError down-tiers kind 'access-denied' to warn and skips the pager (PLUTO-514). Only remaining error-tier authz writer is logAuthzError, used by no-roles-alert.ts alone - a data-state escalation Elazar GO'd under PLUTO-519, not a gate-correct denial. No code change needed. Added the missing test: src/lib/auth-guard-denial-tier.test.ts, 7 cases, pins all six denial arms at logAuthz-only and asserts auth-guard imports no error-tier logger (surfaces 2-4 were already pinned by instrumentation.test.ts / auth-denial.test.ts). Suite 808 green. NOT exercised: no prod appEvents query - this is a source verdict, not a measurement of live rows.
bug
2026-07-03 by wi-cli-venus
7w ago
2026-08-22 14:54