Skip to content

feat(docs): add structural and segment editing#863

Merged
steipete merged 2 commits into
mainfrom
feat/docs-structural-segments
Jun 21, 2026
Merged

feat(docs): add structural and segment editing#863
steipete merged 2 commits into
mainfrom
feat/docs-structural-segments

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Summary

  • add footnote, section-break, horizontal-rule, and section-column commands
  • add header/footer list, create, and delete lifecycle commands
  • add exact segment targeting to plain-text insert, update, delete, format, and range lookup
  • document the new workflows and extend disposable live coverage

Closes #856.
Closes #857.

Verification

  • make ci
  • autoreview: clean
  • disposable Google Docs end-to-end run with the OpenClaw bot-maintenance account
  • multi-tab first-section header creation, lookup, and deletion against the live Docs API

@clawsweeper

clawsweeper Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed June 21, 2026, 7:18 PM ET / 23:18 UTC.

Summary
Adds first-class Google Docs structural editing commands, header/footer lifecycle commands, segment-aware plain-text editing/format/range lookup, generated docs, live-test coverage, and a small calendar constant cleanup.

Reproducibility: yes. for the review finding: source inspection shows header/footer create skips placement validation when only --occurrence or --match-case is provided. I did not execute the PR branch or live Google API commands in this read-only review.

Review metrics: 1 noteworthy metric.

  • Diff size: 44 files, +2416/-142. The PR spans command code, generated docs, tests, and live-test coverage, so maintainers should review it as a broad user-facing Docs surface change.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
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:

  • [P2] Fix the header/footer create validation gap for anchor-only flags.
  • [P2] Wait for the normal GitHub CI jobs to complete before merge.

Risk before merge

  • [P1] This adds new Docs command surface and a new segment selector; VISION.md treats new API surfaces and command-structure changes as discuss-first unless maintainers are comfortable with the direction.
  • [P1] Several CI jobs were still in progress in GitHub at review time, so normal merge gating should wait for those checks.

Maintainer options:

  1. Decide the mitigation before merge
    Land the feature after normal maintainer review, completed CI, and a small fix for the header/footer create validation gap.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • A narrow automated repair can address the header/footer create validation gap; broader acceptance remains normal maintainer review.

Security
Cleared: The diff does not add dependencies, CI permission changes, secret handling, or new downloaded code execution paths.

Review findings

  • [P3] Validate anchor-only header/footer flags — internal/cmd/docs_header_footer.go:191
Review details

Best possible solution:

Land the feature after normal maintainer review, completed CI, and a small fix for the header/footer create validation gap.

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

Yes for the review finding: source inspection shows header/footer create skips placement validation when only --occurrence or --match-case is provided. I did not execute the PR branch or live Google API commands in this read-only review.

Is this the best way to solve the issue?

Mostly yes: the PR reuses existing Docs placement and request plumbing, but header/footer create should validate anchor-only flags consistently before merge.

Full review comments:

  • [P3] Validate anchor-only header/footer flags — internal/cmd/docs_header_footer.go:191
    hasPlacement only considers --index, --at-end, and --at, so gog docs header create <doc> --occurrence 2 or --match-case skips DocsBodyPlacementFlags.plan and silently creates the default header instead of returning the existing usage errors for anchor-only flags. Include those flags in validation before creating the segment.
    Confidence: 0.86

Overall correctness: patch is correct
Overall confidence: 0.78

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0d260ac968f0.

Label changes

Label changes:

  • add P3: This is useful Docs ergonomics and feature work with limited immediate blast radius, not an urgent regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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: The external contributor proof gate does not apply to this collaborator-authored PR; the body still records make ci and live Google Docs validation.

Label justifications:

  • P3: This is useful Docs ergonomics and feature work with limited immediate blast radius, not an urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external contributor proof gate does not apply to this collaborator-authored PR; the body still records make ci and live Google Docs validation.
Evidence reviewed

Acceptance criteria:

  • [P1] go test ./internal/cmd ./internal/docsedit.

What I checked:

Likely related people:

  • steipete: Current-main blame and recent logs tie the Docs command registry, write/update/format paths, and adjacent Docs command work to Peter Steinberger. (role: primary Docs surface contributor; confidence: high; commits: 508a4d3cd368, 360310f49093, 0d260ac968f0; files: internal/cmd/docs.go, internal/cmd/docs_edit.go, internal/cmd/docs_format.go)
  • sebsnyk: The linked feature issues were authored by sebsnyk, and visible history shows Sebastian Roth contributed adjacent positional markdown insertion used by the Docs editing surface. (role: recent adjacent contributor and feature reporter; confidence: medium; commits: ab9a331d4c07; files: internal/cmd/docs_edit.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. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jun 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f36226fd20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


func BuildRequests(options Options, start, end int64, tabID string) ([]*docs.Request, error) {
if start <= 0 || end <= start {
if start < 0 || end <= start {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle segment bullet ranges that start at zero

When docs format --segment formats the first paragraph of a header/footer/footnote with both bullet creation and paragraph styling (for example --match Header --bullets --indent-start 36), this newly allowed start == 0 path reaches BuildRequests with PostBulletParagraphStart == 0. The existing post-bullet check below requires > 0, so the paragraph style request is emitted before CreateParagraphBullets instead of after it; bullet creation can then reset indentation/paragraph properties and drop the requested styling for the first paragraph of a segment.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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

1 participant