Skip to content

feat(environments): add ab_synth, AutomationBench app simulator with user and time sim - #5532

Merged
yfw merged 26 commits into
mainfrom
cmunley1/ab-time-simulation
Dec 2, 2026
Merged

yfw merged 26 commits into
mainfrom
cmunley1/ab-time-simulation

Conversation

@cmunley1

@cmunley1 cmunley1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds environments/ab_synth, a training environment for synthetic SaaS workflow tasks on the AutomationBench app simulator (world state, API routes and assertion checks from benchmarks/automationbench). Tasks come from the user's own dataset; no benchmark tasks are shipped or used. One environment serves three kinds of rows, chosen by keys in each row's info:

  • Single-day (initial_state, assertions): one session, scored on the final world.
  • Multi-day (period_end, events, wait_tool_description, wait_until_description): a wait tool moves a per-rollout clock and applies dated events. Writes are logged with simulated time, and acted_on_day / not_acted assertions grade when the agent acted.
  • Multi-turn (user_card, requester_services): when the agent ends a turn, a simulated requester answers from its private notes. For apps listed in requester_services, the requester operates them itself (api_search, api_fetch) when asked, so the agent has to hand those steps over.

The requester is any OpenAI-compatible chat endpoint (requester_base_url, requester_model, requester_body), called through Gym's HTTP client. It sees only the visible conversation. With unavailable_call_break, a call to a tool the agent was not given, or to a service not connected for it, breaks a guardrail. A requester that stays down ends the episode with requester_failed set, so training can mask the rollout instead of learning from it.

The reward is the guardrail-gated share of objectives (the AutomationBench headline split) over world and day assertions. The dataset owns all text the policy reads. Runs through the existing verifiers_agent, which gains one editable install like benchmarks/automationbench.

Why

Single-session tasks cannot teach multi-day workflows (wait for an approval, act on the due date) or asking and handing back steps that only the requester can do. That needs simulated time and a requester in the loop.

No issue: this is a new opt-in environment.

