Skip to content

feat(uat): page assertions, a versioned export record, and replay - #23

Open
unohee wants to merge 2 commits into
masterfrom
feat/uat-asserts-replay-export
Open

unohee wants to merge 2 commits into
masterfrom
feat/uat-asserts-replay-export

Conversation

@unohee

@unohee unohee commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

무엇

  • 결정적 assert: run/batch spec 에 asserts 추가 (url_matches, title_contains, text_present, text_absent, selector_count). 모델이 아니라 서버가 평가한다. finish 가 불릴 때 그 페이지에서, finish 없이 끝나면 러너가 브라우저를 닫기 직전에 한 번 평가한다. 브라우저가 한 번도 열리지 않았으면 평가하지 않고 not_evaluated 로 남긴다. 리포트에 행마다 관측값과 asserts_passed(모두 통과면 True, 하나라도 아니면 False, assert 가 없으면 null)가 들어가고 report.md 에 표로 나온다.
  • 벤치마크 export 스키마: lyra-uat export <run> 는 lyra-uat-export v1 레코드를 낸다(task_id, success, claimed_outcome, final_url, steps, tokens, cost …). JSON Schema 는 src/lyra_browser/uat/schemas/export.v1.json 에 커밋했고, 모델과 같은지 테스트로 고정한다. 형태를 바꾸려면 새 버전 파일을 만들어야 한다. lyra-uat schema export 로 출력할 수 있다.
  • replay: lyra-uat replay <run> 는 run 의 trace 를 scripted brain 으로, 같은 run.json spec 에 다시 돌린다. 그리고 status·exit_reason·outcome·steps·assert 별 상태를 비교한다. 같으면 exit 0, 다르면 2. audit 이 가리는 값(type_text 의 value 등)이 들어간 단계 직전에서 멈추고 exact=false, stopped_at 으로 알린다. 가린 placeholder 를 대신 입력하면 다른 행동이 되기 때문이다.
  • scripts/verify_uat_e2e.py 에 assert·export·replay 전용 run 을 추가했다 (/pricing 직접 이동 → #buy → finish).
  • 문서: docs/UAT.md (Assertions / Export and replay), README 한 줄.

왜

무인 UAT 결과를 사람이 다시 확인하고 벤치마크에 제출하려면, 판정이 모델의 자기 보고(finish)가 아니라 페이지 상태에서 나와야 하고 다시 돌려 재현할 수 있어야 한다.

검증

  • pytest -q: 1992 passed, 5 failed. 실패 5건(test_uat_llm_brains.py)은 이 venv 에 anthropic/openai SDK 가 없어서 나며, origin/master 에서도 똑같이 실패한다.
  • 새 테스트:
    • test_uat_report.py 6개: not_evaluated, 기록된 assert 의 결합, spec 검증, 페이지 평가 함수, 커밋된 스키마 == 모델, jsonschema 검증과 깨진 레코드 거부.
    • test_uat_runner.py 5개: finish 시점 판정, 모델 주장과 다른 판정, finish 없는 run, replay 같음/다름, redacted 단계에서 멈춤.
  • 실제 Chrome (headless, demo site, 2026-11-15): native·playwright 두 드라이버 모두 assert 6개가 기대대로 5 passed / 1 failed 였다. export 는 schemas/export.v1.json 검증을 통과했고, replay 는 모든 단계를 재생해 같은 판정(same=true, exact=true)에 이르렀다.

남은 것 / 알려진 것

  • trace/video 녹화는 이 PR 에 없다. 이슈 할 일 목록에 있지만 만들지 않았다. 기본 드라이버(native)의 CDP 세션에는 이벤트 구독이 없어서 screencast 를 바로 붙일 수 없고, 설계가 따로 필요하다. 지금의 증거는 기존 trace.jsonl 과 액션마다 찍는 스크린샷이다.
  • scripts/verify_uat_e2e.py 의 기존 completed_run 은 origin/master 에서도 native·playwright 모두 #pricing 클릭이 element_not_actionable(<p> 가 포인터를 가로챔)로 실패한다(부하 26~111 에서 확인). 이 PR 과 무관한 기존 문제다. 새 run 은 그 클릭을 거치지 않는다.
  • 같은 날 열린 UAT PR 들(feat(uat): disposable profiles, retries, start limiter, SIGKILL sweeper #22 등)과 runner.py import 블록, spec.py, docs/UAT.md 를 같이 건드린다. 이 PR 의 추가분은 각각 별도 필드와 별도 절이다.

Spec asserts (url_matches, title_contains, text_present, text_absent,
selector_count) are checked by the server on the page the run ends on:
when finish is called, or when the runner closes the browser. The report
carries every row with what was observed, and asserts_passed as the
judgement; a harness that never finishes leaves them not_evaluated.

lyra-uat export writes the stable part of a run as lyra-uat-export v1,
whose JSON Schema is committed under uat/schemas and pinned to the model by
a test. lyra-uat replay feeds a run's own trace to the scripted brain with
the run's spec and compares status, exit reason, outcome, steps and every
assertion; redacted arguments make it say exact=false.
…h a browser

The gate checks assertions, the export and the replay on a run of their own.

This branch has not been deployed

No deployments
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