#!/usr/bin/env python3 from __future__ import annotations import importlib import sys, pathlib def ensure_unique(name: str, gen_func, n: int = 500) -> None: items = list(gen_func(n)) uniq = len(set(items)) print(f"{name}: generated={len(items)} unique={uniq}") if len(items) != n: print(f"WARN: {name} generated {len(items)} items, expected {n}", file=sys.stderr) if uniq != len(items): print(f"WARN: {name} has duplicates: unique={uniq}", file=sys.stderr) def main(): root = pathlib.Path(__file__).resolve().parents[1] sys.path.insert(0, str(root)) sys.path.insert(0, str(root / 'daemon')) sm = importlib.import_module('daemon.seed_math_models') sa = importlib.import_module('daemon.seed_agents') sl = importlib.import_module('daemon.seed_language') sp = importlib.import_module('daemon.seed_prophecy') ensure_unique('math_models', sm.gen_math_models) ensure_unique('agents', sa.gen_agents) ensure_unique('language', sl.gen_language) ensure_unique('prophecy', sp.gen_prophecy) print('OK: smoke checked 4 generator functions') if __name__ == '__main__': main()