Skip to content

Add optional variant-retrieval task compiler and evaluator example - #61

Open
kr7001 wants to merge 1 commit into
ServiceNow:mainfrom
kr7001:codex/interaction-gated-variants
Open

kr7001 wants to merge 1 commit into
ServiceNow:mainfrom
kr7001:codex/interaction-gated-variants

Conversation

@kr7001

@kr7001 kr7001 commented Oct 28, 2026 •

Copy link
Copy Markdown

Related to #60.

This draft adds a reusable evaluation-layer example for shopping questions where a requested size has its own price and stock status. A four-seller fixture distinguishes the cheapest advertised listing, a cheaper but sold-out target size, the cheapest buyable target size, and an absent size. The compiler derives three typed tasks and evaluates responses with the existing AgentResponseEvaluator.

The default dataset, evaluator implementation, shopping image and environment configuration are unchanged. This is an opt-in example under examples/evaluation/variant_tasks/, not an addition to the official benchmark.

Included:

  • Strict fixture validation, integer-cent prices, all-ties handling and explicit no-availability results.
  • Deterministic task compilation with an explicit subset and source-fixture checksum.
  • Separate agent inputs without evaluator keys.
  • An offline evaluation command and reproducible examples.
  • Regression tests that accept the correct answer and reject plausible card-price, sold-out-stock and absent-size confusions.

This PR is draft because live environment integration remains unfinished. The fixture products are not present in the standard image. Before benchmark inclusion, the next steps are to agree on extension location/task IDs, package an isolated Magento adapter with setup and teardown, pin and test a fresh image, verify every rendered variant and reset, check for target-price leakage under a declared observation model, and independently review the task wording/keys. The README specifies this integration contract. No Magento-derived template has been copied into this change.

Validation:

python -m pytest tests/examples tests/api/test_evaluation_api_retrieval_tasks.py \
  tests/types/test_eval_types.py tests/types/test_agent_response.py -q
3312 passed, 43 skipped

ruff check
ruff format --check
ty check src dev tests
# All passed; changed example scripts also checked explicitly with Ruff and ty.

All 23 new tests pass. The documented compile-and-evaluate CLI was also run successfully. These are offline evaluator checks, not browser-agent performance or live-gating validation. No paid model calls or live shopping-instance changes were made.

Prepared by Kayleen Lee Kai Rong. New code and fixture are submitted under the repository's Apache-2.0 licence.

@kr7001
kr7001 marked this pull request as ready for review October 28, 2026 13:40

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