| """Offline self-check — no API call. Run: python test_fr_start.py""" |
| from pathlib import Path |
|
|
| import fr_start |
|
|
| ROOT = Path(__file__).parent |
| REGIONS = ["us", "india", "uae", "singapore", "uk"] |
| EXTRAS = ["cross-border", "entity-types", "industries-grants", "playbooks"] |
|
|
|
|
| def main() -> None: |
| for name in REGIONS + EXTRAS: |
| f = ROOT / "corpus" / f"{name}.md" |
| assert f.exists(), f"missing corpus file: {f.name}" |
| assert "as_of" in f.read_text(), f"{f.name} missing as_of date" |
|
|
| text = fr_start.build_system() |
| assert "Reference corpus" in text |
| for name in ["Singapore", "SEIS", "FEMA", "free zone", "Delaware"]: |
| assert name in text, f"corpus content missing: {name}" |
| assert "not a lawyer" in text, "disclaimer missing from system prompt" |
| assert len(text) < 200_000, "corpus outgrew in-context serving — add retrieval" |
| print(f"OK — {len(REGIONS + EXTRAS)} corpus files, system prompt {len(text):,} chars") |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|