Commit Graph

10949 Commits

Author SHA1 Message Date
ac595bc5cf Merge pull request #3762 from hathach/claude/agents-workflows
Multi-agent dev/test harness: worker agents, workflows, /pre-pr gate, per-board HIL locks
2026-07-13 22:11:07 +07:00
ff69550b3d Fix max-effort review findings in lock protocol, workflows, and docs
Confirmed by a 10-finder / 28-verifier adversarial review pass:

board_lock.py — the flock is now the sole authority: drop cmd_hold's
pid-liveness pre-gate (a live hil_test.py pool worker's stale record no
longer blocks a genuinely free board); cmd_release probes the flock and
only signals a verified holder, refuses to kill hil_test.py holders
(CI mid-test), handles PermissionError; the holder daemon truncates its
lock records on SIGTERM and keeps the success pipe clear of fds 0-2
(closed-stdio hold used to leave an orphan holder while reporting
failure); --config default resolves beside the script.

hil_test.py — truncate the lock record on per-board release (pool
workers outlive their flocks); warn instead of silently failing open
when the lock dir is unusable; error out on -b names absent from the
config (was a silent zero-test exit 0, readable as a green HIL run);
drop an emptied board row in accumulate_report (variant boards left a
blank ghost row).

workflows — remove the stray positional arg that made the validate size
stage exit 2 on every run; wrap JSON.parse(args) in all six scripts;
factor pr-babysit's drifted reply recipe into postReplyRecipe and dedup
refutation replies across cycles; validate args.pr and maxCycles;
driver-review rejects an empty dimensions list; hil-validate drops a
dead guard clause and retries diagnostics with -v -r 1.

agents/docs — port-dev scopes git clang-format to its own files
(concurrent workers reformatted each other in shared checkouts);
hil-operator/hil skill wording matches actual fail-fast output; the
implementation plan is now a DO-NOT-EXECUTE historical record (banner +
checked boxes) so plan-executing agents cannot revert shipped files.

Verified: lock storm 1-winner-in-10, stale-record hold, closed-stdio
hold, dead-pid cleanup, CI-holder refusal, ghost-row 4-scenario merge,
unknown-board exit 1, py_compile + check.sh on all six workflows,
pre-commit clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Upj4hta5TNoAbidqeC1zZ6
2026-07-13 18:01:07 +07:00
0557655afb Fix review findings and add static-analyzer agent
Review-fix batch (owner-confirmed) on the multi-agent harness:

- board_lock: detach holder stdio so a captured `hold` cannot hang on the
  daemon's inherited pipe; probe locks by holder-pid liveness instead of a
  momentary flock, which could spuriously fail a concurrent acquirer
  (storm-tested: 1 winner in 10, 0/15 acquire failures under probe storm)
- hil_test: locked board renders a visible board-locked fail row so the
  report matches the exit code; stale marker cleared on a real re-run
- pr-babysit: autoPush now opt-in (default dry run); resolve recipe
  paginates reviewThreads; post-push resolve gets issue-comment fallback
- validate: size stage honors non-default base via --base-branch; pvs
  stage delegated to the new agent
- new static-analyzer agent (sonnet): PVS-Studio SAST+MISRA for one
  board, structured findings gated on files changed vs base

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rn1AN5DsTdFhRwhugfgKZi
2026-07-10 23:28:09 +07:00
4354b24848 Merge pull request #3768 from hathach/hil_stlink
hil: use stlink for stm32f746disco
2026-07-10 21:15:52 +07:00
5453ed09f1 Merge pull request #3766 from mikeysklar/fix-nrfx-v2.0.0-hfclk
nrf5x: fix hfclk_running() for nrfx v2.0.0
2026-07-10 15:23:36 +02:00
72e14c7e02 nrf5x: fix hfclk_running() for nrfx v2.0.0
nrf_clock_is_running() was added in nrfx 2.1.0 (MDK 8.30.2), but the
version autodetect puts 2.0.0 (MDK 8.29.0) in the v2 bucket, so
hfclk_running() fails to compile on that nrfx.

Route v2 through nrf_clock_hf_is_running(), which all of 2.x provides.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 06:17:38 -07:00
4c0eb65277 hil: use stlink for stm32f746disco
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-10 14:56:53 +02:00
e3dd9245ef feat: Claude Code multi-agent dev/test harness for TinyUSB
Add worker agents (builder, port-dev, driver-reviewer, hil-operator,
pr-monitor), deterministic workflows (validate, fanout-dev, driver-review,
hil-validate, full-check, pr-babysit) and a /pre-pr gate skill, so sessions
can fan build/test/review/PR-triage work out to tiered subagents. pr-babysit
drives a PR to green: triage CI + bot reviews, fix validated findings, verify,
push, and reply-to + resolve each inline review thread (fixed or refuted).

Replace the stop-the-runner HIL discipline with per-board flock locks:
test/hil/board_lock.py plus a fail-open guard in hil_test.py let CI and dev
sessions share the rig per board (locked boards fail fast and re-run;
HIL_NO_BOARD_LOCK=1 is a user-authorized bypass). The actions-runner is
never stopped.

Design spec, implementation plan, and real-rig smoke evidence under
docs/superpowers/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rn1AN5DsTdFhRwhugfgKZi
2026-07-09 23:34:29 +07:00
fa750d6bf0 Merge pull request #3759 from hathach/claude/prefer-worktree-docs
docs(AGENTS): prefer git worktrees for branch/multi-step work
2026-07-07 19:01:22 +07:00
98099a569e docs(AGENTS): prefer git worktrees for branch/multi-step work
Direct agents to work in a git worktree rather than switching the shared
primary checkout's branch. Concurrent sessions share that checkout, so a
mid-flight branch switch disrupts the other sessions and can silently
point a review, build, or commit at the wrong diff. CLAUDE.md is a
symlink to AGENTS.md, so both pick this up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
2026-07-07 17:56:51 +07:00
fcd5a0603e Merge pull request #3756 from dxbjavid/rndis-data-offset-overflow
bound rndis data packet offset in handle_incoming_packet
2026-07-05 19:28:14 +02:00
0f61948954 bound rndis data packet offset in handle_incoming_packet
Signed-off-by: Javid Khan <dxbjavid@gmail.com>
2026-07-05 22:20:18 +05:30
536157cb98 Merge pull request #3738 from sauloverissimo/fix/midi2-fb-direction
feat(midi2): derive function blocks from the GTB descriptor
2026-07-05 17:46:14 +02:00
0309e7c016 ensure gtb is valid
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-05 16:48:41 +02:00
3579ea1888 Merge pull request #3753 from Old-Ding/codex/usbd-driver-count-warning
Fix usbd empty builtin driver warning
2026-07-05 16:14:01 +02:00
073657a04e Fix usbh empty builtin driver warning
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-05 15:27:30 +02:00
19274b95a6 Fix usbd empty builtin driver warning v2
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-05 15:25:34 +02:00
be2218e3d8 Merge pull request #3754 from Old-Ding/codex/usbtmc-status-byte-buffer
Fix USBTMC status byte interrupt buffer
2026-07-05 13:23:41 +02:00
6fc114c827 Merge pull request #3741 from dxbjavid/ncm-ndp-length-bound
bound ndp16 wLength against received ntb in recv_validate_datagram
2026-07-05 13:22:58 +02:00
2b978382d9 Fix USBTMC status byte notification buffer
Queue the USB488 READ_STATUS_BYTE interrupt notification through tud_usbtmc_transmit_notification_data so it uses the class notification endpoint buffer for the asynchronous transfer.

Fixes #2928

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-05 19:09:42 +08:00
7bc2e7d129 Merge pull request #3755 from Old-Ding/codex/usbtmc-notification-idle-xfer
Fix USBTMC notification endpoint claim
2026-07-05 12:47:30 +02:00
2d5f5c0cf2 clamped copied length to n
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-05 12:45:55 +02:00
6d697c629e fix sizeof(nth16_t) typo
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-05 12:45:12 +02:00
6563ef3b27 fix ci
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-05 12:35:03 +02:00
742ca33c8a Fix USBTMC notification endpoint claim
Use usbd_edpt_claim() before queuing USBTMC notification data so the interrupt endpoint is reserved through the normal endpoint ownership path. Release the claim if the notification payload cannot be copied before the transfer is queued.

Fixes #2735

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-05 18:24:04 +08:00
6912f23618 Fix usbd empty builtin driver warning
Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-05 15:38:17 +08:00
3439e9c8de add ncm receive-path fuzz harness with out-of-bounds seed
folds the reproducer for the recv_validate_datagram bound into a small
self-contained fuzz target. it feeds a raw ntb straight into the validator
(the driver is pulled in so the static function is reachable) and ships the
crafted 64-byte ntb as a seed. the seed trips an asan heap-buffer-overflow
against the unpatched driver and is rejected cleanly with the wLength bound
in place.
2026-07-03 23:16:28 +05:30
41b8ad2039 Merge pull request #3748 from mikeysklar/fix-max3421-oscok-hang
max3421: prevent USB host hang at startup
2026-07-03 23:25:05 +07:00
37ea546aba Merge pull request #3751 from cuolm/master
fix: correct video stack macro typo in video capture examples
2026-07-03 16:55:14 +02:00
0eb1928570 fix HID_STACK_SIZE typo
Signed-off-by: HiFiPhile <admin@hifiphile.com>
2026-07-03 16:00:29 +02:00
b2a9a5d06a fix: correct video stack macro typo in video capture examples
Corrects VIDEO_STACK_SZIE to VIDEO_STACK_SIZE.
2026-07-03 15:21:40 +02:00
ef05184635 Merge pull request #3742 from Old-Ding/fix/rtthread-msc-inquiry-bounds
Fix RT-Thread MSC inquiry string bounds
2026-07-03 11:25:33 +02:00
3157621ee6 Merge pull request #3660 from andrewleech/cdch-on-enum-idx-guard
cdc_host: fix undeclared 'idx' when only LINE_CONTROL_ON_ENUM is defined
2026-07-03 11:10:50 +02:00
7a4111b96e license: use SPDX identifiers for src/ headers (#3749)
* license: use SPDX identifiers for src/ headers

Replace the full ~20-line MIT license boilerplate on every src/ file with a
two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following
the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500
lines of duplicated boilerplate.
2026-07-02 21:55:45 +07:00
4202e1e2d0 hcd(max3421): improve CHIPRES reset logic and refine oscillator stabilization timing 2026-07-01 17:49:14 +07:00
f96757a19a max3421: prevent USB host hang at startup
On some boards the MAX3421E doesn't report its oscillator ready after a
soft reset (CHIPRES), so hcd_init() waits on USBIRQ_OSCOK forever and the
host hangs at startup before any USB device can be used. Bound the wait so
it proceeds after a timeout; it is a no-op where OSCOK arrives normally.

Needed on the Adafruit Feather ESP32 V2 (classic ESP32) + USB Host
FeatherWing, which otherwise hangs on essentially every cold boot.

Relates to adafruit/circuitpython#10053.
2026-07-01 16:07:59 +07:00
dae3f9a366 docs: convert changelog release notes from RST to Markdown (#3746)
* docs: convert changelog release notes from RST to Markdown
0.21.0
2026-06-30 22:27:27 +07:00
188b998929 Merge pull request #3747 from hathach/claude/claude-review-allowtools
ci(claude-review): allowlist the tools /code-review needs
2026-06-30 17:26:02 +07:00
37e247176c ci(claude-review): allowlist Write too (review writes a helper script)
The log shows two gated tools, not one: compound Bash pipelines AND Write — the
review tried to drop check_headings.py (at /tmp, then the workdir, both denied).
Add Write to the allowlist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 17:14:29 +07:00
2bedc60e83 ci(claude-review): trim allowlist to Bash (the only gated tool)
Every blocked call in the review log was a compound Bash pipeline; Read/Grep/
Glob/Task already ran un-prompted, so only bare Bash needs allowlisting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 17:04:32 +07:00
c52a4a37f0 ci(claude-review): allowlist the tools /code-review needs
The auto-review job runs /code-review headless, which uses Bash (git diff, gh),
file search, and Task (it fans out sub-agent reviewers). None were allowlisted,
so every such call stalled on a per-tool approval prompt and the review couldn't
gather the diff or spawn reviewers. Add --allowedTools.

Safe here (unlike claude.yml): this job is gated to same-repo PRs and its token
is contents:read, so it cannot push. Bash is broad — scope to git/gh/grep if
preferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 16:45:34 +07:00
da41189467 Merge pull request #3745 from hathach/claude/release-0.21.0
Release 0.21.0
2026-06-30 16:11:24 +07:00
47ce85fc19 make-release skill: tighten to commands + essential judgment
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 16:07:21 +07:00
20200b3520 docs: move changelog to docs/changelog, drop the docs/info folder
Relocate docs/info/changelog/ -> docs/changelog/ (docs/info held only the
changelog) and update all references: the toctree, README + MAINTAINERS links,
make_release.py, and the make-release skill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 14:39:57 +07:00
0849a5c172 docs: keep the changelog page last in the toctree (maintainers before it)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 14:36:48 +07:00
ae87287f5b Revert MAINTAINERS to .rst and add it to the docs build
- restore MAINTAINERS.rst (drop the .md); make the changelog link absolute so it
  resolves both on GitHub and in the rendered docs
- docs/maintainers.rst includes the root file (same pattern as README) and is
  wired into the Documentation toctree

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 14:33:15 +07:00
9b2c11f031 Convert MAINTAINERS.rst to Markdown (MAINTAINERS.md)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 14:25:19 +07:00
4ae991fd88 build.py: keep only raspberry_pi_pico in rp2040 ci_preferred_boards
The one-board selector uses preferred_list[0] anyway, so pico is the board built.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 13:37:29 +07:00
36667740cb build.py: prefer pico/pico2 for rp2040 CI; skill: drop one-time 0.20.0 backfill note
- ci_preferred_boards: rp2040 -> raspberry_pi_pico, raspberry_pi_pico2 so the
  one-board CI/metrics build uses a Pico (the first-alphabetical board failed).
- make-release skill: the metrics backfill was a one-time 0.20.0 task, not a
  recurring release step; keep only the CI auto-compare note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 13:35:35 +07:00
aa7db172ca make-release skill: document code-size compare vs previous release
CI auto-uploads metrics.json + a compare to each release on the release event
(needs the previous release's metrics.json); plus the procedure to backfill a
missing baseline by building the old tag's own tree and post-processing its
linker maps (current tooling can't build old source — co-evolved tree).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 13:26:53 +07:00