Repository navigation
fix(raw): preserve canonical Google JSON across readers - #1158
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 8:04 AM ET / 12:04 UTC. ClawSweeper reviewWhat this changesThe branch moves eight Google service raw readers to authenticated HTTP responses, reuses the helper for Sheets, and updates regression tests, documentation, and the changelog. Merge readiness✅ Ready for maintainer review Current main fixes lossless raw output for Sheets, but the documented JSON-preservation behavior remains unmet in other readers. This PR is a coherent candidate to complete that work. Priority: P2 Review scores
Verification
How this fits togetherThe gog raw commands fetch Google Workspace resources for scripts and agents, then emit JSON through the CLI output layer. Some commands resolve a name or email before fetching the final resource. flowchart LR
A[Account and resource ID] --> B[Optional selector lookup]
B --> C[Authenticated Google GET]
C --> D[Validate JSON]
D --> E[Tab projection or redaction]
E --> F[Raw JSON output]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep one authenticated JSON-preserving read path while retaining each command's selectors, Drive redaction, error handling, and output contract. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main sends typed SDK resources to the raw JSON writer, so SDK-omitted explicit values cannot survive. This read-only review did not execute a live reproduction. Is this the best way to solve the issue? Yes. Retaining the authenticated response as JSON values addresses the shared loss mechanism without special-casing individual Google fields. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9413a6c24382. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landed as c24b7dc. All raw readers now preserve Google's explicit values and unknown fields through the shared HTTP/JSON reader. Drive's existing redaction and field-mask behavior remain intact; Docs tab projection preserves raw content and root identity. The Contacts scope remains contact-only, and the other service scopes are unchanged. Verified full local Live proof covered all ten raw command groups. Baseline loss was reproduced for Docs/Slides false style values, Drive zero size/false flags, Calendar zero sequence/false reminders, Gmail FULL empty part fields, and Tasks empty links. Forms, People/Contacts, other Gmail formats, and the shared Sheets reader passed direct-response preservation checks. Docs nested-tab title/ID projection and Contacts email resolution also passed. Drive comparisons exclude only its asynchronous version counter; deterministic fixtures cover precision and unknown/explicit fields. All synthetic objects from both fixture attempts were cleaned up with readback: Drive-backed objects trashed, Calendar event cancelled, and the exact draft/contact/task list absent. No mail was sent and no scopes were added. |
Raw readers promised Google's canonical JSON but decoded responses into SDK structs before writing them. That discarded unknown fields and explicit zero/false/empty values. For example, Slides
bold: falsebecame an unset inherited style, Drive's zero-bytesize: "0"disappeared, and Gmail's empty part IDs and zero body sizes were lost.Read the final resource response through authenticated HTTP and preserve fields as
json.RawMessage. All raw readers share the same GET/error/JSON-validation helper, including Sheets. Preserve existing scopes, selectors, formatting, untrusted wrapping, and redirect refusal. Calendar, Tasks, and email-to-contact resolution retain their typed lookup clients; People/Contacts raw keeps the existing contact-only scope.Drive still redacts the same capability fields by default and honors explicit field masks. Docs keeps its default first-tab response and all-tabs tree; selected-tab projection preserves raw values and unknown fields while retaining root document identity and clearing unrelated first-tab content.
Validation:
make cipassed, including formatting, lint, deadcode, Go tests, Docker version check, generated docs, and skill checks. Independent P2 Auto Review completed with no actionable findings.