Repository navigation
docs(autoresearch): rewrite JSON-RPC reference to match bound methods - #2621
Conversation
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]>
📝 WalkthroughWalkthroughUpdated ChangesHardware AutoResearch JSON-RPC Documentation Refresh
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
agents/docs/hardware-autoresearch.md
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]>
There was a problem hiding this comment.
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 winAdd missing optional parameters to
runSingleTestargs.The documented args
{driver, laneSizes, pattern?, timing?, iterations?}are incomplete. According to the firmware implementation,pinTxandpinRxare 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
📒 Files selected for processing (1)
agents/docs/hardware-autoresearch.md
Summary
agents/docs/hardware-autoresearch.mdagainst the actualmRemote->bind(...)registrations inexamples/AutoResearch/AutoResearchRemote.cpprunTest/setDrivers/setLaneRange/setStripSizes/configure/setLaneSizes/setLedCount/setPattern/setShortStripSize/setLongStripSize/setStripSizeValues/getState/resetentries — none of those names are bound and they all return-32601status,runSingleTest,runParallelTest, pin-config family,testSimd*,wave8ExpandBenchmark,parlioEncodeBenchmark,testAsync, net/OTA/BLE,testCoroutine*pingreturn shape ({success, message:'pong', timestamp, uptimeMs}) andtestGpioConnectionarg shape ([txPin, rxPin])rpc.discoverandhelp(no args) as the live discovery rails so the doc cannot silently re-driftci/autoresearch_agent.pyas containing stale RPC names pending reconciliation (out of scope here)Closes #2520.
Test plan
grepfor removed method names in the doc — none should remainmRemote->bind(...)inexamples/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)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