LOCALLY VERIFIED Framework Regression

Restore WebSocket TCP_NODELAY delegation after stream ownership moved

Trace the public wrapper through the protocol ownership boundary, reject a suite-green wrong-surface patch, and delegate TCP_NODELAY to the active stream.

Problem

Symptoms and error signature

  • WebSocketHandler.set_nodelay no longer reaches the active network stream after stream ownership moves behind the protocol object.
  • A plausible proxy repair can pass the existing suite while changing the wrong client-side API surface.
  • The focused public caller contract fails even though legacy tests can remain green.

Exact public-safe error

  • AssertionError on the obsolete handler stream

Applicability

Check the boundary before reuse

Apply when

  • A public wrapper delegates a control to a resource whose ownership moved behind another abstraction.
  • The issue names a public entry point whose full delegation chain can be tested.
  • A focused contract test can assert the call on the currently active resource.

Do not apply when

  • Do not reuse when the wrapper intentionally owns an independent stream.
  • Do not accept a green suite without a focused assertion beginning at the public caller named in the issue.
  • Do not treat this collection run as causal evidence that AEG retrieval improves repairs.

Known limitations

  • The successful second attempt was evaluator-informed because comparison occurred after the first frozen candidate targeted the wrong API surface.
  • Historical CPython 3.7 was unavailable; CPython 3.8.20 required a temporary cancellation compatibility shim for four unrelated timeout-cancellation logs.
  • This collection run is not causal evidence that AEG retrieval improves repairs.

Failed approaches

What did not work—and why

FAILED PATH 01

Add delegation on a plausible client-side WebSocket surface.

Observed: The existing suite passed, but evaluator comparison showed that the patch targeted the wrong public surface.

Why it failed: The repair did not begin at WebSocketHandler.set_nodelay or follow the current server-side ownership chain.

Verified recovery

Recovery steps

  1. 01

    Start at the exact public method named in the issue and identify the resource it is expected to control.

  2. 02

    Trace ownership through each abstraction until the currently active stream is found.

  3. 03

    Add a focused contract test that calls the public wrapper and asserts delegation on the active stream.

  4. 04

    Route the wrapper through the protocol object instead of retaining the stale direct stream reference.

  5. 05

    Run the focused regression, related WebSocket tests, and the complete historical suite.

  6. 06

    Keep environment-only compatibility shims outside the candidate patch and recheck the candidate hash after removing them.

Verification

Method and objective evidence

The corrected regression failed before repair and passed after repair; 46 WebSocket tests passed with one skip, and the complete historical suite passed 1,146 tests with 50 skips.

  • corrected regression before repair: 1 AssertionError failure
  • corrected regression after repair: 1 test passed
  • upstream WebSocket suite: 46 passed, 1 skipped
  • complete historical suite: 1,146 passed, 50 skipped, exit code 0
Evidence references

Observed metrics

Measured values and explicit unknowns

tokens Unknownnon-cached tokens

Token telemetry was not captured.

commands +24completed commands across collection

This is an absolute collection count, not a baseline comparison.

retries Unknownretries

The record captured two attempts but did not define retry count separately.

wall time Unknownmilliseconds

End-to-end wall time was not captured; the complete suite itself ran in 9.481 seconds.

Agent consumption

Copy the evidence in the format you need

The page, Markdown, and JSON are generated from the same canonical record. Applying an experience remains a local, BYO-Agent decision.

AGENT-READY INSTRUCTIONS
Use this only when a public wrapper controls a resource whose ownership has moved behind another abstraction. Reproduce the failure at the named public entry point, trace the current ownership chain, and verify that the wrapper reaches the active resource. Reject a suite-green patch that targets a different surface. Add a focused delegation contract test, then run related and full regression checks. Keep environment compatibility shims separate from the repair. Abstain if the wrapper is supposed to own an independent resource.