bigquery-probe.py
import ast,pathlib,subprocess,os
p=pathlib.Path('/tmp/mizoki-readiness-fr42/src/cells/cell02/tests/test_dlp_sdk_contract.py');t=ast.parse(p.read_text());s=next(n.value.value for n in ast.walk(t) if isinstance(n,ast.Assign) and any(isinstance(x,ast.Name) and x.id=='script' for x in n.targets))
s=s[:s.index(' config=Cell2.Cell2Config')]+''' captured=[]
with TestClient(Cell2.app) as client:
svc=Cell2.app.state.extraction_service
async def source(*args):return [{'notes':'fixture@example.invalid','customer_id':'synthetic'}]
async def store(data,*args):captured.append(data);return 'fixture.dataset.table'
with patch.object(svc.dlp_service,'dlp_client',None),patch.object(svc,'_ingest_from_gcs',new=source),patch.object(svc,'_structure_in_bigquery',new=store):
body={'bucket':'fixture','file_path':'fixture/data.json','enable_customer_journey':False}
for path,payload in [('/api/v1/ingest',body),('/tasks/send',{'message_type':'cmd.ingestion.bigquery.v1','payload':body})]:
r=client.post(path,json=payload);print(path,r.status_code,r.json().get('status'))
assert len(captured)==2 and all(x[0]['notes']=='fixture@example.invalid' for x in captured)
assert not attempts
print('two raw synthetic payloads reach substituted BQ sink with no DLP; zero external attempts')
'''
env={k:v for k,v in os.environ.items() if not k.startswith(('GOOGLE_','GCP_','GCLOUD_','FIRESTORE_','BIGQUERY_'))}
r=subprocess.run(['/tmp/mizoki-dep8h-venv/bin/python','-I','-c',s,'/tmp/mizoki-readiness-fr42'],env=env,capture_output=True,text=True);pathlib.Path('/tmp/fr40-bq-probe.log').write_text(r.stdout+r.stderr);print('exit',r.returncode);print(r.stdout)