-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathwebshop_patch.json
More file actions
17 lines (17 loc) · 1.01 KB
/
Copy pathwebshop_patch.json
File metadata and controls
17 lines (17 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"schema_version": "harness-r1-patch-v1",
"benchmark": "webshop",
"description": "Track shopping stage and avoid buying before required options are selected.",
"actions": [
{
"type": "add_code_hook",
"hook": "on_init",
"code": "def hook(ctx, nb):\n nb['stage'] = 'search'\n nb['last_hint'] = ''\n return {'skills': [{'text': 'Search, inspect a matching product, select every required option, verify constraints, then buy.'}], 'tool_hint': 'Use visible page evidence before advancing to the next shopping stage.'}"
},
{
"type": "add_code_hook",
"hook": "make_pre_hint",
"code": "def hook(ctx, nb):\n state = ctx.get('state', {})\n text = str(state).lower()\n if 'buy now' in text and ('required' in text or 'select' in text):\n msg = 'Before buying, select every required option shown on the product page.'\n if nb.get('last_hint') != msg:\n nb['last_hint'] = msg\n return {'message': msg}\n return None"
}
]
}