Skip to content

fix(pcap): retain producer contradiction diagnostics - #7937

Merged
morluto merged 2 commits into
mainfrom
codex/pcap-contradiction-diagnostics-7293
Oct 29, 2026
Merged

morluto merged 2 commits into
mainfrom
codex/pcap-contradiction-diagnostics-7293

Conversation

@morluto

@morluto morluto commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #7293. Packet-capture inspection refused contradictory capinfos and TShark packet counts but omitted the observed counts from its public error. The capture owner now retains both counts and a mismatch reason in structured diagnostics. The analogous disagreement between the capinfos and snapshot SHA-256 values retains both digests.

Problem and expected behavior

The provider's protocol errors carried a specific internal message, while the shared projection returned generic unreadable_output advice without those facts. Contradictory results remain refused; CLI and MCP should expose the producer-owned facts in details.diagnostics.

Change and scope

Bind only the parsed comparison facts at the capture producer. The common error projection already preserves diagnostics. Other packet-output parser failures can also lose internal reasons; some include arbitrary producer field names, so making those reasons public requires a separately bounded representation and is not covered here.

Contract and boundary impact

  • Semantic owner and earliest changed stage: packet-capture producer after parsed producer outputs and snapshot verification.
  • Contribution scope fit and linked maintainer decision: existing read-only capture inspection; no new authority.
  • CLI and MCP/tool-catalog contract: existing error details gain structured mismatch diagnostics; no tool input or successful output schema changes.
  • Provider, bridge, target-format, or platform compatibility: existing bounded TShark and capinfos workflow.
  • Evidence, artifact, provenance, or reconstruction contract: contradictory results remain failures; observed counts and hashes remain distinct.
  • Target selection, authority, upstream behavior, and cleanup details: unchanged.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.

Evidence and regression coverage

The issue reports a public Linux CLI reproduction with controlled tools. New Linux producer-boundary regressions cover count mismatch, equal zero counts, and digest mismatch; a new public CLI/MCP regression checks the count diagnostic. All new cases were skipped on the macOS development host. Their post-fix results are not verified; Linux CI or an admitted Linux/Windows host must run them. No real Wireshark run was performed.

Validation performed

  • npm run check:fast — passed.
  • npm run test:focused -- tests/acceptance/pcapOutputUtf8CliMcp.test.ts tests/boundary/pcap/pcapProvider.test.ts — four existing tests passed and 40 skipped on macOS, including all new regressions.
  • git diff --check — passed.
  • Docker was unavailable, so Linux capture behavior was not exercised.

Compatibility, safety, and release

No successful output or error-code change; unreadable-output errors for these contradictions gain structured diagnostics. Real-tool and admitted-host verification remain outstanding.

Author readiness

Human owner: @morluto

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

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking code issue was found.

Summary

The PR preserves observed packet counts and SHA-256 values when capture tools disagree. Contradictory results remain errors.

  • Capture mismatch errors show the reason and both observed values.

Reviews (2) · Last reviewed commit: "test(pcap): align DNS fixture with empty..." · Reviewed by Greptile

@morluto
morluto marked this pull request as ready for review October 28, 2026 23:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T23:25:57.567307Z be85a08 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto
morluto merged commit 0386efd into main Oct 29, 2026
44 of 45 checks passed
@morluto
morluto deleted the codex/pcap-contradiction-diagnostics-7293 branch October 29, 2026 00:43
@morluto morluto added bug Something isn't working provider: pcap Analysis provider / engine: pcap labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: pcap Analysis provider / engine: pcap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Pcap count contradictions lose their specific reason in the CLI error

1 participant