Skip to content

chore(lint): enable no-zero-fractions#81045

Open
DragunovX16 wants to merge 1 commit into
openclaw:mainfrom
DragunovX16:fix/80504-no-zero-fractions
Open

chore(lint): enable no-zero-fractions#81045
DragunovX16 wants to merge 1 commit into
openclaw:mainfrom
DragunovX16:fix/80504-no-zero-fractions

Conversation

@DragunovX16

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Enable remaining readability lint rules in cleanup batches #80504 tracks enabling the remaining readability lint rules in cleanup batches; unicorn/no-zero-fractions still had 52 hits on current main.
  • Why it matters: enabling small zero-drift lint batches keeps readability policy moving without bundling hundreds of unrelated style changes into one review.
  • What changed: enabled unicorn/no-zero-fractions, applied its mechanical fixes, and added it to the oxlint config coverage test.
  • What did NOT change (scope boundary): the noisier readability rules from Enable remaining readability lint rules in cleanup batches #80504 remain deferred for separate PRs.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: unicorn/no-zero-fractions is now enforced and the previous 52 zero-fraction literals are cleaned up.
  • Real environment tested: Local OpenClaw source checkout on Linux, branch fix/80504-no-zero-fractions, based on upstream main fce4f10e96.
  • Exact steps or command run after this patch:
    • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json src ui packages extensions scripts
    • pnpm test test/scripts/oxlint-config.test.ts -- --reporter=verbose
    • pnpm check:changed
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):
$ node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json src ui packages extensions scripts
Found 0 warnings and 0 errors.
Finished in 122.6s on 14131 files with 217 rules using 1 threads.

$ pnpm test test/scripts/oxlint-config.test.ts -- --reporter=verbose
Test Files  1 passed (1)
Tests       9 passed (9)
[test] passed 1 Vitest shard in 16.02s

$ pnpm check:changed
[check:changed] lanes=core, coreTests, extensions, extensionTests, tooling
Found 0 warnings and 0 errors. # core lint
Found 0 warnings and 0 errors. # extensions lint
Found 0 warnings and 0 errors. # scripts lint
runtime-sidecar-loaders: local runtime sidecar loaders look OK.
Import cycle check: 0 runtime value cycle(s).
  • Observed result after fix: the lint wrapper passes with unicorn/no-zero-fractions enabled in .oxlintrc.json, and the config test locks the rule as enabled.
  • What was not tested: runtime behavior, because this is a mechanical lint-policy cleanup.
  • Before evidence (optional but encouraged):
$ node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json -D unicorn/no-zero-fractions src ui packages extensions scripts
Found 0 warnings and 52 errors.

Root Cause (if applicable)

N/A

  • Root cause: N/A
  • Missing detection / guardrail: unicorn/no-zero-fractions was intentionally left out of the previous zero-drift batch because its cleanup needed a separate pass.
  • Contributing context (if known): Enable remaining readability lint rules in cleanup batches #80504 lists this rule in the suggested small readability batch.

Regression Test Plan (if applicable)

N/A

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: test/scripts/oxlint-config.test.ts
  • Scenario the test should lock in: unicorn/no-zero-fractions remains enabled in .oxlintrc.json.
  • Why this is the smallest reliable guardrail: the change is lint-policy only, so config coverage plus the oxlint wrapper directly proves it.
  • Existing test that already covers this (if any): test/scripts/oxlint-config.test.ts
  • If no new test is added, why not: The existing config coverage test was extended.

User-visible / Behavior Changes

None.

Diagram (if applicable)

N/A

Before:
zero-fraction literals -> rule disabled -> cleanup not enforced

After:
zero-fraction literals cleaned -> rule enabled -> future regressions fail lint

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: local source checkout
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): .oxlintrc.json

Steps

  1. Re-run the issue probe for unicorn/no-zero-fractions on current main.
  2. Apply the mechanical lint fixes and enable the rule.
  3. Run oxlint, the config test, and pnpm check:changed.

Expected

  • No remaining unicorn/no-zero-fractions lint findings.
  • The rule is present in .oxlintrc.json and covered by the config test.

Actual

  • All validation commands passed.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: remeasured 52 pre-fix lint hits, applied the mechanical fixes, enabled the rule, and confirmed the full oxlint wrapper passes.
  • Edge cases checked: config coverage includes the new rule so it cannot silently drop from .oxlintrc.json.
  • What you did not verify: runtime behavior, because no runtime code path changed beyond numeric literal spelling.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: This handles only one rule from the small readability batch.
    • Mitigation: keeping the PR small makes review straightforward; the remaining rules can land as separate cleanup PRs.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core scripts Repository scripts agents Agent runtime and tooling extensions: minimax extensions: huggingface extensions: volcengine extensions: kilocode extensions: arcee size: S proof: supplied External PR includes structured after-fix real behavior proof. labels May 12, 2026
@clawsweeper

clawsweeper Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 12:53 AM ET / 04:53 UTC.

