Subchapter 7.10
references/patterns.mdMarkdown37 KBView on GitHub
Use these patterns as evidence-backed starting points. Read the relevant domain section before designing a Task. Open the cited benchmark when its design can answer a concrete question about Task shape, Environment state, tool surfaces, simulation, or verification. Adapt the method to the current project. Do not copy a benchmark’s private data, hidden answer, exact scenario, or limitations without review.
Use this table to decide which external design to inspect in more detail.
| Benchmark | Domain | Design worth studying |
|---|---|---|
| AutomationBench (opens in a new tab) | Business automation | Trigger data, pre-populated SaaS state, realistic tool surfaces, assertion-level scoring, and a separate strict completion result |
| AppWorld (opens in a new tab) | Cross-application APIs | Stateful simulated applications, database-backed truth, cross-app workflows, and final-state verification |
| ToolSandbox (opens in a new tab) | Stateful tool use | Controlled hidden state, milestones, tool-call consequences, and reproducible interaction state |
| TheAgentCompany (opens in a new tab) | Workplace agents | Longer work across applications, documents, messages, and durable artifacts |
| WebArena (opens in a new tab) | Browser agents | Reproducible websites, browser interaction, seeded application state, and state-based evaluation |
| WorkArena (opens in a new tab) | Enterprise browser work | Role-aware enterprise tasks, realistic web workflows, and application state |
| WorkArena++ (opens in a new tab) | Multi-application enterprise work | Longer workflows across enterprise applications and role-sensitive state |
| OSWorld (opens in a new tab) | Desktop agents | OS and application snapshots, computer input, cross-application work, and state restoration |
| SWE-bench (opens in a new tab) | Coding agents | Real issues, pinned repository revisions, behavior tests, and patch verification |
| SWE-smith (opens in a new tab) | Scalable coding Tasks | Reproducible mutation and execution pipelines; mutations still need usefulness review |
| CRMArena-Pro (opens in a new tab) | CRM agents | CRM roles, linked business records, permissions, and realistic sales workflows |
| tau-bench (opens in a new tab) | Policy and tool use | User simulation, policy-guided decisions, tool use, and database final state |
| tau-squared Bench (opens in a new tab) | Longer multi-turn work | Both sides of a tool-mediated dialogue, longer interactions, and final-state checks |
| Terminal-Bench (opens in a new tab) | Terminal agents | Isolated command-line Environments, natural instructions, tests, and reference solutions |
A benchmark citation is not an authority claim. Check its current repository, paper, release, license, and task format before copying an implementation pattern. Record which design choice was adapted and why it fits this project.
Use for scheduled jobs, event handlers, background agents, retries, alerts, integrations, and work where time or repeated delivery changes correctness.
Store current state and append-only events separately. Include:
Use a fixed clock and deterministic event queue. Use an explicit state machine, which lists allowed states and changes. Store enough history to prove retry, deduplication, and recovery behavior.
For each case, define trigger data, pre-populated starting state, the allowed tool surface, and final-state assertions. This is the useful AutomationBench case shape. The trigger starts the workflow; it does not replace the World or the Task success contract.
Simulate mutable queues, schedulers, webhooks, email, and third-party writes unless an approved sandbox is safe and resettable. Preserve payload schema, delivery order, duplicate delivery, error classes, retry limits, and side-effect IDs.
Catalog scheduler, queue, service, cloud, and model credentials by name and scope. Keep the fixed clock and hidden future events unavailable to the agent.
Test reset after partial effects and timeouts.
Instruction:
Process the pending notification. The first delivery attempt has a transient error. Complete the delivery without creating a duplicate message.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| final_state | Workflow is complete | Final workflow row | Compare state with completed | Exact match |
| retry | One allowed retry occurred | Attempt and error rows | Match one transient failure then one success | Exact sequence |
| one_effect | One message exists | External-effect ledger | Count unique message IDs for the source event | One |
| repeat_safety | Both attempts share one repeat-protection key | Attempt records | Compare keys and source event ID | All equal |
| scope | Other work stays fixed | Before and after snapshots | Compare unrelated workflows and schedules | Equal |
Known-good: one transient failure is followed by one successful attempt with the same repeat-protection key and one message. Wrong results: abandon, create two messages, change the key, exceed the retry limit, or change another action.
Instruction:
Process the two visible trigger deliveries for the same source event. Apply the business change once and retain audit evidence for both deliveries.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| one_change | Business state changes once | State history | Count changes for the source event | One |
| delivery_log | Both deliveries are retained | Delivery records | Compare delivery ID set | Exact two IDs |
| one_effect | Both deliveries resolve to one effect | Delivery and effect records | Join by source event and effect ID | One shared effect |
| no_loss | Other visible triggers remain | Queue before and after | Compare unrelated trigger IDs and states | Equal |
Known-good: both deliveries are logged and one business effect is committed. Wrong results: apply twice, drop the second delivery record, create two effect IDs, or consume an unrelated trigger.
Use a fixed clock. Run one delivery, duplicate delivery, transient retry, permanent failure, reordered events, partial effect, and timeout. Reset queue, attempt, repeat-protection, and effect state each time. Inspect the full event order and final state. Treat worker startup or clock-control failure as infrastructure.
Report assertion-level partial credit when useful for diagnosis or training. Keep a separate strict completion result that passes only when every required assertion passes.
Change one condition: longer delay, retryable then permanent error, concurrent worker, stale read, reordered event, or partial side effect. Use controlled time and known event order so failures remain reproducible.
Use when the agent operates websites, browsers, desktop applications, files, and visual interfaces.
Pin:
Use local sites or snapshots when live content changes results. Preserve realistic DOM, visual, pagination, latency, validation, and permission behavior. Use accessibility state only when the real Harness can use it.
Choose live services only when accounts, data, reset, cost, and side effects are controlled. Prefer a local clone, frozen site, or sandbox for mutable workflows.
Match the real Harness input and observation surface:
Catalog model, website, SSO, OAuth, VPN, application, and cloud credentials by name, role, scope, provider, and network need. Never save cookies or secret values in specs or committed artifacts.
Do not rely on clicking back or reversing UI actions as reset.
Instruction:
Update the selected employee’s department and phone number. Keep their role, group membership, and account status unchanged.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| identity | Correct employee was edited | Final application row | Match stable employee ID | Exact ID |
| fields | Department and phone match | Final application row | Compare normalized requested values | Both equal |
| access | Role, groups, and status stay fixed | Before and after access rows | Exact comparison | Equal |
| persistence | Saved values survive a new session | Reloaded row from clean session | Read again after restart | Both equal |
| scope | Other state stays fixed | Application state difference | Compare non-allowlisted rows and fields | No difference |
Known-good: only the stable employee ID and requested fields change and remain after a new session. Wrong results: update a similar name, change access, leave an unsaved form, or edit another record while searching.
Instruction:
Read the approved local request file, create the matching application record, and save the confirmation PDF in
/home/oai/share/confirmations.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| source | Created values match the approved request | Parsed source file and final row | Compare named fields | All equal |
| record | One record was created | Before and after application rows | Count new IDs and match type | One |
| artifact | One valid confirmation PDF exists | Required path and parsed PDF | Check path, file count, text, and record ID | One valid file |
| scope | No extra effect occurred | State, upload, message, and file differences | Compare with allowlist | No extra change |
Use application state and file parsing for verification. Use visual comparison only for layout that cannot be checked structurally.
Known-good: one matching application row and one readable confirmation PDF. Wrong results: wrong source file, unsaved form, duplicate record, screenshot instead of PDF, wrong output path, or an extra upload or message.
Restore the snapshot before each reference, wrong-result, and model run. Test a similar identity, unsaved form, changed access, stale page, duplicate submit, and extra file. Verify raw application and file state after a fresh session. Treat login, display, or application startup failure as infrastructure.
Change one condition: similar records, more pages, modal or validation error, permission boundary, stale page, cross-application transfer, or required file artifact. Do not create difficulty through tiny targets, hidden UI, or unstable live content.
Use for bug repair, feature work, refactoring, tests, build systems, and codebase navigation.
Model relationships beyond files:
Prefer a frozen repository and installed offline dependencies. Allow live package or web access only when the real job requires it and the run can remain safe and comparable.
Preserve the production Harness shell, editor, patch, search, test, and build interfaces. Record private registry credentials, source-host access, and model credentials by variable name only. Keep hidden tests and reference patches unavailable to the agent.
Use a container or VM when system packages, services, or compiler state affect the result.
Do not score a preferred patch shape when tests and public behavior define correctness.
Instruction:
Fix the duplicate-item pagination bug in
/workspace. Keep the public API compatible. Add or update focused tests for duplicate-free traversal.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| behavior | Pagination has no duplicate items | Focused test output | Run the pinned reproduction and boundary tests | All pass |
| regression | Related behavior still works | Existing focused suite | Run the named test files | All pass |
| compatibility | Public call shape remains available | Consumer import and call test | Import and call the old public function | Test passes |
| scope | No unrelated change | Git diff and generated-file hashes | Compare with an allowlist | No extra path or hash change |
Known-good: a patch that fixes cursor advancement and adds a focused boundary test. Wrong results: filtering duplicate output after retrieval, changing the public signature, disabling the failing test, or editing unrelated snapshots.
Instruction:
Add the requested provider through the public package import path. Register it in runtime selection and add a consumer-facing test.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| implementation | Provider performs the requested behavior | Focused provider test | Run the named behavior case | Passes |
| registration | Runtime selects the provider | Factory test and registry state | Load valid config through the public factory | Correct class returned |
| public surface | Consumer import works | Clean consumer process | Import from the documented package path | Import succeeds |
| tests | Related code remains valid | Pinned internal and consumer suites | Run the named tests | All pass |
| scope | Other providers and defaults stay fixed | Git diff and config snapshot | Compare named files and defaults | No extra change |
Known-good: implementation, registry entry, public export, and consumer test from the source files that own each surface. Wrong results: implementation without registration, internal export only, unit test only, or hand-edited generated output without its source update.
Run the reference patch, no-op patch, disabled-test shortcut, and unrelated edit. Run agent trials when they answer a named calibration question. Inspect the selected diffs and each named test. Treat toolchain, dependency, and build-start failures as infrastructure errors, not coding failures.
Change one condition: cross-package surface, longer call path, missing regression test, lifecycle interaction, migration, partial failure, or more plausible distractor code. Do not remove needed issue context or rely on a huge unrelated test suite to create difficulty.
Use for sales, support, operations, research, documents, messaging, meetings, and work that crosses business applications.
Use a relational store for identities and mutable business records. Use files or document tables for email, notes, reports, transcripts, and attachments. Add search only when retrieval behavior is part of the Task.
Model:
Create structural facts with code. Create selected prose through source-supported generation requests and criterion-level review.
Choose per service:
Match tool names, arguments, results, pagination, permission errors, and effects. Catalog CRM, email, calendar, document, model, and search credentials by name, account, role, scope, network need, and provider. Do not store values.
Instruction:
Review the latest meeting and current account state. Update the account’s next step and create an internal follow-up note. Do not send an external message.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| account | Correct account has the supported next step | Before and after CRM rows plus meeting | Match account ID and allowed values | Exact match |
| note | One supported internal note exists | New note and meeting facts | Check count and cited facts; judge only unsupported prose | One valid note |
| identity | Assigned user made permitted changes | Audit log, owner, and role | Match actor, owner, and permission rule | All match |
| no_message | No external draft or send exists | Message and draft tables | Compare before and after | Equal |
| scope | Other business records stay fixed | Stable state snapshot | Compare every non-allowlisted row and field | No difference |
Known-good: supported next step plus one source-supported note. Wrong results: use an older meeting, update a similar account name, claim a decision not made, send an email, or change a related opportunity that was not requested.
Instruction:
Create a brief for the assigned accounts. Rank urgent items, cite the source record for each claim, and state conflicts instead of resolving them without evidence.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| coverage | Each qualifying assigned account appears once | Assignment and issue rows plus brief | Recompute expected account IDs and counts | Exact set and count |
| ranking | Order follows the stated urgency rule | Source values and brief order | Recompute score and compare order | Exact order, allowing declared ties |
| sources | Each material claim names a valid record | Brief citations and source rows | Resolve each ID and compare its claimed fields | Every claim supported |
| uncertainty | Conflicts stay explicit | Conflicting rows and brief text | Check required conflict IDs; judge only whether wording preserves uncertainty | All conflicts stated; none invented |
Known-good: every qualifying account appears once in recomputed order with valid citations and stated conflicts. Wrong results: omit an account, include an unassigned account, use stale state, cite a missing record, or hide a conflict. Use a limited judge only for claim support and useful wording.
Run the reference actions, wrong identity, stale-source, duplicate-effect, unsupported-claim, and collateral-change cases before model trials. Reset all services between runs. Inspect final state, audit rows, citations, and each meaning-based result. Do not treat service startup or login failure as Task failure.
Change one condition: similar names, longer history, cross-service identity, stale record, permission boundary, several valid actions, or collateral-effect risk. Do not make the Task hard by hiding a required source.
Use when success depends on conversation, hidden user facts, clarification, consent, policy, escalation, or changes during a dialogue.
Keep separate:
The simulator may know facts the agent must ask for. It must not reveal facts without the defined trigger or judge correctness itself. Store final service state independently from dialogue.
Preserve production tool schemas, permission errors, and state changes. Use a simulated user for repeatability and a simulated or sandbox service for mutable effects.
Catalog model credentials for the agent, user simulator, and any judge separately. Pin each model. Keep simulator facts, policies, and expected results hidden from the agent.
Define:
Do not let the simulator help the agent simply because progress stalled.
User start:
I need a refund for my last order.
Hidden user facts include order identity, reason, and whether the item was used. Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| identity | Customer and order are confirmed | Dialogue and service IDs | Find explicit confirmation before action | Correct IDs confirmed |
| facts | Required facts are obtained first | Ordered turns and policy fields | Check each required answer precedes the action | Complete and ordered |
| policy | Action follows the pinned rule | Policy and confirmed facts | Recompute allowed action | Exact match |
| state | Service records match that action | Final order, refund, and escalation rows | Compare expected fields and counts | Exact match |
| scope | No extra effect occurred | Before and after service state | Compare non-allowlisted rows | Equal |
Known-good: confirm the order and required facts, then create only the refund or escalation allowed by policy. Wrong results: act on the latest order without confirmation, infer item state, invent an exception, create both refund and credit, or refuse an allowed request.
User start:
Move Alex’s meeting to Friday afternoon.
Two visible contacts match Alex. Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| clarification | Agent asks before changing state | Ordered dialogue | Find a question that names a distinguishing fact before the tool call | Present and ordered |
| selection | Confirmed contact owns the changed event | User reply and final event | Resolve confirmed contact ID and compare | Exact match |
| time | New time follows request and calendar rules | Final event, clock, and policy | Recompute allowed Friday window | Within window |
| scope | Other events and attendees stay fixed | Calendar difference | Compare with focal-event allowlist | No extra change |
Dialogue checks should establish that clarification happened. Final calendar state proves the action.
Known-good: ask one distinguishing question, receive the answer, then move only the confirmed contact’s event. Wrong results: guess from name, ask after the move, change both events, choose a blocked time, or change attendees.
Run scripted good, ambiguous, changed-request, refusal, repeated-question, and premature-action conversations before model trials. Inspect ordered turns and final service state. Reset both after every run. Treat simulator, model, or tool startup failure as infrastructure, not policy failure.
Change one condition: more hidden facts, policy exception, conflicting user statement, changed request, permission boundary, or tool state change. Do not make the simulator evasive beyond the defined user behavior.
Use for command-line diagnosis, repair, build, data processing, services, systems work, and tasks that require a container or VM.
Pin:
Keep tests and reference solutions outside the agent-visible image. Store starting-state and final-state evidence for files, processes, services, and command results.
Use a single container when possible. Use Compose only for real service
boundaries; name the primary Harbor service main. Add health checks for
dependencies.
Disable network unless the real Task requires it. Record registry, cloud, SSH, database, and model credential names and scopes. Never bake secrets into images or pass them as build arguments.
Separate Environment build errors, service startup failures, timeouts, and Verifier errors from Task failure.
Instruction:
The service in
/appfails its health check after restart. Diagnose and fix it. Keep its public endpoint and stored records compatible.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| readiness | Service becomes healthy | Process, port, and health output | Start with the pinned command and poll to the limit | Healthy in time |
| behavior | Public endpoint is correct | Request and response | Run named requests and compare status and body | All match |
| persistence | Existing records stay readable | Baseline and final store | Read and compare every pinned record | Equal |
| restart | Fix survives restart | Fresh process and requests | Stop, start, wait, and rerun checks | All pass |
| scope | Other system state stays fixed | Port, process, file, owner, and permission differences | Compare with allowlist | No extra change |
Known-good: the normal start command reaches health, serves correct stored data, and does the same after restart. Wrong results: bypass health, hardcode a response, delete stored data, leave a foreground process only, or open an extra port.
Instruction:
Recover all valid records from
/data/input, write stable, sorted JSONL to/data/output/recovered.jsonl, and report rejected record IDs.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| recovery | Every valid record appears once | Independent parser and output | Recompute valid IDs and compare output IDs | Exact set, no duplicates |
| rejection | Every invalid ID has a valid reason | Independent errors and report | Compare ID set and allowed reason per ID | Exact match |
| format | Output is stable JSONL | Parsed output and second run | Check schema, sort key, bytes, and repeat build | All match |
| scope | Inputs and other files stay fixed | Before and after file hashes | Compare outside the output allowlist | Equal |
Known-good: recover the exact valid ID set in stable order and report every invalid ID once. Wrong results: drop or duplicate rows, repair unsupported values, write only to stdout, change an input, use unstable order, or give an unsupported rejection reason.
Run the reference solution, no-op, hardcoded response, data deletion, foreground-only service, partial recovery, and unrelated-file edit. Rebuild the container or VM for each run and test restart. Treat image build, service startup, and resource failure as infrastructure.
Change one condition: more services, partial failure, permission fault, restart, larger data, limited resources, or cross-file consistency. Do not create difficulty through missing tools, impossible timeouts, or hidden network needs.
For every adapted pattern, ask:
Store proven project-specific adaptations in the project World Skill. Keep the
exact request, focal state, expected answer, and scoring criteria in the
collocated Task.md.
This file