Skip to content

refactor(engine): keep the health probes in one folder - #126

Open
3mei wants to merge 2 commits into
yev/refactor/financial-services-own-folderfrom
yev/refactor/health-probes-own-folder
Open

3mei wants to merge 2 commits into
yev/refactor/financial-services-own-folderfrom
yev/refactor/health-probes-own-folder

Conversation

@3mei

@3mei 3mei commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

What changed and why

The four health probes, health_triage_disclosure, health_therapy_disclosure, health_decision_support_disclosure and health_general_disclosure, keep everything in the folder they share, probes/health_disclosure/: their bank loader bank.py, realized_audit.py, the concealment scorer scorer.py and their banks in assets/<label>/, the folder their base class names as its assets_root. Their tests are in tests/probes/health_disclosure/. The labels, the scorer name, the banks, the stored columns and the caches are unchanged.

Builds on #125.

  • Banks in a folder several probes share (first commit). Until a built-in's class registers, the asset lookup finds its banks in the assets/ folder of its package under usersim/engine/probes/. It takes the package named after the probe, or else the package whose assets/ holds the probe's folder, so a scorer, or a prompt read while a module loads, reaches the banks of a probe that shares its folder.
  • The health probes in one folder (second commit). core/clinical_profile_bank.py becomes bank.py, core/realized_audit.py keeps its name, and the scorer becomes scorer.py. The four banks move into assets/, and the tests become test_probe.py, test_scorer.py, test_bank.py, test_realized_audit.py and test_e2e.py.
    • DEFAULT_SCORER_MODULES and the docs name the new modules, and the authoring guide and architecture/probes.md describe a folder several probes share.
    • The layout test accepts a folder several probes share, and the shared-code label allowances drop the bank loader.
    • The asset-discovery test of a built-in's packaged folder uses tool_calling.

How it was verified

At each commit, on that commit's tree:

$ make check-all && make test && make smoke
All checks passed!
365 files already formatted
4657 passed in 95.60s (0:01:35)
All checks passed.

That is the first commit's tree; the second passes with 4657 tests as well.

At the head:

$ make check-license-headers
🎉 All files have correct license headers!
$ make check-doc-links
✓ every relative link, and every link into this repository's main branch, resolves
$ make check-notebooks-clean
OK 4 notebook(s) carry no outputs
$ make check-dist
✓ installed package runs from a clean environment
$ make check-extensions
all extension seams work against an installed distribution
  • The first commit's test fails without its lookup change:

    E       AssertionError: assert PosixPath('.../src/usersim/engine/assets/multi_a') == (((PosixPath('.../test_a_package_holding_several0') / 'multi') / 'assets') / 'multi_a')
    
  • make health-check ran against a custom provider config for health_triage_disclosure in en_IN and health_therapy_disclosure in fr_FR. Each ended with ✓ simulate, eval and report all completed, and every model's requests show failed=0.

  • usersim simulate, eight turns of health_triage_disclosure in en_US with USERSIM_DISCLOSURE_MOVES=1, then usersim eval naming the concealment scorer, ran against the same config:

    judge: scored
    concealment: ok (moves_enabled=True, preview_only=True, scores=['concealment.disclosure_coverage', 'concealment.risk_surfaced'], error=None)
    

Results impact

Conversations, prompts and scores are unchanged. The setup fingerprint of a simulate --inputs run hashes the contents of every asset root, so it changes, as after any bank edit, and such a run gives its rows new trajectory ids rather than skipping rows it wrote before this change.

3mei added 2 commits November 3, 2026 15:06
Until a built-in's class registers, the asset lookup takes the assets/ folder of the built-in package under usersim/engine/probes/ that holds the probe's <label>/ folder: the package named after the probe, or else a package holding several probes. A test builds a package holding two probes and resolves each by its label.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
The four health probes keep their banks in probes/health_disclosure/assets/<label>/, the folder their base class names as its assets_root, beside the bank loader bank.py, realized_audit.py and the concealment scorer scorer.py. Their tests are in tests/probes/health_disclosure/. The labels, the scorer name, the banks, the stored columns and the caches are unchanged.

DEFAULT_SCORER_MODULES and the docs name the new modules, the authoring guide and architecture/probes.md describe a folder several probes share, and the layout test accepts one. The shared-code label allowances do not list the bank loader, which sits under engine/probes/. A test reads a health probe's asset folder in a fresh process with no probe registered.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
@3mei
3mei added this pull request to stack #113 November 3, 2026 20:07
@3mei
3mei requested a review from a team as a code owner November 3, 2026 20:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant