Skip to content

Run the agent skill scripts on Windows - #4247

Open
HiFiPhile wants to merge 26 commits into
masterfrom
windows-skill-scripts
Open

HiFiPhile wants to merge 26 commits into
masterfrom
windows-skill-scripts

Conversation

@HiFiPhile

Copy link
Copy Markdown
Collaborator

On Windows the agent skill scripts failed or gave wrong answers:

  • check_build.py reported every driver "unverified: preprocessing failed": tools/family_json.py split CMake's
    Windows-quoted compile commands POSIX-style, so the compiler path lost its backslashes. The same split broke the
    real-compiler probe, so family_json fix could not add or refresh rows. split_command now follows the Windows C
    runtime's rules there; POSIX keeps shlex.split.
  • coverage_audit.py dropped every source: native separators never matched ninja's /, and relpath across drives
    raised.
  • hil_remote.py crashed on import (fcntl) and refused every receipt (backslash keys); rsync is now resolved as
    rsync.exe on PATH, and every refusal comes before the lease.
  • gen_doc.py crashed on six family.c files (GBK decode); update_sponsor.py's codespell guard was silently off
    (the temp file could not be reopened); release.py and kernel_src.py read and printed text in the locale
    encoding.
  • run_case.py, wedge_drill.py and usb_recover.sh crashed or misreported off Linux; they now refuse through
    their normal contract (the JSON verdict line, exit 2).

Visible on POSIX, on purpose: check_build decodes compiler output with errors='replace' (a crash became a
replacement character); a missing rsync is refused before the lease instead of after the remote wipe; the usbtest
scripts and usb_recover.sh refuse on macOS too.

Tests on Windows: .claude/test 227 run, OK, 48 skipped (151 run, 12 failures, 5 errors before);
test/hil/test/test_family_json.py 26 OK; test/hil/test/test_hil_remote.py 37 OK; each under CPython 3.12 with and
without -X utf8 and MSYS2's python3. check_build.py --scope src/portable/wch/dcd_ch32_usbfs.c: pass, nothing
uncovered, 6 boards. pre-commit over the changed files: codespell and claude-scripts pass; hil-test,
change-impact-test, drivers-coverage and membrowse-targets fail on Windows with the same tests at master. Not run on
Linux; no HIL.

CMake on Windows writes compile_commands.json commands for CreateProcess; shlex.split ate
their backslashes, so every real compiler probe and check_build's body check failed there.
…posix

build_doc's tests call main() in-process: a #!/bin/sh stub on PATH cannot run on Windows,
so the real sphinx-build ran instead.
The CLI tests answer git and gh in-process: #!/bin/sh stubs on PATH cannot run on Windows,
so the real git ran there.
No fcntl there: the started record is locked with msvcrt on a byte past its content, and its
temporary name goes only after the close. Receipt keys and messages are posix, so a receipt
pins the firmware a run stages; rsync gets local paths relative to the checkout, since it reads
a drive letter as a remote host.
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c8a6bc4f-97ab-409c-83f8-e0e3982f51a1
📥 Commits

Reviewing files that changed from the base of the PR and between 4a3cc84 and 69132b4.

📒 Files selected for processing: 19
  • .claude/skills/build/scripts/coverage_audit.py
  • .claude/skills/hil-contract/scripts/hil_remote.py
  • .claude/skills/make-release/scripts/release.py
  • .claude/skills/update-sponsor/update_sponsor.py
  • .claude/skills/usbtest/scripts/run_case.py
  • .claude/skills/usbtest/scripts/wedge_drill.py
  • .claude/test/test_build.py
  • .claude/test/test_coverage_audit.py
  • .claude/test/test_gen_doc.py
  • .claude/test/test_hil_remote.py
  • .claude/test/test_release.py
  • .claude/test/test_usbtest_kernel_src.py
  • .claude/test/test_usbtest_run_case.py
  • .claude/test/test_usbtest_wedge_drill.py
  • .pre-commit-config.yaml
  • test/hil/test/test_family_json.py
  • test/hil/test/test_hil_remote.py
  • tools/family_json.py
  • tools/get_deps.py