Validation

  • pytest in responses_api_agents/verifiers_agent (the gym env test +entrypoint=responses_api_agents/verifiers_agent suite, which now holds tests/test_ab_synth_env.py): 98 passed, 28 of them ab_synth (Python 3.14, uv 0.13.4 sync --locked, automation-bench 4a8e106). Covers the clock and events, day and guardrail scoring (including scored / excluded), the wait tool, single-day stop, the unavailable-call guardrail, the requester reply / DONE / unavailable paths, a requester acting in its own app, and the load-time refusal of assertions on date or time fields (created records carry the wall clock, see the README's Limitations).

  • pre-commit run --files on the changed files: passed.

  • Smoke rollouts: 8 synthetic rows (2 per kind) through gym env start + gym eval run --no-serve with the upstream verifiers_agent. A self-hosted DeepSeek V4.1 Flash served as both the policy and the requester. All 8 completed with no errors and no requester failures.

    Kind Rows Rewards Notes
    single-day 2 1.0, 1.0
    multi-day 2 0.37, 0.0 the first used wait; the second ended on a reasoning-only turn
    requester with notes 2 0.67, 0.83 the agent never asked, so the requester stayed silent
    requester-owned apps 2 0.0, 0.0 the agent called the requester's app itself, and the unavailable-call guardrail fired. On one row the requester made 9 tool calls in its own app and reported back.

Compatibility

New environment only. No data is shipped: rows follow the schema in the README.

…ment

A wait tool moves a per-rollout clock and applies each task's dated events.
Successful writes are logged with simulated time, so tasks can grade the day
an action happened (acted_on_day, not_acted) next to the world assertions,
under the guardrail-gated AutomationBench headline.

Signed-off-by: Christian Munley <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Signed-off-by: Christian Munley <[email protected]>
@cmunley1 cmunley1 changed the title feat(automationbench): add a simulated business days training environment feat(environments): add ab_synth, synthetic multi-day workflows with simulated time Nov 3, 2026
…urn rows

Rows pick their features through info keys: period_end for simulated days,
user_card for a simulated requester, requester_services for apps only the
requester runs. The requester is any OpenAI-compatible endpoint called through
Gym's HTTP client. unavailable_call_break turns calls to missing tools or
unconnected services into a broken guardrail. A requester that stays down
ends the episode with requester_failed set, so training can mask it.

Signed-off-by: Christian Munley <[email protected]>
@cmunley1 cmunley1 changed the title feat(environments): add ab_synth, synthetic multi-day workflows with simulated time feat(environments): add ab_synth, synthetic workflow tasks on the AutomationBench app simulator Nov 3, 2026
@cmunley1 cmunley1 changed the title feat(environments): add ab_synth, synthetic workflow tasks on the AutomationBench app simulator feat(environments): add ab_synth, AutomationBench app simulator with user and time sim Nov 3, 2026
@cmunley1
cmunley1 marked this pull request as ready for review November 3, 2026 22:44
@cmunley1
cmunley1 requested a review from a team as a code owner November 3, 2026 22:44
@cmunley1

cmunley1 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test b69dbb0

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD

I found one BLOCKER, four RISKs, and one NOTE. The requester HTTP path can hang indefinitely; the other findings cover event insertion, requester limits and visibility, failure masking, and runnable documentation.

I inspected all eight changed files and their affected adapter, HTTP, scoring, and masking paths. I rechecked the clock/event/reward topic directly because its child report wasn't available. The external AutomationBench and verifiers implementations aren't mounted, so I haven't asserted their unseen dispatch behavior. I couldn't execute tests. The PR's supplied smoke-rollout evidence satisfies the representative-rollout requirement.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread environments/ab_synth/README.md Resolved
Comment thread environments/ab_synth/README.md Resolved
…dded records

- Requester calls: each try (request and body read) ends after requester_timeout_s (default 300, must be finite), and
  _chat owns the retries, so a refused or stalled requester ends the episode instead of hanging the rollout. The client
  is imported from nemo_gym.client, the public API.
- verifiers_agent: mask_sample_metrics lists rubric metrics that flag an environment failure; a rollout with any of them
  above 0 returns mask_sample=true and failure_kind verifiers_agent:<metric>. ab_synth's config masks requester_failed.
- A record added by an event takes the type the collection declares, so a later event can update it even when the
  collection started empty.
- The requester's tool budget counts calls, not responses.
- Unclosed reasoning blocks are dropped from the requester's view.
- README: a complete single-day row and the gym eval run command.

Signed-off-by: Christian Munley <[email protected]>
@cmunley1

cmunley1 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ee34328

@cmunley1

cmunley1 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP

The five prior runtime findings are addressed in the inspected source: typed event additions, requester deadlines, per-call tool budgets, unfinished reasoning removal, and top-level requester-failure masking. The remaining NOTE concerns the missing discoverable Fern guide; the README now includes a dataset row and collection command.

I compared this head with the previous reviewed head and checked the relevant regression tests and affected HTTP, state-mutation, adapter, relay, and aggregation paths. I found no eligible introduced regression within this follow-up scope.

I couldn't execute tests. The external AutomationBench schema and verifiers implementation aren't mounted, so these conclusions rely on the supplied source and test assertions, not observed runtime results.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

Comment thread environments/ab_synth/README.md Resolved
Main replaced component requirements.txt files with locked pyprojects.
The ab_synth environment moves from requirements.txt into
verifiers_agent's pyproject.toml as a path source and uv.lock is
regenerated. In verifiers_agent run, mask_sample_metrics now applies
after main's reward function failure check, inside the observed verifier.

Signed-off-by: Christian Munley <[email protected]>
@cmunley1

cmunley1 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3b502a5

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD

I found one newly introduced BLOCKER: a partially resolved sheet range can let a forbidden write earn full reward. Its demonstrated impact is high because it silently corrupts training rewards for affected multi-day rows.

I compared this head with the reachable prior review at 70e990766f1a15cd704743adfa0f2ea6214fc2d5, verified the previous fixes, and collected three delegated reviews covering scoring, clock/row validation, and requester/integration behavior. The prior documentation suggestion was checked but is not reissued here.

Validation: On this head, CI run 45521253509 succeeded, including all four core shards, all eight server shards, sandbox tests, coverage, Unit tests / Test, Unit tests / Server suite, and Nemo_CICD_Test. Lint and component-lock checks also succeeded. Changed-server tests and session-routing end-to-end tests were skipped, not passed.

I ran CPU probes in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:a00ea65cdbc590f4c7801070fec581b618ae5d3a, the default-branch CI image because this head has no built image. Differential scoring probes reproduced the finding below. Clock, row-refusal, masking, requester replay, and local HTTP probes passed their controls. The external AutomationBench and verifiers packages were unavailable, so those boundaries were faked; full simulator dispatch and model rollouts were not executed locally. I relied on CI for repository suites rather than rerunning them.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

- Clock no longer tracks which records ever existed. Load and setup run every
  dated event on the seed (resolve_records), so an event that cannot find its
  record mid-rollout always means the rollout deleted it: the event is skipped.
  This drops _known and a full world dump after every applied event.
- Shorter docstrings and comments: the module docstring points to the README
  instead of repeating it, and comments keep only the why.
- README: the multi-day section no longer restates the implementation, and the
  refusal and masking rules are in one section.
- Tests: drop two duplicates (a never-existing event target, a row refused at
  load and masked at setup), fold the one-bad-row load test into its
  parametrized twin, and assert the actual outcome where a test accepted either
  of two. Comments describe the behavior instead of review finding numbers.

Rewards, masks and refusals are identical before and after on 551 recorded
rollouts of single-day, multi-day and multi-turn rows and on 1,918 generated
training rows (1,158 multi-day, 760 mixed), with no calls and with a
wait to the end of the period.

Signed-off-by: Christian Munley <[email protected]>

@yfw yfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD: multi-day rows are graded when the agent stops (__init__.py:595). So an agent that never calls wait can score the same as an agent that does the task. The other risks are in grading, in the load checks that refuse bad rows, and in eval recovery after you merge main.

Thank you for this environment. The design is careful. Each rollout gets its own world and clock. The core above load_environment calls no verifiers code. Load and every rollout share the same row checks. A row that fails the checks is masked instead of scored. The smoke rollouts cover all three row kinds. Thanks also to Yu Yao and Daniele Molinari for their earlier reviews. Yu Yao's nine threads and Daniele Molinari's two are fixed at the latest commit (the key commits are 2d1753e, e136987, e2cb28e and 706b95d).

DCO passes. CI is green on the latest commit, and the Server suite runs all 89 ab_synth tests (shard 4: 163 passed, 0 skipped). The PR's base is from 2026-11-11, and main moved after that. The comment on app.py:991-997 depends on main.

The review bot's new comment on A1 range resolution (__init__.py:321) is real at the latest commit. The reply on that thread has a one-line fix.

Rollout evidence: the PR description was last edited on 2026-11-11. Eleven commits on 2026-11-23 and 2026-11-24 (c6e3f71 to 706b95d) reworked day-assertion grading, masking and the load checks. The test counts in the description are also out of date (98 passed and 28 for ab_synth, against 159 and 89 now). Please rerun the 8-row smoke after the grading fixes land. For the multi-day rows, please include the targets of each logged write and the reward of each row.

Generated by Claude Code

…quester

- A multi-day row is graded at period_end: the clock runs to it before
  grading, so an event the agent did not wait for still applies. Waiting
  can no longer only lower the reward.
- Load refuses a row whose dated events alone change a world assertion,
  unless the assertion sets excluded (true to skip it, false to make it an
  objective that must hold at period_end).
- An A1 day-assertion record resolves against the world after the row's
  events, so a range covers sheet rows an event adds.
- Requester tool calls go through the clock, so its writes reach the write
  log that acted_on_day and not_acted grade.
- Load refuses rows whose events can never fire: events without a
  period_end, a multi-day row without the seed's meta.current_time, a
  period_end not after it, or an event after period_end.
- A naive time the agent waits until is read in the seed's zone.
- A not_acted with excluded: false scores as an objective, as the world
  assertions already did.
- Each policy message the requester sees is cut to REQUESTER_RESULT_CHARS.
- verifiers_agent warns when a mask_sample_metrics name is not among the
  rollout's metrics.
- Tests: one regression per fix, the requester DONE test now asks the
  requester a second time, and the delete-then-event test deletes through a
  route that exists.

Replayed against the previous head, graded at period_end: 551 recorded
rollouts and 1,918 generated rows (no calls, and a wait to the end) keep
their rewards. The changes are in which rows load: 17 rows whose events
alone flip a world assertion are refused, and 8 rows with A1 records on
event-added sheet rows now load.

Signed-off-by: Christian Munley <[email protected]>
A row's info may set max_turns and unavailable_call_break, which override the
environment's values for that row, so single-day, multi-day and multi-turn
rows with different limits can share one agent. A value of the wrong type
refuses the row. Two tests cover the override and the refused values.

Signed-off-by: Christian Munley <[email protected]>
@yfw

yfw commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

copyright-check fails on environments/ab_synth/__init__.py: the empty file has no license header. Please add the same two SPDX lines as the other new files.

A masked metric's kind is declared for the outcome policy, and a kind the
policy names saves its outcome decision. ab_synth retries
verifiers_agent:requester_failed, so rollout recovery reruns a requester
outage, and an invalid row stays masked. Adds the missing copyright header
to environments/ab_synth/__init__.py.

Signed-off-by: Christian Munley <[email protected]>
@cmunley1

cmunley1 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/review 510c6e6

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP

The prior sheet-range finding is resolved. I verified review 6050141772 and comment 4688927684 against the reachable baseline 706b95d0160d4fda906772d2f8647baf8007abbf. The differential probe reproduces reward 1.0 on that baseline and 0.0 on this head for the forbidden write to an event-added row. The resolver includes the added row, and the regression tests cover the guardrail and correct-day objective.

I collected three delegated reviews covering sheet scoring, clock and row contracts, and requester integration. No new finding qualifies under this follow-up’s strictly-above-high impact filter. This verdict applies to that limited scope.

Validation

  • In CI run 46764314476, all four core shards, all eight server shards, sandbox tests, coverage, Unit tests / Test, Unit tests / Server suite, and Nemo_CICD_Test succeeded. Lint and component-lock checks also succeeded. The workflow reports failure because the explicitly non-blocking compliance checks are red for the agent’s run()/session API shape. Container build, changed-server tests, and session-routing end-to-end tests were skipped, not passed.
  • CPU probes exercised sheet-range scoring, event ordering, period-end grading, row limits, requester writes, HTTP failure and timeout handling, and masking/recovery. The prior-finding probe passed 26 controls. The requester configuration emits masked retry/evaluation/agent fields, and the admitted recovery code selects that failure for another attempt while leaving invalid rows masked.

The probes ran in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:a00ea65cdbc590f4c7801070fec581b618ae5d3a, a verified default-branch CI image because this head has no built image. Probe scripts and logs are under /workspace/review-probes/. AutomationBench and verifiers boundaries were faked where their packages were unavailable; HTTP probes used a local aiohttp service and a request shim. Full simulator dispatch, verifiers stop-hook integration, and model rollouts were not executed locally. I relied on CI for repository suites.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

@yfw
yfw added this pull request to the merge queue Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/46811199896

Merged via the queue into main with commit bd90a1b Dec 2, 2026
70 of 72 checks passed
@yfw
yfw deleted the cmunley1/ab-time-simulation branch December 2, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants