mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 16:45:22 +00:00
2.1 KiB
2.1 KiB
BrowserGym compatibility contract
Pi-chrome benchmark tasks mirror BrowserGym without importing Gymnasium.
Task fields
Each task-manifest.json entry maps to AbstractBrowserTask concepts:
taskId/id— stable namespaced idseed— deterministic state seedviewport,slowMoMs,timeoutMs,locale,timezoneIdgoalandgoalObject— text and OpenAI-style message objectssetupUrl— page URL that performs setup fromtask,run,seedvalidateScript— JS validate hook returning reward contractcheatScript— gold recipe used to sanity-check gradermaxSteps,humanBaseline,difficulty,tagsactionSubsets,allowedActions— BrowserGym HighLevelActionSet metadata
Reset / step return
Runner should expose:
reset() -> (obs, info)
step(action) -> (obs, reward, terminated, truncated, info)
terminated means task done. truncated means max step or timeout.
Validate return
In-page validators return:
{ reward, done, message, info }
reward is incremental. Current hermetic tasks use binary terminal reward. info.rubric carries per-check details.
Observation schema target
Runner observations should include BrowserGym-like keys:
chat_messagesgoal,goal_objectopen_pages_urls,open_pages_titles,active_page_indexurl,screenshot,dom_object,axtree_objectextra_element_propertiesfocused_element_bidlast_action,last_action_errorelapsed_time
BID plan
BrowserGym uses bid attributes as stable element handles. Pi-chrome currently returns snapshot uid. Compatibility path:
- During snapshot, assign every interactive element a deterministic
bid. - Return both
uidandbid. - Add
visibility,bbox,clickable,set_of_marksmetadata. - Maintain uid↔bid mapping so agents can use either addressing mode.
Target attributes:
bidbrowsergym_visibility_ratiobrowsergym_set_of_marks
Action subsets
See ../browsergym-action-space.json for BrowserGym-compatible subsets and function signatures.