test(reconcile): merge buildPayloadDiagnostic helper with redactSensitiveFields call

W-POLISH's helper extraction and W-OBSERV-PII's redactor landed
through separate worktrees and collided at cherry-pick time on the
dashboard widget + measurement series routes. Resolution routes
the request body / query map through `redactSensitiveFields` first,
then passes the redacted shape to `buildPayloadDiagnostic` — the
helper owns the JSON.stringify + 256-char truncate, the redactor
owns the denylist sweep. Composable; both modules stay
single-purpose.

Also regenerates docs/api/openapi.yaml after both worktree merges
applied (the cherry-pick resolution kept ours, which was stale).
This commit is contained in:
Marc-André Bombeck committed 2026-05-23 11:11:11 +02:00
1 parent 0229bb371f
commit bf5c796c84
3 files changed
+13 -18

No files matched your search

+13 -16
View File
@@ -788,7 +788,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/DisableCoachRequest"
$ref: "#/components/schemas/DisableCoachFlag"
responses:
"200":
description: Resolved next-state echoed back for optimistic-update consumers.
@@ -1412,7 +1412,7 @@ components:
- bundleId
description: Native device registration. Re-registering an APNs token belonging to another user returns 409
(cross-user-hijack guard).
DisableCoachRequest:
DisableCoachFlag:
type: object
properties:
disableCoach:
@@ -2229,13 +2229,7 @@ components:
type: object
properties:
data:
type: object
properties:
disableCoach:
type: boolean
required:
- disableCoach
additionalProperties: false
$ref: "#/components/schemas/DisableCoachFlagOutput"
error:
type: "null"
meta:
@@ -2252,13 +2246,7 @@ components:
type: object
properties:
data:
type: object
properties:
disableCoach:
type: boolean
required:
- disableCoach
additionalProperties: false
$ref: "#/components/schemas/DisableCoachFlagOutput"
error:
type: "null"
meta:
@@ -3159,6 +3147,15 @@ components:
additionalProperties: false
description: AI-generated insights bundle. Strict-schema validated server-side; Coach-routed when the insight surface
needs day-level grounding.
DisableCoachFlagOutput:
type: object
properties:
disableCoach:
type: boolean
required:
- disableCoach
additionalProperties: false
description: Per-account Coach opt-out toggle (v1.4.47 W3). `true` hides the Coach FAB and short-circuits its API gates.
securitySchemes:
bearerAuth:
type: http
-1
View File
@@ -151,7 +151,6 @@ export const PUT = apiHandler(async (request: NextRequest) => {
// the Zod rejection so a single wide-event line carries enough
// detail to diagnose serialiser drift in `HealthLog-iOS`. We log
// ONLY the top-level keys plus a hard 256-char JSON excerpt — never
<<<<<<< HEAD
// the full body — so PII / token-like fields cannot leak. The
// diagnostic shape is built by the shared `buildPayloadDiagnostic`
// helper (v1.4.49) so the widget + series routes can't drift; the
-1
View File
@@ -82,7 +82,6 @@ export const GET = apiHandler(async (request: NextRequest) => {
// the Zod rejection. Top-level keys + a hard 256-char JSON excerpt
// only; never the full payload, so token-shaped query params (we
// do not currently accept any but the truncation keeps that
<<<<<<< HEAD
// invariant cheap) cannot leak. Shared helper via v1.4.49 so the
// widget + series routes can't drift on the diagnostic shape; the
// query map is routed through `redactSensitiveFields` first so any