refactor(v1): collapse interception to PrimeTunnel and server|elastic - #2504
Closed
hallerite wants to merge 1 commit into
Closed
refactor(v1): collapse interception to PrimeTunnel and server|elastic#2504hallerite wants to merge 1 commit into
hallerite wants to merge 1 commit into
Conversation
The tunnel layer was a discriminated union with an ABC, a generic config base, bind_host/bind_port hooks and a `custom` bring-your-own-endpoint implementation that nothing selects: no config, doc, skill, test, or downstream repo sets `interception.tunnel`, and the default elastic pool hard-pins prime anyway. StaticInterceptionPool existed for the same bring-your-own case and has no consumer either. - verifiers/v1/interception/tunnel/ package -> tunnel.py: PrimeTunnel and TUNNEL_LIMITER only; PrimeTunnelConfig, BaseTunnelConfig, Tunnel, CustomTunnel(+Config), TunnelConfig, make_tunnel are gone - InterceptionServerConfig loses its `tunnel` field; the server always binds an ephemeral loopback port and exposes it through a prime tunnel when a consumer is remote - StaticInterceptionPool(+Config) removed; InterceptionConfig is server | elastic - docstrings in interception/base.py and the runtimes updated to match Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Stacked on #2503 (which is stacked on #2496).
The interception layer carried a generic plugin system with one used implementation. The
tunnel/package was a discriminatedTunnelConfigunion, aTunnelABC generic over its config,bind_host/bind_porthooks, and acustombring-your-own-endpoint tunnel. Nothing selects it: no config, doc, skill or test in verifiers setsinterception.tunnel, prime-rl and the env repos never touch it, and the defaultElasticInterceptionPoolhard-pinsPrimeTunnelConfig()regardless.StaticInterceptionPoolexisted for the same bring-your-own case and has no consumer either.After this PR
verifiers/v1/interception/tunnel.pyis one module:PrimeTunnel(no config, no base class) andTUNNEL_LIMITER.mcp/launch.pykeeps importingPrimeTunnelfrom the same path.InterceptionServerConfighas notunnelfield. The server always binds an ephemeral loopback port; when a consumer is remote it exposes that port through a prime tunnel, exactly as the only reachable configuration did before.InterceptionConfigisserver | elastic.--interception.type staticand anyinterception.tunnel.*flag now fail validation instead of selecting dead code.Removed:
PrimeTunnelConfig,BaseTunnelConfig,Tunnel,CustomTunnel,CustomTunnelConfig,TunnelConfig,make_tunnel,StaticInterceptionPool,StaticInterceptionPoolConfig. None is exported fromverifiers.v1and none is referenced in prime-rl, prime-envs or community-environments.TunnelErroris unchanged.Checks run:
ruff check,ruff format --check,ty check verifiers,pytest tests/v1 -m "not e2e"(82 passed), plus a direct check that{"type": "server"}and{"type": "elastic"}validate,staticand atunnelfield are rejected, theEnvConfigdefault is still elastic, and a non-tunnelled server binds loopback.🤖 Generated with Claude Code
Note
Remove static interception pool and collapse tunnel to
PrimeTunnelStaticInterceptionPoolandStaticInterceptionPoolConfigfrom the interception config union, factory, and public exports; onlyserverandelastictypes remainInterceptionServerno longer carries a configurable tunnel field; it constructs aPrimeTunneldirectly whenrequires_tunnelis true, otherwise runs with no tunnelInterceptionServer.startalways binds an ephemeral port on the server host; remote exposure publishes that port throughPrimeTunnel, non-remote returns a loopback URLElasticInterceptionPool._serverno longer passes an explicit prime tunnel config to new elastic servers; they use the default server config while retaining pool-level tunnel requirement and state secretsInterceptionServerConfig.tunnelor instantiate thestaticinterception type will break; thetunnelfield andStaticInterceptionPoolConfigdiscriminator are removed from server.py and pool.pyMacroscope summarized 15302bf.