Repository navigation
refactor: share device and node RPC validation preambles - #177240
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs maintainer review before merge. What this changesThis PR moves seven device and node RPC registrations onto the existing shared validation wrapper. Example: A client sends node.invoke.progress with invokeId="invoke-1", nodeId="node-1", seq=-1 and chunk="".
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a useful, maintainer-directed refactor with no actionable findings; it preserves request validation and authority while removing duplicated preambles, and exact-head CI passes. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway RPC router supplies authenticated request options to device and node handlers, which validate parameters before invoking pairing, scope-upgrade, queue, or node-registry owners and returning an RPC response. flowchart TD
A[Authenticated RPC request] --> B[Gateway router]
B --> C[Shared parameter validation]
C --> D[Invalid request response]
C --> E[Device or node handler]
E --> F[Existing operation owner]
F --> G[RPC response]
Technical reviewBest possible solution: Use the existing identity-preserving validation wrapper while keeping each operation's authorization, lifecycle, and response logic with its current owner. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a bug report; source inspection confirms the repeated validation preambles, and no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is the smallest complete consolidation: every hunk serves the seven registration conversions, reuses the existing owner, and retains the historically justified pending-work type assertion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 16f1ef80f9d5. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -32. Total -32 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 19, 2026, 6:35 AM ET / 10:35 UTC. |
|
Merged via squash.
|
What Problem This Solves
Seven device/node RPC registrations duplicate the Gateway's existing parameter-validation preamble. Recover this small area from the wider parked cleanup so CI can attribute it independently.
User Impact
No intended behavior change. The same method names, validators, invalid-request responses and original handler options remain. Live authority checks, scope-upgrade identity binding, node progress byte limits, pending-work FIFO ordering and wake cleanup are unchanged. No configuration, schema, protocol, dependency or public SDK change.
Why This Change Was Made
Reuse the existing
defineValidatedGatewayHandlerowner rather than repeating validation and early-return boilerplate in five device/node modules. The owner was introduced in #156521 (caa1422d1c5a1c7c3ddc48828e4e2c3c6177e010) and is unchanged. This is an area slice of the wide parked family under rule 11: 32 net production lines removed (+453/-485); most churn is callback indentation. Tests are unchanged. Phase E is untouched.Best-effort tradeoffs accepted
None newly introduced. Validation remains at the same RPC trust boundary; no security, authorization, concurrency, lifecycle or durability guard is removed.
Evidence
Own isolated frozen install passed 1,842 supply-chain checks with the current pinned native tooling. All 81 focused RPC tests across five files passed. Three protected-wrapper closure tests passed. Canonical targeted type-aware lint passed all five production files; formatting passed in 36ms. Runtime import cycles and Madge cycles are both zero. Full semantic Gateway graph typechecking is left to exact-head hosted CI under the local CPU budget; typed lint is not semantic typechecking.
The required suppression-policy suite passed13 cases and failed its global allowlist-tail assertion (actual98 vs expected97): the extra entry is
ui/src/e2e/chat-managed-media-order.test-support.ts|typescript/unbound-method|2. This matches the coordinator's OPEN signature for scheduled main39232001367. The causal UI file (blobded561cf48071a5316258484d84ea2253f76a9d6) and audit test (c8e30a677c171e3afd6db85b4f8ccbf70734ea6a) are unchanged from this slice's886ba0f base. This is a newer cause than an earlier, same-count native-MCP inventory failure. This slice adds no suppression and edits no allowlist. Combined local proof is 97 passed / 1 investigated inherited failure across98 cases, not all green. No timeout, retry, skip or baseline was weakened.Fresh independent full-cut P0–P2 review completed scoped-clean with no actionable findings (confidence0.98); the actual report and machine status were inspected. Exact-head hosted CI remains the broad landing gate. No live Gateway or operator state was used.
Exact-head CI39236589474 completed successfully at signed
3704d6140564c44001ab93f6974285338400945b: all77 jobs completed with no failure. The full200-check census has75success/123skip/1neutral/1historical draft PR-context cancellation. No check is unfinished or failed; the cancelled non-execution draft-context check has a successful ready-context replacement. Skipped jobs are not claimed as execution proof. The local suppression inventory failure remains recorded above, not relabeled fixed.