Repository navigation
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:
|
Addresses review feedback that the offline --local-range full review paralleled the hardened local-review path (openclaw#298) instead of reusing it. Now --local-range: - enforces openclaw#298's clean-checkout contract (dirtyWorktree guard — rejects a dirty tree; the committed-range review can't see staged/untracked work); - scrubs every GitHub credential from the engine (scrubGitHubCredentialEnv) and disables web search (LOCAL_REVIEW_WEB_SEARCH_CONFIG) — the same offline guarantee; - reuses commitMetadata(offline=true) for author/subject/dates instead of its own git calls. dirtyWorktree + scrubGitHubCredentialEnv are extracted from commit-sweeper.ts's localReviewCommand (behavior unchanged there) and shared. This is the openclaw#357 full proof-aware review made offline — distinct from openclaw#298's commit-sweeper code-only lane, but built on its offline plumbing.
…rename parsing Re-review of openclaw#369 found four issues; all fixed: - [P1 security] --local-range now reuses openclaw#298's FULL offline envelope, not just token scrubbing: an empty GH_CONFIG_DIR (isolateGitHubConfigDir) so gh's own cached auth is unreachable, plus the no-network localReviewAdditionalPrompt. - [P1] --local-range implies --local-only, so a standalone run takes the local Codex auth / Windows-launcher path (was gated on --local-only alone). - [P2] name-status parser takes the LAST tab-field as the path, so rename/copy rows (R100<tab>old<tab>new) review the new path instead of an empty patch. - [P2] synthetic item is authorAssociation CONTRIBUTOR, not OWNER, so the proof gate exercises the real pre-submission path. isolateGitHubConfigDir is extracted from openclaw#298's localReviewCommand (behavior unchanged there) and shared between the offline paths.
…llision) Addresses @clawsweeper P2: every --local-range review is synthesized as item #0, so its item-numbered artifacts (0.md, codex/0.json, proof-scratch/0, logs) under one default dir collide across repeated/concurrent pre-PR runs. The default dir is now per-run (local-range-<ts>-<pid>, mirroring openclaw#298's run identity). An explicit --artifact-dir is still honored as-is.
Addresses review feedback that the offline --local-range full review paralleled the hardened local-review path (openclaw#298) instead of reusing it. Now --local-range: - enforces openclaw#298's clean-checkout contract (dirtyWorktree guard — rejects a dirty tree; the committed-range review can't see staged/untracked work); - scrubs every GitHub credential from the engine (scrubGitHubCredentialEnv) and disables web search (LOCAL_REVIEW_WEB_SEARCH_CONFIG) — the same offline guarantee; - reuses commitMetadata(offline=true) for author/subject/dates instead of its own git calls. dirtyWorktree + scrubGitHubCredentialEnv are extracted from commit-sweeper.ts's localReviewCommand (behavior unchanged there) and shared. This is the openclaw#357 full proof-aware review made offline — distinct from openclaw#298's commit-sweeper code-only lane, but built on its offline plumbing.
…rename parsing Re-review of openclaw#369 found four issues; all fixed: - [P1 security] --local-range now reuses openclaw#298's FULL offline envelope, not just token scrubbing: an empty GH_CONFIG_DIR (isolateGitHubConfigDir) so gh's own cached auth is unreachable, plus the no-network localReviewAdditionalPrompt. - [P1] --local-range implies --local-only, so a standalone run takes the local Codex auth / Windows-launcher path (was gated on --local-only alone). - [P2] name-status parser takes the LAST tab-field as the path, so rename/copy rows (R100<tab>old<tab>new) review the new path instead of an empty patch. - [P2] synthetic item is authorAssociation CONTRIBUTOR, not OWNER, so the proof gate exercises the real pre-submission path. isolateGitHubConfigDir is extracted from openclaw#298's localReviewCommand (behavior unchanged there) and shared between the offline paths.
…llision) Addresses @clawsweeper P2: every --local-range review is synthesized as item #0, so its item-numbered artifacts (0.md, codex/0.json, proof-scratch/0, logs) under one default dir collide across repeated/concurrent pre-PR runs. The default dir is now per-run (local-range-<ts>-<pid>, mirroring openclaw#298's run identity). An explicit --artifact-dir is still honored as-is.
…weeper (openclaw#298) * feat: add local-review command for offline branch review 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. * fix(local-review): skip gh-api metadata in offline mode 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. * fix(local-review): isolate gh config in offline mode 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. * test(local-review): cover offline metadata contract; export commitMetadata 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. * test(local-review): add CLI guard-path coverage 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. * docs(commit-sweeper): document the local-review offline branch lane 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. * fix(local-review): add runnable local-review entrypoint 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. * fix(local-review): scrub GITHUB_ENTERPRISE_TOKEN alias 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. * fix(local-review): disable network lookups * fix(local-review): require configured profiles --------- Co-authored-by: Peter Steinberger <[email protected]>
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?