Summary
The branch enables unicorn/no-zero-fractions, rewrites zero-fraction numeric literals across core, UI, plugins, scripts, and tests, and adds the rule to oxlint config coverage.

PR surface: Source 0, Tests +1, Other +1. Total +2 across 22 files.

Reproducibility: not applicable. as a cleanup PR rather than a runtime bug. The PR body does provide a high-signal before lint probe and after terminal output for the lint wrapper, config test, and changed checks.

Review metrics: 2 noteworthy metrics.

  • Closing references: 1 broad open tracker uses closing syntax. The PR covers one lint rule from a multi-rule cleanup tracker, so merge would close more work than it completes.
  • Current-main conflicts: 1 PR-edited file deleted on current main. The branch needs refresh before maintainers can trust the final merge result or CI state.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

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

Rank-up moves:

Risk before merge

  • [P1] The PR body currently uses closing syntax for Enable remaining readability lint rules in cleanup batches #80504 even though this branch only handles one rule from that broader tracker, so merge automation would close remaining lint work prematurely.
  • [P1] The branch is dirty against current main: at least one PR-edited test file has been deleted on main, so the branch needs a rebase or conflict resolution before normal merge gates can evaluate the exact result.

Maintainer options:

  1. Fix metadata and stale base before merge (recommended)
    Replace the broad closing reference with a non-closing link to Enable remaining readability lint rules in cleanup batches #80504, then rebase the branch so current-main conflicts are resolved and the lint checks can be rerun.
  2. Manually own the tracker side effect
    A maintainer could accept the automation risk only if they intentionally keep or reopen the broader lint tracker after this one-rule cleanup lands.

Next step before merge

  • [P2] No code repair lane is needed; a maintainer or contributor should refresh the branch and replace the broad closing reference before normal merge review.

Security
Cleared: The diff is a mechanical lint-rule enablement and numeric-literal cleanup; it does not add dependencies, secrets handling, permissions, network calls, or new code-execution paths.

Review details

Best possible solution:

Land the focused lint cleanup after preserving the broader tracker and resolving current-main conflicts.

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

Not applicable as a cleanup PR rather than a runtime bug. The PR body does provide a high-signal before lint probe and after terminal output for the lint wrapper, config test, and changed checks.

Is this the best way to solve the issue?

Yes for the code direction: enabling the rule, applying mechanical numeric-literal fixes, and extending the config coverage test is the narrow maintainable path. The merge path still needs PR metadata cleanup and a rebase before it is safe to land.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against f7c32fc8befd.

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: This is a low-risk mechanical lint-policy cleanup with no intended runtime behavior change.
  • merge-risk: 🚨 automation: The PR body's broad closing reference can make GitHub automation close the remaining lint cleanup tracker when this narrower PR merges.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output for the lint wrapper, oxlint config test, and changed checks, which is sufficient real behavior proof for this mechanical lint-policy change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output for the lint wrapper, oxlint config test, and changed checks, which is sufficient real behavior proof for this mechanical lint-policy change.
Evidence reviewed

PR surface:

Source 0, Tests +1, Other +1. Total +2 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 8 14 14 0
Tests 11 31 30 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 4 3 +1
Total 22 49 47 +2

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the related lint cleanup tracker and recent commits enabling adjacent oxlint rules in .oxlintrc.json and the config coverage test. (role: recent lint-area contributor and tracker author; confidence: high; commits: 155162a8cd80, cd2ef0f3a362, c95d6049c2ef; files: .oxlintrc.json, test/scripts/oxlint-config.test.ts)
  • vincentkoc: Vincent Koc recently changed the extension test-plan script that this mechanical cleanup touches, and the PR author explicitly asked him for review. (role: adjacent tooling contributor; confidence: medium; commits: c756d61cdc76, 9e2e4cde1911, b535d1e2b91d; files: scripts/lib/extension-test-plan.mjs, .oxlintrc.json)
  • cpojer: Local history shows multiple earlier oxlint and formatting rule-enablement commits by cpojer across the affected lint configuration surface. (role: prior lint tooling contributor; confidence: medium; commits: d0cb8c19b2a1, 843acd52b772, 935a0e57083d; files: .oxlintrc.json, test/scripts/oxlint-config.test.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 the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 12, 2026
@DragunovX16

Copy link
Copy Markdown
Contributor Author

@vincentkoc could you please review my PR and give me feedback? Thanks.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 27, 2026
@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg: ✨ hatched 🥚 common Mossy Crabkin. Rarity: 🥚 common. Trait: purrs at green checks.

Details

Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Mossy Crabkin in ClawSweeper.
Hatchability:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

About:

  • Eggs appear after real-behavior proof passes. They are collectible flavor only.
  • Review momentum changes the shell state: follow-up work warms it, re-review makes it wobble, and a clean final review lets it hatch.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui extensions: arcee extensions: huggingface extensions: kilocode extensions: memory-core Extension: memory-core extensions: minimax extensions: volcengine gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S 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.

Enable remaining readability lint rules in cleanup batches

1 participant