Skip to content

docs(autoresearch): rewrite JSON-RPC reference to match bound methods - #2621

Merged
zackees merged 2 commits into
masterfrom
docs/2520-autoresearch-jsonrpc-refresh
May 31, 2026
Merged

zackees merged 2 commits into
masterfrom
docs/2520-autoresearch-jsonrpc-refresh

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Rewrite the "JSON-RPC Commands" section of agents/docs/hardware-autoresearch.md against the actual mRemote->bind(...) registrations in examples/AutoResearch/AutoResearchRemote.cpp
  • Drop the runTest / setDrivers / setLaneRange / setStripSizes / configure / setLaneSizes / setLedCount / setPattern / setShortStripSize / setLongStripSize / setStripSizeValues / getState / reset entries — none of those names are bound and they all return -32601
  • Add the actually-bound methods grouped by Phase 1–6: status, runSingleTest, runParallelTest, pin-config family, testSimd*, wave8ExpandBenchmark, parlioEncodeBenchmark, testAsync, net/OTA/BLE, testCoroutine*
  • Fix ping return shape ({success, message:'pong', timestamp, uptimeMs}) and testGpioConnection arg shape ([txPin, rxPin])
  • Steer readers at rpc.discover and help (no args) as the live discovery rails so the doc cannot silently re-drift
  • Flag ci/autoresearch_agent.py as containing stale RPC names pending reconciliation (out of scope here)

Closes #2520.

Test plan

  • grep for removed method names in the doc — none should remain
  • Cross-check the new table against mRemote->bind(...) in examples/AutoResearch/AutoResearchRemote.cpp (988, 1001, 1009, 1027, 1042, 1055, 1067, 1076, 1106, 1172, 1199, 1229, 1284, 1376, 1381, 1605, 1640, 1699, 1731, 1801, 1831, 1967–2542)
  • Manual client.send("help") on a P4 board returns a manifest whose names are a superset of the table here

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Revamped hardware auto-testing protocol docs with a focused fail-fast JSON-RPC example and async completion model.
    • Added pre-flight GPIO connection check and a streaming JSONL run example.
    • Added guidance for discovering RPC methods directly from devices and reorganized commands by functional phases.
    • Expanded configuration and extension guidance, and noted legacy RPC names that are no longer bound.

The "JSON-RPC Commands" section advertised methods the firmware does not
expose. Following the docs as written produced `-32601 Method not found`
on `runTest`, `setDrivers`, `setLaneRange`, `setStripSizes`, `configure`,
`setLaneSizes`, `setLedCount`, `setPattern`, `setShortStripSize`,
`setLongStripSize`, `setStripSizeValues`, `getState`, and `reset`. The
`ping` and `testGpioConnection` shapes were also wrong, and a long list
of actually-bound methods (status, testSimd, parlioEncodeBenchmark,
runSingleTest, runParallelTest, testCoroutine*, BLE/OTA/net, etc.) was
not documented at all.

Rewrite the section against the actual `mRemote->bind(...)` registrations
in `examples/AutoResearch/AutoResearchRemote.cpp` (the source of truth):

- Group commands by Phase 1-6, matching the live `help` manifest layout.
- Fix `ping` return shape: `{success, message:"pong", timestamp, uptimeMs}`.
- Fix `testGpioConnection` arg shape: `[txPin, rxPin]`.
- Replace the bogus consolidated `runTest` example with the real
  `runSingleTest` / `runParallelTest` ASYNC pattern.
- Point readers at `rpc.discover` and `help` (no args) as the live
  discovery rails so the doc cannot silently re-drift.
- Flag `ci/autoresearch_agent.py` as containing stale RPC names pending
  reconciliation, and steer agents toward `ci/rpc_client.py` for now.

Closes #2520

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updated hardware-autoresearch.md to align documentation with the current firmware JSON-RPC surface. Replaced stale runTest example with runSingleTest-based flow, added live RPC discovery guidance, refreshed command reference grouped by function phase, listed deprecated methods, and expanded usage examples with JSONL streaming and lane configuration patterns.

Changes

Hardware AutoResearch JSON-RPC Documentation Refresh

Layer / File(s) Summary
Updated JSON-RPC protocol example flow
agents/docs/hardware-autoresearch.md
Replaced legacy consolidated runTest invocation with a new example that shows GPIO pre-flight check followed by runSingleTest call using the current argument/config shape (driver, lane sizes, pattern) aligned to the async completion model.
Live RPC command surface reference
agents/docs/hardware-autoresearch.md
Added discovery instructions for querying rpc.discover and help directly from the device, replaced the obsolete command listings with a current phase-by-phase table of bound methods (status/control, GPIO probe, async tests, utilities/benchmarks, networking/OTA/BLE/decode, coroutine tests), and explicitly listed deprecated "not bound (historical)" methods pointing users to the current runSingleTest/runParallelTest alternatives.
Protocol usage examples and lane configuration
agents/docs/hardware-autoresearch.md
Added practical examples for runSingleTest JSONL streaming output format and variable per-lane LED configuration patterns showing both uniform and asymmetric sizing expressions in the updated config payload.
Protocol extension and integration guidance
agents/docs/hardware-autoresearch.md
Updated the "extending the protocol" section to reflect current firmware RPC registration workflow and manifest updates, including a note that higher-level Python wrapper code may still reference legacy RPC method names that are no longer bound.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • FastLED/FastLED#2562: Adds a new parlioStreamValidate RPC endpoint to the hardware auto-testing protocol, directly related to the RPC surface documented in this PR.

