next-path-fr19-probe.py
import ast,asyncio,json,logging,socket,types
from pathlib import Path
from datetime import datetime,timezone
from fastapi import FastAPI,Depends
from fastapi.responses import StreamingResponse
from pydantic import BaseModel
import httpx
attempts=[]
def deny(*a,**k):
attempts.append('network');raise AssertionError('network forbidden')
socket.socket.connect=deny;socket.getaddrinfo=deny
async def skip_delay(*a):pass
async def fixture_identity():return {'sub':'fixture-subject','email':'fixture@example.invalid','role':'authenticated'}
source=Path('/tmp/next-path-cell1.py'); names={'ReasonInput','reason_endpoint','trace_endpoint','user_metrics_endpoint'}
nodes=[n for n in ast.parse(source.read_text()).body if isinstance(n,(ast.ClassDef,ast.AsyncFunctionDef)) and n.name in names];assert len(nodes)==4
app=FastAPI();scope=dict(app=app,Depends=Depends,BaseModel=BaseModel,get_current_user=fixture_identity,asyncio=types.SimpleNamespace(sleep=skip_delay),datetime=datetime,json=json,StreamingResponse=StreamingResponse,logger=logging.getLogger('fixture'))
exec(compile(ast.Module(body=nodes,type_ignores=[]),str(source),'exec'),scope)
async def run():
async with httpx.AsyncClient(transport=httpx.ASGITransport(app=app),base_url='http://fixture.invalid') as c:
out=[]
for method,path,kwargs in [('POST','/v1/reason',{'json':{'prompt':'offline fixture'}}),('GET','/v1/trace',{}),('GET','/v1/cell01/me',{})]:
r=await c.request(method,path,**kwargs);out.append({'path':path,'status':r.status_code,'body':r.text})
return out
out={'observed_at':datetime.now(timezone.utc).isoformat(),'source_sha':'2094fed183f04670a178adf88dc94b8c899083cf','scope':'Exact four AST nodes realASGI; fixture identity and skipped simulated delay; no authentication/startup/live proof','results':asyncio.run(run()),'network_attempts':attempts}
Path('/tmp/next-path-fr19-probe.json').write_text(json.dumps(out,indent=2));print(json.dumps(out,indent=2))