Skip to content

refactor(review): git-native PR inspection (replaces prompt-hydrated patch text, per #68) #84

@stainlu

Description

@stainlu

Following #68's close — confirming the replacement design before opening code so it matches the intended direction.

Plan:

  • Keep the target checkout on main (preserve the read-only invariant — do not materialize the PR as the working tree).
  • Reuse the existing fetchSourcePullRequestHead primitive (src/repair/source-pr-checkout.ts) to fetch refs/pull/<n>/head into a read-only refs/remotes/clawsweeper/... ref — no new parallel helper.
  • Instruct Codex in prompts/review-item.md to inspect via git diff origin/main...<ref> and git show <ref>:path.
  • Slim compactPullFilesForPrompt to file metadata only, dropping patch bodies. Verified .patch is consumed only by the prompt builder; repair/automerge gates run on the decision JSON + live git, so nothing downstream breaks.

Open question I want to get right: the main checkout is --filter=blob:none, so I'd pre-warm the PR diff blobs deterministically under ClawSweeper's control rather than let Codex trigger lazy promisor fetches inside the sandbox.

Net effect: deletes the truncation layer entirely, simpler core bot. @steipete does this match the direction from #68? I'll scope it as refactor(review): off fresh main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions