Skip to content

feat(sim): share the simulation runner with the host repos - #78

Merged
BatLeDev merged 2 commits into
mainfrom
feat-sim-shared-runner
Oct 12, 2026
Merged

BatLeDev merged 2 commits into
mainfrom
feat-sim-shared-runner

Conversation

@BatLeDev

Copy link
Copy Markdown
Member

Move into @data-fair/lib-agents-sim the simulation runner that data-fair, portals and catalogs each copied:

  • runSimulation(page, simCase, { agentsUrl, locale, setup, perceptionRoots }) runs one judged case end to end: pessimistic sidecar, wait_for_user_action hand-over, silent passes, accepted dialogs, SIM_SUB_AGENTS=0, validity guards (provider error, cold Vite dev server, empty transcript, no gateway exchange). The host keeps its cases, seeding, login and what the person sees.
  • captureGatewayErrors / errorsInSseBody / errorsInResponse, bridgeSettings / seedAgentsSettings / assertBridgeUp, passActions / withSilentPasses, CHAT_FRAME / ensureChatOpen, defineSimConfig, reportCli, simCaseNames.
  • The hosts' unit tests of these helpers move to tests/features/lib-sim/runner-helpers.unit.spec.ts; the barrel test lists the new exports.

Why: catalogs, the third consumer, copied 536 of its 556 runner lines from portals, and the copies had drifted (data-fair had no silent passes, an older drawer probe, and counted 401/403 as provider errors).

Heads-up: behaviour is portals' and catalogs' where the copies differed: 401/403 are left to the judge, every quota role is unlimited, dialogs are accepted. The agents repo's own simulations keep their loop (the chat is the page there, not a frame). Each host switches in its own PR after the 0.11.0 release.

…im config with the host repos

runSimulation runs one judged case end to end (pessimistic sidecar, wait
hand-over, silent passes, dialogs, validity guards, provider and dev server
errors). The host keeps its cases, seeding, login and what the person sees.

Also exported: captureGatewayErrors (401/403 left to the judge),
bridgeSettings/seedAgentsSettings/assertBridgeUp, passActions/withSilentPasses,
CHAT_FRAME/ensureChatOpen, defineSimConfig, reportCli and simCaseNames. The unit
tests of data-fair, portals and catalogs move here with them.
@BatLeDev
BatLeDev merged commit dcef7e4 into main Oct 12, 2026
3 checks passed
@BatLeDev
BatLeDev deleted the feat-sim-shared-runner branch October 12, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant