feat(local-review): offline committed-range branch review on Commit Sweeper#298
Conversation
Reviews the committed range merge-base(base,HEAD)..HEAD as one unit via the Commit Sweeper engine (runCodexProcess). Conforms to the openclaw#253 replacement spec: clean checkout required, unique per-run output dir, withholds all GitHub tokens, rejects unsupported repos (no foreign-profile fallback). Built fresh off main on the current codex infrastructure.
commitMetadata takes an offline flag that skips the gh api author/committer lookups; local-review passes it. gh ignores token env vars, so not running gh at all is the only way to honor the no-GitHub-access contract. Found by local-review self-reviewing this branch.
Point GH_CONFIG_DIR at an empty dir so the spawned reviewer cannot use cached gh auth even if the review prompt invokes gh for issue refs. Enforces the no-GitHub-access contract at the env level rather than relying on Codex's sandbox. Second finding from local-review self-review.
…adata Hermetic test proves commitMetadata(..., offline=true) reads only local git and never calls gh (uses an unsupported repo slug, so a gh call would fail). Exports commitMetadata for the test.
|
Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 4:36 PM ET / 20:36 UTC. Summary Reproducibility: not applicable. this is a feature PR, not a current-main bug report. Source inspection confirms current main and v0.2.0 lack the requested Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the local-review lane if maintainers accept the feature scope, preserving local-only report output, clean-checkout enforcement, and the no-GitHub-auth boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR, not a current-main bug report. Source inspection confirms current main and v0.2.0 lack the requested Is this the best way to solve the issue? Yes, if maintainers want the feature: reusing the existing Commit Sweeper engine for a clean committed range is a narrow implementation path. The remaining question is whether the local branch review and offline-auth policy belong in core. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b00e25933977. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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
|
Covers localReviewCommand's exit paths without invoking codex: dirty-tree refusal, unsupported-repo rejection, and no-commits-beyond-base. Closes the coverage gap noted in the PR.
Replaces the 'branch review out of scope' note with a section describing the local-review subcommand and its no-GitHub-access credential boundary. Addresses the P3 review finding on openclaw#298.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Adds a 'local-review' package script (node dist/commit-sweeper.js local-review) and updates the docs to invoke it via pnpm, so the documented command is backed by a real entrypoint. Addresses the P1 doc/entrypoint mismatch on openclaw#298.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
gh honors both GH_ENTERPRISE_TOKEN and GITHUB_ENTERPRISE_TOKEN; the offline scrub list omitted the latter, so an Enterprise credential could reach the spawned reviewer. Extracts the scrub list to an exported const, adds the alias, and adds a regression test. Addresses the P1 finding on openclaw#298.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Landed in Verification:
|
What
local-review: an offline, pre-PR review of the current branch's committed range, built on Commit Sweeper. This replaces the closed #253 / #274 — rebuilt from scratch on currentmainto address every point in the #253 closure.It reviews
merge-base(<base>, HEAD)..HEADas a single unit via the existing Commit Sweeper engine (runCodexProcess), reusing its codex worker, report writer, and classifier — no faked PR object.How it addresses the #253 closure
base..HEAD.run-<sha>-<ts>-<pid>/; no shared item-0 / result-path collision.gh-api metadata hydration in offline mode, and pointsGH_CONFIG_DIRat an empty dir so the spawned reviewer can't fall back to cachedghauth.main, usesrunCodexProcess(the branch no longer predates it).Proof — it reviewed its own PR
Ran
local-reviewon this branch againstorigin/main:commitMetadatastill shelled out togh api. Fixed (skipghin offline mode).ghvia the review prompt. Fixed (isolateGH_CONFIG_DIR).result: nothing_found, high confidence).Both offline fixes in this PR were found by the tool reviewing itself.
Tests / not tested
commitMetadata(..., offline=true)reads only local git, never callsgh).-D correctness) +oxfmt+ targeted tests pass.localReviewCommand's guard paths (clean-checkout / no-commits / reject-unsupported) — theyprocess.exit/ spawn codex. Happy to add a CLI-level fixture test before un-drafting.Direction check
This is the Commit-Sweeper-based replacement described in the #253 closure. Opening as draft to confirm the approach and scope match what you intended before I polish coverage — does this look right?