Skip to content

Add public mock stripe runtime#20

Merged
bingran-you merged 1 commit into
mainfrom
bry/public-mock-stripe-runtime
Jul 4, 2026
Merged

Add public mock stripe runtime#20
bingran-you merged 1 commit into
mainfrom
bry/public-mock-stripe-runtime

Conversation

@bingran-you

Copy link
Copy Markdown
Contributor

Summary

  • add a public mock-stripe environment package with CLI/runtime wiring and tests
  • publish stripe-refund-correct-customer under both tasks/ and example_tasks/
  • wire Stripe into the manifest, control-plane helper, Docker base image, CI conformance matrix, and smoke tests

Validation

  • uv run --extra dev pytest tests -q in packages/environments/mock-stripe (291 passed)
  • uv run --extra dev pytest tests/test_conformance.py tests/test_auth_integration.py -q in packages/environments/mock-stripe (62 passed)
  • python3 -m unittest tests/test_env0_control.py (23 tests OK)
  • public task package structural check (all-public-task-packages-valid)
  • scripts/smoke_dev.sh
  • python3 scripts/env0_control.py seed-task stripe-refund-correct-customer mock-stripe
  • docker/build-base.sh && PULL_BASE=0 scripts/smoke_docker_examples.sh
  • BENCHFLOW_REWARD_LENIENT=1 bench eval run --tasks-dir example_tasks --include stripe-refund-correct-customer --agent oracle --sandbox docker --jobs-dir .local/bf-jobs-public-stripe-example-oracle --context-root . --concurrency 1 --build-concurrency 1 (1/1, reward 1.0)
  • BENCHFLOW_REWARD_LENIENT=1 bench eval run --tasks-dir example_tasks --agent oracle --sandbox docker --jobs-dir .local/bf-jobs-public-examples-oracle-stripe --context-root . --concurrency 1 --build-concurrency 1 (7/7, score 100.0%)
  • git diff --check

@bingran-you bingran-you merged commit 22958ac into main Jul 4, 2026
10 checks passed
@bingran-you bingran-you deleted the bry/public-mock-stripe-runtime branch July 4, 2026 20:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bfccc1326

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


ENV STRIPE_URL=http://localhost:9007

COPY tasks/stripe-refund-correct-customer/data /tasks/stripe-refund-correct-customer/data

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Hide the task seed payload from the agent

In the public task image, this COPY leaves /tasks/stripe-refund-correct-customer/data/needles.py readable by the normal agent user because Docker's default copy mode is readable and this Dockerfile never locks /tasks afterward. The base image only locks /var/lib/task and /data, and the example-task Dockerfile adds chmod -R 700 /tasks; without that here, agents can read the exact target and decoy customers from the seed payload, corrupting the benchmark result.

Useful? React with 👍 / 👎.

needles = _load_needles()

for entry in needles.ALL:
created = ANCHOR - entry["days_ago"] * _DAY

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Align seeded dates with the prompt

This computes the task charge timestamps from the fixed mock-stripe ANCHOR of 2026-05-28, so days_ago: 1 seeds the target charge on 2026-05-27 rather than the actual “yesterday” described in the prompt when the task is run later. Agents that use Stripe's created[...] filters to find yesterday's charge will miss the target; either make the seed relative to runtime or change the prompt to the absolute seeded date.

Useful? React with 👍 / 👎.

Comment on lines +106 to +108
and target_ch.get("amount_refunded", 0) == target_ch.get("amount")
and target_refunds
and all(r.get("status") == "succeeded" for r in target_refunds)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require the duplicate refund reason in scoring

When an agent refunds the correct charge without reason=duplicate, the API still creates a succeeded refund and this predicate awards full credit because it only checks the amount/status. Since the prompt explicitly says to process it as a duplicate refund, runs that omit or use a different reason currently pass; include the refund reason in the success condition.

Useful? React with 👍 / 👎.

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