Repository navigation
feat(captures): discover installed protocol and field definitions - #2496
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
776da8f to
df821f8
Compare
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reviewed on 9ca3c87. The feature/real-verifier bytes match the tested f5d9724 tree; the additional main sync only updates README counts and Ghidra fixtures. The follow-up strengthens the real TShark verifier with independent matching counts, exact page source ordinals, display bases and masks.
Linux x64, pinned Node 24.18.0/npm 11.16.0, actual TShark 4.0.17: 42 focused tests, 23 native CLI/MCP cases, advertised schemas, cancellation/cleanup, and a real recorded TLS/DNS traffic workflow passed. The installation glossary contained 236,481 records / 19,271,694 bytes; selected records and coverage matched independently invoked native output. The capture remained byte-identical.
For the same two-call DNS task, three alternating warm pairs measured o200k_base request/response estimates of 41,449 tokens (all DNS fields) vs 5,878 (focused query). Including the same 135,311-token input-schema catalog projection gives 176,760 vs 141,189. Median wall time was 1.931 vs 1.763 s; server plus waited-child CPU was 2.34 vs 2.05 s. This is a bounded local task measurement, not billed usage or a general speedup claim. The benchmark family peaked at 1,149 MiB; the largest local verification/check family at 3,841 MiB, without OOM.
No persistent glossary cache was added: the executable digest alone does not cover installed plugins/global configuration. Discovery remains installation evidence, not observed traffic. macOS/Windows remain unsupported.
The earlier static/Ghidra CI failures came from unchanged main fixtures missing application.java.min. Main fixed those in 18d56f5; this PR now includes that update. The complete local npm run check passes, including format, typecheck/lint, Knip, metadata and architecture guards; docs pass and duplication is 2.94%.
|
|
@greptileai review |
Summary
Add
inspect_packet_fields/inspect-packet-fieldsso analysts can find the installed TShark protocol and field definitions before selecting fields forinspect_packet_capture. For example,{ "kind": "fields", "protocol": "usb", "query": "idVendor" }returnsusb.idVendor, itsFT_UINT16type, parentusb, display base and bitmask.Problem and expected behavior
Capture inspection requires exact field names but currently offers no installation-specific discovery. Search protocol registrations or field definitions by literal substring, optionally selecting an exact protocol. Return 50 matches by default, offset/limit paging, explicit full output within resource limits, and examined/matching/returned counts. Duplicate abbreviations remain separate records with source line numbers. No linked issue: this is a focused follow-up to #2318.
Change and scope
Extend the existing TShark adapter and its shared CLI/MCP Evidence workflow. Reuse the same admission slot, owned process execution, executable verification, inherited Linux limits, private empty personal profile and retryable cleanup. The common resource owner accepts a per-request operation so discovery failures have the correct identity; it does not create a second queue. This small common-owner change is identical to #2487; both PRs are independently based on main.
Contract and boundary impact
-G fieldsP/F grammar. Preserve names, types, parents, display bases, masks, descriptions and duplicate registrations.kind,protocol,query,offset,limit. CLI--allconflicts with--limit. Catalog registrations describe tool capabilities, not observed traffic.Expected effects:
Evidence and regression coverage
Parser/provider tests cover duplicate registrations, malformed off-page records, paging/filtering/no matches, representation and command-output budgets, failed version probes, shared admission, executable changes, shutdown, cancellation and cleanup retry. MCP tests validate SDK-converted schemas and actionable unavailable results. Existing signal-provider regressions pass after the common-owner change.
The real verifier compares source ordinals and native field columns against direct TShark output under a separate empty profile; checks USB vendor-ID discovery, protocol paging, full UDP field selection, negative queries and CLI/MCP parity; and retains the existing packet-capture workflow and cleanup checks.
Validation performed
Cleanup follow-up on
b2aff43e8: retained workspaces now keep the operation that acquired them alongside process ownership. Shutdown and pre-request cleanup retries use that identity, rather than the provider default or the next request's operation. Extended the existing field discovery boundary regression to reject a different operation while cleanup is pending, verify two failed shutdown attempts keep the original operation, and then complete cleanup. No public contract or execution scope changed.npm run check,git diff --check, and a Gitleaks diff scan passed.Earlier feature validation:
npm run check,npm run docs:check,npm run verify:test-discovery— passed; 1,023 test files discovered exactly once.npm run jscpd— passed, 2.95% duplicated lines.git diff --check— passed.Six discovery cases measured 651–761 ms per MCP call and 7.5–20.3 KB response envelopes.
tokenxestimates including one tool definition, request and response were 6,634–11,253 tokens. Warm MCP server, fresh native processes, no filesystem-cache control; these are estimates, not billed usage or evidence of improved agent task completion.Compatibility, safety, and release
No breaking call/configuration changes or migrations. macOS/Windows integration remains unsupported. The private profile does not sandbox installed plugins or libraries. Limits are per process/file, not aggregate quotas. Ambient environment is not serialized. Model-driven task selection, CPU time and peak process-family memory remain unmeasured; no cache or speedup claim.
Before merge
Summary by CodeRabbit