Repository navigation
fix(limits)!: let inspect_pcap_capture take producer_limits for its snapshot and TShark output - #14280
Merged
Conversation
…napshot and TShark output inspect_pcap_capture kept private copies of the producer budgets that inspect_packet_capture already exposes. It now accepts producer_limits with input_bytes (the streamed capture snapshot, default 2 GiB) and output_bytes (each TShark JSON pass, default 8 MiB, at most the fixed 128 MiB decoded-JSON allowance). Refusals report details.limit for the parameter instead of a fixed ceiling. The decoded-JSON expansion and retained-fact allowances stay fixed because raising them needs a streaming decoder; the version and summary probe capture is reclassified as protocol. Part of #14237 BREAKING CHANGE: an inspect_pcap_capture refusal at the snapshot or TShark JSON budget reports details.limit for producer_limits.input_bytes or producer_limits.output_bytes and no longer carries details.refusal fixed_ceiling.
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
3 tasks done
Contributor
[Medium impact] The reviewed changes appear safe to merge; no new actionable issue was established. Summary
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CLI or MCP request"] --> B["Validate producer_limits"]
B --> C["Copy snapshot within input_bytes"]
C --> D["Run TShark within output_bytes"]
D --> E["Check fixed decoded-JSON allowance"]
E --> F{"DNS pass needed?"}
F -->|No| I["Verify snapshot and return Evidence"]
F -->|Yes| G["Run DNS pass with the same budgets"]
G -->|Complete| I
G -->|Output limit| H["Keep partial facts and dns_identity_limit"]
H --> I
Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
… budgets When only the DNS wire-identity pass exceeds producer_limits.output_bytes, the partial summary now records dns_identity_limit with the parameter, effective value, default and range. The pcap output budget is documented as combined stdout and stderr, as producer_limits.output_bytes is elsewhere. Acceptance covers TShark output above the old 8 MiB ceiling in both passes.
morluto
enabled auto-merge (squash)
November 24, 2026 14:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #14237.
inspect_pcap_capturekept its own hard-coded copies of the producer budgets thatinspect_packet_capturealready exposes. It refused a capture over 2 GiB, or a TShark JSON pass over 8 MiB, with a fixed ceiling and no override. It now acceptsproducer_limits(input_bytes,output_bytes), and each refusal reportsdetails.limitfor that parameter.Problem and expected behavior
Change and scope
src/domain/pcap/pcapAnalysis.tsownsPCAP_PRODUCER_LIMITS,PCAP_PRODUCER_LIMIT_MAXIMA,pcapProducerLimitandpcapProducerLimitRecovery. The schema, the snapshot, the TShark command and the JSON decoder all use these.output_byteshas a maximum of 128 MiB, the fixed decoded-JSON allowance. Raising it therefore never removes the memory guard; above that, a streaming decoder would be needed.--producer-limitsas JSON text, the same asinspect-packet-capture.protocol.limit.TargetFailure.Contract and boundary impact
Semantic owner and earliest changed stage: the pcap domain contract. The provider resolves the limits once and passes them to the snapshot, the commands and the decoders.
Contribution scope fit and linked maintainer decision: [Feature] Let fixed producer output and capture allowances use producer_limits #14237, which the owner approved.
CLI and MCP/tool-catalog contract: an optional
producer_limitsfield is added; the advertised schema summary is updated.Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract: none.
Read existing files or captured data.
Evidence and regression coverage
tests/acceptance/pcapProducerLimitsCliMcp.test.ts(Linux; CI): over CLI and MCP, refusals atinput_bytesandoutput_bytesreportdetails.limitwith nodetails.refusal, and the defaults admit the same capture.tests/boundary/mcp/pcapWorkspaceAllocation.test.ts: the sparse 2 GiB + 1 capture now reportsdetails.limitforproducer_limits.input_bytes(default 2 GiB) instead of a fixed ceiling. This superseded assertion is replaced, not duplicated.tests/boundary/pcap/pcapSnapshotCancellation.test.ts: the snapshot refuses one byte under the file size with the limit, and admits the file at its size.src/pcap/PcapOutput.test.ts: TShark JSON one byte overoutput_bytesis refused with the limit, and admitted at its size.limitfails the output test.Validation performed
npx vitest run src/pcap tests/boundary/pcap tests/boundary/mcp/pcapWorkspaceAllocation.test.ts: passed; the Linux-only tests were skipped on macOSnode scripts/verify/fixed-ceilings.mjs: 96 registered, 78 pending, 108 authored-onlynode scripts/verify/architecture-guards.mjs: passednpm run build:cachedandnpm run verify:advertised-schemas -- --update-summary: summary updatedtsc --noEmiton the changed files: cleannpx oxfmt --check .: cleannpx oxlinton the changed files: no errorsCompatibility, safety, and release
details.limit(producer_limits.input_bytesorproducer_limits.output_bytes) and no longer carry adetails.refusalfixed_ceiling. Behaviour is unchanged whenproducer_limitsis omitted.input_bytesuses more temporary disk. A largeroutput_bytesstays within the fixed decoded-JSON memory estimate.