Skip to content

feat(docs): add tab-aware raw output#722

Merged
steipete merged 1 commit into
mainfrom
feat/docs-raw-tabs-697
Jun 10, 2026
Merged

feat(docs): add tab-aware raw output#722
steipete merged 1 commit into
mainfrom
feat/docs-raw-tabs-697

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Summary

  • add docs raw --tab <title-or-id> for one selected tab in the existing top-level Document shape
  • add docs raw --all-tabs for the canonical recursive tabs response
  • preserve the unflagged request and first-tab output contract
  • document the new modes and cover nested tabs, request parameters, field projection, conflicts, and errors

Fixes #697.

Validation

  • DEVELOPER_DIR=/Library/Developer/CommandLineTools make ci
  • DEVELOPER_DIR=/Library/Developer/CommandLineTools go test ./internal/cmd -run '^Test(DocsRaw|ProjectRawDocumentTab)' -count=1
  • autoreview: clean, no accepted/actionable findings
  • live Google Docs smoke with [email protected]:
    • default output retained first-tab shape without tabs
    • nested tab resolved by both title and ID
    • selected-tab output retained top-level Document metadata and nested sentinel content
    • --all-tabs returned all three tabs recursively
    • disposable document trashed after verification

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 10, 2026, 12:24 AM ET / 04:24 UTC.

Summary
The PR adds docs raw --tab and docs raw --all-tabs, projects one selected Docs tab into the legacy top-level Document shape, updates docs, and adds focused raw-output tests.

Reproducibility: not applicable. as a PR feature review; the linked issue has concrete CLI reproduction steps, and this PR adds tests plus a live Google Docs smoke summary for the new behavior.

Review metrics: 2 noteworthy metrics.

  • Changed files: 6 files affected. The PR touches one command implementation, one test file, three docs pages, and the changelog for a narrow user-facing CLI feature.
  • Validation coverage: 5 raw-output tests added plus live smoke described. The tests and PR body cover default compatibility, selected nested tabs, all-tabs output, and flag conflicts.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] This review did not run tests because the cleanup review contract requires the target checkout to remain read-only; it relies on source inspection and the PR body's reported validation.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused tab-aware raw-output implementation after normal maintainer review, keeping default raw output backward-compatible and preserving the canonical all-tabs response.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • This collaborator PR should remain in normal maintainer review; there is no narrow automated repair to route.

Security
Cleared: The diff changes command handling, docs, and tests only; it does not add dependencies, workflow execution, credential handling, or new supply-chain surfaces.

Review details

Best possible solution:

Land the focused tab-aware raw-output implementation after normal maintainer review, keeping default raw output backward-compatible and preserving the canonical all-tabs response.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a PR feature review; the linked issue has concrete CLI reproduction steps, and this PR adds tests plus a live Google Docs smoke summary for the new behavior.

Is this the best way to solve the issue?

Yes, the PR uses the existing Docs tab resolution helpers and keeps the unflagged raw request unchanged while adding explicit selected-tab and canonical all-tabs modes.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against ebc8218b609a.

Label changes

Label changes:

  • add P2: This is a focused user-facing docs raw improvement with limited blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a collaborator-authored PR, so the external-contributor real behavior proof gate does not apply; the PR body nevertheless includes a live Google Docs smoke summary.

Label justifications:

  • P2: This is a focused user-facing docs raw improvement with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a collaborator-authored PR, so the external-contributor real behavior proof gate does not apply; the PR body nevertheless includes a live Google Docs smoke summary.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its PR review-mode guidance, parseable-output convention, and project testing expectations were applied without switching branches or editing files. (AGENTS.md:1, ebc8218b609a)
  • Current main lacks the new raw tab flags: On current main, DocsRawCmd only has DocID and Pretty, and Run calls Documents.Get(id).Context(ctx).Do() without IncludeTabsContent; the PR is still needed for the requested selected/all-tab raw modes. (internal/cmd/docs.go:70, ebc8218b609a)
  • PR implementation is focused: The PR head adds Tab and AllTabs fields, rejects using them together, requests includeTabsContent=true only for those modes, and projects selected tab content into the legacy top-level Document fields. (internal/cmd/docs.go:70, 468e9f8c9c85)
  • Existing tab helpers reused: Current main already has flattenTabs for nested tab traversal and findTab for exact tab ID plus case-folded title lookup, matching the related issue's title-or-ID expectation. (internal/cmd/docs_tabs.go:10, ebc8218b609a)
  • PR test coverage: The PR adds raw-output tests for default compatibility, selected nested tab by ID/title, missing tab errors, all-tabs canonical output, conflict validation, and legacy-field projection. (internal/cmd/docs_raw_test.go:46, 468e9f8c9c85)
  • API struct cross-check: The Google Docs Go client's Document legacy fields correspond to the DocumentTab fields copied by projectRawDocumentTab, and Tabs remains the canonical all-tabs field. (internal/cmd/docs.go:137, 468e9f8c9c85)

Likely related people:

  • steipete: Current DocsRawCmd, raw-output docs, and tab helpers on main are attributed to recent release and Docs-command work. (role: recent area contributor; confidence: high; commits: 71a8504d0add, 7b288cc92278; files: internal/cmd/docs.go, internal/cmd/docs_raw_test.go, internal/cmd/docs_tabs.go)
  • sebsnyk: Recent merged Docs tab work and the linked feature request are connected to the same multi-tab raw-output problem space. (role: adjacent feature contributor; confidence: medium; commits: 58b866e9ac55; files: internal/cmd/docs_edit.go, internal/cmd/docs_tab_edit_test.go)
  • Ben Lewis: Introduced the per-tab Docs export surface that the related issue cites as precedent for title-or-ID tab selection. (role: adjacent feature contributor; confidence: medium; commits: 26e01cfa972a; files: internal/cmd/docs_tab_export.go, internal/cmd/docs.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. labels Jun 10, 2026
@steipete
steipete merged commit 0a7e642 into main Jun 10, 2026
9 checks passed
@steipete
steipete deleted the feat/docs-raw-tabs-697 branch June 10, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(docs raw): add --tab to traverse a specific tab; default returns tab 0 only

1 participant