Repository navigation
Conversation
…, set_emulation drag presses on one element and releases on another through the click actionability checks and the interaction consent. evaluate_readonly runs an expression with V8's throwOnSideEffect, so a write is refused by Chrome before it runs; names of cookies and storage are left to storage, which asks before it reveals. read_download reads only files this session saved; save_deliverable writes a plain-named file into the deliverables directory (a UAT run's own directory). set_emulation overrides position (granting the permission), locale and time zone for this tab and every later one.
…is a field Chrome drops an Emulation override when the session that set it detaches, which Playwright's new_cdp_session does; the gate now passes on native and Playwright.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇
새 도구 5종 (
src/lyra_browser/tools/tasks.py,register_all에 등록):drag(source, target): 두 끝을click과 같은 actionability 로 검사한 뒤, 상호작용 동의(hover와 같은 INTERACT)를 거쳐 source 에서 누르고 target 위로 단계적으로 옮겨 놓는다.evaluate_readonly(expression): CDPRuntime.evaluate를throwOnSideEffect로 실행한다. 쓰기(대입, DOM 변경, 요청)는 정규식이 아니라 V8 이 실행 전에 거부한다(refused_side_effect). 그래서evaluate와 달리 승인을 묻지 않는다. cookie·web storage 를 이름으로 부르는 식은refused_storage로 거부한다. 값 공개 전에 묻는storage를 우회하지 못하게 하기 위해서다.read_download(filename): 이 세션이 저장한 파일만 읽는다. 텍스트는 최대 50000자, 바이너리는 크기·sha256·앞 바이트를 돌려준다.save_deliverable(name, content): 평범한 파일명만 받아 deliverables 디렉터리(<data_dir>/deliverables, UAT 에서는 run 디렉터리)에 쓴다. 기존 파일은overwrite=true일 때만 덮어쓰고, 1 MB 까지다.set_emulation(latitude, longitude, accuracy, locale, timezone, clear): 위치(권한 부여 포함), locale, 시간대를 현재 탭과 이후 열리는 탭에 적용한다.read_storage는 새로 만들지 않았다. 0.4.0 의storage도구가 같은 일을 하고(값은reveal때 묻는다), 문서에 대응을 적었다. UAT 에서는 이 도구들을 기본으로 주지 않는다. 필요한 페르소나만tools.allow에 넣는다.부수 변경:
Config.deliverables_dir필드, 테스트 fake(FakeMouse.down/up/move,FakeCDPSession,FakeSession.page_observers), README·docs/UAT.md.왜
벤치마크 과제 일부는 드래그, 스크립트 상태 읽기, 다운로드 확인, 산출물 저장, 지역 설정 없이는 풀 수 없다.
검증
pytest -q: 1995 passed, 5 failed. 실패 5건(test_uat_llm_brains.py)은 이 venv 에 SDK 가 없어서 나며, origin/master 에서도 똑같이 실패한다. 새tests/test_task_tools.py는 14개 모두 통과했다. 쓰기·storage 거부, 사이트 밖 drag 의 needs_approval 처리, 두 끝 검사, 저장된 파일만 읽기, 파일명·크기·덮어쓰기 규칙, 이후 탭에 적용을 다룬다.scripts/verify_task_tools_e2e.py(headless, 2026-11-15): native·playwright 모두 ALL PASS.document.title=…, DOM append,fetch를 Chrome 이refused_side_effect로 거부했고, 이후 title 은 그대로였다.Emulation.*override 를 버린다. Playwright 의new_cdp_session은 별도 세션이라 탭마다 세션을 열어 둔 채 유지하도록 했다.남은 것
set_emulation은Accept-Language와 IP 를 바꾸지 않는다(문서에 명시).docs/UAT.md,uat/server.py를 같이 건드린다.