Files
manual_slop/tests/fixtures/synthetic_src/ai_client.py
T
ed db4fb5c2ef test(audit): Phase 10 fixtures - synthetic src/ + 6 audit_inputs JSONs
synthetic_src/:
- type_aliases.py (3 TypeAliases: Metadata, FileItems, History)
- ai_client.py (producer + consumer of Metadata + History)
- aggregate.py (producer + consumer of FileItems)
- gui_2.py (hot-path consumer of FileItems)
- cleanup.py (cold-path consumer of Metadata)
- overrides.toml (frequency override for cleanup.do_nothing)

audit_inputs/ (6 JSON files):
- audit_weak_types.json (4 findings in Metadata + FileItems functions)
- audit_exception_handling.json (2 BOUNDARY_SDK findings)
- audit_optional_in_3_files.json (0 findings)
- audit_no_models_config_io.json (0 findings)
- audit_main_thread_imports.json (0 findings)
- type_registry.json (3 aggregates' field sets)
2026-06-22 02:02:21 -04:00

26 lines
640 B
Python

"""Synthetic AI client for the v2 audit integration tests."""
from __future__ import annotations
from typing import Any
Metadata = dict[str, Any]
History = list[dict[str, Any]]
def send_result() -> dict[str, Any]:
data: Metadata = {"role": "user", "content": "hello"}
return data
def append_history() -> list[dict[str, Any]]:
data: History = []
return data
def to_list(history: History) -> History:
out: History = []
for entry in history:
role = entry["role"]
content = entry["content"]
out.append({"role": role, "content": content})
return out
def process(metadata: Metadata) -> str:
role = metadata["role"]
return role