[PR #5008] [CLOSED] fix(cli): expose device_id in list-frida-devices JSON output (#4637) #6728

Closed
opened 2026-11-01 21:42:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5008
Author: @prasad2512
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/issue-4637-frida-devices-key


📝 Commits (2)

  • ea60631 fix(cli): expose device_id in list-frida-devices JSON output (#4637)
  • 7c35014 fix(cli): project device_id before cleanup wrapping

📊 Changes

2 files changed (+55 additions, -11 deletions)

View changed files

📝 src/cli/fridaCommands.ts (+15 -10)
📝 tests/boundary/cli/fridaCli.test.ts (+40 -1)

📄 Description

Summary

ode scripts/rea.mjs list-frida-devices --json previously exposed each device with internal key deviceId instead of canonical device_id, causing successful non-empty CLI results to fail the contract defined in FRIDA_TOOL_CONTRACTS.outputSchema. In contrast, production MCP (list_frida_devices in src/server/registerFridaTools.ts) and list-frida-processes already project to device_id.

This PR maps device_id: device.deviceId in src/cli/fridaCommands.ts, aligning list-frida-devices CLI JSON output with the shared MCP contract.

Fixes #4637

Problem and expected behavior

When running
ode scripts/rea.mjs list-frida-devices --json, device objects contained deviceId instead of device_id. CLI consumers expecting the schema defined in FRIDA_TOOL_CONTRACTS.outputSchema failed to access device_id.

Change and scope

  • In src/cli/fridaCommands.ts, map
    esult.value.devices to expose device_id,
    ame, and ype.
  • In ests/boundary/cli/fridaCli.test.ts, add unit test maps internal deviceId to canonical device_id in successful list-frida-devices output asserting the returned structure conforms to expected keys.

Contract and boundary impact

  • Semantic owner and earliest changed stage: cli

  • Contribution scope fit and linked maintainer decision: not applicable

  • CLI and MCP/tool-catalog contract: aligns CLI with MCP schema

  • Provider, bridge, target-format, or platform compatibility: all platforms

  • Evidence, artifact, provenance, or reconstruction contract: none

  • Target selection, authority, upstream behavior, and cleanup details: not applicable

  • Generated metadata: none

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Tests added or updated: ests/boundary/cli/fridaCli.test.ts
  • Base reproduction: reported in #4637

Validation performed

pm run test:focused -- tests/boundary/cli/fridaCli.test.ts passed (7/7 tests passed).

pm run check:fast passed (typecheck and lint passed with 0 errors).

Compatibility, safety, and release

  • Breaking changes or migration steps: none
  • Real Hopper/Ghidra, browser, or OS coverage: frida CLI
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: safe

Author readiness

Human owner: @prasad2512

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows ype(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5008 **Author:** [@prasad2512](https://github.com/prasad2512) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/issue-4637-frida-devices-key` --- ### 📝 Commits (2) - [`ea60631`](https://github.com/morluto/rea/commit/ea6063149ad6a2ae8d47c8878e69196a7d990481) fix(cli): expose device_id in list-frida-devices JSON output (#4637) - [`7c35014`](https://github.com/morluto/rea/commit/7c3501486e0c154eca43bc982523986117adfa90) fix(cli): project device_id before cleanup wrapping ### 📊 Changes **2 files changed** (+55 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/fridaCommands.ts` (+15 -10) 📝 `tests/boundary/cli/fridaCli.test.ts` (+40 -1) </details> ### 📄 Description ## Summary ode scripts/rea.mjs list-frida-devices --json previously exposed each device with internal key deviceId instead of canonical device_id, causing successful non-empty CLI results to fail the contract defined in FRIDA_TOOL_CONTRACTS.outputSchema. In contrast, production MCP (list_frida_devices in src/server/registerFridaTools.ts) and list-frida-processes already project to device_id. This PR maps device_id: device.deviceId in src/cli/fridaCommands.ts, aligning list-frida-devices CLI JSON output with the shared MCP contract. Fixes #4637 ## Problem and expected behavior When running ode scripts/rea.mjs list-frida-devices --json, device objects contained deviceId instead of device_id. CLI consumers expecting the schema defined in FRIDA_TOOL_CONTRACTS.outputSchema failed to access device_id. ## Change and scope - In src/cli/fridaCommands.ts, map esult.value.devices to expose device_id, ame, and ype. - In ests/boundary/cli/fridaCli.test.ts, add unit test maps internal deviceId to canonical device_id in successful list-frida-devices output asserting the returned structure conforms to expected keys. ## Contract and boundary impact - Semantic owner and earliest changed stage: cli - Contribution scope fit and linked maintainer decision: not applicable - CLI and MCP/tool-catalog contract: aligns CLI with MCP schema - Provider, bridge, target-format, or platform compatibility: all platforms - Evidence, artifact, provenance, or reconstruction contract: none - Target selection, authority, upstream behavior, and cleanup details: not applicable - Generated metadata: none - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage - Tests added or updated: ests/boundary/cli/fridaCli.test.ts - Base reproduction: reported in #4637 ## Validation performed - pm run test:focused -- tests/boundary/cli/fridaCli.test.ts passed (7/7 tests passed). - pm run check:fast passed (typecheck and lint passed with 0 errors). ## Compatibility, safety, and release - Breaking changes or migration steps: none - Real Hopper/Ghidra, browser, or OS coverage: frida CLI - Package or release metadata impact: none - Security, privacy, process, or containment review: safe ## Author readiness Human owner: @prasad2512 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows ype(scope): outcome. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6728
No description provided.