[PR #4924] test(http3): verify reset and partial-response capture semantics #6675

Open
opened 2026-11-01 21:42:14 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4924
Author: @LuisTaffelli
Created: 10/18/2026
Status: 🔄 Open

Base: main ← Head: test/http3-origin-reset


📝 Commits (3)

  • 71942b2 test(http3): verify reset and partial-response capture semantics
  • 7bd6b09 test(jadx): retain protocol fixture lifetime until owned cleanup
  • c755d26 docs(http3): record reinspection against the refreshed runtime

📊 Changes

11 files changed (+1432 additions, -167 deletions)

View changed files

📝 docs/http3-capture-lab.md (+172 -5)
📝 scripts/fixtures/http3-lab.py (+88 -6)
📝 scripts/fixtures/http3-lab.test.py (+73 -2)
📝 scripts/fixtures/observe-mitmproxy-http3.py (+12 -2)
📝 scripts/lib/http3-capture-assertions.mjs (+67 -45)
📝 scripts/lib/http3-capture-assertions.test.mjs (+291 -100)
➕ scripts/lib/http3-capture-fixtures.mjs (+312 -0)
➕ scripts/lib/http3-reset-assertions.mjs (+320 -0)
📝 scripts/verify-http3-network-captures.mjs (+60 -4)
➕ tests/evaluation/http3CaptureAssertions.test.ts (+33 -0)
📝 tests/fixtures/android/jadx-mcp.mjs (+4 -3)

📄 Description

Summary

Verify native HTTP/3 capture semantics and recovery on the original connections after origin cancellation, both before response headers and after a streamed partial response. Follow-up to merged #1997; no separate issue is linked because this extends that existing optional lab.

Problem and expected behavior

Status 200 and a declared content-length do not establish a complete response or recovered body bytes. The lab must distinguish bytes observed at endpoints from bytes retained in captures, preserve incomplete exchanges, and prove recovery independently on each connection leg.

Change and scope

  • --with-origin-reset cancels before headers. --with-partial-reset sends 21 of 32 declared bytes, waits for client receipt, then cancels. Both require H3_REQUEST_CANCELLED and same-connection recovery; stream IDs remain local to each leg.
  • Shared assertions own HTTP field interpretation. Requested missing scenarios fail before analysis. A discovered evaluation test rejects failing and empty assertion suites in ordinary CI.
  • A separate CI repair keeps the synthetic JADX protocol fixture alive until its verified cleanup owner stops it. The explicit RPC-disconnect fault still exits. JADX production code is unchanged.

Contract and boundary impact

  • Semantic owner: optional lab producer, shared capture assertions and verifier; the CI repair belongs to the synthetic process fixture.
  • Scope and maintainer decision: existing self-owned loopback boundaries from #1997 and a test-fixture correction; separate advance scope decision not applicable.
  • CLI/MCP contract: no schema or product-tool changes; complete delivery defaults remain unchanged. Only the optional verifier gains scenario flags.
  • Compatibility: mitmproxy 12.2.3, aioquic 1.2.0, Linux reverse mode, QUIC v1. Earlier normal/fallback and before-headers captures remain inspectable.
  • Evidence/provenance: original capture hashes, exact fields/bytes, nulls, errors and retained session Evidence are checked through CLI/MCP. Endpoint receipt is distinct from stored body evidence.
  • Authority/cleanup: generated loopback endpoints, private files, explicit test CAs and existing owned-process supervision. Partial responses stream with body storage disabled; cleanup attempts all acquired resources.
  • Metadata/package/install: no dependencies, installers, public metadata or release changes. Lab scripts and test fixtures are outside the package file allowlist.

Expected effects of running the optional lab:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

These effects are the lab's Python/addon/proxy/client code, private generated files and loopback traffic; host trust and routes are unchanged.

Evidence and regression coverage

Fresh traffic and reinspection passed for nine native records. The partial response retains status_code: 200, content: null, timestamp_end: null and the producer error. The 21-byte prefix is endpoint evidence, not a captured body. Recovery bodies were 42/50 bytes.

Suppressing receipt produced a failed attempt without success output, cleanup failures or live owned descendants/groups. This was a controlled fault. Source/capture hashes, versions, run IDs and the refreshed-runtime reinspection are in the lab evidence; raw captures and keys remain private.

  • 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

  • CI 39088666739 on c755d268230e5d82bad8ba14936876058852585b — passed all 36 jobs, including all five test shards, their aggregate, Windows capability/package verification and CI required.
  • npm run check and npm run docs:check — passed after the final documentation update; docs checks include five README consistency tests.
  • Focused plist, keyed-archive and HTTP/3 evaluation tests — 54 passed on the rebased runtime, including the formerly failing archive case and the HTTP/3 assertion gate.
  • node --test scripts/lib/http3-capture-assertions.test.mjs scripts/lib/http3-verifier-lifecycle.test.mjs — 65 passed. Pinned aioquic Python producer tests — six passed.
  • Ten affected Android/JADX boundary and MCP files — 116 passed after the fixture repair, covering cleanup retry, disconnect, cancellation, startup and archive ownership.
  • Real fresh-traffic verifier, then --inspect-existing --with-origin-reset --with-partial-reset — passed CLI/MCP schemas, bytes, identity, reset/recovery, retained Evidence and cleanup. The updated-runtime reinspection run was a3a1c38e-d4cf-4cef-97cb-c76743866c40 (2026-10-18 01:31 UTC); its five lab source hashes and four capture digests match the original evidence. Reinspection adds no traffic or scenario coverage.

The complete local deterministic suite was not run; the remote result above is the CI evidence for this revision.

CI repairs and earlier failure limits

Rebased onto upstream 1accac27c36d98fb432e32a4a45fe75c78480773 / #4930 to consume the independently reproduced plist-format and keyed-archive expectation repairs.

The next CI run exposed a synthetic JADX cleanup race. Its original 48-test integration file passed locally, so no deterministic local reproduction of that complete failure is claimed. A separate EOF experiment confirmed that the fixture exited without its cleanup owner in tool-error mode; after the repair it stayed alive until explicitly stopped. All five remote test shards passed subsequently.

An earlier Windows curated run exceeded a 15-second webModuleCli deadline despite complete JSON output. Its cause remains unestablished; the Linux test passed but does not establish Windows behavior. The latest Windows lane passed without changing that test or deadline. GitHub refused an isolated rerun because repository admin rights were required; the documentation update triggered fresh CI from the owned branch.

Compatibility, safety, and release

  • No breaking change, migration, package metadata change or release request.
  • New reset scenarios were verified in private Linux user/mount/network/PID namespaces with loopback and no default routes; they share the host kernel/filesystem. These resets were not rerun in the pinned VM.
  • Buffered partial responses, storing streamed bodies, other reset codes, client cancellation, real-browser HTTP/3 and QUIC v2 remain unverified. No performance claim is made.
  • Generated test CAs are passed explicitly. Raw captures, certificates and keys remain outside Git.

Author readiness

Human owner: @LuisTaffelli

  • 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/4924 **Author:** [@LuisTaffelli](https://github.com/LuisTaffelli) **Created:** 10/18/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/http3-origin-reset` --- ### 📝 Commits (3) - [`71942b2`](https://github.com/morluto/rea/commit/71942b2617770fd57e2c5e6bb9c3ecbd3348fe82) test(http3): verify reset and partial-response capture semantics - [`7bd6b09`](https://github.com/morluto/rea/commit/7bd6b09ffd52db8369c3ba48dba9cd4b94b413c6) test(jadx): retain protocol fixture lifetime until owned cleanup - [`c755d26`](https://github.com/morluto/rea/commit/c755d268230e5d82bad8ba14936876058852585b) docs(http3): record reinspection against the refreshed runtime ### 📊 Changes **11 files changed** (+1432 additions, -167 deletions) <details> <summary>View changed files</summary> 📝 `docs/http3-capture-lab.md` (+172 -5) 📝 `scripts/fixtures/http3-lab.py` (+88 -6) 📝 `scripts/fixtures/http3-lab.test.py` (+73 -2) 📝 `scripts/fixtures/observe-mitmproxy-http3.py` (+12 -2) 📝 `scripts/lib/http3-capture-assertions.mjs` (+67 -45) 📝 `scripts/lib/http3-capture-assertions.test.mjs` (+291 -100) ➕ `scripts/lib/http3-capture-fixtures.mjs` (+312 -0) ➕ `scripts/lib/http3-reset-assertions.mjs` (+320 -0) 📝 `scripts/verify-http3-network-captures.mjs` (+60 -4) ➕ `tests/evaluation/http3CaptureAssertions.test.ts` (+33 -0) 📝 `tests/fixtures/android/jadx-mcp.mjs` (+4 -3) </details> ### 📄 Description ## Summary Verify native HTTP/3 capture semantics and recovery on the original connections after origin cancellation, both before response headers and after a streamed partial response. Follow-up to merged #1997; no separate issue is linked because this extends that existing optional lab. ## Problem and expected behavior Status 200 and a declared content-length do not establish a complete response or recovered body bytes. The lab must distinguish bytes observed at endpoints from bytes retained in captures, preserve incomplete exchanges, and prove recovery independently on each connection leg. ## Change and scope - `--with-origin-reset` cancels before headers. `--with-partial-reset` sends 21 of 32 declared bytes, waits for client receipt, then cancels. Both require `H3_REQUEST_CANCELLED` and same-connection recovery; stream IDs remain local to each leg. - Shared assertions own HTTP field interpretation. Requested missing scenarios fail before analysis. A discovered evaluation test rejects failing and empty assertion suites in ordinary CI. - A separate CI repair keeps the synthetic JADX protocol fixture alive until its verified cleanup owner stops it. The explicit RPC-disconnect fault still exits. JADX production code is unchanged. ## Contract and boundary impact - Semantic owner: optional lab producer, shared capture assertions and verifier; the CI repair belongs to the synthetic process fixture. - Scope and maintainer decision: existing self-owned loopback boundaries from #1997 and a test-fixture correction; separate advance scope decision not applicable. - CLI/MCP contract: no schema or product-tool changes; complete delivery defaults remain unchanged. Only the optional verifier gains scenario flags. - Compatibility: mitmproxy 12.2.3, aioquic 1.2.0, Linux reverse mode, QUIC v1. Earlier normal/fallback and before-headers captures remain inspectable. - Evidence/provenance: original capture hashes, exact fields/bytes, nulls, errors and retained session Evidence are checked through CLI/MCP. Endpoint receipt is distinct from stored body evidence. - Authority/cleanup: generated loopback endpoints, private files, explicit test CAs and existing owned-process supervision. Partial responses stream with body storage disabled; cleanup attempts all acquired resources. - Metadata/package/install: no dependencies, installers, public metadata or release changes. Lab scripts and test fixtures are outside the package file allowlist. Expected effects of running the optional lab: - [x] Read existing files or captured data. - [x] Launch or attach to a process. - [x] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. - [x] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. These effects are the lab's Python/addon/proxy/client code, private generated files and loopback traffic; host trust and routes are unchanged. ## Evidence and regression coverage Fresh traffic and reinspection passed for nine native records. The partial response retains `status_code: 200`, `content: null`, `timestamp_end: null` and the producer error. The 21-byte prefix is endpoint evidence, not a captured body. Recovery bodies were 42/50 bytes. Suppressing receipt produced a failed attempt without success output, cleanup failures or live owned descendants/groups. This was a controlled fault. Source/capture hashes, versions, run IDs and the refreshed-runtime reinspection are in [the lab evidence](https://github.com/LuisTaffelli/rea/blob/c755d268230e5d82bad8ba14936876058852585b/docs/http3-capture-lab.md#verified-reset-snapshot-2026-10-17); raw captures and keys remain private. - [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 - [CI 39088666739](https://github.com/morluto/rea/actions/runs/39088666739) on `c755d268230e5d82bad8ba14936876058852585b` — passed all 36 jobs, including all five test shards, their aggregate, Windows capability/package verification and `CI required`. - `npm run check` and `npm run docs:check` — passed after the final documentation update; docs checks include five README consistency tests. - Focused plist, keyed-archive and HTTP/3 evaluation tests — 54 passed on the rebased runtime, including the formerly failing archive case and the HTTP/3 assertion gate. - `node --test scripts/lib/http3-capture-assertions.test.mjs scripts/lib/http3-verifier-lifecycle.test.mjs` — 65 passed. Pinned aioquic Python producer tests — six passed. - Ten affected Android/JADX boundary and MCP files — 116 passed after the fixture repair, covering cleanup retry, disconnect, cancellation, startup and archive ownership. - Real fresh-traffic verifier, then `--inspect-existing --with-origin-reset --with-partial-reset` — passed CLI/MCP schemas, bytes, identity, reset/recovery, retained Evidence and cleanup. The updated-runtime reinspection run was `a3a1c38e-d4cf-4cef-97cb-c76743866c40` (2026-10-18 01:31 UTC); its five lab source hashes and four capture digests match the original evidence. Reinspection adds no traffic or scenario coverage. The complete local deterministic suite was not run; the remote result above is the CI evidence for this revision. <details> <summary>CI repairs and earlier failure limits</summary> Rebased onto upstream `1accac27c36d98fb432e32a4a45fe75c78480773` / #4930 to consume the independently reproduced plist-format and keyed-archive expectation repairs. The next CI run exposed a synthetic JADX cleanup race. Its original 48-test integration file passed locally, so no deterministic local reproduction of that complete failure is claimed. A separate EOF experiment confirmed that the fixture exited without its cleanup owner in `tool-error` mode; after the repair it stayed alive until explicitly stopped. All five remote test shards passed subsequently. An earlier Windows curated run exceeded a 15-second `webModuleCli` deadline despite complete JSON output. Its cause remains unestablished; the Linux test passed but does not establish Windows behavior. The latest Windows lane passed without changing that test or deadline. GitHub refused an isolated rerun because repository admin rights were required; the documentation update triggered fresh CI from the owned branch. </details> ## Compatibility, safety, and release - No breaking change, migration, package metadata change or release request. - New reset scenarios were verified in private Linux user/mount/network/PID namespaces with loopback and no default routes; they share the host kernel/filesystem. These resets were not rerun in the pinned VM. - Buffered partial responses, storing streamed bodies, other reset codes, client cancellation, real-browser HTTP/3 and QUIC v2 remain unverified. No performance claim is made. - Generated test CAs are passed explicitly. Raw captures, certificates and keys remain outside Git. ## Author readiness Human owner: @LuisTaffelli - [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 - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#6675
No description provided.