Skip to content

fix(scripts): drop redundant boolean comparison in worker detection - #124668

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-check-changed-lint
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-check-changed-lint

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

main is red on check-lint, which blocks the merge gate for every open PR:

scripts/check-changed.mts
  245:7  error  This expression unnecessarily compares a boolean value to a boolean instead of using it directly.  typescript(no-unnecessary-boolean-literal-compare)

Confirmed on main itself (run 31955692694, commit eb174bcaffd, job check-lint), not only on PR branches. Three unrelated PRs hit the identical failure.

Why This Change Was Made

ChangedCheckDelegateOptions.interactive is boolean | undefined and process.stdin.isTTY is boolean, so options.interactive ?? process.stdin.isTTY already narrows to boolean. The === true comparison is redundant and the type-aware rule is correct to reject it.

Dropping the comparison is behavior-preserving across all three cases: true and false keep their truthiness, and an undefined fallback result was already falsy under === true.

User Impact

None at runtime. This only unblocks CI.

Evidence

  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/check-changed.mts — clean (exit 0).
  • node scripts/run-vitest.mjs test/scripts/changed-lanes.test.ts — 151 passed, 1 failed, and that same test (runs trusted changed gates on a dedicated Linux worker) fails identically on unmodified origin/main in this environment while passing on hosted CI, so it is ambient-environment sensitivity rather than a regression from this change. Recorded here rather than fixed, since it is a separate defect from the lint break this PR unblocks.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 16, 2026 15:35
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 16, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 16, 2026
@steipete
steipete merged commit 5f56199 into main Aug 16, 2026
117 of 118 checks passed
@steipete
steipete deleted the steipete/fix-check-changed-lint branch August 16, 2026 15:41
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 11:40 AM ET / 15:40 UTC.

ClawSweeper review

What this changes

The PR removes a redundant strict-true comparison from the changed-check worker detector so the scripts lint lane accepts the condition without changing its boolean result.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. Current main retains the lint-invalid condition, and this maintainer-owned, protected-label PR should remain open for normal exact-head CI and merge handling. Likely related people: steipete (high confidence, recent worker-routing contributor).

Priority: P3
Reviewed head: 72a4790afb1061db3b43557c94a825ddd2ff02dc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral repair with source and existing-test support; normal exact-head CI remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned internal CI repair is exempt from the external-contributor real-behavior-proof gate; its PR body supplies targeted lint evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned internal CI repair is exempt from the external-contributor real-behavior-proof gate; its PR body supplies targeted lint evidence.
Evidence reviewed 5 items Current-main failure location: Current main still compares the nullable interactive option and boolean TTY result to true at the exact condition the PR changes.
Routing owner and caller: The detector is consumed by the delegation decision, so replacing the comparison preserves the existing local-versus-remote routing branch for true and false values.
Sibling regression coverage: Existing worker-routing coverage exercises interactive false, true, explicit worker, and workstation states; the patch leaves those truthiness outcomes unchanged.
Findings None None.
Security None None.

How this fits together

The changed-check script classifies changed files and decides whether to run validation locally or delegate it to a remote runner. The worker-environment detector feeds that routing decision before dependency readiness selects local gates or remote execution.

flowchart LR
A[Changed files] --> B[Changed-check planner]
B --> C[Worker environment]
C --> D{Dedicated Linux worker?}
D --> E[Local dependency check]
D --> F[Remote runner]
E --> G[Local validation gates]
Loading

Before merge

  • Complete next step (P2) - No repair job is needed: the proposed one-line correction is coherent and awaits ordinary maintainer CI and merge handling.
Agent review details

Security

None.

PR surface

Other 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 1 1 1 0

Review metrics

Metric Value Why it matters
Production versus test LOC production +1/-1 (net 0); tests +0/-0 The lint repair simplifies one routing predicate without expanding runtime behavior or test surface.

Technical review

Best possible solution:

Keep the direct boolean condition and merge once the exact PR head has completed the required lint and CI gates.

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

Yes—current main contains the exact boolean comparison at scripts/check-changed.mts:245, and the surrounding type declarations establish the source-level lint violation; this review did not rerun the lint command locally.

Is this the best way to solve the issue?

Yes—the nullish-coalesced expression is already used solely as a condition and is boolean on this path, so removing the redundant comparison is the narrowest maintainable repair.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small internal lint-gate repair with no user-visible runtime behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned internal CI repair is exempt from the external-contributor real-behavior-proof gate; its PR body supplies targeted lint evidence.

Label justifications:

  • P3: This is a small internal lint-gate repair with no user-visible runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned internal CI repair is exempt from the external-contributor real-behavior-proof gate; its PR body supplies targeted lint evidence.

Evidence

What I checked:

  • Current-main failure location: Current main still compares the nullable interactive option and boolean TTY result to true at the exact condition the PR changes. (scripts/check-changed.mts:245, 886e5c049005)
  • Routing owner and caller: The detector is consumed by the delegation decision, so replacing the comparison preserves the existing local-versus-remote routing branch for true and false values. (scripts/check-changed.mts:283, 72a4790afb10)
  • Sibling regression coverage: Existing worker-routing coverage exercises interactive false, true, explicit worker, and workstation states; the patch leaves those truthiness outcomes unchanged. (test/scripts/changed-lanes.test.ts:1244, 886e5c049005)
  • Feature-history provenance: The surrounding dedicated-worker routing behavior appears in Peter Steinberger's recent worker-routing change, making him the strongest current-history routing contact. (scripts/check-changed.mts:228, 55240929f5ad)
  • Patch scope: The branch changes only the condition expression, with a net-zero production-line delta and no formatting error in the three-way diff. (scripts/check-changed.mts:245, 72a4790afb10)

Likely related people:

  • steipete: Authored the recent dedicated-Linux-worker routing change whose implementation contains the affected condition, and is also the author of this focused correction. (role: recent worker-routing contributor; confidence: high; commits: 55240929f5ad; files: scripts/check-changed.mts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS 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