Skip to content

[WS3] Isolate rg tool as clean 2-commit rebaseable patch #161

@randomm

Description

@randomm

Parent: #158

Objective

Clean our rg tool changes into exactly 2 isolated git commits that can be reliably rebased onto upstream after each sync.

Current State

The rg tool diff is currently contaminated with unrelated upstream changes. It needs to be isolated into:

Commit A: Add rg tool (pure additions — zero conflict risk)

  • packages/opencode/src/tool/rg.ts — 222 lines NEW
  • packages/opencode/src/tool/rg.txt — 13 lines NEW

Commit B: Swap grep/glob → rg in registry (8 lines — only conflict point)

  • packages/opencode/src/tool/registry.ts — 2 import swaps, 2 array entry swaps
  • Ensure glob.ts, glob.txt, grep.ts, grep.txt deletions are handled

Conflict Risk Analysis

registry.ts has ~2.5 commits/month upstream. Most changes are adding new tool imports + entries to the all() array — exactly where our diff touches. Estimated:

  • ~70% of upstream changes will auto-merge cleanly
  • ~30% will need trivial manual resolution (import block reordering)

Implementation Steps

  1. Interactive rebase to isolate rg changes from other fork changes
  2. Verify Commit A applies cleanly on current upstream HEAD
  3. Verify Commit B applies cleanly (or identify minimal manual fix)
  4. Document the rebase-onto command for sync automation
  5. Integrate into WS2's upstream-sync.yml workflow

Sync Command

git rebase --onto upstream/dev <recorded-base-sha> fork/rg-tool
bun run typecheck && bun test

Acceptance Criteria

  • Exactly 2 commits, cleanly separated
  • Commit A has zero overlap with upstream files
  • Commit B touches only registry.ts with minimal diff (~8 lines)
  • Both commits apply cleanly on current upstream dev HEAD
  • Rebase command documented and tested
  • Integrated into sync automation (WS2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions