From d736645ed855bff93759a159279014e6e3b772ff Mon Sep 17 00:00:00 2001 From: Yev Meyer Date: Thu, 29 Oct 2026 18:05:14 -0400 Subject: [PATCH 1/3] feat(engine): declare the locale pre-flight on the probe class A probe whose banks are split by locale sets locale_bank_check on its class, and the run pre-flight loads the bank each run locale runs on, named by the bank_locale classmethod, before any model call. authoring_guide is the link a refusal gives for building a bank in another locale, and the feature-request link appears for probes that ship with User Sim. financial_services, sov_ai_facts and sov_ai_dynamic declare theirs, and the pre-flight in cli/_pipeline.py names no probe. assert_probe_conforms checks the three declarations, and the extension fixture exercises them from an installed package. Signed-off-by: Yev Meyer --- architecture/assets.md | 23 ++-- architecture/probes.md | 9 +- docs/engine/AUTHORING_A_PROBE.md | 28 +++++ docs/extensions.md | 18 ++- src/usersim/cli/_pipeline.py | 107 +++++------------- src/usersim/engine/core/probes.py | 23 +++- .../probes/financial_services/generator.py | 14 +++ .../engine/probes/sov_ai_dynamic/generator.py | 7 ++ .../engine/probes/sov_ai_facts/generator.py | 7 ++ src/usersim/testing/__init__.py | 16 +++ templates/probe/README.md | 5 +- templates/probe/generator_bank_verbatim.py | 11 ++ tests/engine/test_conformance_suite.py | 35 ++++++ .../usersim_extension_fixture/probe.py | 7 ++ .../extension_package/verify_seams.py | 22 ++++ tests/test_packaging_contract.py | 66 ++++++++++- 16 files changed, 295 insertions(+), 103 deletions(-) diff --git a/architecture/assets.md b/architecture/assets.md index 51be88d..707de13 100644 --- a/architecture/assets.md +++ b/architecture/assets.md @@ -45,17 +45,18 @@ checkout. ## Pre-flight Before any model call, a run verifies that every selected probe's assets -exist, including the locale subtree for the locale-scoped probes: -`financial_services`, `sov_ai_facts` and `sov_ai_dynamic`. A locale that runs -on another locale's bank is checked against that bank, the one the probe loads -in its place: a registered India variant with no subtree of its own runs on -`en_IN`'s. For `financial_services` a subtree counts once it has tasks, and -`hi_Deva_IN` and `hi_Latn_IN` run on `en_IN`'s until theirs does. Every -missing path is reported at once, with what to do: drop the probe or the -locale from the run, or point `--assets-dir` somewhere else. When a probe -can't run one of the run's locales, the refusal also names the locales it can -run and links the feature-request form, and for `financial_services` the guide -to authoring a bank. +exist. A probe whose banks are split by locale declares a `locale_bank_check` +on its class, and the run loads the bank each run locale runs on with it: +`financial_services`, `sov_ai_facts` and `sov_ai_dynamic` declare one. The +class's `bank_locale` names that bank, the one the probe loads in the locale's +place when it has none of its own: a registered India variant with no subtree +of its own runs on `en_IN`'s. For `financial_services` a subtree counts once it +has tasks, and `hi_Deva_IN` and `hi_Latn_IN` run on `en_IN`'s until theirs +does. Every missing path is reported at once, with what to do: drop the probe +or the locale from the run, or point `--assets-dir` somewhere else. When a +probe can't run one of the run's locales, the refusal also names the locales it +can run and the guide the class's `authoring_guide` links, if any, and for a +probe that ships with User Sim, the feature-request form. Without this, a missing bank surfaces from inside a loader partway through a run, after the other probes in the mix have already been paid for, while diff --git a/architecture/probes.md b/architecture/probes.md index 902b9e8..c9d5ec4 100644 --- a/architecture/probes.md +++ b/architecture/probes.md @@ -111,7 +111,8 @@ A probe's content lives at `engine/assets/