fix: resolve six confirmed bugs found in codebase audit#3
Open
cropsgg wants to merge 1 commit into
Open
Conversation
- [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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.