Poem

🐰 I hopped through docs to chase a test,
Old RPC names laid down to rest;
Now single runs and GPIO pre-flight,
Async streams that glow at night,
A tidy manifest — the docs are blessed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(autoresearch): rewrite JSON-RPC reference to match bound methods' accurately and specifically describes the main change—updating documentation to reflect actual bound RPC methods.
Linked Issues check ✅ Passed The PR comprehensively addresses all coding-related requirements from #2520: removes unbound methods, documents bound-but-undocumented methods with correct signatures, fixes ping/testGpioConnection shapes, adds rpc.discover guidance, and flags stale code in ci/autoresearch_agent.py.
Out of Scope Changes check ✅ Passed All changes are within scope—the PR focuses solely on updating the hardware-autoresearch.md documentation to match bound RPC methods as specified in #2520, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/2520-autoresearch-jsonrpc-refresh

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 and usage tips.

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agents/docs/hardware-autoresearch.md`:
- Line 256: The table entry for findConnectedPins is wrong: update the command
return contract to match the firmware implementation by replacing the listed
`candidates` array with the actual fields returned (e.g., found, txPin, rxPin,
searchRange and optional autoApplied/error metadata). Locate the
findConnectedPins documentation row and change the return column to reflect the
real shape: {found: boolean, txPin?: number, rxPin?: number, searchRange?:
{start,end}, autoApplied?: boolean, error?: string} (or equivalent field names
used in the implementation).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 86558d9c-d9b2-4a1c-ae31-ef159144e855

📥 Commits

Reviewing files that changed from the base of the PR and between 21bf87b and 6637ca6.

📒 Files selected for processing (1)
  • agents/docs/hardware-autoresearch.md

Comment thread agents/docs/hardware-autoresearch.md Resolved
Per CodeRabbit review on #2621: the table row claimed the method returns
`{success, candidates:[{txPin,rxPin}, ...]}`, but the firmware actually
returns `{success, found, txPin, rxPin, autoApplied, testedPairs}` (or
`{error, message}` on invalid range), and the args slot is `[]` or
`[{startPin, endPin, autoApply}]` — all optional. Verified against
`findConnectedPinsImpl()` in `AutoResearchRemote.cpp:818` and the
help-manifest entry at line 1541-1547.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
agents/docs/hardware-autoresearch.md (1)

262-262: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add missing optional parameters to runSingleTest args.

The documented args {driver, laneSizes, pattern?, timing?, iterations?} are incomplete. According to the firmware implementation, pinTx and pinRx are also accepted as optional parameters in the config object.

📝 Suggested documentation fix
-| `runSingleTest` | `{driver, laneSizes, pattern?, timing?, iterations?}` | `{success, passed, totalTests, passedTests, duration_ms, driver, laneCount, laneSizes, pattern, firstFailure?}` |
+| `runSingleTest` | `{driver, laneSizes, pattern?, timing?, iterations?, pinTx?, pinRx?}` | `{success, passed, totalTests, passedTests, duration_ms, driver, laneCount, laneSizes, pattern, firstFailure?}` |

As per context snippet 1 (AutoResearchRemote.cpp:112-167), which shows the firmware accepts these fields in the config object.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agents/docs/hardware-autoresearch.md` at line 262, Update the documentation
for runSingleTest to include the two optional config fields accepted by the
firmware: add pinTx? and pinRx? to the args object signature so it reads
`{driver, laneSizes, pattern?, timing?, iterations?, pinTx?, pinRx?}`; locate
the table row mentioning `runSingleTest` and modify the args column accordingly
(entry referencing runSingleTest).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@agents/docs/hardware-autoresearch.md`:
- Line 262: Update the documentation for runSingleTest to include the two
optional config fields accepted by the firmware: add pinTx? and pinRx? to the
args object signature so it reads `{driver, laneSizes, pattern?, timing?,
iterations?, pinTx?, pinRx?}`; locate the table row mentioning `runSingleTest`
and modify the args column accordingly (entry referencing runSingleTest).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5ec2d727-a62a-430e-a698-9b63c19e5f58

📥 Commits

Reviewing files that changed from the base of the PR and between 6637ca6 and 022d091.

📒 Files selected for processing (1)
  • agents/docs/hardware-autoresearch.md

@zackees
zackees merged commit d2a63e7 into master May 31, 2026
6 checks passed
@zackees
zackees deleted the docs/2520-autoresearch-jsonrpc-refresh branch May 31, 2026 00:53
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.

docs: autoresearch JSON-RPC reference is stale (runTest/setDrivers/getState not bound; ping & testGpioConnection shapes wrong)

1 participant