Repository navigation
refactor(trajectory-replay): read engines and the default model from registries - #206
Conversation
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 1
Reviewed head 0c127976 against base d894600d. Four findings: three P2 and one P3. No P0 or P1 defects found.
Findings
P2. examples/trajectory_replay/rebuild_report.py:55-58: the fallback can flip the baseline, and the new engine logic has no test.
- Problem: for a manifest without
protocol.engines, the order comes from the first-seen row._ratio_pairsandverify_metrics.pytreat the first engine as the baseline. The old code always used chromium, then moli. I ran attempts that start with a moli row through this logic: the denominator became moli and the duration ratio mean went from 1.99× to 0.50×. Labels would also flip, so the result reads as valid. Older runners started task 0 with chromium, so this needs a reordered or merged attempts file. I had no curated evidence locally to check real files. - Related:
protocol.enginesis not checked against the rows. An engine missing from it silently drops out:summarize_attempts(rows, engines=("chromium",))over chromium and moli rows returned only chromium.rebuild_report.pydoes not callverify_metrics.py, so nothing rejects this. - Test gap: the rebuild test in
tests/trajectory_replay/test_runner.pymockssummarize_attempts, so it never checks theenginesargument. I found no assertion on the newprotocol.enginesfield in that file. - Fix: for the fallback, take registered engines in
DEFAULT_BROWSER_IMAGESorder, then any unregistered engines in first-seen order. Reject aprotocol.enginesset that differs from the row engines. Add tests for a moli-first legacy file, a manifest that disagrees with its rows, and the runner recordingprotocol.engines.
P2. src/harness/trajectory_replay/report.py:703: the method page still says "both sides" for any participant count.
- Problem: the page keeps the fixed text
资源基线只比较双方都成功的同任务. I rendered("alpha", "beta", "gamma")and("alpha",), and both method pages contain it. The rest of the same list and the home page's matching sentence already use_all_partiesor_provider_count. The new three-browser test checks other sentences on this page but not this one. - Fix: use
{_all_parties(engines)}here, which keeps the two-browser bytes, and add the assertion totest_report_renders_every_registered_participant_of_a_larger_set.
P2. src/harness/trajectory_replay/public_webarena/report.py:1845: a manifest value reaches published HTML unescaped.
- Problem:
engine_argumentsjoinsprotocol.enginesand goes intorun_command, which is written raw into<pre>. The neighbouringsuite_argumentgoes through_e.summary_enginesvalidates summary IDs, but this path reads only the manifest. Calling_appendix_pagewithprotocol.engines = ["<img src=x onerror=alert(1)>"]emitted the tag unescaped. - Fix: wrap the joined value in
_e(...). Current engine IDs render the same bytes. Add a negative test next to the new--enginesassertions.
P3. src/harness/trajectory_replay/public_webarena/report.py:558 and src/harness/trajectory_replay/participants.py:37: two small leftovers.
- Public report prose: line 558 still says the Mind2Web dataset
不能真正比较 Chromium 和 Moli. This names the compared browsers, so it reads wrongly for another participant set. It is also not under the PR's "Literals that do not mean the participant set". Build it from the participant list, which keeps the current bytes, or add it to that list with the reason. - Duplicate pattern:
participant_registrystill has its own copy of the regex that this PR adds asSAFE_ENGINEin the same file. Use the constant.
Verified with no defect
- Bytes for the current cohort: the first commit changes only tests, and
tests/goldenis identical between the two commits, so the curated snapshots came from the unchanged renderer. All golden tests pass. - Rotation:
rotated_engine_ordergives the old order for one and two browsers in all three runners. - Winner logic: a cell must beat every other participant. Ties and missing values stay neutral, and a single browser renders no winner.
- Larger and smaller sets: with three browsers named
alpha,betaandgamma, no generated route containschromiumormolioutside the CSS and scripts I excluded from the scan. With one browser, the home page has no ratio section. verify_metrics.py: the three-browser audit passes, and the tamper and wrong-participant controls fail as intended.- Default model: the only definition in the track code and
run.shisDEFAULT_DIAGNOSIS_MODEL.examples/trajectory_replay/README.mdstill names the model when documenting the default, which is not a second definition. - Hash-bound files: none of the files returned by
cohort_reference_hashesis in the diff, and the PR's list matches that function. A search ofevaluation/,configs/,research/andscripts/found no references binding the other changed source files. - Scope:
Closes #202holds if the findings above are fixed. The issue allows the bound files and thetask_id == 225branch to stay when listed and explained, and #205 tracks them.
Local runs and CI
- Lint gate: both
ruffcommands pass. - Targeted tests:
pytest tests/test_golden_reports.py tests/trajectory_replay tests/test_explicit_utf8_io.py tests/test_source_language_policy.py: 2281 passed, 5 skipped, including the ASCII-locale test the PR could not confirm locally. - CI on this head: Tests and static checks, Installation and packaging, and Rendered reference and report checks all pass.
- Not run: a rebuild from real measured evidence or a real browser run, because none was available here.
|
Review round 1: all four findings are fixed, none disputed. P2, rebuild baseline ( P2, method page sentence ( P2, unescaped engines ( P3, Mind2Web prose and regex ( The golden route hashes are unchanged, so the rendered bytes for the current cohort are the same. Hash-bound files are untouched. I also added the Added after this comment was first posted, P2 from the automated review of |
There was a problem hiding this comment.
This review found 1 issue(s), including 1 blocking issue(s).
| declared = tuple(str(engine) for engine in protocol.get("engines") or ()) | ||
| if declared: |
There was a problem hiding this comment.
P2: An explicitly declared empty engine list bypasses the new disagreement check. For example, protocol: {"engines": []} with Chromium/Moli attempt rows falls through to registry order, and rebuild writes a summary despite the manifest's participant set differing from the rows. The documented legacy fallback is for an absent field, not an empty declaration. Distinguish key absence from an explicitly supplied list and validate the latter against seen; add an empty-list rejection case to the rebuild tests.
There was a problem hiding this comment.
✅ Re-review complete · 4a724d3
No findings in this incremental review.
There was a problem hiding this comment.
Independent review, round 2
Reviewed head 4a724d35 against base d894600d, which is still the tip of main. Three P3 findings. No P0, P1 or P2 defects. All round 1 findings are fixed.
Findings
P3. examples/trajectory_replay/rebuild_report.py:76, src/harness/trajectory_replay/participants.py:48: an unsafe engine ID fails only after the saved files are overwritten.
- Problem:
attempt_enginesdoes not checkSAFE_ENGINE, so an ID such asmy browserinattempts.jsonlgets through.summary.jsonandmanifest.jsonare then rewritten, andwrite_latest_reportraises an uncaughtValueErrorwith a traceback. I confirmed each step separately:attempt_enginesaccepted<x>, the rebuild wrote both files with the report writer mocked, and the real renderer raised on an unsafe ID. The rejection added for a disagreeingprotocol.enginesdoes stop before writing, so this path behaves differently from it. - Fix: Check
SAFE_ENGINEinattempt_engines, so the existingtryturns it intoSystemExitbefore anything is written. Add this case totest_rebuild_report.py.
P3. examples/trajectory_replay/verify_metrics.py:62: the audit takes the baseline from key order and does not check the labels that name it.
- Problem: The audit used to fix the direction as moli over chromium. It now treats the first key of
functionalas the baseline. It never compares that withrelative_ratios.baseline_engine, or withpaired_ratios.numerator_engineanddenominator_engine. A summary withbaseline_enginechanged tomolistill returnedstatus: passfor three browsers, and so did one with the paired labels swapped for two browsers. The numbers are still audited, and the curated report does not read these labels. Anyone readingsummary.jsoncan still be told the wrong direction. - Fix: Reject a summary whose labels differ from
engines[0]andengines[1], and add these two tamper cases totest_verify_metrics.py. Check that a real two-browser summary still passes.
P3. src/harness/trajectory_replay/report.py:698, and the PR body: two small wording errors.
- Problem: A one-browser method page says
按任务交替 1 个 Provider 的执行顺序, but one browser has no order to alternate. The PR describes the single-browser case as having no comparisons, and its test does not cover this sentence. Separately, the PR body says two sentences inpublic_webarena/report.pydescribe the Chromium-only qualification. There are three: lines 569, 1066 (冷 Chromium 验证) and 1771. - Fix: Omit the alternation clause when there is one browser, keeping the two-browser bytes, and assert it in the single-browser test. Change the PR body to say three sentences.
What I verified
- CI on
4a724d35: Tests and static checks, Installation and packaging, Rendered reference and report checks, and Python 3.11 all pass. The PR is mergeable. - Local gates: both
ruffcommands pass.pytest tests/test_golden_reports.py tests/trajectory_replay tests/browser_use tests/test_explicit_utf8_io.py tests/test_source_language_policy.pygives 2627 passed, 5 skipped. - Bytes for the current cohort:
- No existing golden file changes, and the three new curated snapshots are unchanged since the commit that recorded them.
- I also rendered old and new
report.pyside by side on 10 two-browser summaries the snapshots do not cover. They covered all-failed, disjoint failures, no failures, identical metrics in every column, andagent_smoke. All 13 output files were byte-identical in each case.
- Other participant sets: I rendered three browsers without Moli, one browser, a pair without Moli, and a moli-first pair, keyword-searched every output file and read the home page conclusions. The search found no stale browser names or wrong two-party wording apart from the sentence above. Winner cells, ratio sections and the Moli finding follow the participants.
- Tests fail without the code: changing
alltoanyin the winner cell fails one test. Forcingrelative_ratios=Falsefails three. - Order: the rotation gives the same order as the old code for one and two browsers in the curated, public and Browser Use runners. Public
--enginesstill rejects an empty list before the rotation can divide by zero. - Hash-bound files: no file in
cohort_reference_hashesis changed. I searched for other source-file bindings of the changed files insrc,scripts,evaluation,researchandconfigsand found none. The PR's list of bound files is complete for repository code. - Scope of
Closes #202:- The issue allows the
task_id == 225branch to stay if the PR says why, and the PR does. - #205 is open and tracks the remaining bound literals.
- The synthetic participant-set test is present.
- The default model appears once in
src.examples/trajectory_replay/README.md:129also names it, which I treat as reader documentation, not a second definition.
- The issue allows the
- Not verified: a rebuild from private measured evidence, a real browser run, and the visual release check.
|
Review round 2: all three findings are fixed, none disputed.
Lint gate passes. Left as is: the same one-browser method page still says |
There was a problem hiding this comment.
✅ Re-review complete · d5fc2d4
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 3
Reviewed head d5fc2d4e against base d894600d. One P3 finding. No P0, P1 or P2 defects. All round 2 findings are fixed.
Finding
P3. src/harness/trajectory_replay/report.py:1193 (also :477): the Moli timing content is only partly gated on Moli being a participant.
- Problem: the PR renders
MOLI_TIMING_FINDINGonly when Moli takes part, because it is a Moli-specific fact. The analysis page's first section, 时序机制研究, is the study of that same behaviour, and it still always renders: 低频 screencast 或其触发的布局快照 ... 随 screencast 条件系统性变化. I rendered a report with three browsers and no Moli (alpha,beta_x,gamma). Its analysis page opens with a research hypothesis about a low-frequency screencast that no participant in that cohort was shown to have. The home page's 根因边界 sentence also names screencast as a candidate cause and links to that 验证方案. - Fix: render the 时序机制研究 section only when
"moli" in engines, and do the same for the screencast wording and 验证方案 link in the 根因边界 sentence. Assert both in the three-browser test. The two-browser bytes stay the same. If this text is meant to stay for every cohort, add it to the PR's "Left unchanged" list with the reason instead.
What I verified
- Round 2 fixes: I removed each of these checks in turn, and the new tests failed each time:
- the
SAFE_ENGINEcheck inattempt_engines - the
verify_metrics.pypaired label check - the
verify_metrics.pyrelative baseline check - the one-browser alternation clause
- the
- Older mechanisms: tests also fail when the winner check changes from
alltoany, and whenrotated_engine_orderuses% 2. - Byte comparison for two browsers: I rendered the curated report from
d894600dand from this head withchromium,moli, and compared the hashes of all 85 generated files. All of them match. The seven scenarios were Chromium leads, Moli leads, tied at full pass, tied with failures, all tasks failed, a run with a retry, a missing metric and an agent smoke section, and an empty summary. - Golden snapshots: only
cdb8c2a7, the snapshot commit made before the renderer change, touchestests/golden/. No existing route hash changed. - Other participant sets: I rendered three browsers with no Moli, one browser, and Moli first, plus three browsers with an empty success intersection. Leftover 双方 and 两个 appear only where they are correct for that set. The text 不是两个 Provider 边际分位数相除 still holds, because each ratio is one pair. The 成功判定 heading's 两个 counts metrics, not browsers.
- Rotation:
rotated_engine_ordergives the same order as the old public runner for one or two browsers and the old curated runner for two. Emptyenginesis still rejected in the public runner before rotation. - Runner and entry points:
run.shstill gets the same default through the CLI whenTRAJECTORY_REPLAY_DIAGNOSIS_MODELis unset.gpt-5.6-solnow appears in code only inparticipants.py, plus one README sentence.- The new import in
cli.pydoes not loaddocker,requestsorplaywright. __PROVIDER_LIST__is used only by the curated report, which replaces it.
- Hash-bound files: the PR's diff touches none of the listed files, and nothing under
evaluation/.playwright_tool.pyandcatalog_runner.pydo change, but they are not incohort_reference_hashes, and I found no other binding for them. - Scope:
Closes #202is sound. Engine literals in the replay reports and runners and the repeated default model are done, and there is a synthetic test at other participant counts. Theremote_execution.pybranches and the task 225 branch are explained, and open issue #205 tracks them. The remaining capability literals match the PR's list, including the three sentences atpublic_webarena/report.pylines 569, 1066 and 1771. - Lint and tests: both
ruffcommands pass.pytest tests/test_golden_reports.py tests/trajectory_replay tests/test_explicit_utf8_io.py tests/test_source_language_policy.py: 2301 passed, 5 skipped, 0 failed.pytest tests/browser_use: 335 passed. - CI on
d5fc2d4e: all checks pass, including "Tests and static checks", "Installation and packaging" and "Rendered reference and report checks".
Not verified: a rebuild from private measured evidence, a real browser run of the runners, and the visual release check.
|
Review round 3. Fixed (f846c06), P3: the timing study ( The test for three browsers without Moli asserts both pages drop this text. The test for three browsers with Moli asserts both keep it. The curated golden snapshots are unchanged, so the Chromium and Moli bytes are the same. Disputed: none. |
There was a problem hiding this comment.
✅ Re-review complete · f846c06
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 4
Head reviewed: f846c06. One P3 finding. No P0, P1 or P2.
Finding
P3, src/harness/trajectory_replay/report.py:488, :711 and :1220: a one-browser report still describes ratios it does not render.
The PR says a single browser renders no ratio section and no winner, and the single-browser test confirms that. Three sentences still describe those missing parts when I render ("chromium",):
- Home page (
:488):绝对值优胜项为绿色粗体;配对比值低于 1 为绿色、高于 1 为红色. - Method page (
:711):配对比值的定义和逐项计算过程见首页性能表与计算审计. The link points to a calculation audit that does not exist on that report. - Appendix (
:1220):所有 Provider 成功任务与逐任务配对比值审计.
Suggested fix: leave these clauses out when len(engines) == 1, keeping the bytes for two or more browsers. Extend test_report_renders_a_single_participant_without_comparisons to assert that 配对比值 is absent from all three pages. The curated snapshots should stay unchanged.
What I verified
- Same bytes for two browsers. I rendered the curated report with the base renderer (d894600) and with this head, and compared every route, including the data JSON. There were seven cases: the fixture, an
agent_smokeblock, a bare manifest, empty ratio metrics, Moli without resources, an empty summary and zero tasks. All were byte-identical. The three curated snapshots do not change after the commit that recorded them, and no existing snapshot changes. - Round 3 fix. The timing study, the screencast wording and the
验证方案link follow Moli's participation, and the tests cover three browsers with and without Moli. - Hash-bound files. The diff touches none of the files in
cohort_reference_hashes, nothing underevaluation/and no workflow. A search ofsrc,scripts,evaluation,configs,tests,docsand.githubfound no hash binding for the changed source files. - Shared helpers.
rotated_engine_ordergives the same order as the old code for one and two browsers, and the public runner rejects an empty engine list before using it.summary_enginesmatches the old public_engines, apart from the new rejection of unsafe IDs.[engine, "--version"]matches the old command table for both current engines. Nothing still imports the removed helpers. - Scope of
Closes #202.- The default model has one definition in the track's Python, and
run.shno longer names it. - Synthetic tests cover one and three browsers.
- The
task_id == 225branch stays, with a stated reason, and #205 is open for it and for the remaining engine literals inremote_execution.pyandremote_runtime.py. - The remaining literals I found in this track match the PR's list or are capability branches and comments.
- The default model has one definition in the track's Python, and
- Local checks.
- Both
ruffcommands pass. - The PR's targeted command (
tests/test_golden_reports.py tests/trajectory_replay tests/browser_use tests/test_explicit_utf8_io.py tests/test_source_language_policy.py) gives 2636 passed, 5 skipped, 0 failed.
- Both
- CI on this head. All checks pass, including Tests and static checks, Installation and packaging, and Rendered reference and report checks.
Not verified
I did not rebuild from private measured evidence, run a real browser or run the visual release check. The PR lists the same limits.
|
Review round 4: Fixed
Reports with two or more browsers keep the same bytes, and the golden route hashes are unchanged. Disputed
|
There was a problem hiding this comment.
✅ Re-review complete · 68534be
No findings in this incremental review.
lanyue-llk
left a comment
There was a problem hiding this comment.
Independent review, round 5
Head reviewed: 68534be. Base: d894600, which is still the tip of main.
No defects found. CI passes on this head.
What I verified
- Round 4 fix: A one-browser report no longer has the ratio or winner wording on the home, method or appendix pages. The new test assertions fail if the legend condition is removed.
- Two-browser bytes: I rendered the curated report from the base renderer and from this head, then compared SHA-256 hashes of every output file. All files matched across 40 randomized two-browser runs and one empty summary. The runs varied failures, retries, tied values, zero and missing resource values, and the CowAgent smoke section. This goes beyond the three curated snapshots.
- Golden snapshots: The diff under
tests/golden/only adds the threetrajectory-replay-curated-*files. They were last touched in the commit that recorded them, before the registry change. - Other participant sets: I rendered one browser, one browser as Moli, three browsers with and without Moli, and two browsers without Chromium. I read the home, method, analysis and appendix text plus the Markdown. The participant wording, ratio tables, baseline labels and Moli-only sections were correct for each set.
- Test strength: I made six temporary source changes, and each one failed at least one test:
- winner check changed from
alltoany - ratio pairs cut to one comparison browser
- one-browser wording conditions removed
relative_ratiosturned off- registry ordering removed from
attempt_engines - provider filter list hard-coded
- winner check changed from
- Runner order:
rotated_engine_ordergives the old order for one and two browsers in the curated, public and Browser Use runners, including an explicit reversed public order. The public runner already rejects an empty engine list before reaching the rotation. - Imports: Each of the 10 changed or dependent modules I tried imports in a fresh process.
participants.pyalso imports withdockerandplaywrightblocked, so the new import fromplaywright_tool.pyadds no heavy dependency. - Hash-bound files: None of the files
cohort_reference_hashesrecords is in the diff. None of the 12 main changed source and script files has its base hash recorded underevaluation/,configs/orresearch/. - Scope: Every #202 item is either done or has a stated reason. The
remote_execution.pyengine literals and thetask_id == 225branch are in hash-bound files, so they stay, with the reason in the PR body and the work tracked in #205, which is open.Closes #202is accurate. Remainingchromiumandmoliliterals in the non-bound replay code match the PR's "Left unchanged" list and the Moli-only sections it describes.
Test results
- Lint gate: both
ruffcommands pass. - Local tests:
pytest tests/test_golden_reports.py tests/trajectory_replay tests/browser_use tests/test_explicit_utf8_io.py tests/test_source_language_policy.py: 2636 passed, 5 skipped, 0 failed, which matches the PR's test plan. - CI on this head: Tests and static checks, Installation and packaging, Rendered reference and report checks, and ocr-review all pass.
Not verified
- A rebuild from measured replay evidence. A search of the local data home, limited to four directory levels, found no replay
summary.json. - A real browser run of the runners.
- The visual release check.
…saved runs A manifest without protocol.engines took its order from the first-seen row, so attempts starting with a moli row moved the ratio baseline to moli. Registered engines now keep their registry order, followed by unregistered ones. A manifest whose protocol.engines differ from its rows is rejected before anything is written, because an unlisted engine would otherwise drop out of the summary.
…ne sentence The method page kept the two-party wording for any participant count.
…ommand The public appendix wrote protocol.engines unescaped into its run command.
…articipants The research page named Chromium and Moli whatever the participant set was. The join moves to engine_names so both reports share it, and participant_registry reuses SAFE_ENGINE instead of keeping its own copy of the pattern.
…n rebuild An empty or null list counted as absent and skipped the disagreement check. Only a manifest without the key is treated as predating the field.
68534be to
da4c3d1
Compare
Issues
Closes #202
Part of #97 (this PR covers the Browser Trajectory Replay items). Follow-up for the hash-bound files: #205.
Summary
report.pyhad 34 lines naming Chromium or Moli. Tables, titles, filters, the recommendation and ratio sections now come from the summary's engines, with the browser registry as the order for an empty summary. What remains is Moli-specific and renders only when Moli is a participant: the timing finding, the analysis page's timing study (时序机制研究), and the screencast wording and验证方案link in the home page's root-cause sentence.relative_ratiosfor any set other than two, becausepaired_ratioscan only describe two engines. Two-engine summaries are unchanged. A single browser renders no ratio section and no winner.gpt-5.6-solwas written in 8 places in this track. It now has one definition,DEFAULT_DIAGNOSIS_MODELinparticipants.py.run.shpasses--diagnosis-modelonly whenTRAJECTORY_REPLAY_DIAGNOSIS_MODELis set.ENGINE_IMAGES. The rotation is one shared helper,rotated_engine_order, which also replaces the Browser Use copy and the public runner's reversal. Order is the same as before for one or two browsers.protocol.engines, andrebuild_report.pyreads it and rejects a manifest whose list differs from the rows, including an empty one. Older manifests use registered engines in registry order, then unregistered ones in first-seen order, so the baseline does not depend on row order.verify_metrics.pyaudits any participant set and rejects a summary whose browsers differ from the raw attempts.playwright_tool.pyandcatalog_runner.pyshareBROWSER_ADAPTERS._functional_rowsand_aggregate_ratioin the curated report.Left unchanged, with reasons
Hash-bound files.
cohort_reference_hashesinremote_execution.pyrecords these for each remote cohort. None of them is changed here:remote_execution.py(runner,remote_execution)remote_runtime.pywebarena_replay.pyretrieval_acceptance.pywebarena_corrections.py(correction_logic)scripts/run_remote_three_method_cohort.py(command_entry)evaluation/trajectory-replay/webarena-verified/task-corrections.json(task_corrections)The
task_id == 225branch must stay for now. It sits inwebarena_corrections.py, and moving its checks to correction data would change both that file andtask-corrections.json. #205 tracks doing this with the next cohort revision, together with the engine literals inremote_execution.pyandremote_runtime.py.Literals that do not mean the participant set:
playwright_tool.pyand Chromium host resolver rules incatalog_runner.py.public_webarena/qualification.py, its check inpublic_webarena/runner.py, and the three sentences inpublic_webarena/report.pythat describe it (冷 Chromium, lines 569, 1066 and 1771).binding.get("engine", "chromium")default for older bindings incatalog_acceptance.py.webarena_report.py.Rendered output
Existing golden route hashes are unchanged, so no route changes for the current cohort.
The curated report had no snapshot, so this PR adds three (
trajectory-replay-curated-*: baseline leads, comparison leads, tied). They were recorded from the unchanged renderer in the first commit, and the second commit leaves them untouched, so they show the two-browser bytes are the same.test_shared_core.pychanges on purpose: it asserted curated summaries omitrelative_ratiosat three engines. It now asserts that for two engines, and that three engines publish them.Test plan
ruffcommands pass.pytest tests/test_golden_reports.py tests/trajectory_replay tests/browser_use tests/test_explicit_utf8_io.py tests/test_source_language_policy.py: 2636 passed, 5 skipped, 0 failed, withPYTHONPATHset to the checkout.验证方案wording; the three-browser report with Moli keeps them.verify_metrics.pywith three browsers, with tamper and wrong-participant controls, plus swapped paired labels and a changed relative baseline.protocol.engines, and escaping a hostile engine value.protocol.engines.