Skip to content

[fix] preserve raw bytes and bound hexadecimal grouping (LET-46) - #201

Merged
vt128 merged 1 commit into
masterfrom
codex/fix-bytes-hex-bounds-let46
Nov 10, 2026
Merged

vt128 merged 1 commit into
masterfrom
codex/fix-bytes-hex-bounds-let46

Conversation

@vt128

@vt128 vt128 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

bytes_hex decoded its byte input as UTF-8, so binary data such as b"\xff\xc3\xa9" produced the wrong hexadecimal string. It also negated the minimum signed 64-bit grouping count, causing a negative-index panic; narrowing large grouping counts could change their meaning on 32-bit hosts.

Walk the input byte by byte and check grouping bounds before converting to int. Existing grouping direction, argument errors and ordinary ASCII results are preserved. Add binary-data and integer-boundary regressions, a reusable public-API benchmark, and concise parameter documentation. Fixes LET-46.

Validation:

  • Full build, race tests (count 2), vet and coverage comparison pass on Go 1.27.3 and Go 1.19.13. The modified function has 20/20 covered statements; other functions retain coverage. All 28 direct boundary cases also pass on Linux/386.
  • Sixteen paired framework checks pass across Starbox, StarCLI main/examples and Base, with eight identical consumer coverage profiles. Four fresh CLI binaries pass eight public examples and the expected old-error/new-success boundary checks. CLI module preparation symmetrically selects the existing Starlet requirement of Starlight v0.2.2.
  • One fixed ASCII benchmark comparison covers 14 cases on both compilers: no consistent slowdown was observed, allocation counts match, and reported bytes vary by at most one byte for 4 KiB inputs. This small sample does not establish equivalence or a general speedup. No dependency or interpreter changes.

@codacy-production

codacy-production Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 31 complexity · 2 duplication

Metric Results
Complexity 31
Duplication 2

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.03% coverage variation

Metric Results
Coverage variation ✅ +0.03% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d0aaa4a) 8433 8018 95.08%
Head commit (7c5ddc7) 8437 (+4) 8024 (+6) 95.10% (+0.03%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#201) 7 7 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.98%. Comparing base (d0aaa4a) to head (7c5ddc7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
+ Coverage   93.95%   93.98%   +0.03%     
==========================================
  Files          53       53              
  Lines        6750     6752       +2     
==========================================
+ Hits         6342     6346       +4     
+ Misses        259      258       -1     
+ Partials      149      148       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vt128
vt128 marked this pull request as ready for review November 10, 2026 01:40
@vt128
vt128 merged commit 317e5a6 into master Nov 10, 2026
24 checks passed
@vt128
vt128 deleted the codex/fix-bytes-hex-bounds-let46 branch November 10, 2026 01:45
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.

1 participant