Skip to content

feat(sheets): add --inherit-from-before to sheets insert#658

Merged
steipete merged 2 commits into
openclaw:mainfrom
chrischall:feat/sheets-insert-inherit-from-before
May 30, 2026
Merged

feat(sheets): add --inherit-from-before to sheets insert#658
steipete merged 2 commits into
openclaw:mainfrom
chrischall:feat/sheets-insert-inherit-from-before

Conversation

@chrischall
Copy link
Copy Markdown
Contributor

@chrischall chrischall commented May 30, 2026

Fixes #655.

Problem

gog sheets insert always derived InsertDimensionRequest.inheritFromBefore from --after:

inheritFromBefore := c.After

So there was no way to insert rows/columns with plain formatting next to a formatted neighbour — the reported case: plain 0–100 score columns inserted immediately after a currency-formatted column rendered as currency until the format was manually cleared.

Change

Add a tri-state --inherit-from-before flag (*bool):

  • omitted — unchanged behaviour: inherit only when --after is set;
  • --inherit-from-before=false — force plain formatting (the reported need);
  • --inherit-from-before — force inheritance even on a before-insert.

Maps straight through to InsertDimensionRequest.inheritFromBefore. Command reference regenerated via make docs-commands.

Real-behavior proof (built from this branch)

gog sheets insert --help:

      --inherit-from-before    Inherit number format / styling from the adjacent
                               row/column. Defaults to true with --after, false
                               otherwise; set to false to insert with plain formatting.

--dry-run shows the flag controlling inherit_from_before (no API call):

# default with --after  → inherits
$ gog sheets insert SHEET_ID Sheet1 rows 2 --after --dry-run --json
  → inherit_from_before: true

# explicit override: --after but DON'T inherit
$ gog sheets insert SHEET_ID Sheet1 rows 2 --after --inherit-from-before=false --dry-run --json
  → inherit_from_before: false

# explicit override: force inherit on a before-insert
$ gog sheets insert SHEET_ID Sheet1 rows 2 --inherit-from-before --dry-run --json
  → inherit_from_before: true

Review follow-ups addressed

  • proof — added above (help + dry-run output showing the tri-state behaviour).
  • generated docs — ran make docs-commands; docs/commands/gog-sheets-insert.md now lists the flag.
  • CHANGELOG — no CHANGELOG edit in this PR (release notes are release-owned).

Tests: added two subtests over the existing httptest Sheets stub asserting wire-level InheritFromBefore for both override directions. make fmt + make lint + go test ./internal/cmd/ green.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 30, 2026

Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 1:57 PM ET / 17:57 UTC.

Summary
The PR adds a tri-state --inherit-from-before flag to gog sheets insert, wires it into dry-run and the Sheets API insert request, updates generated command docs and tests, and adds a release-note line.

Reproducibility: yes. for the source-level behavior: current main only derives inheritFromBefore from --after, so the reported missing override is clear from the command implementation. I did not run a live Google Sheets formatting scenario in this read-only review.

Review metrics: 2 noteworthy metrics.

  • Changed files: 4 files affected. The surface spans CLI behavior, request tests, generated command docs, and one release-note line that maintainers should notice before merge.
  • New coverage: 3 subtests added. The tests cover both explicit override directions and the first-row validation path.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
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] The PR body proof shows CLI help plus dry-run/request-path output, not a live Google Sheet before/after formatting run; maintainers may still decide whether VISION.md requires live provider proof for this API-visible behavior.
  • [P1] The branch includes a CHANGELOG.md line; that may be fine for maintainer landing, but release-note ownership should be intentional before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused flag and validation after maintainer review, with release-note handling kept intentional and live Sheets proof requested only if maintainers want provider-visible confirmation beyond dry-run output and request-level tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] The branch already contains the focused implementation, tests, docs, and proof, so the remaining action is maintainer review rather than an automated repair lane.

Security
Cleared: The diff adds a CLI flag, generated docs, tests, and a changelog line; it does not touch credentials, dependencies, workflows, publishing, or other security-sensitive execution paths.

Review details

Best possible solution:

Land the focused flag and validation after maintainer review, with release-note handling kept intentional and live Sheets proof requested only if maintainers want provider-visible confirmation beyond dry-run output and request-level tests.

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

Yes for the source-level behavior: current main only derives inheritFromBefore from --after, so the reported missing override is clear from the command implementation. I did not run a live Google Sheets formatting scenario in this read-only review.

Is this the best way to solve the issue?

Yes, the pointer bool flag is a narrow maintainable fit because omitted preserves the current default while explicit true/false maps directly to the Sheets API field. The remaining questions are proof depth and release-note handling, not the core implementation shape.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal Sheets CLI capability improvement with limited blast radius and focused coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal-style proof for the new help text and dry-run JSON behavior, which proves the CLI/request path even though it is not live Sheets formatting proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal-style proof for the new help text and dry-run JSON behavior, which proves the CLI/request path even though it is not live Sheets formatting proof.
Evidence reviewed

Acceptance criteria:

  • [P1] make fmt.
  • [P1] make lint.
  • [P1] go test ./internal/cmd/.

What I checked:

Likely related people:

  • steipete: The current sheets insert implementation and default inheritance behavior trace to the v0.19.0 import commit, and the latest PR head contains a validation commit by the same author. (role: introduced behavior and recent adjacent contributor; confidence: high; commits: b25a3c029b37, d1da0e673c34; files: internal/cmd/sheets_insert.go, internal/cmd/sheets_insert_test.go, docs/commands/gog-sheets-insert.md)
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels May 30, 2026
@chrischall chrischall closed this May 30, 2026
@chrischall chrischall force-pushed the feat/sheets-insert-inherit-from-before branch from 7fbb0a1 to 929e26b Compare May 30, 2026 12:17
@chrischall chrischall reopened this May 30, 2026
@chrischall chrischall force-pushed the feat/sheets-insert-inherit-from-before branch 2 times, most recently from 73aa8c9 to d9695c4 Compare May 30, 2026 14:38
@chrischall
Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — reopened with real-behavior proof (help + dry-run showing the tri-state inherit_from_before) added to the PR body, regenerated the command reference via make docs-commands, and removed the CHANGELOG edit.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 30, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 30, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 30, 2026
chrischall and others added 2 commits May 30, 2026 18:45
`gog sheets insert` always derived InsertDimensionRequest.inheritFromBefore
from --after, so there was no way to insert columns/rows with plain formatting
next to a formatted neighbour (the reported case: plain 0–100 score columns
inserted beside a currency column first rendered as currency).

Add a tri-state `--inherit-from-before` flag (*bool): omitted keeps the prior
default (inherit only with --after), `--inherit-from-before=false` forces plain
formatting, and `--inherit-from-before` forces inheritance on a before-insert.
Regenerate the command reference (make docs-commands) so the flag is documented.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@steipete steipete force-pushed the feat/sheets-insert-inherit-from-before branch from d9695c4 to d1da0e6 Compare May 30, 2026 17:52
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels May 30, 2026
@steipete steipete merged commit 8a9a908 into openclaw:main May 30, 2026
5 checks passed
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. proof: sufficient Contributor real behavior proof is sufficient. 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.

sheets insert: add a flag to control number-format inheritance (inheritFromBefore)

2 participants