Skip to content

refactor(engine)!: keep every built-in's assets in its own folder - #130

Open
3mei wants to merge 3 commits into
yev/fix/tool-catalog-specsfrom
yev/refactor/tool-calling-own-folder
Open

3mei wants to merge 3 commits into
yev/fix/tool-catalog-specsfrom
yev/refactor/tool-calling-own-folder

Conversation

@3mei

@3mei 3mei commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Every built-in probe keeps its assets beside its code, and a probe's assets resolve from the deliberate overrides, then the root its class declares. The package ships no shared assets folder.

Builds on #129.

  • tool_calling in one folder (first commit). tool_calling keeps its probe, prompts, verifier, tool catalog and tests in its own folder, as the other built-in probes do: probe.py beside prompts.py and verifiers.py, assets/tool_calling/ with the catalog, its prompts and its README, and tests/probes/tool_calling/. The class declares that assets/ folder as its root. The sample_tools fixture is in tests/conftest.py, where the engine tests and the probe's tests both reach it.
  • No shared assets root (second commit). The asset search path holds the deliberate overrides only (the runtime root, USERSIM_ASSET_PATH and USERSIM_ASSETS_DIR), and after them each probe reads the root its class declares. --assets-dir pins every probe to the folder it names, the same for every folder. A run that pins none records no asset folder in its simulator config, its manifest and its stored rows, and simulate --inputs reads such rows from each probe's own assets. gen-assets, validate-assets and evaluate-assets default to the domain's own bank through shipped_assets_dir(). architecture/assets.md, architecture/plugins.md, architecture/probes.md and the engine docs describe the search this way, and 01_simulate.ipynb reads each probe's own assets.

Breaking change

  • The package has no usersim/engine/assets/ folder, and usersim.engine.core._assets has no packaged_assets_dir() or default_assets_dir().
  • A run without --assets-dir records assets_dir: null in its simulator config, its manifest and the rows --materialize-inputs stores.
  • Rows that an earlier release stored with --materialize-inputs name that release's usersim/engine/assets/ folder, so simulate --inputs refuses them and says so. Store them again with this release, or run them with --assets-dir naming a folder that holds a <probe>/ folder for each of their probes.

How it was verified

At each commit, on that commit's tree:

$ make check-all && make test && make smoke
All checks passed!
372 files already formatted
4676 passed in 92.46s (0:01:32)
All checks passed.

That is the first commit's tree. The second passes with 4675: it drops the tests of the shared folder and adds tests of the search path without it.

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
  • An unpinned dry run reports where its assets come from, and a run pinned to an empty folder is refused before any model call (paths shortened):

    $ usersim simulate --locale en_US --num-rows 2 --probe-mix tool_calling=0.5,sov_ai_facts=0.5 --out out --dry-run
      probe mix:     {'tool_calling': 0.5, 'sov_ai_facts': 0.5}
      asset path:    each probe's own assets
      toolset_seed_path: .../src/usersim/engine/probes/tool_calling/assets/tool_calling/toolsets_seed.parquet
    $ usersim simulate --locale en_US --num-rows 2 --probe-mix tool_calling=1 --assets-dir empty --out out --dry-run
      - tool_calling: no asset directory at .../empty/tool_calling
    
  • make health-check ran against a custom provider config for tool_calling in en_GB and for the default probe, sov_ai_dynamic in ja_JP. Both ended with ✓ simulate, eval and report all completed, and every model's requests show failed=0.

  • usersim simulate, then usersim eval --scorers auto, ran against the same config for tool_calling in en_GB, so the tool_use scorer read its judge prompt from the probe's folder in a process that does not import the probe:

    judge: scored
    language_compliance: ok (error=None)
    refusal_basics: ok (error=None)
    response_shape: ok (error=None)
    tool_use: ok (error=None)
    

3mei added 2 commits November 4, 2026 07:42
tool_calling keeps its probe, prompts, verifier, tool catalog and tests
in its own folder, as the other built-in probes do: probe.py beside
prompts.py and verifiers.py, assets/tool_calling/ with the catalog, its
prompts and its README, and tests/probes/tool_calling/. The class
declares that assets/ folder as its root. The sample_tools fixture is
in tests/conftest.py, where the engine tests and the probe's tests both
reach it. engine/assets/ holds a README saying the built-in probes keep
their banks beside their code, and the docs list tool_calling with
them.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
The asset search path holds the deliberate overrides only: the runtime
root, USERSIM_ASSET_PATH and USERSIM_ASSETS_DIR. After them each probe
reads the root its class declares, so the package ships no shared
assets folder. --assets-dir pins every probe to the folder it names,
the same for every folder. A run that pins none records no asset folder
in its config, its manifest and its stored rows, and simulate --inputs
reads such rows from each probe's own assets. gen-assets,
validate-assets and evaluate-assets default to the domain's own bank
through shipped_assets_dir.

BREAKING CHANGE: the package has no usersim/engine/assets/ folder and
no packaged_assets_dir or default_assets_dir. Rows stored by an earlier
release name that folder; store them again, or run them with
--assets-dir.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
@3mei
3mei added this pull request to stack #113 November 4, 2026 12:43
@3mei
3mei requested review from a team as code owners November 4, 2026 12:43
The engine docs list tool_calling/test_probe.py, test_verifiers.py and
test_catalog.py in the table of tests under tests/probes/, and the comment
on the jsonschema dev dependency in pyproject.toml names
tests/probes/tool_calling/test_catalog.py, where the catalog tests are.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>

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