Skip to content

feat(review): offline --local-range mode for pre-submission review (#357 follow-on)#369

Open
anagnorisis2peripeteia wants to merge 8 commits into
openclaw:mainfrom
anagnorisis2peripeteia:feat/offline-local-review
Open

feat(review): offline --local-range mode for pre-submission review (#357 follow-on)#369
anagnorisis2peripeteia wants to merge 8 commits into
openclaw:mainfrom
anagnorisis2peripeteia:feat/offline-local-review

Conversation

@anagnorisis2peripeteia

@anagnorisis2peripeteia anagnorisis2peripeteia commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

#357 added review --local-only — the full proof-aware review (review-item.md +
decision schema, real-behavior-proof + Mantis assessments) for advisory review before
submitting a PR. But it still requires the item to be open on GitHub: it fetches the
item, diff, body, and comments via the API (--item-number) and rejects closed items. So
you can't review your work before opening the PR — which is the stated goal.

This adds --local-range: run that same full review on the local git range
(merge-base(--base, HEAD)..HEAD) with no GitHub fetch. Item + ItemContext are
synthesized from git (diff from git diff, body from the commit message or --body-file),
so the full review — including the real-behavior-proof and Mantis decision — runs offline,
before a PR exists, and on fork checkouts that the gh-fetch gitInfo path rejects.

Relationship to #298 (not a duplicate — its full-review counterpart)

#298 added offline committed-range review on Commit Sweeper — the code-only lane.
This is the full proof-aware counterpart: the same offline committed-range idea, but on
the #357 full-review path (proof + Mantis), which #298's code-only review does not cover. It
deliberately reuses #298's full offline envelope rather than paralleling it:

  • the clean-checkout contract (dirtyWorktree — rejects a dirty tree; the committed-range
    review can't see staged/untracked work);
  • token scrubbing (scrubGitHubCredentialEnv) + an empty GH_CONFIG_DIR
    (isolateGitHubConfigDir) so gh's own cached auth is unreachable — token deletion alone
    can't stop it — + the no-GitHub-access local-review prompt + web search disabled: the same
    no-GitHub-access guarantee;
  • commitMetadata(offline=true) for author/subject/dates;
  • --local-range implies --local-only, so it takes the local Codex-auth / Windows-launcher
    path even when run standalone.

dirtyWorktree, scrubGitHubCredentialEnv, and isolateGitHubConfigDir are extracted from
#298's localReviewCommand (behavior there unchanged) and shared between the two offline paths.

Composing affordances

  • --allow-closed: review closed/merged items (regression fixtures, hypothetical re-review).
  • --body-file <file>: substitute the PR body in the prompt — to test the proof / Mantis
    decision against a hypothetical body, or supply the body when reviewing a local range.
  • --additional-policy <file>: layer a repo-specific policy file onto the review prompt.

Changes

  • --local-range (with --base <ref>, default origin/main): buildLocalRangeReview()
    builds a synthetic Item + ItemContext (pullFiles from git diff, body from the commit
    message) and reviewCommand branches the offline gitInfo ({ mainSha, latestRelease: null },
    no fetch), the synthetic candidate, and the synthetic context, suppresses the start comment,
    and bypasses host-side media proof preprocessing for the synthetic local item.
  • feat(local-review): offline committed-range branch review on Commit Sweeper #298 reuse (full offline envelope): clean-checkout guard (dirtyWorktree),
    scrubGitHubCredentialEnv, empty GH_CONFIG_DIR (isolateGitHubConfigDir), the no-GitHub-access
    prompt, web_search="disabled", and commitMetadata(offline=true) — helpers extracted into
    commit-sweeper.ts and shared. --local-range implies --local-only (local Codex-auth path).
  • rename/copy diffs: the --name-status parser takes the last tab-field as the path, so
    renamed/copied files review the new path instead of an empty patch.
  • synthetic item is authorAssociation: "CONTRIBUTOR" (pre-submission contributor PR, not OWNER).
  • --allow-closed: relaxes the open-only selection gate in selectCandidates.
  • --body-file: injects an authoritative PR-body section into the review prompt.
  • --additional-policy: reads a policy file and layers it onto the review prompt.

Validation

  • TMPDIR=/private/tmp/oflr-proof-check-tmp pnpm run check passed on final-head 8bc4e93425 after refreshing dependencies from current origin/main: unit tests 556 passed, repair tests 569 passed, changed coverage passed, full coverage 1125 passed, and format checked 290 files clean. feat(local-review): offline committed-range branch review on Commit Sweeper #298's local-review tests unaffected by the shared-helper extraction.
  • test/local-range-review.test.ts (9 cases): the synthesized item/context/diff, the
    title + origin/main-base fallbacks, the empty-diff case, rename/copy parsing, the
    dirty-tree refusal, the empty-range throw, the --item-number/--item-numbers conflict,
    and the new guard that a body URL is not host-downloaded before the local-range engine run.
    Mutation 91.76% on buildLocalRangeReview (residual survivors equivalent).
  • Offline envelope verified by live runs: --local-range with bogus GH_TOKEN/GITHUB_TOKEN
    set built the review from git diff (no GitHub API call), scrubbed the tokens, and pointed
    GH_CONFIG_DIR at an empty dir before spawning the engine — i.e. no GitHub read path. The
    latest regression also drives the review CLI with a local HTTP video URL in the synthetic body;
    fake Codex is reached, and the HTTP server observes zero requests, proving local-range skips
    host-side media proof downloads by default.

Scope / notes

  • Advisory/offline only: --local-range implies no GitHub writes (no start comment, no posted
    review) and no GitHub reads (credentials scrubbed, web search off).
  • --local-range reviews committed work — it requires a clean checkout (commit or stash first).
  • Engine selection is intentionally out of scope for this PR.

Evidence — final-head real-behavior proof: no GitHub PR/API path

--local-range reviews the local git range before a PR exists: the item/diff/body are synthesized from local git, GitHub credentials are withheld, gh is pointed at an empty config dir, and Codex web search is disabled. This is not air-gapped model inference — the Codex engine call itself is still a network service — but the PR/repository review input path is local/offline.

Captured on final-head 8bc4e93425 (8bc4e934256c853a3be330979233f2a64b1ad6c7), rebased on ae63b16d6c7483773359acebfa114792a84ed5a4, with bogus GitHub tokens in the parent shell and a wrapper around the real Codex binary:

$ GH_TOKEN=ghp_REDACTED GITHUB_TOKEN=ghp_REDACTED \
    CLAWSWEEPER_CODEX_REVIEW_ATTEMPTS=1 \
    CLAWSWEEPER_PROOF_WRAPPER_DIR=/private/tmp/oflr-proof-proof/wrapper-8bc4e93425 \
    CLAWSWEEPER_REAL_CODEX=/opt/homebrew/bin/codex \
    CODEX_BIN=/private/tmp/oflr-proof-proof/codex-wrapper.cjs \
    node dist/clawsweeper.js review \
      --local-only --local-range \
      --base origin/main \
      --target-repo openclaw/clawsweeper \
      --target-dir . \
      --artifact-dir /private/tmp/oflr-proof-proof/artifacts-8bc4e93425 \
      --codex-reasoning-effort low \
      --codex-timeout-ms 600000
[review] 2026-06-28T09:33:04.388Z shard=0/1 selected=1 scanned_pages=0
[review] 2026-06-28T09:33:04.392Z shard=0/1 start #0 (1/1)
[review] 2026-06-28T09:33:04.393Z shard=0/1 start-comment=skipped #0
[review] 2026-06-28T09:34:29.488Z shard=0/1 done #0 (1/1) decision=keep_open confidence=medium action=kept_open
[review] 2026-06-28T09:34:29.488Z shard=0/1 complete reviewed=1

Wrapper-captured Codex invocation details:

{
  "cwd": "/private/tmp/oflr-proof",
  "sandbox": "read-only",
  "configArgs": [
    "model_reasoning_effort=\"low\"",
    "service_tier=\"fast\"",
    "approval_policy=\"never\"",
    "web_search=\"disabled\""
  ],
  "env": {
    "GH_TOKEN": "[ABSENT]",
    "GITHUB_TOKEN": "[ABSENT]",
    "GH_ENTERPRISE_TOKEN": "[ABSENT]",
    "GITHUB_ENTERPRISE_TOKEN": "[ABSENT]",
    "COMMIT_SWEEPER_TARGET_GH_TOKEN": "[ABSENT]",
    "CLAWSWEEPER_PROOF_INSPECTION_TOKEN": "[ABSENT]",
    "GH_CONFIG_DIR": "/var/folders/.../T/cs-gh-empty-Y7iQh8",
    "OPENAI_API_KEY": "[ABSENT]",
    "CODEX_API_KEY": "[ABSENT]",
    "CODEX_ACCESS_TOKEN": "[ABSENT]"
  }
}

Codex result/proof artifact checks:

  • Wrapper exit status 0, signal null, stderr bytes 0; ClawSweeper produced decision=keep_open / confidence=medium for synthetic item #0.
  • Engine config included approval_policy="never" and web_search="disabled"; sandbox was read-only.
  • The wrapper saw all GitHub token env vars absent inside Codex, including GH_TOKEN, GITHUB_TOKEN, enterprise tokens, COMMIT_SWEEPER_TARGET_GH_TOKEN, and CLAWSWEEPER_PROOF_INSPECTION_TOKEN.
  • GH_CONFIG_DIR was an isolated empty cs-gh-empty-* directory, so cached gh auth was not reachable.
  • Captured Codex JSONL had only read-only local inspection commands (pwd/rg, git status/git diff/git diff --name-only, sed AGENTS.md, file-specific git diff). The parsed command stream matched no gh, curl, wget, ffprobe, ffmpeg, or http(s):// command pattern, and there were no web-search/fetch/browser events.
  • Host-side media preprocessing is also bypassed for --local-range: the regression test drives a synthetic body containing a local HTTP video URL, reaches fake Codex, and the HTTP server observes zero requests.

The local proof files retained for audit were:

  • /private/tmp/oflr-proof-proof/terminal-8bc4e93425.log
  • /private/tmp/oflr-proof-proof/wrapper-8bc4e93425/wrapper-invocation.json
  • /private/tmp/oflr-proof-proof/wrapper-8bc4e93425/wrapper-result.json
  • /private/tmp/oflr-proof-proof/artifacts-8bc4e93425/codex/0.json
  • /private/tmp/oflr-proof-proof/artifacts-8bc4e93425/codex/0.1.codex.stdout.log
  • /private/tmp/oflr-proof-proof/artifacts-8bc4e93425/codex/0.1.codex.stderr.log (0 bytes)

Also guards --item-number/--item-numbers against --local-range (a GitHub-item number is meaningless when the item is synthesized from local git).

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 7:46 AM ET / 11:46 UTC.

Summary
The branch adds a full proof-aware review --local-range mode, related review flags, shared offline guardrails in commit-sweeper, and focused local-range regression tests.

Reproducibility: not applicable. this is a feature PR rather than a current-main bug report. The verification path is source inspection, the added local-range tests, and the final-head terminal proof in the PR body.

Review metrics: 3 noteworthy metrics.

  • Changed files: 3 files affected. The diff is concentrated in review orchestration, shared local-review helpers, and one new local-range test file.
  • CLI affordances: 4 added or extended. --local-range, --allow-closed, --body-file, and --additional-policy change operator-facing review behavior.
  • Local-range tests: 9 cases added. The new test file covers the synthetic review path and security-sensitive guardrails around dirty trees, flag conflicts, rename parsing, and media preprocessing.

Root-cause cluster
Relationship: canonical
Canonical: #369
Summary: This PR is the active follow-on for full proof-aware local-range review; the related merged PRs are prerequisites or adjacent implementations, not duplicates.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Merging adds operator-facing review CLI behavior and local policy/body inputs, so maintainers need to accept the support boundary for full proof-aware pre-submission review.
  • [P1] The no-GitHub-access boundary relies on token scrubbing, GH_CONFIG_DIR isolation, disabled web search, skipped host media preprocessing, and continued prompt compliance rather than complete network isolation.
  • [P1] The PR expands a local automation path that invokes Codex with preserved local auth, so normal CI does not by itself settle the auth-provider and security-boundary policy decision.

Maintainer options:

  1. Accept Local-Range Review Contract (recommended)
    Maintainers can merge after accepting the new full-review local-range CLI surface, terminal proof, and no-GitHub-access boundary as sufficient for advisory pre-submission review.
  2. Narrow The First Surface
    If the combined CLI expansion is too broad, defer --allow-closed, --body-file, or --additional-policy and land only the smallest local-range path first.
  3. Pause For Product Direction
    If full proof-aware pre-PR review is not accepted product direction yet, pause or close this PR in favor of a maintainer-sponsored design.

Next step before merge

  • [P2] Maintainers need to accept the new review CLI surface and auth-boundary contract; there is no narrow automated repair to queue.

Security
Cleared: No concrete security or supply-chain defect was found in the diff; the auth and no-GitHub-access behavior remains a maintainer merge-risk decision.

Review details

Best possible solution:

Land the local-range full-review mode after maintainers accept the new CLI surface and preserve the shared offline guardrails plus regression tests.

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

Not applicable: this is a feature PR rather than a current-main bug report. The verification path is source inspection, the added local-range tests, and the final-head terminal proof in the PR body.

Is this the best way to solve the issue?

Yes at the implementation level: reusing the existing full review path and shared Commit Sweeper offline guardrails is narrow and maintainable. The remaining question is maintainer acceptance of the new CLI and auth-boundary product surface.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded but automation-sensitive review CLI improvement with limited direct user blast radius.
  • merge-risk: 🚨 automation: The diff changes review selection, synthetic item construction, artifact layout, media preprocessing, and Codex invocation for the review lane.
  • merge-risk: 🚨 security-boundary: The new mode relies on preserving a no-GitHub-access boundary for locally synthesized reviews.
  • merge-risk: 🚨 auth-provider: The PR changes which credentials and local Codex auth paths are available to review subprocesses in local-range runs.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. The idea is strategically useful because contributors can run the same proof-aware ClawSweeper review before opening a PR while reusing accepted local-review guardrails.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes final-head terminal and wrapper output showing local-range review with GitHub tokens absent, isolated GH_CONFIG_DIR, disabled web search, and local git input.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes final-head terminal and wrapper output showing local-range review with GitHub tokens absent, isolated GH_CONFIG_DIR, disabled web search, and local git input.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its conservative automation-safe review guidance applies because this PR changes ClawSweeper review behavior and credential boundaries. (AGENTS.md:1, ae63b16d6c74)
  • Current main gap: Current main has no local-range or buildLocalRangeReview implementation, so the useful PR work is not already implemented on main. (ae63b16d6c74)
  • Local-range implementation: PR head synthesizes a pull-request item/context from merge-base(base, HEAD)..HEAD, rejects dirty trees, uses offline commit metadata, and parses rename/copy rows by new path. (src/clawsweeper.ts:16340, 8bc4e934256c)
  • Offline guardrails: PR head scrubs GitHub token env vars, isolates GH_CONFIG_DIR, layers the local-review no-network prompt, and uses a synthetic local context instead of GitHub item collection. (src/clawsweeper.ts:16508, 8bc4e934256c)
  • Shared helper extraction: The branch extracts shared token scrubbing, dirty-tree checking, isolated GH_CONFIG_DIR, and disabled-web-search config for both offline review paths. (src/commit-sweeper.ts:407, 8bc4e934256c)
  • Codex invocation boundary: The local-range path preserves local Codex auth, uses the local review path, and passes web_search="disabled" to the spawned Codex process. (src/clawsweeper.ts:16648, 8bc4e934256c)

Likely related people:

  • brokemac79: Merged commit 79e7688 added the local-only issue/PR review workflow that this PR extends. (role: introduced local-only full review path; confidence: high; commits: 79e768844291; files: src/clawsweeper.ts, README.md, .agents/skills/local-clawsweeper-review/SKILL.md)
  • anagnorisis2peripeteia: Merged feat(local-review): offline committed-range branch review on Commit Sweeper #298 added the Commit Sweeper local-review command and the offline guardrails this PR reuses; this is prior merged history, not just authorship of this PR. (role: introduced merged offline committed-range guardrails; confidence: high; commits: d877d4e7e095, 57584f74d887, c22dd1ea81cc; files: src/commit-sweeper.ts, test/local-review.test.ts, docs/commit-sweeper.md)
  • joshavant: Merged Add local-only issue and PR review mode #357 includes multiple local review hardening commits for Codex auth, checkout handling, and local review output. (role: adjacent local review hardening contributor; confidence: high; commits: 98418faa372a, 156032f9be11, 73e146405cf9; files: src/clawsweeper.ts, src/codex-env.ts, src/codex-spawn.ts)
  • Dallin Romney: Current-main blame shows the broader review command and commit-sweeper scaffolding in commit 4e5c4d4, which is adjacent to the touched orchestration. (role: base review lane contributor; confidence: medium; commits: 4e5c4d47c83f; files: src/clawsweeper.ts, src/commit-sweeper.ts)
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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jun 25, 2026
@anagnorisis2peripeteia anagnorisis2peripeteia marked this pull request as draft June 25, 2026 02:50
@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

Reworked to address the review — pushed 3eae0ed.

To clarify the relationship: this is the #357 full proof-aware review made to run offline, not a duplicate of #298. #298 added offline committed-range review on Commit Sweeper — the code-only lane; this is its full-review counterpart (review-item.md + decision schema, real-behavior-proof + Mantis), which the code-only path doesn't cover.

It no longer parallels #298's offline path — it now reuses it:

dirtyWorktree and scrubGitHubCredentialEnv are extracted from #298's localReviewCommand (behavior there unchanged) and shared between the two offline paths, so this builds on #298 rather than paralleling it.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

anagnorisis2peripeteia added a commit to anagnorisis2peripeteia/clawsweeper that referenced this pull request Jun 25, 2026
…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.
@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

Addressed all four findings — pushed 0ccce350.

  • [P1 security] gh config isolation: --local-range now reuses feat(local-review): offline committed-range branch review on Commit Sweeper #298's full offline envelope — an empty GH_CONFIG_DIR (isolateGitHubConfigDir, extracted from localReviewCommand) so gh's cached auth is unreachable, plus the no-network local-review prompt — not just token scrubbing.
  • [P1] local Codex auth: --local-range now implies --local-only, so a standalone run takes the local Codex-auth / Windows-launcher path.
  • [P2] rename/copy diffs: the name-status parser takes the last tab-field as the path, so R100<tab>old<tab>new rows review the new path instead of an empty patch (new test covers it).
  • [P2] author association: the synthetic item is CONTRIBUTOR, not OWNER, so the proof gate exercises the real pre-submission path.

On proof: codex is rate-limited right now, so a full final-head Decision capture is pending engine quota. The offline envelope is verified by a live run (built the review from git diff with bogus GH_TOKEN/GITHUB_TOKEN scrubbed and GH_CONFIG_DIR isolated — no GitHub API call) and by the test suite.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

Addressed the P2 (unique output paths) — pushed 514c25eb.

--local-range reviews are synthesized as item #0, so their item-numbered artifacts (0.md, codex/0.json, proof-scratch/0, logs) could overwrite each other across repeated/concurrent pre-PR runs under one default dir. The default artifact dir is now per-run (local-range-<ts>-<pid>, mirroring #298's run-<id> identity); an explicit --artifact-dir is still honored as-is.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@brokemac79

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

Added the real-behavior proof for offline --local-range to the PR body (final-head 514c25eb): ran the review with bogus GH_TOKEN/GITHUB_TOKEN and the normal gh login present — it produced a valid Decision with tokens scrubbed, an empty GH_CONFIG_DIR (no cached gh auth), web search disabled, the diff read from git (synthetic-local item, no pulls/<n> fetch), and zero network actions by the engine.

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 26, 2026
@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

Addressed the findings — pushed 331628dd.

On the "offline boundary / no network" P1s: the framing was the issue, and I've narrowed it in the body. --local-range is about reviewing before a PR exists — it synthesizes the item/diff from local git with GitHub credentials/access withheld (the #298 envelope), so it never reaches the real PR/repo. It is not air-gapped — codex itself is a network call. So "the offline boundary is incomplete because media-proof can curl a URL" rests on a zero-network claim the PR never actually makes; the Evidence section now states the real guarantee (no GitHub PR fetch + creds withheld), not "no network." Running the review model locally too — true total-offline — is a deliberate follow-up on the local-inference path.

The genuine flag-conflict is fixed: --item-number / --item-numbers are now rejected with --local-range (a GitHub-item number is meaningless when the item is synthesized from local git, and could otherwise route into a managed checkout) — with a CLI test.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 27, 2026
Add --allow-closed (review closed/merged items: fixtures, hypothetical re-review),
--body-file (substitute a hypothetical PR body to exercise the proof/mantis decision,
and to feed the body to engines that cannot fetch it live), and --additional-policy
(layer a repo-specific policy file). All route through additionalPrompt + the one
selection gate, so they apply to every engine uniformly.
Synthesize the Item + ItemContext from the local git range
(merge-base(--base, HEAD)..HEAD) so the full review — real-behavior proof and
mantis decision — runs BEFORE a PR exists and WITHOUT a GitHub fetch. The diff
comes from `git diff`, the body from the commit message (or --body-file), so it
works offline and on fork checkouts that the gh-fetch path rejects.
Add buildLocalRangeReviewForTest + a temp-git-repo test asserting the synthetic
PR item, the commit-message body, and the git-diff pullFiles are built offline,
and that an empty range throws.
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.
--local-range synthesizes the review item from the local git range and never fetches a
GitHub item, so an item number is meaningless there and could otherwise route into a
managed GitHub checkout. Reject the combination with a clear error (+ a CLI test).
Addresses the @clawsweeper P2 flag-conflict finding.
@anagnorisis2peripeteia

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 28, 2026
@anagnorisis2peripeteia anagnorisis2peripeteia marked this pull request as ready for review June 28, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant