Repository navigation
feat(capture): decode selected protobuf and gRPC bodies - #5031
Conversation
…e records Adds a derived protobuf view to inspect_web_network_capture for records chosen with record_ordinals: gRPC/gRPC-web framing (including trailers and grpc-web-text) and a protoc --decode_raw style wire decode with byte offsets. Length-delimited readings are marked inferred. Retained base64 stays the source of truth. Refs morluto#4986 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Reproducible wire-decoding correctness issue in the new const payload = Buffer.from("0880808080808080808002", "hex");
const decoded = decodeProtobufWire(payload);
// Current logic reports field 1's value as "0".The payload is a valid field-1 varint tag followed by an invalid 10-byte uint64 varint: nine continuation bytes Please reject an overflowing tenth byte ( This is limited to the proposed decoder and does not assert a bug in REA's current released runtime. |
…llowup # Conflicts: # src/contracts/analysisViewToolContracts.ts # src/domain/analysisView/analysisView.ts # src/domain/analysisView/webNetworkCaptureView.ts
Codex Review SummaryThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The reviewed changes appear safe to merge, with the previous credential-exposure finding fixed. SummaryAdds selected Protobuf and gRPC body reads, optional local schemas, and paged field views.
Live supersession status could not be checked because GitHub access was not authenticated. No tests were run during this review. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Selected capture bodies] --> B[Check credentials]
B --> C{Credential found?}
C -->|Yes| D[Exclude body bytes and digest]
C -->|No| E{Hidden coding and incomplete check?}
E -->|Yes| F[Stop without source Evidence]
E -->|No| G{Identity coding established?}
G -->|No| H[Keep source opaque]
G -->|Yes| I[Read frames and fields]
D --> J[Retain sanitized Evidence]
H --> J
I --> J
J --> K[Page retained facts]
Reviews (6) · Last reviewed commit: "fix(capture): inspect credentials before..." · Reviewed by Greptile |
… into feat/environment-state-coverage Keep main's tool description and change only its environment-state documents clause to this branch's rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ansition-view Resolve conflicts with main's protobuf capture view (morluto#5031). Main now derives UnsignedAnalysisView from AnalysisViewResult instead of listing each kind, so the browser-scenario result needs no separate entry. The inspect_analysis_view description is main's text, including the protobuf sentence, plus this branch's capture_browser_scenario additions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Fixes #4986. Selected historical HTTP bodies expose bounded Protobuf/gRPC facts, optional supplied-schema interpretations and compact field queries through the same CLI/MCP implementation. Continues @AayushJB03's original PR with its commit preserved and follow-up fixes.
Behavior and ownership
Domain contracts describe facts; browser/history adapters own parsing; shared application workflows serve named CLI/MCP contracts. SDK-converted schemas are validated against AJV2020. Additive options/view variant; authored docs/skill updated. Pinned
@bufbuild/[email protected]has verified Apache/BSD notices and locked inventory.Expected effects: read selected existing files/captured data and launch existing owned capture-decoder workers. No new target execution, injection, mutation or protection-recovery capability requiring a scope decision.
Executed validation
Head
06ac908f5; main snapshot4668cea24:npm run check,npm run docs:check: static/architecture/generated-doc/license checks and 5 README tests passed.npm run verify:package: packed install/update, CLI/MCP/Evidence, planned/idempotent setup, backups, uninstall and cleanup passed.375f4946642425dbc53c0fe89467235016ff4dea543be1bf82720bddc948580d.Example interpretation:
field_id: "offset:5", schema_name: "sentence", schema_value: "hello", with mandatory provenance/coordinates, coverage and parent links.Current-head GitHub CI: 45 checks passed, including all five test shards, Windows/package, native packages and real-application lanes. CI checked merge preview
ff8c1be730(head06ac908f5plus main799e8265b); its only addition over the local qualification snapshot is the upstream Hopper-owner verification fix. All 9 review threads are resolved. A prior-head unchanged Windows fixture EBUSY passed on subsequent heads without an unrelated code change.Measured completed tasks
Token estimates, latency, CPU, memory and limitations
Baseline
a9370a906retains the original decoder; candidate06ac908f5shares main4668cea24. Both read the same selected UTF-8 candidate with source/body hashes and exact range; eight baseline sidecars were independently audited. Real Say uses complete inspection in both; generated 20,001-field data uses original complete inspection versus summary plus one field page.Tokenx estimates count the extra RPC. Actual model usage/rendering is unmeasured; small answers grow. Generated data is a stress case, not observed application scale.
Two fresh-process primary-only runs, complete verification harness including SDK/catalog/schema checks, token estimates and teardown:
Cold generated-case RPCs regress: original 1.38–1.65 s versus follow-up 2.80–3.04 s for summary plus first page. Smaller context and stronger facts cost initial time/memory; no cold-speedup claim.
Separate retained reads after source removal: original 2,029/733/775 ms; selected fields 10.57/8.39/6.46 ms. These probes are excluded from primary counters. Full probe harness: original 14.01 s wall/13.93 s CPU/0.913 GiB; follow-up 8.99 s/8.89 s/0.870 GiB. Two-RPC real-schema correctness harness: 13.28 s/13.10 s/1.222 GiB; the old decoder has no equivalent schema capability.
Linux/Node24.18, two CPUs, 3 GiB V8 heaps, 8 GiB family guard; no retries/stops. RSS sampled every20ms sums family RSS and can double-count shared pages/miss short peaks. Runtime caches fresh; OS cache/host load uncontrolled. Engine-only costs and post-task sidecar audit unmeasured. Results qualify scoped projection/reuse, not a general provider speedup.
Real traffic verification is Linux/HAR only. Generated SAZ files exercise the production reader, not a Fiddler producer golden. Real native-gRPC, mitmproxy and other-OS protocol coverage remains unverified. Compression, map semantics, extensions and required-field validation remain explicitly unsupported. Supplied schemas do not establish the sender's schema; missing/mismatched interpretations remain visible.
Author readiness
Human owner: @gensokyo-dev
The human owner explicitly authorized this work, delegated the technical review and validation to Codex, directed these declarations to be recorded on their behalf, and requested ready-for-review submission and normal merge. This records that direction; it does not assert a separate, independent human diff review. Codex performed the documented technical review and checks.
Before merge
type(scope): outcome.