Run 3 Print Diagnostics — Byproducts
Summary
Section titled “Summary”The smallest of the three operations runs. Run 2’s refactor of PdfRenderService to renderGroups() collapsed the diagnostic surface from “extend render() plus add a wrapper type” to “add an optional field on the existing per-group result and three query parameters.” The most useful side effect was that Run 4’s API tests could rely on dry-run=true to validate payload shape without provisioning Documint connectivity.
Learnings
Section titled “Learnings”- Pre-implementation re-planning paid off. The original Run 3 spec assumed Run 2 would leave
render()as the public method and add aDiagnosticRenderResultwrapper. Once Run 2 landedrenderGroups()+GroupRenderResult, the cleanest approach was to attachdebugPayloaddirectly toGroupRenderResult, which is what shipped. See implementation-log § Run 3 pre-implementation adjustments. dry-runas a test enabler. The dry-run mode was specified for support diagnostics, but its biggest immediate benefit was Phase 4 tests: the team could assert on the Documint payload contents without standing up Documint in the local environment.- Parameter precedence needs to be explicit in OpenAPI. Without an explicit description, callers reading the generated docs cannot tell whether
debug=trueanddry-run=truetogether short-circuits Documint or not. The endpoint route descriptions were extended to spell this out.
Alternatives considered
Section titled “Alternatives considered”DiagnosticRenderResultwrapper type — rejected after Run 2 made it unnecessary. See implementation-log § Run 3 pre-implementation adjustments.- Header-based diagnostic flags (e.g.,
X-Arda-Print-Debug: true) — considered briefly during planning, rejected because Bruno and curl are friendlier with query params and because the existinglive-printparameter set the precedent. - Returning the payload as a stringified JSON field — rejected;
JsonElementround-trips through serialisation cleanly and lets the test layer assert on structure rather than text. - Recording dry-run requests as no-op print events so support could see “this user attempted a dry-run at 14:03” — rejected. Side-effect-free is the contract; auditing dry-runs would require its own decision and persistence layer.
Suggestions / follow-ups
Section titled “Suggestions / follow-ups”- Per-tenant audit logging for
debug=truecalls. A support engineer runningdebug=trueagainst a customer tenant exposes the constructed payload (which can include item names, notes, and locator data) to whoever can read the response body. A log line per debug call would aid forensics. Not in scope. - Schema for
debugPayload. Today it’s an opaqueJsonElement; aDocumintPayloaddata class with field validation would make the response self-describing. Out of scope per the “minimum to satisfy support” framing ofSAC::PRINT-DX. - Frontend exposure of diagnostic mode. Currently support staff invoke these via API tools (Bruno, curl) — there is no UI affordance. Intentional, but worth revisiting when the Customer Support persona (DQ-010) grows tooling.
Skipped
Section titled “Skipped”- Print history API (
#792Option 1). Per DQ-011, deferred to a future project. Run 3 implements only#792Option 2 (debug + dry-run flags). - Frontend support UI for dry-run / debug. Not requested by tickets; support persona uses API tools today.
Specification delta (post)
Section titled “Specification delta (post)”Differences between phase-3-diagnostics/specification.md and what shipped:
debugPayloadfield placement. The specification described aDiagnosticRenderResultwrapper; the implementation placesdebugPayload: JsonElement?directly onGroupRenderResult. Functionally equivalent for callers, structurally simpler.- No new public method on
PdfRenderService. The spec implied an extension torender(); in practice the diagnostic flags are parameters onrenderGroups()only.
No other deltas.
Copyright: (c) Arda Systems 2025-2026, All rights reserved
Copyright: © Arda Systems 2025-2026, All rights reserved