fr35-boss-probe.py
import ast,asyncio,json
from pathlib import Path
from types import SimpleNamespace
from typing import Dict,Optional
from fastapi import FastAPI,HTTPException
from pydantic import BaseModel
s=ast.parse(Path('miz-oki-adk-agents/boss/boss_agent_core.py').read_text())
model=next(n for n in s.body if isinstance(n,ast.ClassDef) and n.name=='CellInvokeRequest')
route=next(n for n in s.body if isinstance(n,ast.AsyncFunctionDef) and any(isinstance(d,ast.Call) and d.args and isinstance(d.args[0],ast.Constant) and d.args[0].value=='/api/v1/cells/invoke' for d in n.decorator_list))
calls=[];auth=[]
class Client:
def __init__(self,**kw):pass
async def __aenter__(self):return self
async def __aexit__(self,*a):pass
async def get(self,url,**kw):calls.append({'method':'GET','url':url,'kwargs':kw});return SimpleNamespace(status_code=200,headers={'content-type':'application/json'},json=lambda:{'actual_value':7})
async def request(self,method,url,**kw):calls.append({'method':method,'url':url,'kwargs':kw});return SimpleNamespace(status_code=200,headers={'content-type':'application/json'},json=lambda:{'actual_value':7})
ns={'BaseModel':BaseModel,'Dict':Dict,'Optional':Optional,'app':FastAPI(),'HTTPException':HTTPException,'httpx':SimpleNamespace(AsyncClient=Client),'AGENT_REGISTRY':{'cell_16':{'url':'https://fixture-cell.run.app'}},'service_authenticator':SimpleNamespace(get_auth_headers=lambda url:auth.append(url) or {'Authorization':'Bearer fixture'})}
exec(compile(ast.Module(body=[model,route],type_ignores=[]),'boss:exact-selected-route','exec'),ns)
async def run():
results=[]
for method in ['GET','POST']:
result=await ns['invoke_cell'](ns['CellInvokeRequest'](cellId='cell_16',endpoint='/fixture',method=method,body={'fixture':True}))
results.append(result)
print(json.dumps({'scope':'exact current route/model AST; all HTTP replaced offline','source_sha':'4c218e4fc','results':results,'outbound_calls':calls,'auth_helper_calls':auth},indent=2))
asyncio.run(run())