[PR #6179] [CLOSED] fix(pcap): report capture summaries unsupported where their bound is unavailable #7185

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6179
Author: @Iyanuoluwa007
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: fix/pcap-capture-host-availability


📝 Commits (1)

  • e6ce1c5 fix(pcap): report capture summaries unsupported where their bound is unavailable

📊 Changes

6 files changed (+56 additions, -2 deletions)

View changed files

📝 src/application/CapabilityInventory.test.ts (+32 -0)
📝 src/application/CapabilityInventory.ts (+11 -0)
📝 src/domain/pcap/pcapAnalysis.ts (+7 -0)
📝 src/pcap/PcapNativeBound.ts (+2 -1)
📝 src/pcap/PcapProvider.ts (+2 -1)
📝 src/server/sessionAvailabilityPolicy.ts (+2 -0)

📄 Description

Summary

Fixes #5711. binary_session no longer advertises inspect_pcap_capture as available on hosts where capture summaries are always refused (anything other than Linux and Windows, e.g. macOS). It now reports unsupported_host with remediation. inspect_pcap_client stays available.

Problem and expected behavior

CapabilityInventory.ts returned available for every pcap-provider tool. PcapProvider.inspectAvailability and preparePcapNativeBound refuse capture summaries unless the host can enforce their native memory bound: util-linux prlimit on Linux, owned Job Objects on Windows. On macOS, inspect_pcap_capture therefore always returned a non-retryable capability_unavailable, while binary_session kept advertising it.

Change and scope

  • src/domain/pcap/pcapAnalysis.ts: pcapCaptureHostSupported(platform), the one host rule.
  • src/pcap/PcapProvider.ts, src/pcap/PcapNativeBound.ts: use it instead of two inline platform checks, so the provider and the inventory can't drift apart.
  • src/application/CapabilityInventory.ts: optional policy fact pcapCaptureHostSupported. When it is false, inspect_pcap_capture is unsupported_host. Undefined keeps today's behavior for configured policies.
  • src/server/sessionAvailabilityPolicy.ts: the default policy sets it from the host platform.

Not included: per-call probing of TShark/capinfos or prlimit in binary_session. inspect_pcap_client and execution still report those.

Contract and boundary impact

  • Semantic owner and earliest changed stage: session tool availability for inspect_pcap_capture.

  • Contribution scope fit and linked maintainer decision: not applicable.

  • CLI and MCP/tool-catalog contract: on non-Linux/non-Windows hosts, binary_session reports inspect_pcap_capture with available: false, reason: "unsupported_host". Schemas unchanged.

  • Provider, bridge, target-format, or platform compatibility: Linux and Windows unchanged.

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

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

  • Generated metadata, package, or installation impact: none.

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added: src/application/CapabilityInventory.test.ts "pcap capture host availability (#5711)". With pcapCaptureHostSupported: false, capture is unsupported_host and the client stays available; with true or undefined, both stay available.

  • Base reproduction: with the CapabilityInventory.ts change stashed, the unsupported-host case fails (executed).

  • Remaining proof gaps: no macOS host. The default-policy wiring is source-derived (platform from node:process), and the issue's macOS stdio MCP reproduction was not rerun. The 18 tests/boundary/pcap failures on my Windows checkout are identical with and without this change (process-ownership tests needing the packaged native addon).

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npx vitest run src/application/CapabilityInventory.test.ts: 31 passed; the new case fails without the source change.
  • npx tsc --noEmit, npm run check:fast (typecheck, lint, pre-push), npm run verify:architecture-guards (1726 files): passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; availability reporting only.
  • Real Hopper/Ghidra, browser, or OS coverage: none.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

  • 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 type(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/6179 **Author:** [@Iyanuoluwa007](https://github.com/Iyanuoluwa007) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/pcap-capture-host-availability` --- ### 📝 Commits (1) - [`e6ce1c5`](https://github.com/morluto/rea/commit/e6ce1c5b3f5af56ff2a1ecbd460df786bd01f24f) fix(pcap): report capture summaries unsupported where their bound is unavailable ### 📊 Changes **6 files changed** (+56 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/application/CapabilityInventory.test.ts` (+32 -0) 📝 `src/application/CapabilityInventory.ts` (+11 -0) 📝 `src/domain/pcap/pcapAnalysis.ts` (+7 -0) 📝 `src/pcap/PcapNativeBound.ts` (+2 -1) 📝 `src/pcap/PcapProvider.ts` (+2 -1) 📝 `src/server/sessionAvailabilityPolicy.ts` (+2 -0) </details> ### 📄 Description ## Summary Fixes #5711. `binary_session` no longer advertises `inspect_pcap_capture` as available on hosts where capture summaries are always refused (anything other than Linux and Windows, e.g. macOS). It now reports `unsupported_host` with remediation. `inspect_pcap_client` stays available. ## Problem and expected behavior `CapabilityInventory.ts` returned `available` for every `pcap-provider` tool. `PcapProvider.inspectAvailability` and `preparePcapNativeBound` refuse capture summaries unless the host can enforce their native memory bound: util-linux `prlimit` on Linux, owned Job Objects on Windows. On macOS, `inspect_pcap_capture` therefore always returned a non-retryable `capability_unavailable`, while `binary_session` kept advertising it. ## Change and scope - `src/domain/pcap/pcapAnalysis.ts`: `pcapCaptureHostSupported(platform)`, the one host rule. - `src/pcap/PcapProvider.ts`, `src/pcap/PcapNativeBound.ts`: use it instead of two inline platform checks, so the provider and the inventory can't drift apart. - `src/application/CapabilityInventory.ts`: optional policy fact `pcapCaptureHostSupported`. When it is `false`, `inspect_pcap_capture` is `unsupported_host`. Undefined keeps today's behavior for configured policies. - `src/server/sessionAvailabilityPolicy.ts`: the default policy sets it from the host platform. Not included: per-call probing of TShark/capinfos or `prlimit` in `binary_session`. `inspect_pcap_client` and execution still report those. ## Contract and boundary impact - Semantic owner and earliest changed stage: session tool availability for `inspect_pcap_capture`. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: on non-Linux/non-Windows hosts, `binary_session` reports `inspect_pcap_capture` with `available: false`, `reason: "unsupported_host"`. Schemas unchanged. - Provider, bridge, target-format, or platform compatibility: Linux and Windows unchanged. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. - [x] Read existing files or captured data. ## Evidence and regression coverage - Tests added: `src/application/CapabilityInventory.test.ts` "pcap capture host availability (#5711)". With `pcapCaptureHostSupported: false`, capture is `unsupported_host` and the client stays available; with `true` or undefined, both stay available. - Base reproduction: with the `CapabilityInventory.ts` change stashed, the unsupported-host case fails (executed). - Remaining proof gaps: no macOS host. The default-policy wiring is source-derived (`platform` from `node:process`), and the issue's macOS stdio MCP reproduction was not rerun. The 18 `tests/boundary/pcap` failures on my Windows checkout are identical with and without this change (process-ownership tests needing the packaged native addon). - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npx vitest run src/application/CapabilityInventory.test.ts`: 31 passed; the new case fails without the source change. - `npx tsc --noEmit`, `npm run check:fast` (typecheck, lint, pre-push), `npm run verify:architecture-guards` (1726 files): passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none; availability reporting only. - Real Hopper/Ghidra, browser, or OS coverage: none. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness Human owner: <!-- @GitHub-handle --> - [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 `type(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:45:59 +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#7185
No description provided.