🚧 Files skipped from review as they are similar to previous changes: 1
  • tools/get_deps.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The changes add Windows-aware path handling, command parsing, file locking, and rsync support across build, catalog, and HIL tools. Several scripts now use explicit UTF-8 handling and POSIX-formatted paths. USB test scripts reject non-Linux hosts before importing the hardware harness and emit an error with a JSON report. Tests cover the updated platform behavior, output encoding, and remote run-record handling.

Sequence Diagram(s)

sequenceDiagram
  participant HILRunner
  participant hil_remote
  participant rsync
  participant SSH
  participant RunRecord
  HILRunner->>hil_remote: Provide config and firmware paths
  hil_remote->>rsync: Locate executable and validate local operands
  hil_remote->>SSH: Acquire remote lease
  hil_remote->>rsync: Stage sidecar, config, and firmware
  hil_remote->>RunRecord: Publish and lock run record
Loading

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 69132

No actionable issue is established for this change; it is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 26.06% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 188 functions across 27 files. (1 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: enabling the agent skill scripts to run on Windows.
Description check Passed The description directly explains the Windows compatibility failures, implemented fixes, and test results.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 26.06% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 188 functions across 27 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

This PR makes the agent scripts work on Windows:

  • Build checks keep Windows compiler commands and paths intact.
  • Remote HIL runs stage files and track run status on Windows.
  • Generated board and HIL docs keep their text and ordering across platforms.
  • Release commands keep version files and PR text readable on Windows.
  • Sponsor updates run their spelling check and keep UTF-8 names intact.
  • USB test scripts return their refusal result on unsupported hosts.

The earlier cross-drive finding is fixed: dep_files() now catches ValueError and keeps the Ninja name. That thread was unnumbered, so it has no previousFindings entry.

The previous review and current head have different merge bases with the target commit, so this review covered the full PR diff. No new actionable issues were found. Tests and hardware runs were not executed during this review.

Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." · Reviewed by Greptile

Comment thread .claude/skills/build/scripts/coverage_audit.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔇 Additional comments: 25
.claude/skills/hil-contract/SKILL.md: 1

113-113: LGTM!

.claude/skills/hil-contract/scripts/hil_remote.py: 2

626-647: Windows lock acquisition is correct, and the retry loop is bounded only by block.

The code saves and restores the file position and retries only on EACCES and EDEADLOCK. The blocking loop has no timeout. This matches flock(LOCK_EX) semantics for publish_locked, so no change is needed.


601-602: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Write the started record and the done record as UTF-8.

Other reads and writes in this file now use encoding='utf-8'. write_json and publish_locked still call write_text with the locale encoding. The data is ASCII-only today, because json.dumps escapes non-ASCII characters by default. The change is therefore not urgent. Set the encoding explicitly so the files stay consistent with the new UTF-8 reads.

.claude/test/test_hil_remote.py: 1

30-31: LGTM!

Also applies to: 124-126, 526-606

test/hil/test/test_hil_remote.py: 1

119-155: LGTM!

Also applies to: 373-374, 398-398

tools/family_json.py: 3

99-137: Windows split_command matches the Microsoft C runtime rules.

I traced the backslash and quote handling and the "" rule inside quotes. I did not find a defect. The tests cover trailing backslashes, embedded quotes and quoted paths with spaces.


343-369: Windows lock handling looks correct.

The loop retries LK_NBLCK only on EACCES and EDEADLOCK, and re-raises other errors. The unlock runs in finally. Seeking to byte 0 before each lock and unlock keeps the locked range the same.


72-74: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Chain the Failure to the original ValueError.

Ruff B904 flags that raise Failure(...) inside the except ValueError clause hides the cause. Use from e. The same applies to the other raise statements in except clauses.

Proposed fix
-        raise Failure(f'{path.relative_to(ROOT).as_posix()} is not valid JSON ({e}); fix it by hand')
+        raise Failure(f'{path.relative_to(ROOT).as_posix()} is not valid JSON ({e}); fix it by hand') from e

Source: Linters/SAST tools

.claude/skills/build/scripts/coverage_audit.py: 2

233-234: The LTO nm name is wrong when the compiler has a .exe suffix with a non-gcc name.

The code appends -nm after stripping .exe. This is correct for arm-none-eabi-gcc.exe. For clang.exe or cc.exe, no matching -nm tool exists. In that case run raises OSError and is_live returns True. This is the safe fallback, so no change is needed.


51-64: Cross-drive handling is correct.

rel records the path in other_drive and returns None. This matches the POSIX "outside the checkout" semantics. cmd_graph clears the set per board and reports it.

test/hil/test/test_family_json.py: 2

119-150: LGTM!


153-185: LGTM!

.claude/test/test_coverage_audit.py: 1

117-127: The run closure binds the loop variable calls.

Ruff B023 flags this. The closure runs inside the same iteration, so the behavior is correct. No change is required. Pass calls as a default argument only if you want to silence the warning.

.claude/skills/build-doc/scripts/gen_doc.py: 1

24-24: LGTM!

Also applies to: 111-111, 128-130, 135-135

.claude/skills/build/scripts/check_build.py: 1

435-435: LGTM!

Also applies to: 662-662, 746-746

.claude/skills/make-release/scripts/release.py: 1

62-62: LGTM!

Also applies to: 72-72, 78-78, 83-83, 86-86, 91-91, 124-124, 146-148, 153-153

.claude/skills/update-sponsor/update_sponsor.py: 1

65-65: LGTM!

Also applies to: 191-203, 411-413

.claude/skills/usbtest/scripts/kernel_src.py: 1

167-168: LGTM!

Also applies to: 191-191

tools/build_utils.py: 1

613-614: LGTM!

tools/get_deps.py: 1

422-422: LGTM!

.claude/test/test_build_doc.py: 1

5-102: LGTM!

.claude/test/test_gen_doc.py: 1

42-43: LGTM!

Also applies to: 54-54, 73-87, 106-107, 121-122

.claude/test/test_release.py: 1

93-104: LGTM!

Also applies to: 119-161, 180-208

.claude/test/test_update_sponsor.py: 1

1-62: LGTM!

.claude/test/test_usbtest_kernel_src.py: 1

180-183: LGTM!

Also applies to: 201-207, 209-215


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: edc5aa24-a431-4d86-93db-df7d01bea0be
📥 Commits

Reviewing files that changed from the base of the PR and between 98741b5 and d9c1f71.

📒 Files selected for processing: 27
  • .claude/skills/build-doc/scripts/gen_doc.py
  • .claude/skills/build/scripts/check_build.py
  • .claude/skills/build/scripts/coverage_audit.py
  • .claude/skills/hil-contract/SKILL.md
  • .claude/skills/hil-contract/scripts/hil_remote.py
  • .claude/skills/make-release/scripts/release.py
  • .claude/skills/update-sponsor/update_sponsor.py
  • .claude/skills/usb-kernel-recover/scripts/usb_recover.sh
  • .claude/skills/usbtest/scripts/kernel_src.py
  • .claude/skills/usbtest/scripts/run_case.py
  • .claude/skills/usbtest/scripts/wedge_drill.py
  • .claude/test/test_build_doc.py
  • .claude/test/test_coverage_audit.py
  • .claude/test/test_gen_doc.py
  • .claude/test/test_hil_remote.py
  • .claude/test/test_release.py
  • .claude/test/test_update_sponsor.py
  • .claude/test/test_usb_recover.py
  • .claude/test/test_usbtest_host.py
  • .claude/test/test_usbtest_kernel_src.py
  • .claude/test/test_usbtest_run_case.py
  • .claude/test/test_usbtest_wedge_drill.py
  • test/hil/test/test_family_json.py
  • test/hil/test/test_hil_remote.py
  • tools/build_utils.py
  • tools/family_json.py
  • tools/get_deps.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Hardware-in-the-loop (HIL) Test Report

hfp-iar

✅ 25 passed · ❌ 4 failed · ⚪ 0 skipped · blank not run

Board usbtest cdc_msc_throughput audio_test_freertos board-locked cdc_dual_ports cdc_msc cdc_msc_freertos dfu dfu_runtime hid_boot_interface hid_generic_inout midi_test msc_dual_lun mtp printer_to_cdc duration
stm32f746disco ❌
stm32l412nucleo ✅ 30/30 ✅ C 507/511k M 524/548k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 77s
lpcxpresso43s67 ❌ 0/30 ❌ ✅ ❌ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 231s

hfp.json

✅ 16 passed · ❌ 13 failed · ⚪ 0 skipped · blank not run

Board usbtest cdc_msc_throughput audio_test_freertos board-locked cdc_dual_ports cdc_msc cdc_msc_freertos dfu dfu_runtime hid_boot_interface hid_generic_inout midi_test msc_dual_lun mtp printer_to_cdc duration
stm32f746disco ❌
stm32l412nucleo ❌ 0/30 ✅ C 507/511k M 511/511k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ❌ ❌ ❌ ✅ ❌ 108s
lpcxpresso43s67 ❌ 0/30 ❌ ❌ ✅ ❌ ✅ ✅ ✅ ✅ ❌ ✅ ✅ ❌ ❌ 212s

tinyusb-esp.json

✅ 36 passed · ❌ 0 failed · ⚪ 0 skipped · blank not run

Board usbtest cdc_msc_throughput msc_file_explorer_freertos audio_test_freertos cdc_msc_freertos device_info dfu_runtime hid_composite_freertos mtp duration
espressif_p4_function_ev ✅ 30/30 ✅ C 13.8/10.4M M 18.5/31M 409 KB/s ✅ ✅ ✅ ✅ ✅ ✅ 99s
espressif_p4_function_ev-DMA ✅ 30/30 ✅ C 16/9.6M M 22/31.5M 409 KB/s ✅ ✅ ✅ ✅ ✅ ✅ 95s
espressif_s3_devkitm ✅ 30/30 ✅ C 507/511k M 521/524k 409 KB/s ✅ ✅ ✅ ✅ ✅ ✅ 134s
espressif_s3_devkitm-DMA ✅ 30/30 ✅ C 535/508k M 511/511k 409 KB/s ✅ ✅ ✅ ✅ ✅ ✅ 134s

tinyusb.json

✅ 398 passed · ❌ 28 failed · ⚪ 19 skipped · blank not run

Board usbtest cdc_msc_throughput msc_file_explorer msc_file_explorer_freertos audio_test_freertos cdc_dual_ports cdc_msc cdc_msc_freertos cdc_msc_hid device_info dfu dfu_runtime hid_boot_interface hid_generic_inout host_info_to_device_cdc midi_test msc_dual_lun mtp printer_to_cdc duration
frdm_k64f ⚪ ⚪ ✅ ✅ 18s
raspberry_pi_pico_w 1106 KB/s 1022 KB/s ✅ ✅ 20s
raspberry_pi_pico2 ❌ ❌ ❌ ❌ 113s
ek_tm4c123gxl ✅ 30/30 ✅ C 499/510k M 511/516k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 117s
ch32v103r_r1_1v0 ✅ 30/30 ✅ C 507/508k M 511/511k ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 132s
lpcxpresso55s69 ✅ 30/30 ✅ C 8.5/8.2M M 30.7/26.7M ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 139s
stm32f407disco ✅ 30/30 ✅ C 507/511k M 511/511k ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 149s
raspberry_pi_pico ✅ 30/30 ✅ C 508/517k M 561/587k 62 KB/s 62 KB/s ✅ ✅ ✅ ❌ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 168s
max32666fthr ✅ 30/30 ✅ C 7/14.1M M 13.8/21.1M ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 167s
metro_m4_express ✅ 30/30 ✅ C 507/511k M 511/511k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ❌ ✅ 171s
lpcxpresso11u37 ✅ 30/30 ✅ C 507/259k M 510/511k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 175s
ra6m5_ek ✅ 30/30 ✅ C 8/8M M 17.6/12.2M ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 179s
stm32f072disco ✅ 30/30 ✅ C 507/256k M 510/486k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 180s
nrf52840dk ✅ 30/30 ✅ C 459/510k M 511/511k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 181s
ra4m1_ek ✅ 30/30 ✅ C 522/488k M 514/511k ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 182s
nanoch32v203-fsdev ✅ 30/30 ✅ C 507/481k M 511/548k ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 115s
nanoch32v203-usbfs ✅ 30/30 ❌ ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 109s
mimxrt1064_evk ✅ 30/30 ✅ C 23.8/16.8M M 34.8/31.4M 1361 KB/s 1351 KB/s ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 229s
stm32g0b1nucleo ✅ 30/30 ✅ C 500/511k M 511/531k ✅ ❌ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 86s
adafruit_fruit_jam ✅ 30/30 ✅ C 507/511k M 511/511k 62 KB/s 62 KB/s ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 151s
stm32u083nucleo ✅ 30/30 ✅ C 510/510k M 533/522k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 90s
ea4088_quickstart ✅ 30/30 ✅ C 507/464k M 528/514k 682 KB/s 681 KB/s ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 257s
nrf5340dk ✅ 30/30 ✅ C 339/340k M 509/493k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 141s
stm32h743nucleo ✅ 30/30 ✅ C 513/546k M 529/512k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 101s
stm32h743nucleo-DMA ✅ 30/30 ✅ C 510/564k M 513/526k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 89s
nrf54lm20dk ✅ 30/30 ✅ C 2/4.1M M 7.8/8.9M ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 142s
stm32l476disco ✅ 30/30 ✅ C 509/511k M 512/519k ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 140s
ch582m_evt ❌ ❌ ⚪ ❌ ❌ ⚪ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ 144s
ch32v307v_r1_1v0-usbhs ✅ 30/30 ✅ C 7.1/8.2M M 17.5/24.4M ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 118s
ch32v307v_r1_1v0-usbfs ✅ 30/30 ✅ C 507/511k M 511/511k ⚪ ✅ ✅ ⚪ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 116s
stm32f723disco ✅ 30/30 ✅ C 507/511k M 511/511k ❌ ❌ ✅ ✅ ✅ ✅ ❌ ❌ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 245s
stm32f723disco-DMA ✅ 30/30 ✅ C 507/511k M 511/511k ❌ ❌ ✅ ✅ ✅ ✅ ❌ ❌ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ 193s

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Code size

Baseline: 687ab47 (exact) https://github.com/hathach/tinyusb/actions/runs/39144371176

  • 22 baseline elfs are of examples this PR did not build (outside coverage)

1090 builds on 33 boards compared, 0 changed

no changes
Full report

@HiFiPhile

Copy link
Copy Markdown
Collaborator Author

#4247 (review)

  • hil_remote.py 601 and 609, UTF-8 writes: no defect. write_json and publish_locked write json.dumps(data) with the default ensure_ascii=True, so the text is ASCII and every locale codec writes the bytes UTF-8 would.
  • family_json.py 72, B904: the cause is kept. Failure is printed as text and its message embeds the ValueError (({e})); a raise inside except also records it as __context__, and the repo runs no Ruff.

@hathach hathach left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the whole change at e6af283: 40 new finding(s) (40 open); open thread claims: 3 refuted.

CI: red, all 4 failing jobs rig-side: the same HIL cells fail on master (runs 39133069767, 39110007058, 39017404166), and the one ESP32-S3 dd stall did not recur.

Board HIL Regression
nrf52840dk pass none

.claude/skills/build/scripts/coverage_audit.py:213: low: run() still decodes ninja -t deps/targets/query and nm output with the locale code page (text=True), as does open(script, errors='replace') at line 126.

  • check_build.py moved the same tool output to encoding='utf-8', errors='replace' in this diff.
  • Impact: on Windows a non-ASCII path in ninja's output decodes differently from the UTF-8 compile_commands.json it is matched against.

.claude/skills/usbtest/scripts/run_case.py:11: nit: The new non-Linux refusal (exit 2) is missing from the documented list of exit-2 refusals.

  • run_case.py:11: the docstring, also shown by --help, omits it. wedge_drill.py defers to that list, and usbtest SKILL.md line 43 does not mention it.
  • Impact: a caller cannot learn from the contract that a non-Linux host is refused.

.claude/test/test_hil_remote.py:392: low: The sidecar UTF-8 test cannot detect a missing encoding='utf-8'.

  • test_hil_remote.py:526: json.dumps defaults to ensure_ascii=True, so the check mark is written as the ASCII escape ✔ and any codec decodes it. (Reported as line 392; the code is at 526-527.)
  • Impact: it would not catch a regression in sidecar_matches (hil_remote.py:231).
  • Fix: json.dumps(..., ensure_ascii=False).

.claude/test/test_update_sponsor.py:649: low: Same gap as the test_release stub: it returns str whatever the call's text or encoding, so dropping encoding= from gh() or codespell_collisions() would not fail here.

  • In the real script gh() would then return bytes to its str callers, and the codespell parse would raise.
  • On a UTF-8 locale a switch to text=True is hidden too; the "whatever the locale" check only bites on Windows.

.claude/test/test_usb_recover.py:728: low: The skip check excludes only the System32 WSL launcher, not the Store alias.

  • test_usb_recover.py (NotLinux.test_every_verb_is_refused_before_it_runs; reported as line 728): a Store-installed WSL registers bash.exe in %LOCALAPPDATA%\Microsoft\WindowsApps.
  • Impact: if that comes first on PATH, the test runs WSL bash with a Windows path and fails (exit 127, or uname is Linux) instead of skipping. Windows only.

.claude/test/test_usbtest_kernel_src.py:812: low: test_utf8_source_prints_as_utf8_whatever_the_locale depends on the caller's locale on POSIX.

  • test_usbtest_kernel_src.py:201 (reported as 812): kernel_src.py:167-168 reconfigures stdout only on nt, and run_script passes the whole os.environ to the child.
  • Impact: PYTHONIOENCODING=latin-1 or ascii makes it fail.
  • Fix: pin PYTHONIOENCODING=utf-8 in this test on POSIX, or skip it there.

Comment thread .claude/skills/build/scripts/coverage_audit.py Outdated
Comment thread .claude/skills/hil-contract/scripts/hil_remote.py
Comment thread .claude/skills/hil-contract/scripts/hil_remote.py Outdated
Comment thread .claude/skills/make-release/scripts/release.py Outdated
Comment thread .claude/skills/update-sponsor/update_sponsor.py Outdated
Comment thread test/hil/test/test_family_json.py
Comment thread test/hil/test/test_hil_remote.py Outdated
Comment thread test/hil/test/test_family_json.py Outdated
Comment thread tools/build_utils.py
Comment thread tools/family_json.py
…e_sponsor and tools/ edits, document the off-Linux refusal
@hathach

hathach commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Review-body findings, outside the diff's lines:

  • coverage_audit.py:213 tool output decoded with the locale: fixed in f9125b9.
  • run_case.py:11 non-Linux refusal missing from the exit-2 list: fixed in ab1c368.
  • test_hil_remote.py:392 sidecar test cannot see a missing encoding: fixed in 40f4a50.
  • test_update_sponsor.py:649 stub hides a dropped encoding=: fixed in ab1c368.
  • test_usb_recover.py:728 Store-alias WSL bash not skipped: fixed in ab1c368.
  • test_usbtest_kernel_src.py:812 test depends on the caller's locale: fixed in ab1c368.

@hathach

hathach commented Oct 18, 2026

Copy link
Copy Markdown
Owner

#4247 (review)

  • hil_remote.py:601-602: no defect. Both writers emit only json.dumps(data) with default ensure_ascii=True, so the bytes are pure ASCII and identical under any locale codec; the UTF-8 reads decode them unchanged.
  • tools/family_json.py:72: the repo runs no ruff or bugbear hook. Failure is a user-facing message that callers stringify (tools/family_json.py:409, :591), and it already embeds the ValueError text, so chaining adds nothing. The pattern predates this PR.

# Conflicts:
#	.claude/skills/usb-kernel-recover/scripts/usb_recover.sh
#	.claude/test/test_usb_recover.py

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants