Repository navigation
Description
Problem
bash autoresearch <board> does not auto-discover the wired loopback pins by default. Today the agent must remember to pass --auto-discover-pins, and if it forgets, the harness uses hard-coded default pin numbers that may not match the board's actual wiring -- the bench validation silently runs against the wrong pins and either fails confusingly or worse, "succeeds" because the wrong pins happen to also be wired somewhere.
This bit a /clud-fix session on #3102: the agent ran bash autoresearch lpc845brk (no flag), did not know about --auto-discover-pins, and could not derive the right invocation from the in-tree docs. The README that documents the four validation phases (src/platforms/arm/lpc/README.md) does not mention --auto-discover-pins at all, so reading the docs first does not surface the flag.
Proposed work
1. Flip the default
--auto-discover-pinsbecomes the default behavior ofbash autoresearch <board>.- Add
--no-auto-discover-pinsas the opt-out for callers that want to pin the tx/rx explicitly (e.g. for a known-bad wiring debug session, or for CI determinism). - The existing
--tx-pin/--rx-pinflags continue to work and implicitly override the auto-discovery for those specific pins.
Acceptance:
-
bash autoresearch lpc845brk(no flags) runs the discovery sweep on its own. -
bash autoresearch lpc845brk --no-auto-discover-pinsfalls back to the hard-coded default tx/rx pins (current behavior of the unflagged invocation). -
bash autoresearch lpc845brk --tx-pin P0_10 --rx-pin P0_11(no other flags) uses the provided pins without running discovery -- explicit overrides win.
2. Documentation sweep
The flag's absence from the docs is what trapped the agent. Sweep these surfaces so future agents (and humans) cannot get stuck:
-
src/platforms/arm/lpc/README.md-- the "Hardware verification via AutoResearch loopback (hardware: bring up LPC845 + WS2812 + AutoResearch UART (Stages 3.5, 3.6 from #2845) #2880)" section. Mention the default + opt-out flag explicitly. Update the four-phase example commands so the canonical form reflects post-flip behavior. -
agents/docs/hardware-autoresearch.md-- the agent-facing autoresearch guide. Add a "Pin discovery" subsection documenting the default + opt-out + override precedence. Add an "Agent should know" callout. -
examples/AutoResearch/AutoResearch.inoheader comment -- if it mentions tx/rx pin conventions, link to the autoresearch doc instead of restating fixed numbers. -
ci/autoresearch/__main__.pyargparse--auto-discover-pins/--no-auto-discover-pinshelp strings -- mention "default: enabled" and "use this to disable" so--helpis the source of truth. -
CLAUDE.md-- the project rules listbash autoresearch --parlioas an example. Add a note that pin discovery is automatic by default, so future agents reading CLAUDE.md know.
3. Related: serial-port access errors
Adjacent (not strictly part of this issue, but related to the same "agent gets stuck on autoresearch" failure mode): when COM<N> is held by another process (VS Code's serial monitor, leftover PuTTY, the previous autoresearch run that didn't release cleanly), autoresearch prints a clear error but doesn't suggest the fix. A one-line "is another monitor open on this port?" hint after the PermissionError(13) would help. Optional but worth bundling.
Acceptance criteria
- Default-on behavior implemented + tested via unit-test mock of pin-discovery sweep.
-
--no-auto-discover-pinsopt-out wired and tested. - Docs sweep complete: every surface listed above mentions the new default.
-
bash autoresearch lpc845brk --bring-up(if--bring-updoesn't exist, document the actual default-phase invocation) works first-try without any pin-flag for an agent who reads only the README. - CLAUDE.md's autoresearch line gets a "pin discovery is automatic" note.
Out of scope
- Changing the pin-discovery algorithm itself (just changing default + docs).
- The COM-port-busy error message improvement (separable; file a sub-issue if not bundled).
- AutoResearch RPC schema changes.
Refs
Filed during /clud-fix burn-down on #3208 -- ran into the missing default + missing docs while attempting to validate #3102. Future agents reading this should be able to invoke bash autoresearch <board> and have it Just Work, with the README pointing at the opt-out for the edge cases.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 19, 2026
Adding requirement: user-facing notification on LED-driver runs
When the script enters a phase that tests an LED driver (e.g.
--ws2812-loopback,--parlio,--rmt,--spi,--lcd-spi,--lcd-rgb,--object-fled,--flex-io,--lpuart-- any phase whose purpose is driving real LEDs and reading them back), and auto-discover-pins is active (default per the proposal above), emit a green stdout line:```
[green] auto discover pins is ACTIVE for LED-driver testing — pass --no-auto-discover-pins if this is not desired
```
Rationale: when you're hooking up a real LED strip on specific pins, you usually want explicit pin control (you wired what you wired); auto-discovery scanning unrelated pins during an LED test is at best confusing and at worst could drive an unintended GPIO into output mode mid-test. The user should see the discovery banner BEFORE the LED test starts so they have a chance to abort and rerun with
--no-auto-discover-pinsif discovery isn't appropriate for their setup.Color: green per the user spec. Suggested implementation: use whatever colorized-stdout helper autoresearch already uses (
fl_emit_color/print(termcolor.colored(..., 'green'))/ similar) -- consistent with the rest of the harness's success-banner style.Adds to the acceptance criteria above:
--auto-discover-pinsis active AND the selected phase is an LED-driver test (list the qualifying phase flags in the implementation), the harness prints the green banner above stdout before phase work begins.--no-auto-discover-pinsis passed (no point telling the user about a thing they disabled).--quietis passed (consistent with existing harness banner suppression).zackees commentedon Jun 23, 2026
Tracking this under the new LPC845-BRK / LPC8xx AutoResearch coordination meta: #3348.
Keeping this issue open because the implementation appears only partial: pin auto-discovery defaults exist, but the docs sweep and green LED-driver banner acceptance still need closeout.
docs(lpc/autoresearch): document --auto-discover-pins default behavior (
feat(simd/arm-dsp): wire UXTB16/PKHBT/PKHTB/USAT16/SEL ops (refs #3425)…
docs(lpc/autoresearch): document --auto-discover-pins default (closes F…