Skip to content

fix: resolve six confirmed bugs found in codebase audit#3

Open
cropsgg wants to merge 1 commit into
openclaw:mainfrom
cropsgg:fix/codebase-audit-bugs
Open

fix: resolve six confirmed bugs found in codebase audit#3
cropsgg wants to merge 1 commit into
openclaw:mainfrom
cropsgg:fix/codebase-audit-bugs

Conversation

@cropsgg
Copy link
Copy Markdown

@cropsgg cropsgg commented May 21, 2026

So I was looking bugs in the codebase and my claude agent found some , I confirmed them manually and resolved them as well , all test cases did pass as well

Below are the bugs , if helpful kindly merge it

  • [CRITICAL] source.mjs: wrap readJson JSON.parse in try/catch so a single malformed state-branch file no longer crashes the full render pipeline; emits console.warn and returns the caller's fallback instead

  • [HIGH] repair-dashboard.mjs: inspectionRow and closeRow both had a copy-paste error where the "Cluster" column and the "Report" column rendered the identical clusterLink; Cluster is now plain text so Report is the only hyperlink to the cluster state file

  • [MEDIUM] markdown.mjs: percent() returned "0.0%" when the denominator was zero, which misrepresents absence of data as a 0% rate; now returns "N/A" for zero denominators

  • [MEDIUM] dashboard.yml: setup-node action pinned to @v5 while ci.yml uses @v6; bumped to @v6 for consistency

  • [LOW] markdown.mjs: truncate() violated its max contract when max < 4 by always appending "..." (3 chars) regardless; now returns a clean slice for max values below 4

Tests: new test/source.test.mjs (5 cases); extended test/render.test.mjs (+percent N/A cases, +truncate edge cases); extended test/repair-dashboard.test.mjs (needs_human fixture, column assertions). All 10 tests pass.

- [CRITICAL] source.mjs: wrap readJson JSON.parse in try/catch so a
  single malformed state-branch file no longer crashes the full render
  pipeline; emits console.warn and returns the caller's fallback instead

- [HIGH] repair-dashboard.mjs: inspectionRow and closeRow both had a
  copy-paste error where the "Cluster" column and the "Report" column
  rendered the identical clusterLink; Cluster is now plain text so
  Report is the only hyperlink to the cluster state file

- [MEDIUM] markdown.mjs: percent() returned "0.0%" when the denominator
  was zero, which misrepresents absence of data as a 0% rate; now
  returns "N/A" for zero denominators

- [MEDIUM] dashboard.yml: setup-node action pinned to @v5 while ci.yml
  uses @v6; bumped to @v6 for consistency

- [LOW] markdown.mjs: truncate() violated its max contract when max < 4
  by always appending "..." (3 chars) regardless; now returns a clean
  slice for max values below 4

Tests: new test/source.test.mjs (5 cases); extended test/render.test.mjs
(+percent N/A cases, +truncate edge cases); extended
test/repair-dashboard.test.mjs (needs_human fixture, column assertions).
All 10 tests pass.

https://claude.ai/code/session_016BorTvjkqGo1cSzTkKc5BL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants