selection-probe.py
import ast,asyncio,datetime,json,pathlib,socket,sys,typing
root=pathlib.Path(sys.argv[1]);attempts=[]
def deny(*a,**k):attempts.append('network');raise AssertionError('network denied')
socket.socket.connect=deny;socket.create_connection=deny;socket.getaddrinfo=deny
source=root/'scripts/validate-registry.py';tree=ast.parse(source.read_text());chosen=[]
for n in tree.body:
if isinstance(n,ast.Assign) and any(isinstance(t,ast.Name) and t.id in {'AGENT_REGISTRY','CRITICAL_SERVICES'} for t in n.targets):chosen.append(n)
if isinstance(n,ast.AsyncFunctionDef) and n.name=='validate_registry':chosen.append(n)
seen=[]
async def health(aid,info,timeout):seen.append(aid);return {'id':aid,'status':'healthy','latency_ms':0}
ns={'asyncio':asyncio,'datetime':datetime.datetime,'Tuple':typing.Tuple,'List':typing.List,'Dict':typing.Dict,'check_service_health':health}
exec(compile(ast.Module(body=chosen,type_ignores=[]),str(source),'exec'),ns)
result,stats=asyncio.run(ns['validate_registry'](json_output=True))
print(json.dumps({'scope':'actual validator function/constant AST with fixture health collaborator; no cloud or provider','checked':seen,'count':stats['total_checked'],'available_legacy_registry_count':len(ns['AGENT_REGISTRY']),'network_attempts':attempts},indent=2))